mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-03 08:41:34 +00:00
suppress unused result warning
This commit is contained in:
@@ -181,7 +181,12 @@ int load_elf(char *elff)
|
|||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
int size = ftell(fp);
|
int size = ftell(fp);
|
||||||
fseek(fp, 0, SEEK_SET);
|
fseek(fp, 0, SEEK_SET);
|
||||||
fread(elf, 1, size, fp);
|
size_t result = fread(elf, 1, size, fp);
|
||||||
|
if (result < 0) {
|
||||||
|
fprintf(stderr, "Error, could not read the ELF\n");
|
||||||
|
fclose(fp);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
|
@@ -158,7 +158,8 @@ int main(int argc, char *argv[]) { int loop0, result;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read in the data from the file
|
// Read in the data from the file
|
||||||
if (fread(buffer, readsize, 1, infile) < 0) {
|
size_t result = fread(buffer, readsize, 1, infile);
|
||||||
|
if (result < 0) {
|
||||||
printf("ERROR: Could not read in the file data. (%s)\n", argv[2 + loop0]);
|
printf("ERROR: Could not read in the file data. (%s)\n", argv[2 + loop0]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -195,7 +195,12 @@ unsigned char *load_file(const char *file, unsigned int *size)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) fread(data, 1, *size, fp);
|
size_t result = fread(data, 1, *size, fp);
|
||||||
|
if (result < 0) {
|
||||||
|
fprintf(stderr, "Error, could not read the ELF\n");
|
||||||
|
fclose(fp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -144,7 +144,12 @@ unsigned char *load_file(const char *file)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) fread(data, 1, size, fp);
|
size_t result = fread(data, 1, size, fp);
|
||||||
|
if (result < 0) {
|
||||||
|
fprintf(stderr, "Error, could not read the ELF\n");
|
||||||
|
fclose(fp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -96,7 +96,8 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read in the header
|
// Read in the header
|
||||||
if (fread(&header, sizeof(HEADER), 1, infile) < 0) {
|
size_t result = fread(&header, sizeof(HEADER), 1, infile);
|
||||||
|
if (result < 0) {
|
||||||
printf("ERROR: Could not read the input file header.\n");
|
printf("ERROR: Could not read the input file header.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -168,7 +169,8 @@ int main(int argc, char *argv[]) {
|
|||||||
size -= readsize;
|
size -= readsize;
|
||||||
|
|
||||||
// Read in the data from the PBP
|
// Read in the data from the PBP
|
||||||
if (fread(buffer, readsize, 1, infile) < 0) {
|
size_t result = fread(buffer, readsize, 1, infile);
|
||||||
|
if (result < 0) {
|
||||||
printf("ERROR: Could not read in the section data.\n");
|
printf("ERROR: Could not read in the section data.\n");
|
||||||
free(buffer);
|
free(buffer);
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user