From a630a84822ab81ec41dc188b8982e5eb87836df7 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 11 Aug 2012 16:19:07 +0000 Subject: [PATCH] Removed all usage of __attribute__((unused)), replaced by void cast which is supported both on GCC and VBCC git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1984 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 4 ---- src/fileformats.c | 3 ++- src/graph.c | 32 +++++++++++++++++++++----------- src/input.c | 14 ++++++-------- src/io.c | 8 ++------ src/miscfileformats.c | 6 ++++-- src/mountlist.c | 16 +++++----------- src/op_c.c | 3 ++- src/pxdouble.c | 11 ++++++----- src/pxquad.c | 11 ++++++----- src/pxsimple.c | 11 ++++++----- src/pxtall.c | 11 ++++++----- src/pxtall2.c | 11 ++++++----- src/pxtriple.c | 11 ++++++----- src/pxwide.c | 11 ++++++----- src/pxwide2.c | 11 ++++++----- src/setup.c | 11 +++-------- src/text.c | 14 +++++++------- 18 files changed, 100 insertions(+), 99 deletions(-) diff --git a/src/buttons.c b/src/buttons.c index 777ed189..fc236da8 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -77,10 +77,6 @@ #include "tiles.h" #include "setup.h" -#ifdef __VBCC__ - #define __attribute__(x) -#endif - #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #include #include diff --git a/src/fileformats.c b/src/fileformats.c index 8f8d25a5..9ba6bb39 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -3723,8 +3723,9 @@ void Test_PNG(T_IO_Context * context) /// Used by a callback in Load_PNG T_IO_Context * PNG_current_context; -int PNG_read_unknown_chunk(__attribute__((unused)) png_structp ptr, png_unknown_chunkp chunk) +int PNG_read_unknown_chunk(png_structp ptr, png_unknown_chunkp chunk) { + (void)ptr; // unused // png_unknown_chunkp members: // png_byte name[5]; // png_byte *data; diff --git a/src/graph.c b/src/graph.c index 2344134e..4a696e77 100644 --- a/src/graph.c +++ b/src/graph.c @@ -51,10 +51,6 @@ #include "brush.h" #include "tiles.h" -#ifdef __VBCC__ - #define __attribute__(x) -#endif - #if defined(__VBCC__) || defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__) #define M_PI 3.141592653589793238462643 #endif @@ -1225,8 +1221,10 @@ void Fill_general(byte fill_color) } // Affichage d'un point pour une preview en xor - void Pixel_figure_preview_xor(word x_pos,word y_pos,__attribute__((unused)) byte color) + void Pixel_figure_preview_xor(word x_pos,word y_pos,byte color) { + (void)color; // unused + if ( (x_pos>=Limit_left) && (x_pos<=Limit_right) && (y_pos>=Limit_top) && @@ -1237,8 +1235,10 @@ void Fill_general(byte fill_color) // Affichage d'un point pour une preview en xor additif // (Il lit la couleur depuis la page backup) - void Pixel_figure_preview_xorback(word x_pos,word y_pos,__attribute__((unused)) byte color) + void Pixel_figure_preview_xorback(word x_pos,word y_pos,byte color) { + (void)color; // unused + if ( (x_pos>=Limit_left) && (x_pos<=Limit_right) && (y_pos>=Limit_top) && @@ -1248,8 +1248,10 @@ void Fill_general(byte fill_color) // Effacement d'un point de preview - void Pixel_figure_clear_preview(word x_pos,word y_pos,__attribute__((unused)) byte color) + void Pixel_figure_clear_preview(word x_pos,word y_pos,byte color) { + (void)color; // unused + if ( (x_pos>=Limit_left) && (x_pos<=Limit_right) && (y_pos>=Limit_top) && @@ -2818,15 +2820,20 @@ void Display_pixel(word x,word y,byte color) // -- Aucun effet en cours -- -byte No_effect(__attribute__((unused)) word x,__attribute__((unused)) word y,byte color) +byte No_effect(word x, word y, byte color) { + (void)x; // unused + (void)y; // unused + return color; } // -- Effet de Shading -- -byte Effect_shade(word x,word y,__attribute__((unused)) byte color) +byte Effect_shade(word x,word y,byte color) { + (void)color; // unused + return Shade_table[Read_pixel_from_feedback_screen(x,y)]; } @@ -2879,21 +2886,24 @@ byte Effect_quick_shade(word x,word y,byte color) // -- Effet de Tiling -- -byte Effect_tiling(word x,word y,__attribute__((unused)) byte color) +byte Effect_tiling(word x,word y,byte color) { + (void)color; // unused + return Read_pixel_from_brush((x+Brush_width-Tiling_offset_X)%Brush_width, (y+Brush_height-Tiling_offset_Y)%Brush_height); } // -- Effet de Smooth -- -byte Effect_smooth(word x,word y,__attribute__((unused)) byte color) +byte Effect_smooth(word x,word y,byte color) { int r,g,b; byte c; int weight,total_weight; byte x2=((x+1)