rpms/Glide3/devel Glide3-warn.patch,NONE,1.1 Glide3.spec,1.12,1.13

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Mon Jan 16 15:54:52 UTC 2006


Author: jwrdegoede

Update of /cvs/extras/rpms/Glide3/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29522

Modified Files:
	Glide3.spec 
Added Files:
	Glide3-warn.patch 
Log Message:
* Mon Jan 16 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 20050815-2
- Add modular Xorg BuildReqs
- Add a patch which fixes gcc4.1 warnings


Glide3-warn.patch:

--- NEW FILE Glide3-warn.patch ---
diff -ur Glide3.orig/cvg/glide3/src/fxgasm.c Glide3/cvg/glide3/src/fxgasm.c
--- Glide3.orig/cvg/glide3/src/fxgasm.c	2005-08-08 14:27:26.000000000 +0200
+++ Glide3/cvg/glide3/src/fxgasm.c	2006-01-16 16:43:14.000000000 +0100
@@ -210,8 +210,8 @@
     OFFSET (gr, pool.f1,    "pool_f1");
     OFFSET (gr, pool.f255,  "pool_f255");
 
-    OFFSET (gr, pool.ftemp1, "pool_fTemp1");
-    OFFSET (gr, pool.ftemp2, "pool_fTemp2");
+    OFFSET (gr, pool.temp1.f, "pool_fTemp1");
+    OFFSET (gr, pool.temp2.f, "pool_fTemp2");
 
     SIZEOF (gr,"GlideRoot");
     NEWLINE;
Only in Glide3/cvg/glide3/src: fxgasm.c.warn
diff -ur Glide3.orig/cvg/glide3/src/fxglide.h Glide3/cvg/glide3/src/fxglide.h
--- Glide3.orig/cvg/glide3/src/fxglide.h	2005-08-13 23:06:56.000000000 +0200
+++ Glide3/cvg/glide3/src/fxglide.h	2006-01-16 16:43:14.000000000 +0100
@@ -1370,7 +1370,9 @@
     float  fHalf;
     float  f1;
     float  f255;
-    float  ftemp1, ftemp2;       /* temps to convert floats to ints */
+    /* temps to convert floats to ints */
+    union { float f; FxI32 i; FxU32 u; } temp1;
+    union { float f; FxI32 i; FxU32 u; } temp2;
     float  fIntTruncBias;
 
 #if GLIDE_PACKED_RGB
@@ -2702,10 +2704,10 @@
  */
 #if GLIDE_PACKED_RGB
 #define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
