N Sep 17 8791 Sam Lantinga Re: tks source released
authorSam Lantinga <slouken@libsdl.org>
Sun, 21 Sep 2003 18:32:04 +0000
changeset 720f90d80d68071
parent 719 269c97e24da6
child 721 ab0656314eef
N Sep 17 8791 Sam Lantinga Re: tks source released
Date: Sun, 07 Sep 2003 02:51:58 +0200
From: Stephane Marchesin
Subject: [SDL] Two little patches

Compiling SDL with a recent gcc (gcc 3.3.1, 3.3 doesn't have this
behaviour) gives some nasty warnings :

SDL_blit_A.c: In function `BlitRGBtoRGBSurfaceAlpha128MMX':
SDL_blit_A.c:223: warning: integer constant is too large for "long" type
SDL_blit_A.c:225: warning: integer constant is too large for "long" type
SDL_blit_A.c:227: warning: integer constant is too large for "long" type
[...]

The first attached patch (longlongfix.patch) tells gcc to really treat
those constants as unsigned long long and not long.

The second patch (nasinclude.patch) fixes an include problem I had while
compiling nas audio : when the <audio/audiolib.h> file lies in
/usr/X11R6/include, a -I/usr/X11R6/include option is needed or the file
isn't found.
Makefile.am
configure.in
src/video/SDL_blit_A.c
     1.1 --- a/Makefile.am	Sun Sep 21 18:18:17 2003 +0000
     1.2 +++ b/Makefile.am	Sun Sep 21 18:32:04 2003 +0000
     1.3 @@ -105,3 +105,10 @@
     1.4  	mv SDL12 SDL-1.2
     1.5  	tar zcvf $(HOME)/SDL-1.2.tar.gz SDL-1.2
     1.6  	rm -rf SDL-1.2
     1.7 +snapshot13:
     1.8 +	cvs -d $(CVSROOT) login
     1.9 +	cvs -d $(CVSROOT) checkout -r branch_1_3_x SDL12
    1.10 +	(cd SDL12 && ./autogen.sh)
    1.11 +	mv SDL12 SDL-1.3
    1.12 +	tar zcvf $(HOME)/SDL-1.3.tar.gz SDL-1.3
    1.13 +	rm -rf SDL-1.3
     2.1 --- a/configure.in	Sun Sep 21 18:18:17 2003 +0000
     2.2 +++ b/configure.in	Sun Sep 21 18:32:04 2003 +0000
     2.3 @@ -415,7 +415,7 @@
     2.4          have_nas=no
     2.5          if test -r /usr/X11R6/include/audio/audiolib.h; then
     2.6              have_nas=yes
     2.7 -            CFLAGS="$CFLAGS -DNAS_SUPPORT"
     2.8 +            CFLAGS="$CFLAGS -DNAS_SUPPORT -I/usr/X11R6/include/"
     2.9              SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
    2.10              AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
    2.11              AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
     3.1 --- a/src/video/SDL_blit_A.c	Sun Sep 21 18:18:17 2003 +0000
     3.2 +++ b/src/video/SDL_blit_A.c	Sun Sep 21 18:32:04 2003 +0000
     3.3 @@ -220,11 +220,11 @@
     3.4  	int dstskip = info->d_skip >> 2;
     3.5          Uint8 load[8];
     3.6    
     3.7 -        *(Uint64 *)load = 0x00fefefe00fefefe;/* alpha128 mask */
     3.8 +        *(Uint64 *)load = 0x00fefefe00fefefeULL;/* alpha128 mask */
     3.9          movq_m2r(*load, mm4); /* alpha128 mask -> mm4 */
    3.10 -        *(Uint64 *)load = 0x0001010100010101;/* !alpha128 mask */
    3.11 +        *(Uint64 *)load = 0x0001010100010101ULL;/* !alpha128 mask */
    3.12          movq_m2r(*load, mm3); /* !alpha128 mask -> mm3 */
    3.13 -        *(Uint64 *)load = 0xFF000000FF000000;/* dst alpha mask */
    3.14 +        *(Uint64 *)load = 0xFF000000FF000000ULL;/* dst alpha mask */
    3.15          movq_m2r(*load, mm7); /* dst alpha mask -> mm7 */
    3.16  	while(height--) {
    3.17              DUFFS_LOOP_DOUBLE2(
    3.18 @@ -276,10 +276,10 @@
    3.19      					alpha, alpha, alpha, alpha};
    3.20  					
    3.21                  movq_m2r(*load, mm4); /* alpha -> mm4 */
    3.22 -		*(Uint64 *)load = 0x00FF00FF00FF00FF;
    3.23 +		*(Uint64 *)load = 0x00FF00FF00FF00FFULL;
    3.24                  movq_m2r(*load, mm3); /* mask -> mm3 */
    3.25  		pand_r2r(mm3, mm4); /* mm4 & mask -> 0A0A0A0A -> mm4 */
    3.26 -		*(Uint64 *)load = 0xFF000000FF000000;/* dst alpha mask */
    3.27 +		*(Uint64 *)load = 0xFF000000FF000000ULL;/* dst alpha mask */
    3.28  		movq_m2r(*load, mm7); /* dst alpha mask -> mm7 */
    3.29  		
    3.30  		while(height--) {
    3.31 @@ -360,13 +360,13 @@
    3.32          Uint32 alpha = 0;
    3.33          Uint8 load[8];
    3.34  	                
    3.35 -	*(Uint64 *)load = 0x00FF00FF00FF00FF;
    3.36 +	*(Uint64 *)load = 0x00FF00FF00FF00FFULL;
    3.37          movq_m2r(*load, mm3); /* mask -> mm2 */
    3.38 -	*(Uint64 *)load = 0x00FF000000000000;
    3.39 +	*(Uint64 *)load = 0x00FF000000000000ULL;
    3.40          movq_m2r(*load, mm7); /* dst alpha mask -> mm2 */
    3.41 -        *(Uint64 *)load = 0x00FFFFFF00FFFFFF;
    3.42 +        *(Uint64 *)load = 0x00FFFFFF00FFFFFFULL;
    3.43          movq_m2r(*load, mm0); /* alpha 255 mask -> mm0 */
    3.44 -        *(Uint64 *)load = 0xFF000000FF000000;
    3.45 +        *(Uint64 *)load = 0xFF000000FF000000ULL;
    3.46          movq_m2r(*load, mm6); /* alpha 255 !mask -> mm6 */
    3.47  	while(height--) {
    3.48  	    DUFFS_LOOP4({
    3.49 @@ -792,11 +792,11 @@
    3.50                  punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */
    3.51  	  
    3.52   	        /* Setup the 565 color channel masks */
    3.53 -	        *(Uint64 *)load = 0xF800F800F800F800;
    3.54 +	        *(Uint64 *)load = 0xF800F800F800F800ULL;
    3.55  		movq_m2r(*load, mm1); /* MASKRED -> mm1 */
    3.56 -		*(Uint64 *)load = 0x07E007E007E007E0;
    3.57 +		*(Uint64 *)load = 0x07E007E007E007E0ULL;
    3.58  		movq_m2r(*load, mm4); /* MASKGREEN -> mm4 */
    3.59 -		*(Uint64 *)load = 0x001F001F001F001F;
    3.60 +		*(Uint64 *)load = 0x001F001F001F001FULL;
    3.61  		movq_m2r(*load, mm7); /* MASKBLUE -> mm7 */
    3.62  		while(height--) {
    3.63                          DUFFS_LOOP_QUATRO2(
    3.64 @@ -942,11 +942,11 @@
    3.65                  punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */
    3.66  	  
    3.67   	        /* Setup the 555 color channel masks */
    3.68 -	        *(Uint64 *)load = 0x7C007C007C007C00;
    3.69 +	        *(Uint64 *)load = 0x7C007C007C007C00ULL;
    3.70  		movq_m2r(*load, mm1); /* MASKRED -> mm1 */
    3.71 -		*(Uint64 *)load = 0x03E003E003E003E0;
    3.72 +		*(Uint64 *)load = 0x03E003E003E003E0ULL;
    3.73  		movq_m2r(*load, mm4); /* MASKGREEN -> mm4 */
    3.74 -		*(Uint64 *)load = 0x001F001F001F001F;
    3.75 +		*(Uint64 *)load = 0x001F001F001F001FULL;
    3.76  		movq_m2r(*load, mm7); /* MASKBLUE -> mm7 */
    3.77  		while(height--) {
    3.78                          DUFFS_LOOP_QUATRO2(