Hello, I've posted this patch to the forums, but the discussion seems to have died down. Is the mailing list a better place to discuss patches?
The attached patch fixes a pair of trivial warnings in Allegro 4.4 I also noticed a warning about an aliasing problem in the OSS code; with compilers becoming more aggressive at high optimization levels, it might be prudent to add -fno-strict-aliasing to the CFLAGS, as Linux has been doing for ages. Regards. (Please CC me in replies)
>From dc65b812c3753aea7b4fc5ef4272edeca428083c Mon Sep 17 00:00:00 2001 From: Boon <[email protected]> Date: Sat, 29 Aug 2015 14:10:42 +0200 Subject: [PATCH] Fix warnings in ljoy.c and tga.c --- src/linux/ljoy.c | 7 ------- src/tga.c | 10 +++++----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/linux/ljoy.c b/src/linux/ljoy.c index 12e2306..75c49bb 100644 --- a/src/linux/ljoy.c +++ b/src/linux/ljoy.c @@ -53,9 +53,6 @@ static int joy_init(void) AL_CONST char *device_name = NULL; char tmp[128], tmp1[128], tmp2[128]; unsigned int raw_version; - struct { - unsigned char build, minor, major; - } version; char num_axes, num_buttons; int throttle; int i, s, a, b; @@ -97,10 +94,6 @@ static int joy_init(void) return -1; } - version.major = (raw_version & 0xFF0000) >> 16; - version.minor = (raw_version & 0xFF00) >> 8; - version.build = (raw_version & 0xFF); - ioctl(joy_fd[i], JSIOCGAXES, &num_axes); ioctl(joy_fd[i], JSIOCGBUTTONS, &num_buttons); diff --git a/src/tga.c b/src/tga.c index d40762e..2340fbb 100644 --- a/src/tga.c +++ b/src/tga.c @@ -280,8 +280,8 @@ BITMAP *load_tga_pf(PACKFILE *f, RGB *pal) unsigned char image_id[256], image_palette[256][3]; unsigned char id_length, palette_type, image_type, palette_entry_size; unsigned char bpp, descriptor_bits; - short unsigned int first_color, palette_colors; - short unsigned int left, top, image_width, image_height; + short unsigned int palette_colors; + short unsigned int image_width, image_height; unsigned int c, i, y, yc; int dest_depth; int compressed; @@ -299,11 +299,11 @@ BITMAP *load_tga_pf(PACKFILE *f, RGB *pal) id_length = pack_getc(f); palette_type = pack_getc(f); image_type = pack_getc(f); - first_color = pack_igetw(f); + /* first_color */ pack_igetw(f); palette_colors = pack_igetw(f); palette_entry_size = pack_getc(f); - left = pack_igetw(f); - top = pack_igetw(f); + /* left */ pack_igetw(f); + /* top */ pack_igetw(f); image_width = pack_igetw(f); image_height = pack_igetw(f); bpp = pack_getc(f); -- 2.4.3
_______________________________________________ Allegro-developers mailing list [email protected] https://mail.gna.org/listinfo/allegro-developers
