We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 529 - SDL_blit_A.c fails to compile with SDL_ALTIVEC_BLITTERS
Summary: SDL_blit_A.c fails to compile with SDL_ALTIVEC_BLITTERS
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: PowerPC Mac OS X 10.4 (PPC)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-29 13:17 UTC by Christian Walther
Modified: 2007-12-29 14:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Walther 2007-12-29 13:17:24 UTC
If SDL_ALTIVEC_BLITTERS is defined, compilation of SDL_blit_A.c for PPC fails with the following error:

./src/video/SDL_blit_A.c: In function 'Blit32to32SurfaceAlphaKeyAltivec':
./src/video/SDL_blit_A.c:758: error: 'alpha' undeclared (first use in this function)
./src/video/SDL_blit_A.c:758: error: (Each undeclared identifier is reported only once
./src/video/SDL_blit_A.c:758: error: for each function it appears in.)
./src/video/SDL_blit_A.c: In function 'Blit32to32SurfaceAlphaAltivec':
./src/video/SDL_blit_A.c:1074: error: 'alpha' undeclared (first use in this function)

I have no idea if this is correct, but judging from the rest of the changes in <http://libsdl.org/cgi/viewvc.cgi/trunk/SDL/src/video/SDL_blit_A.c?r1=3426&r2=3428&diff_format=l>, the fix could look about like this:

--- src/video/SDL_blit_A.c	2007-08-18 05:39:09 +0000
+++ src/video/SDL_blit_A.c	2007-12-29 20:59:19 +0000
@@ -755,7 +755,7 @@
     vsdstPermute = calc_swizzle32(dstfmt, NULL);
 
     /* set a vector full of alpha and 255-alpha */
-    ((unsigned char *) &valpha)[0] = alpha;
+    ((unsigned char *) &valpha)[0] = sA;
     valpha = vec_splat(valpha, 0);
     vbits = (vector unsigned char) vec_splat_s8(-1);
 
@@ -1071,7 +1071,7 @@
     vsdstPermute = calc_swizzle32(dstfmt, NULL);
 
     /* set a vector full of alpha and 255-alpha */
-    ((unsigned char *) &valpha)[0] = alpha;
+    ((unsigned char *) &valpha)[0] = sA;
     valpha = vec_splat(valpha, 0);
     vbits = (vector unsigned char) vec_splat_s8(-1);
Comment 1 Sam Lantinga 2007-12-29 14:16:02 UTC
This is fixed with revision 3499.  Thanks!