[AD] src/dos/wss.c fix

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


The file src/dos/wss.c had a problem which caused GCC to issue a warning when compiling it (see attached file wss_warning.txt). Following the suggestion given by Elias Pschernig, in the following thread ( http://sourceforge.net/mailarchive/forum.php?thread_id=6326719&forum_id=34598 ). I could sucessfully fix it.

Basically I've changed the declaration of "wss_dma_addr" from "static int" to "static long", and I removed a cast in the line 282.

I hope this doesn't introduce any side effects in the code.

:-)
Marcio.
Compiling Allegro for djgpp, optimised. Please wait...
gcc -DALLEGRO_SRC -DALLEGRO_LIB_BUILD -Wall -W -Wstrict-prototypes -Wno-unused -Werror -mcpu=pentium -O2 -funroll-loops -ffast-math -fomit-frame-pointer -I. -I./include -o obj/djgpp/alleg/wss.o -c src/dos/wss.c
src/dos/wss.c: In function `wss_init':
src/dos/wss.c:282: warning: dereferencing type-punned pointer will break strict-aliasing rules
make.exe: *** [obj/djgpp/alleg/wss.o] Error 1
--- src\dos\wss.bak	2003-02-08 22:31:38.000000000 +0000
+++ src\dos\wss.c	2005-01-19 22:14:52.000000000 +0000
@@ -144,7 +144,7 @@
 static int wss_stereo = TRUE;
 static int wss_16bits = TRUE;
 static int wss_dma_sel;
-static int wss_dma_addr;
+static long wss_dma_addr;
 static int wss_dma_block;
 static int wss_in_use = FALSE;
 static int wss_detected = FALSE;
@@ -279,7 +279,7 @@
 
    digi_wss.voices = voices;
 
-   if (_dma_allocate_mem(BLOCKLEN * 2, &wss_dma_sel, (unsigned long *)&wss_dma_addr) != 0)
+   if (_dma_allocate_mem(BLOCKLEN * 2, &wss_dma_sel, &wss_dma_addr) != 0)
       return -1;
 
    nsamples = BLOCKLEN;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/