-((_GlideRoot.pool.ftemp1 = (float)((float)(__fpVal) + (float)(__fpBias))), \
+((_GlideRoot.pool.temp1.f = (float)((float)(__fpVal) + (float)(__fpBias))), \
  GR_ASSERT((__fpVal) >= 0.0f), \
  GR_ASSERT((__fpVal) < 256.0f), \
- (((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)) << (__fpShift)))
+ ((_GlideRoot.pool.temp1.u & (__fpMask)) << (__fpShift)))
                                                   
 #define RGBA_COMP_CLAMP(__fpVal, __compToken) \
    RGBA_COMP(__fpVal, kPackBias##__compToken, kPackShift##__compToken, kPackMask##__compToken)
Only in Glide3/cvg/glide3/src: fxglide.h.warn
diff -ur Glide3.orig/cvg/glide3/src/gaa.c Glide3/cvg/glide3/src/gaa.c
--- Glide3.orig/cvg/glide3/src/gaa.c	2005-08-13 23:06:57.000000000 +0200
+++ Glide3/cvg/glide3/src/gaa.c	2006-01-16 16:43:14.000000000 +0100
@@ -273,34 +273,30 @@
 
   GR_BEGIN_NOFIFOCHECK(FN_NAME, 91);
 
-#define  DX _GlideRoot.pool.ftemp1
-#define ADY _GlideRoot.pool.ftemp2
+#define  DX _GlideRoot.pool.temp1
+#define ADY _GlideRoot.pool.temp2
 
   GR_FLUSH_STATE();
 
   {
-    FxI32 i, j;
-    FxU32 dataElem;
-    FxU32 vSize;
+    int i;
+    FxU32 vSize, dataElem;
     
     /*
     ** compute absolute deltas and draw from low Y to high Y
     */
-    ADY = FARRAY(b, 4) - FARRAY(a, 4);
-    i = *(int *)&ADY;
-    if (i < 0) {
+    ADY.f = FARRAY(b, 4) - FARRAY(a, 4);
+    if (ADY.i < 0) {
       const void *tv;
       tv = a; a = b; b = tv;
-      i ^= 0x80000000;            /* ady = -ady; */
-      /* (*(long *)&ADY) = i; */
+      ADY.i ^= 0x80000000;            /* ady = -ady; */
     }
     
-    DX = FARRAY(b, 0) - FARRAY(a, 0);
-    j = *(int *)&DX;
-    j &= 0x7fffffffL;            /* abs(adx) */
+    DX.f = FARRAY(b, 0) - FARRAY(a, 0);
+    DX.i &= 0x7fffffff;            /* abs(adx) */
     
     /* check for zero-length lines */
-    if ((j >= i) && (j == 0))
+    if ((DX.i >= ADY.i) && (DX.i == 0))
       return;
     
     vSize = gc->state.vData.vSize + 8;
@@ -308,7 +304,7 @@
     TRI_STRIP_BEGIN(kSetupCullDisable | kSetupStrip, 4, vSize, 
                     SSTCP_PKT3_BDDDDD | (1<<15));
     /* x major */
-    if (j >= i) {
+    if (DX.i >= ADY.i) {
       TRI_SETF(FARRAY(b, 0));
       dataElem = 0;
       TRI_SETF(FARRAY(b, 4) - _GlideRoot.pool.fHalf);
@@ -1391,35 +1387,31 @@
         dyBC = fb[yindex] - fc[yindex];
         
         /* Stash the area in the float pool for easy access */
-        _GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
+        _GlideRoot.pool.temp1.f = dxAB * dyBC - dxBC * dyAB;
         
 #define FloatVal(__f) (((__f) < 786432.875) ? (__f) : ((__f) - 786432.875))
-        {
-          const FxI32 j = *(FxI32*)&_GlideRoot.pool.ftemp1;
-          
-          /* Zero-area triangles are BAD!! */
-          if ((j & 0x7FFFFFFF) == 0) {
-            GDBG_INFO(291, FN_NAME": Culling (%g %g) (%g %g) (%g %g) : (%g : 0x%X : 0x%X)\n",
-                      FloatVal(fa[xindex]), FloatVal(fa[yindex]), 
-                      FloatVal(fb[xindex]), FloatVal(fb[yindex]), 
-                      FloatVal(fc[xindex]), FloatVal(fc[yindex]), 
-                      _GlideRoot.pool.ftemp1, gc->state.cull_mode, culltest);
+        /* Zero-area triangles are BAD!! */
+        if ((_GlideRoot.pool.temp1.i & 0x7FFFFFFF) == 0) {
+          GDBG_INFO(291, FN_NAME": Culling (%g %g) (%g %g) (%g %g) : (%g : 0x%X : 0x%X)\n",
+                    FloatVal(fa[xindex]), FloatVal(fa[yindex]), 
+                    FloatVal(fb[xindex]), FloatVal(fb[yindex]), 
+                    FloatVal(fc[xindex]), FloatVal(fc[yindex]), 
+                    _GlideRoot.pool.temp1.f, gc->state.cull_mode, culltest);
 
-            goto done;
-          }
+          goto done;
+        }
+    
+        /* Backface culling, use sign bit as test */
+        if ((gc->state.cull_mode != GR_CULL_DISABLE) &&
+            ((_GlideRoot.pool.temp1.i ^ (culltest << 31)) >= 0)) {
+      
+          GDBG_INFO(291, FN_NAME": Culling (%g %g) (%g %g) (%g %g) : (%g : 0x%X : 0x%X)\n",
+                    FloatVal(fa[xindex]), FloatVal(fa[yindex]), 
+                    FloatVal(fb[xindex]), FloatVal(fb[yindex]), 
+                    FloatVal(fc[xindex]), FloatVal(fc[yindex]), 
+                    _GlideRoot.pool.temp1.f, gc->state.cull_mode, culltest);
       
-          /* Backface culling, use sign bit as test */
-          if ((gc->state.cull_mode != GR_CULL_DISABLE) &&
-              ((j ^ (culltest << 31)) >= 0)) {
-        
-            GDBG_INFO(291, FN_NAME": Culling (%g %g) (%g %g) (%g %g) : (%g : 0x%X : 0x%X)\n",
-                      FloatVal(fa[xindex]), FloatVal(fa[yindex]), 
-                      FloatVal(fb[xindex]), FloatVal(fb[yindex]), 
-                      FloatVal(fc[xindex]), FloatVal(fc[yindex]), 
-                      _GlideRoot.pool.ftemp1, gc->state.cull_mode, culltest);
-        
-            goto done;
-          }
+          goto done;
         }
       }
     } /* end culling test */
@@ -1718,35 +1710,31 @@
         dyBC = fb[yindex] - fc[yindex];
         
         /* Stash the area in the float pool for easy access */
-        _GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
+        _GlideRoot.pool.temp1.f = dxAB * dyBC - dxBC * dyAB;
         
 #define FloatVal(__f) (((__f) < 786432.875) ? (__f) : ((__f) - 786432.875))
-        {
-          const FxI32 j = *(FxI32*)&_GlideRoot.pool.ftemp1;
-          
-          /* Zero-area triangles are BAD!! */
-          if ((j & 0x7FFFFFFF) == 0) {
-            GDBG_INFO(291, FN_NAME": Culling (%g %g) (%g %g) (%g %g) : (%g : 0x%X : 0x%X)\n",
-                      FloatVal(fa[xindex]), FloatVal(fa[yindex]), 
-                      FloatVal(fb[xindex]), FloatVal(fb[yindex]), 
-                      FloatVal(fc[xindex]), FloatVal(fc[yindex]), 
-                      _GlideRoot.pool.ftemp1, gc->state.cull_mode, culltest);
+        /* Zero-area triangles are BAD!! */
+        if ((_GlideRoot.pool.temp1.i & 0x7FFFFFFF) == 0) {
+          GDBG_INFO(291, FN_NAME": Culling (%g %g) (%g %g) (%g %g) : (%g : 0x%X : 0x%X)\n",
+                    FloatVal(fa[xindex]), FloatVal(fa[yindex]), 
+                    FloatVal(fb[xindex]), FloatVal(fb[yindex]), 
+                    FloatVal(fc[xindex]), FloatVal(fc[yindex]), 
+                    _GlideRoot.pool.temp1.f, gc->state.cull_mode, culltest);
 
-            goto done;
-          }
+          goto done;
+        }
+    
+        /* Backface culling, use sign bit as test */
+        if ((gc->state.cull_mode != GR_CULL_DISABLE) &&
+            ((_GlideRoot.pool.temp1.i ^ (culltest << 31)) >= 0)) {
+      
+          GDBG_INFO(291, FN_NAME": Culling (%g %g) (%g %g) (%g %g) : (%g : 0x%X : 0x%X)\n",
+                    FloatVal(fa[xindex]), FloatVal(fa[yindex]), 
+                    FloatVal(fb[xindex]), FloatVal(fb[yindex]), 
+                    FloatVal(fc[xindex]), FloatVal(fc[yindex]), 
+                    _GlideRoot.pool.temp1.f, gc->state.cull_mode, culltest);
       
-          /* Backface culling, use sign bit as test */
[...1688 lines suppressed...]
Only in Glide3/sst1/glide3/src: gstrip.c.warn
diff -ur Glide3.orig/sst1/glide3/src/gxdraw.c Glide3/sst1/glide3/src/gxdraw.c
--- Glide3.orig/sst1/glide3/src/gxdraw.c	2005-06-09 20:32:35.000000000 +0200
+++ Glide3/sst1/glide3/src/gxdraw.c	2006-01-16 16:43:14.000000000 +0100
@@ -159,7 +159,7 @@
   const float *fb = (const float *)vb + xindex;
   const float *fc = (const float *)vc + xindex;
   float ooa, dxAB, dxBC, dyAB, dyBC;
-  int i,j,culltest;
+  int i,culltest;
   union { float f; int i; } ay;
   union { float f; int i; } by;
   union { float f; int i; } cy;
@@ -239,16 +239,15 @@
   dyBC = snap_yb - snap_yc;
   
   /* this is where we store the area */
-  _GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
+  _GlideRoot.pool.temp1.1 = dxAB * dyBC - dxBC * dyAB;
   
   /* Zero-area triangles are BAD!! */
-  j = *(long *)&_GlideRoot.pool.ftemp1;
-  if ((j & 0x7FFFFFFF) == 0)
+  if ((_GlideRoot.pool.temp1.i & 0x7FFFFFFF) == 0)
     return 0;
   
   /* Backface culling, use sign bit as test */
   if (gc->state.cull_mode != GR_CULL_DISABLE) {
-    if ((j ^ (culltest<<31)) >= 0) {
+    if ((_GlideRoot.pool.temp1.i ^ (culltest<<31)) >= 0) {
       return -1;
     }
   }
@@ -291,7 +290,7 @@
   SET_GW_CMD(    fifoPtr, 0, gc->hwDep.sst96Dep.gwCommand );
   SET_GW_HEADER( fifoPtr, 1, gc->hwDep.sst96Dep.gwHeaders[0] );
 
-  ooa = _GlideRoot.pool.f1 / _GlideRoot.pool.ftemp1;
+  ooa = _GlideRoot.pool.f1 / _GlideRoot.pool.temp1.f;
   /* GMT: note that we spread out our PCI writes */
   /* write out X & Y for vertex A */
   FSET_GW_ENTRY( fifoPtr, 2, snap_xa );
@@ -353,7 +352,7 @@
 
   /* write triangle command */
 triangle_command:
-  FSET_GW_ENTRY( fifoPtr, 0, _GlideRoot.pool.ftemp1 );
+  FSET_GW_ENTRY( fifoPtr, 0, _GlideRoot.pool.temp1.f );
   fifoPtr+=1;
   
   if (((FxU32)fifoPtr) & 0x7) {
@@ -433,7 +432,7 @@
   const float *fb = (const float *)vb + xindex;
   const float *fc = (const float *)vc + xindex;
   float ooa, dxAB, dxBC, dyAB, dyBC;
-  int i,j,culltest;
+  int i,culltest;
   union { float f; int i; } ay;
   union { float f; int i; } by;
   union { float f; int i; } cy;
@@ -517,16 +516,15 @@
   dyBC = snap_yb - snap_yc;
   
   /* this is where we store the area */
-  _GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
+  _GlideRoot.pool.temp1.f = dxAB * dyBC - dxBC * dyAB;
   
   /* Zero-area triangles are BAD!! */
-  j = *(long *)&_GlideRoot.pool.ftemp1;
-  if ((j & 0x7FFFFFFF) == 0)
+  if ((_GlideRoot.pool.temp1.i & 0x7FFFFFFF) == 0)
     return 0;
   
   /* Backface culling, use sign bit as test */
   if (gc->state.cull_mode != GR_CULL_DISABLE) {
-    if ((j ^ (culltest<<31)) >= 0) {
+    if ((_GlideRoot.pool.temp1.i ^ (culltest<<31)) >= 0) {
       return -1;
     }
   }
@@ -535,7 +533,7 @@
 
   GR_SET_EXPECTED_SIZE(_GlideRoot.curTriSize);
   
-  ooa = _GlideRoot.pool.f1 / _GlideRoot.pool.ftemp1;
+  ooa = _GlideRoot.pool.f1 / _GlideRoot.pool.temp1.f;
   /* GMT: note that we spread out our PCI writes */
   /* write out X & Y for vertex A */
   GR_SETF( hw->FvA.x, snap_xa );
@@ -608,7 +606,7 @@
   }
 
   /* Draw the triangle by writing the area to the triangleCMD register */
-  P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, _GlideRoot.pool.ftemp1 ) );
+  P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, _GlideRoot.pool.temp1.f ) );
   _GlideRoot.stats.trisDrawn++;
 
   GR_CHECK_SIZE();
@@ -639,7 +637,7 @@
   const float *fb = (const float *)vb + xindex;
   const float *fc = (const float *)vc + xindex;
   float dxAB, dxBC, dyAB, dyBC;
-  int i,j;
+  int i;
   union { float f; int i; } ay;
   union { float f; int i; } by;
   union { float f; int i; } cy;
@@ -713,12 +711,11 @@
   dyBC = snap_yb - snap_yc;
 
   /* this is where we store the area */
-  _GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
+  _GlideRoot.pool.temp1.f = dxAB * dyBC - dxBC * dyAB;
   _GlideRoot.stats.trisProcessed++;
 
   /* Zero-area triangles are BAD!! */
-  j = *(long *)&_GlideRoot.pool.ftemp1;
-  if ((j & 0x7FFFFFFF) == 0) {
+  if ((_GlideRoot.pool.temp1.i & 0x7FFFFFFF) == 0) {
     return 0;
   }
 
@@ -795,7 +792,7 @@
   }
 
 triangle_command:
-  FSET_GW_ENTRY( fifoPtr, 0, _GlideRoot.pool.ftemp1 );
+  FSET_GW_ENTRY( fifoPtr, 0, _GlideRoot.pool.temp1.f );
   fifoPtr += 1;
 
   if (((FxU32)fifoPtr) & 0x7) {
@@ -862,7 +859,7 @@
   const float *fb = (const float *)vb + xindex;
   const float *fc = (const float *)vc + xindex;
   float dxAB, dxBC, dyAB, dyBC;
-  int i,j;
+  int i;
   union { float f; int i; } ay;
   union { float f; int i; } by;
   union { float f; int i; } cy;
@@ -950,12 +947,11 @@
    GR_SETF( hw->FvB.y, snap_yb );
 
   /* this is where we store the area */
-  _GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
+  _GlideRoot.pool.temp1.f = dxAB * dyBC - dxBC * dyAB;
   _GlideRoot.stats.trisProcessed++;
 
   /* Zero-area triangles are BAD!! */
-  j = *(long *)&_GlideRoot.pool.ftemp1;
-  if ((j & 0x7FFFFFFF) == 0) {
+  if ((_GlideRoot.pool.temp1.i & 0x7FFFFFFF) == 0) {
     GR_CHECK_SIZE_SLOPPY();
     return 0;
   }
@@ -995,7 +991,7 @@
   }
 
   /* Draw the triangle by writing the area to the triangleCMD register */
-  P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, _GlideRoot.pool.ftemp1 ) );
+  P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, _GlideRoot.pool.temp1.f ) );
   _GlideRoot.stats.trisDrawn++;
 
   GR_CHECK_SIZE();
Only in Glide3/sst1/glide3/src: gxdraw.c.warn
diff -ur Glide3.orig/sst1/incsrc/sst.h Glide3/sst1/incsrc/sst.h
--- Glide3.orig/sst1/incsrc/sst.h	2004-03-02 08:56:00.000000000 +0100
+++ Glide3/sst1/incsrc/sst.h	2006-01-16 16:43:14.000000000 +0100
@@ -1049,7 +1049,14 @@
 #define GET16(s) s
 #define SET(d,s) d = s
 #define SET16(d,s) d = s
-#define SETF(d,s) (*(float *)&(d)) = s
+#define SETF(d,s) *((float *)((void *)(&(d)))) = s
+/*
+do { \
+  union { float f; FxU32 u; } uni; \
+  uni.f = s; \
+  d = uni.u; \
+} while(0)
+*/
 
 // SET macros for FBI
 #define SET_FBI(d,s)    SET (*(&(d)+0x100),s)
Only in Glide3/sst1/incsrc: sst.h.warn
diff -ur Glide3.orig/sst1/init/initvg/sst1init.h Glide3/sst1/init/initvg/sst1init.h
--- Glide3.orig/sst1/init/initvg/sst1init.h	2005-05-25 10:53:23.000000000 +0200
+++ Glide3/sst1/init/initvg/sst1init.h	2006-01-16 16:49:31.000000000 +0100
@@ -105,8 +105,8 @@
 #define IGET(A)    A
 #define ISET(A,D)  A = (D)
 #else
-#define IGET(A)    sst1InitRead32((FxU32 *) &(A))
-#define ISET(A,D)  sst1InitWrite32((FxU32 *) &(A), D)  
+#define IGET(A)    sst1InitRead32((FxU32 *)(void *)&(A))
+#define ISET(A,D)  sst1InitWrite32((FxU32 *)(void *)&(A), D)  
 #endif
 
 /*
Only in Glide3/sst1/init/initvg: sst1init.h~


Index: Glide3.spec
===================================================================
RCS file: /cvs/extras/rpms/Glide3/devel/Glide3.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Glide3.spec	15 Aug 2005 13:13:56 -0000	1.12
+++ Glide3.spec	16 Jan 2006 15:54:52 -0000	1.13
@@ -1,6 +1,6 @@
 Name:    Glide3
 Version: 20050815
-Release: 1
+Release: 2
 Summary: Glide3 runtime for the 3Dfx Voodoo family of cards
 # Glide3 is x86/alpha/ia64/x86_64 only, ia64 is untested
 ExclusiveArch: %{ix86} alpha ia64 x86_64
@@ -17,8 +17,11 @@
 #   tar jcf Glide3-$(date +"%Y%m%d").tar.bz2 Glide3/
 Source0: %{name}-%{version}.tar.bz2
 Source1: glidelink.c
+Patch0: Glide3-warn.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: xorg-x11-devel
+BuildRequires: libX11-devel xorg-x11-proto-devel 
+# Add these to try the experimental DGA support and add DGA=1 to %{glide_flags}
+# BuildRequires: libXxf86dga-devel libXxf86vm-devel
 %ifarch %{ix86}
 BuildRequires: nasm
 %endif
@@ -43,6 +46,7 @@
 
 %prep
 %setup -q -n Glide3
+%patch0 -p1 -z .warn
 
 
 %build
@@ -127,6 +131,10 @@
 
 
 %changelog
+* Mon Jan 16 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 20050815-2
+- Add modular Xorg BuildReqs
+- Add a patch which fixes gcc4.1 warnings
+
 * Mon Aug 15 2005 Hans de Goede <j.w.r.degoede at hhs.nl> 20050815-1
 - Add -soname to linkerflags, so that we report the correct soname,
   otherwise rpm can't properly resolve dependencies because of the




More information about the fedora-extras-commits mailing list