Commit e4db17f2 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

cabinet: Don't cast the return value of PF[CD]I_ALLOC; those are void pointers.

parent 4008a350
...@@ -382,7 +382,7 @@ static BOOL fci_flush_data_block (HFCI hfci, int* err, ...@@ -382,7 +382,7 @@ static BOOL fci_flush_data_block (HFCI hfci, int* err,
/* inefficient, but it's harder to forget about freeing the buffer :-). */ /* inefficient, but it's harder to forget about freeing the buffer :-). */
/* Reserved areas are used seldom besides that... */ /* Reserved areas are used seldom besides that... */
if (cbReserveCFData!=0) { if (cbReserveCFData!=0) {
if(!(reserved = (char*)PFCI_ALLOC(hfci, cbReserveCFData))) { if(!(reserved = PFCI_ALLOC(hfci, cbReserveCFData))) {
fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE ); fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE );
return FALSE; return FALSE;
} }
...@@ -852,7 +852,7 @@ static BOOL fci_flushfolder_copy_cffolder(HFCI hfci, int* err, UINT cbReserveCFF ...@@ -852,7 +852,7 @@ static BOOL fci_flushfolder_copy_cffolder(HFCI hfci, int* err, UINT cbReserveCFF
/* add optional reserved area */ /* add optional reserved area */
if (cbReserveCFFolder!=0) { if (cbReserveCFFolder!=0) {
if(!(reserved = (char*)PFCI_ALLOC(hfci, cbReserveCFFolder))) { if(!(reserved = PFCI_ALLOC(hfci, cbReserveCFFolder))) {
fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE ); fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE );
return FALSE; return FALSE;
} }
...@@ -1419,7 +1419,7 @@ static BOOL fci_flush_folder( ...@@ -1419,7 +1419,7 @@ static BOOL fci_flush_folder(
/* save size of file CFDATA2 - required for the folder's offset to data */ /* save size of file CFDATA2 - required for the folder's offset to data */
sizeFileCFDATA2old = p_fci_internal->sizeFileCFDATA2; sizeFileCFDATA2old = p_fci_internal->sizeFileCFDATA2;
if(!(reserved = (char*)PFCI_ALLOC(hfci, cbReserveCFData+sizeof(CFDATA)))) { if(!(reserved = PFCI_ALLOC(hfci, cbReserveCFData+sizeof(CFDATA)))) {
fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE ); fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE );
PFCI_CLOSE(hfci,handleCFDATA1new,&err,p_fci_internal->pv); PFCI_CLOSE(hfci,handleCFDATA1new,&err,p_fci_internal->pv);
/* TODO error handling of err */ /* TODO error handling of err */
...@@ -1753,7 +1753,7 @@ static BOOL fci_flush_cabinet( ...@@ -1753,7 +1753,7 @@ static BOOL fci_flush_cabinet(
/* add optional reserved area */ /* add optional reserved area */
if (cbReserveCFHeader!=0) { if (cbReserveCFHeader!=0) {
if(!(reserved = (char*)PFCI_ALLOC(hfci, cbReserveCFHeader))) { if(!(reserved = PFCI_ALLOC(hfci, cbReserveCFHeader))) {
fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE ); fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE );
return FALSE; return FALSE;
} }
...@@ -2397,7 +2397,7 @@ BOOL __cdecl FCIAddFile( ...@@ -2397,7 +2397,7 @@ BOOL __cdecl FCIAddFile(
fci_set_error( FCIERR_NONE, ERROR_GEN_FAILURE, TRUE ); fci_set_error( FCIERR_NONE, ERROR_GEN_FAILURE, TRUE );
return FALSE; return FALSE;
} }
if(!(p_fci_internal->data_in = (char*)PFCI_ALLOC(hfci,CB_MAX_CHUNK))) { if(!(p_fci_internal->data_in = PFCI_ALLOC(hfci,CB_MAX_CHUNK))) {
fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE ); fci_set_error( FCIERR_ALLOC_FAIL, ERROR_NOT_ENOUGH_MEMORY, TRUE );
return FALSE; return FALSE;
} }
......
...@@ -1054,7 +1054,7 @@ struct Ziphuft **t, cab_LONG *m, fdi_decomp_state *decomp_state) ...@@ -1054,7 +1054,7 @@ struct Ziphuft **t, cab_LONG *m, fdi_decomp_state *decomp_state)
l[h] = j; /* set table size in stack */ l[h] = j; /* set table size in stack */
/* allocate and link in new table */ /* allocate and link in new table */
if (!(q = (struct Ziphuft *) PFDI_ALLOC(CAB(hfdi), (z + 1)*sizeof(struct Ziphuft)))) if (!(q = PFDI_ALLOC(CAB(hfdi), (z + 1)*sizeof(struct Ziphuft))))
{ {
if(h) if(h)
fdi_Ziphuft_free(CAB(hfdi), ZIP(u)[0]); fdi_Ziphuft_free(CAB(hfdi), ZIP(u)[0]);
...@@ -2181,7 +2181,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state ...@@ -2181,7 +2181,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state
if (cab->mii.folder_resv > 0) if (cab->mii.folder_resv > 0)
PFDI_SEEK(CAB(hfdi), cab->cabhf, cab->mii.folder_resv, SEEK_CUR); PFDI_SEEK(CAB(hfdi), cab->cabhf, cab->mii.folder_resv, SEEK_CUR);
fol = (struct fdi_folder *) PFDI_ALLOC(CAB(hfdi), sizeof(struct fdi_folder)); fol = PFDI_ALLOC(CAB(hfdi), sizeof(struct fdi_folder));
if (!fol) { if (!fol) {
ERR("out of memory!\n"); ERR("out of memory!\n");
return DECR_NOMEMORY; return DECR_NOMEMORY;
...@@ -2203,7 +2203,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state ...@@ -2203,7 +2203,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state
if (PFDI_READ(CAB(hfdi), cab->cabhf, buf2, cffile_SIZEOF) != cffile_SIZEOF) if (PFDI_READ(CAB(hfdi), cab->cabhf, buf2, cffile_SIZEOF) != cffile_SIZEOF)
return DECR_INPUT; return DECR_INPUT;
file = (struct fdi_file *) PFDI_ALLOC(CAB(hfdi), sizeof(struct fdi_file)); file = PFDI_ALLOC(CAB(hfdi), sizeof(struct fdi_file));
if (!file) { if (!file) {
ERR("out of memory!\n"); ERR("out of memory!\n");
return DECR_NOMEMORY; return DECR_NOMEMORY;
...@@ -2592,7 +2592,7 @@ BOOL __cdecl FDICopy( ...@@ -2592,7 +2592,7 @@ BOOL __cdecl FDICopy(
if (CAB(mii).folder_resv > 0) if (CAB(mii).folder_resv > 0)
PFDI_SEEK(hfdi, cabhf, CAB(mii).folder_resv, SEEK_CUR); PFDI_SEEK(hfdi, cabhf, CAB(mii).folder_resv, SEEK_CUR);
fol = (struct fdi_folder *) PFDI_ALLOC(hfdi, sizeof(struct fdi_folder)); fol = PFDI_ALLOC(hfdi, sizeof(struct fdi_folder));
if (!fol) { if (!fol) {
ERR("out of memory!\n"); ERR("out of memory!\n");
PFDI_INT(hfdi)->perf->erfOper = FDIERROR_ALLOC_FAIL; PFDI_INT(hfdi)->perf->erfOper = FDIERROR_ALLOC_FAIL;
...@@ -2622,7 +2622,7 @@ BOOL __cdecl FDICopy( ...@@ -2622,7 +2622,7 @@ BOOL __cdecl FDICopy(
goto bail_and_fail; goto bail_and_fail;
} }
file = (struct fdi_file *) PFDI_ALLOC(hfdi, sizeof(struct fdi_file)); file = PFDI_ALLOC(hfdi, sizeof(struct fdi_file));
if (!file) { if (!file) {
ERR("out of memory!\n"); ERR("out of memory!\n");
PFDI_INT(hfdi)->perf->erfOper = FDIERROR_ALLOC_FAIL; PFDI_INT(hfdi)->perf->erfOper = FDIERROR_ALLOC_FAIL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment