From 3ab746ef297670c6a9b8457b4514d510f3e851b6 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 12 Mar 2018 01:05:20 +0100 Subject: [PATCH] fileformats.c: Get rid of "unreferenced argument" Warning --- src/fileformats.c | 19 +++++++++++++++---- src/miscfileformats.c | 19 ++++++++++++++----- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/fileformats.c b/src/fileformats.c index b646bc25..d4175024 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -86,6 +86,7 @@ void Test_IMG(T_IO_Context * context, FILE * file) T_IMG_Header IMG_header; byte signature[6]={0x01,0x00,0x47,0x12,0x6D,0xB0}; + (void)context; File_error=1; // Lecture et vérification de la signature @@ -256,7 +257,7 @@ typedef struct // -- Tester si un fichier est au format IFF -------------------------------- -void Test_IFF(T_IO_Context * context, FILE * IFF_file, const char *sub_type) +void Test_IFF(FILE * IFF_file, const char *sub_type) { char format[4]; char section[4]; @@ -323,15 +324,18 @@ void Test_IFF(T_IO_Context * context, FILE * IFF_file, const char *sub_type) void Test_PBM(T_IO_Context * context, FILE * f) { - Test_IFF(context, f, "PBM "); + (void)context; + Test_IFF(f, "PBM "); } void Test_LBM(T_IO_Context * context, FILE * f) { - Test_IFF(context, f, "ILBM"); + (void)context; + Test_IFF(f, "ILBM"); } void Test_ACBM(T_IO_Context * context, FILE * f) { - Test_IFF(context, f, "ACBM"); + (void)context; + Test_IFF(f, "ACBM"); } @@ -2430,6 +2434,7 @@ void Test_INFO(T_IO_Context * context, FILE * file) { T_INFO_Header header; + (void)context; File_error=1; if (Read_INFO_Header(file, &header)) @@ -2903,6 +2908,7 @@ void Test_BMP(T_IO_Context * context, FILE * file) { T_BMP_Header header; + (void)context; File_error=1; if (Read_bytes(file,&(header.Signature),2) // "BM" @@ -3485,6 +3491,7 @@ void Test_ICO(T_IO_Context * context, FILE * file) word Count; // Specifies number of images in the file. } header; + (void)context; File_error=1; if (Read_word_le(file,&(header.Reserved)) @@ -3864,6 +3871,7 @@ void Test_GIF(T_IO_Context * context, FILE * file) { char signature[6]; + (void)context; File_error=1; if (Read_bytes(file,signature,6)) @@ -5062,6 +5070,7 @@ T_PCX_Header PCX_header; void Test_PCX(T_IO_Context * context, FILE * file) { + (void)context; File_error=0; if (Read_byte(file,&(PCX_header.Manufacturer)) && @@ -5601,6 +5610,7 @@ void Test_SCx(T_IO_Context * context, FILE * file) //byte Signature[3]; T_SCx_Header SCx_header; + (void)context; File_error=1; // Ouverture du fichier @@ -5885,6 +5895,7 @@ void Test_PNG(T_IO_Context * context, FILE * file) { byte png_header[8]; + (void)context; File_error=1; // Lecture du header du fichier diff --git a/src/miscfileformats.c b/src/miscfileformats.c index c2fb3e76..7a07a491 100644 --- a/src/miscfileformats.c +++ b/src/miscfileformats.c @@ -52,6 +52,7 @@ void Test_PAL(T_IO_Context * context, FILE * file) char buffer[32]; long file_size; + (void)context; File_error = 1; file_size = File_length_file(file); @@ -91,15 +92,16 @@ void Test_GPL(T_IO_Context * context, FILE * file) char buffer[16]; long file_size; + (void)context; File_error = 1; file_size = File_length_file(file); if (file_size > 33) { - // minimum header length == 33 - // "GIMP Palette" == 12 - fread(buffer, 1, 12, file); - if (strncmp(buffer,"GIMP Palette",12) == 0) - File_error = 0; + // minimum header length == 33 + // "GIMP Palette" == 12 + fread(buffer, 1, 12, file); + if (strncmp(buffer,"GIMP Palette",12) == 0) + File_error = 0; } } @@ -375,6 +377,7 @@ void Test_PKM(T_IO_Context * context, FILE * file) { T_PKM_Header header; + (void)context; File_error=1; // Lecture du header du fichier @@ -826,6 +829,7 @@ void Test_CEL(T_IO_Context * context, FILE * file) T_CEL_Header2 header2; int file_size; + (void)context; File_error=0; file_size = File_length_file(file); @@ -1134,6 +1138,7 @@ void Test_KCF(T_IO_Context * context, FILE * file) int pal_index; int color_index; + (void)context; File_error=0; if (File_length_file(file)==320) { @@ -1595,6 +1600,7 @@ void Test_PI1(T_IO_Context * context, FILE * file) int size; // Taille du fichier word resolution; // Résolution de l'image + (void)context; File_error=1; // Vérification de la taille @@ -1903,6 +1909,7 @@ void Test_PC1(T_IO_Context * context, FILE * file) int size; // Taille du fichier word resolution; // Résolution de l'image + (void)context; File_error=1; // Vérification de la taille @@ -2070,6 +2077,7 @@ void Test_NEO(T_IO_Context * context, FILE * file) int size; // Taille du fichier word resolution; // Résolution de l'image + (void)context; File_error=1; // Vérification de la taille @@ -2217,6 +2225,7 @@ void Test_C64(T_IO_Context * context, FILE * file) { long file_size; + (void)context; file_size = File_length_file(file); switch (file_size) {