Package: python-soya
Version: 0.13.2-4
Severity: serious
Tags: patch

soya lacks a build-dependency on python-pyrex, which causes the build
system skips building the pyx files in the distribution (it uses
precompiled files instead). As a result, the pyx files have bitrotted
and no longer build with current pyrex.

The attached patch, taken from Soya SVN (revision 391), fixes this.

However, the version of pyrex in Debian generates broken code
(#483035), so you should wait with uploading until that bug is fixed.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/1 CPU core)
Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-soya depends on:
ii  libc6                       2.7-13       GNU C Library: Shared libraries
ii  libcal3d12                  0.11.0-3     Skeletal based 3d character animat
ii  libfreetype6                2.3.7-2      FreeType 2 font engine, shared lib
ii  libglew1.5                  1.5.0dfsg1-3 The OpenGL Extension Wrangler - ru
ii  libode0debian1              2:0.9-1      Open Dynamics Engine - runtime lib
ii  libopenal1                  1:1.4.272-2  Software implementation of the Ope
ii  libsdl1.2debian             1.2.13-2     Simple DirectMedia Layer
ii  libstdc++6                  4.3.1-9      The GNU Standard C++ Library v3
ii  python                      2.5.2-2      An interactive high-level object-o
ii  python-editobj              0.5.7-7      Python object editor
ii  python-imaging-tk           1.1.6-3      Python Imaging Library - ImageTk M
ii  python-support              0.8.5        automated rebuilding support for P
ii  python-twisted-core         8.1.0-3      Event-based framework for internet
ii  ttf-freefont                20080323-3   Freefont Serif, Sans and Mono True

python-soya recommends no packages.

Versions of packages python-soya suggests:
pn  python-soya-doc               <none>     (no description available)

-- no debconf information
--- a/text/text.pyx
+++ b/text/text.pyx
@@ -152,7 +152,7 @@
                for j from 0 <= j < bitmap.rows: # get pixels
                        memcpy(self._pixels + self._current_x + 
(self._current_y + j) * MAX_TEXTURE_SIZE, bitmap.buffer + bitmap.pitch * j, 
bitmap.pitch)
                        
-               self._current_x = <int> (self._current_x + glyph.width + 5.)
+               self._current_x = self._current_x + (<int> glyph.width) + 5
                
                glBindTexture(GL_TEXTURE_2D, self._tex_id)
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
--- a/cal3d/model.pyx
+++ b/cal3d/model.pyx
@@ -685,8 +685,11 @@
                        CalCoreModel_CreateCoreMaterialThread(self._core_model, 
i)
                        CalCoreModel_SetCoreMaterialId(self._core_model, i, 0, 
i)
                        CalCoreMaterial_SetUserData(material, <CalUserData> i)
-                       
-               CalRenderer_GetMapUserData
+               
+               # Greg Ewing, March 2007 ([EMAIL PROTECTED])
+               # Following line commented out as it wasn't doing anything and 
was causing
+               # a compiler warning. POSSIBLE BUG.
+               #CalRenderer_GetMapUserData
                
 # This method is split in 3 ; this is a work-around for a bug in Pyrex
 
--- a/opengl.pyx
+++ b/opengl.pyx
@@ -22,6 +22,7 @@
 include "python.pxd"
 
 cimport c_opengl
+from c_opengl cimport GLenum, GLuint
 
 GL_FALSE = c_opengl.GL_FALSE
 GL_TRUE = c_opengl.GL_TRUE
@@ -844,9 +845,8 @@
        c_opengl.glScalef(x,y,z)
 
 def glGenTextures(int n):
-       cdef unsigned int ret
+       cdef GLuint ret
        c_opengl.glGenTextures(n,&ret)
-
        return ret
  
 def glBindTexture(int target, unsigned int texture):
@@ -864,7 +864,7 @@
 def glMatrixMode(int mode):
        c_opengl.glMatrixMode(mode)
        
-def glMultMatrix(float mode):
+def glMultMatrix(GLenum mode):
        c_opengl.glMultMatrix(mode)
        
 def glTexParameteri(int target, int param, int value):
--- a/definitions/model/terrain.pxd
+++ b/definitions/model/terrain.pxd
@@ -54,7 +54,7 @@
        int         texcoord_type # 0: use terrainvertex texcoord, 1, 2, 3, 4: 
the tri use a texture generated (from blend_material), and the texcoord are 
(0.0, 0.0) - (1.0, 1.0)
 ctypedef _TerrainTri TerrainTri
 
-ctypedef void (*terrain_drawColor_FUNC   )(float*)
+ctypedef void (*terrain_drawColor_FUNC   )(GLfloat*)
 ctypedef void (*terrain_disableColor_FUNC)()
 ctypedef void (*terrain_enableColor_FUNC )()
 
--- a/definitions/base.pxd
+++ b/definitions/base.pxd
@@ -238,29 +238,30 @@
        NETWORK_STATE_HAS_POSITION = 1 << 0
        NETWORK_STATE_HAS_SCALING  = 1 << 1
 
-ctypedef struct Frustum:
-## Frustum
-## points :
-## 15-------12
-## |\       /|
-## | \     / |
-## |  3---0  |
-## |  |   |  |
-## |  6---9  |
-## | /     \ |
-## |/       \|
-## 18-------21
-## 
-## plane[ 0] : front plane
-## plane[ 4] : top plane
-## plane[ 8] : bottom plane
-## plane[12] : right plane
-## plane[16] : left plane
-## plane[20] : back plane
-## plane normals are oriented toward the exterior of the frustum
-       float position[3]  # camera position (x,y,z)
-       float points  [24] # points : (x,y,z) * 8
-       float planes  [24] # planes equation : (a,b,c,d) * 6
+cdef extern from "matrix.h":
+       ctypedef struct Frustum:
+       ## Frustum
+       ## points :
+       ## 15-------12
+       ## |\       /|
+       ## | \     / |
+       ## |  3---0  |
+       ## |  |   |  |
+       ## |  6---9  |
+       ## | /     \ |
+       ## |/       \|
+       ## 18-------21
+       ## 
+       ## plane[ 0] : front plane
+       ## plane[ 4] : top plane
+       ## plane[ 8] : bottom plane
+       ## plane[12] : right plane
+       ## plane[16] : left plane
+       ## plane[20] : back plane
+       ## plane normals are oriented toward the exterior of the frustum
+               float position[3]  # camera position (x,y,z)
+               float points  [24] # points : (x,y,z) * 8
+               float planes  [24] # planes equation : (a,b,c,d) * 6
 
 cdef struct _Pack: # See material.pyx for doc and comments
        int       option
--- a/definitions/ode/ctype.pxd
+++ b/definitions/ode/ctype.pxd
@@ -15,6 +15,8 @@
 # author:
 #      edited by Marmoute - Pierre-Yves David - [EMAIL PROTECTED]
 
+#cdef extern from "ode_check.h":
+#      pass
 
 cdef extern from "ode/ode.h":
 
--- a/c.pxd
+++ b/c.pxd
@@ -34,7 +34,7 @@
        float sin (float x)
        float tan (float x)
        float exp (float x)
-       float pow (float x, int n)
+       float pow (float x, float n)
        float ceil (float x)
        float floor (float x)
 
--- a/init.pyx
+++ b/init.pyx
@@ -237,7 +237,7 @@
        renderer.screen_width  = width
        renderer.screen_height = height
        # Information about the current video settings
-       info = SDL_GetVideoInfo()
+       info = <SDL_VideoInfo*> SDL_GetVideoInfo() # cast for constness 
adjustment
        if info == NULL:
                s = "Video query failed : %s" % SDL_GetError()
                print s
--- a/chunk.c
+++ b/chunk.c
@@ -472,4 +472,3 @@
   dat2.b[3] = dat1.b[0];
   return dat2.f;
 }
-
--- a/soya3d/light.pyx
+++ b/soya3d/light.pyx
@@ -33,7 +33,7 @@
        ##cdef int _used
        #cdef _static_shadow_displaylists
        
-       def __new__(self, *args, **kargs):
+       def __cinit__(self, *args, **kargs):
                self.__raypick_data              = -1
                self._id                         = -1
                self._static_shadow_displaylists = weakref.WeakKeyDictionary()
@@ -401,11 +401,11 @@
                        glEnable(GL_LIGHT0 + light._id)
                        light._gl_id_enabled = 1
                        
-cdef void disable_deep_lights():
-       """Disable all non top level lights."""
-       cdef _Light light
-       for light in LIGHTS:
-               if (not light is None) and (light._option & LIGHT_TOP_LEVEL) 
and (light._gl_id_enabled == 1):
-                       glDisable(GL_LIGHT0 + i)
-                       light._gl_id_enabled = 0
+#U#cdef void disable_deep_lights():
+#U#    """Disable all non top level lights."""
+#U#    cdef _Light light
+#U#    for light in LIGHTS:
+#U#            if (not light is None) and (light._option & LIGHT_TOP_LEVEL) 
and (light._gl_id_enabled == 1):
+#U#                    glDisable(GL_LIGHT0 + i)
+#U#                    light._gl_id_enabled = 0
                        
--- a/soya3d/world.pyx
+++ b/soya3d/world.pyx
@@ -417,8 +417,14 @@
        #  return item in self.children
        def __getitem__(self, name):
                cdef CoordSyst item, i
+               cdef object name_attr
                for item in self.children:
-                       if getattr(item, "name", "") == name: return item
+                       try:
+                               name_attr = getattr(item, "name")
+                       except:
+                               name_attr = ""
+                       if name_attr == name:
+                               return item
                for item in self.children:
                        if isinstance(item, _World):
                                i = item[name]
--- a/soya3d/camera.pyx
+++ b/soya3d/camera.pyx
@@ -25,7 +25,7 @@
        #cdef int      _viewport[4]
        #cdef          _master
        
-       def __new__(self, *args, **kargs):
+       def __cinit__(self, *args, **kargs):
                self.__raypick_data     = -1
                self._render_matrix[15] = 1.0
                self._frustum           = <Frustum*> malloc(sizeof(Frustum))
--- a/soya3d/coordsyst.pyx
+++ b/soya3d/coordsyst.pyx
@@ -83,7 +83,7 @@
        #cdef int _option
        #cdef int _auto_static_count
        
-       def __new__(self, *args, **kargs):
+       def __cinit__(self, *args, **kargs):
                self.__raypick_data     = -1
                self._auto_static_count = 3
                
--- a/soya3d/body.pyx
+++ b/soya3d/body.pyx
@@ -71,12 +71,12 @@
                        # pos            vector (3)   # XXX ignored for the 
moment
                        # quaternion     quaternion   # XXX use a self-relativ 
cordinate later
                        # linear speed   vector (3)   # XXX idem
-                       v = dBodyGetLinearVel(bid)
+                       v = <dReal*> dBodyGetLinearVel(bid) # Cast for const 
correction
                        vector_by_matrix(vector, 
self._ode_parent._root_matrix())
                        vector_by_matrix(vector, self._inverted_root_matrix())
                        chunk_add_floats_endian_safe(ode_chunk,v,3)
                        # angular speed  vector (3)   # XXX idem
-                       v = dBodyGetAngularVel(bid)
+                       v = <dReal*> dBodyGetAngularVel(bid) # Cast for const 
correction
                        vector_by_matrix(v, self._ode_parent._root_matrix())
                        vector_by_matrix(v, self._inverted_root_matrix())
                        chunk_add_floats_endian_safe(ode_chunk,v,3)
@@ -110,7 +110,7 @@
                                if self._option & BODY_HAS_ODE:
                                        self.__ode_data = cstate[3]
                                        self.joints = cstate[4]
-                                       self._option & BODY_HAS_ODE
+                                       #self._option & BODY_HAS_ODE
                                        self._option = self._option & 
~BODY_HAS_ODE
                                else:
                                        self.__ode_data = None
@@ -464,13 +464,17 @@
                        
                                                
        cdef void _sync_ode_position(self):
-               cdef GLfloat * m
+               # Greg Ewing, March 2007 ([EMAIL PROTECTED])
+               # multiply_matrix was being passed an uninitialised pointer
+               cdef GLfloat ma[19]
+               cdef GLfloat *m
                cdef dMatrix3  R
                cdef dReal * q
                
                if self.parent is self.ode_parent:
                        m = self._matrix
                else:
+                       m = ma
                        multiply_matrix(m, 
self._ode_parent._inverted_root_matrix(), self._root_matrix())
                R[0]  = m[0]
                R[1]  = m[4]
@@ -490,13 +494,13 @@
                dBodySetPosition(self._OdeBodyID, m[12], m[13], m[14])
                dBodySetRotation(self._OdeBodyID, R)
                
-               q = dBodyGetQuaternion(self._OdeBodyID)
+               q = <dReal*> dBodyGetQuaternion(self._OdeBodyID) # Cast for 
const correction
                self._q[0] = q[1]
                self._q[1] = q[2]
                self._q[2] = q[3]
                self._q[3] = q[0]
 
-               q = dBodyGetPosition(self._OdeBodyID)
+               q = <dReal*> dBodyGetPosition(self._OdeBodyID) # Cast for const 
correction
                self._p[0] = q[0]
                self._p[1] = q[1]
                self._p[2] = q[2]
@@ -518,13 +522,13 @@
                        self._t = 0
                        if self._option & BODY_ODE_INVALIDE_POS:
                                self._sync_ode_position()
-                       q = dBodyGetQuaternion(self._OdeBodyID)
+                       q = <dReal*> dBodyGetQuaternion(self._OdeBodyID) # Cast 
for const correction
                        self._q[0] = q[1]
                        self._q[1] = q[2]
                        self._q[2] = q[3]
                        self._q[3] = q[0]
        
-                       q = dBodyGetPosition(self._OdeBodyID)
+                       q = <dReal*> dBodyGetPosition(self._OdeBodyID) # Cast 
for const correction
                        self._p[0] = q[0]
                        self._p[1] = q[1]
                        self._p[2] = q[2]
@@ -560,8 +564,8 @@
                                        #saving the scale of the object
                                        #XXX optimisable
                                        
memcpy(&zoom[0],&self._matrix[16],3*sizeof(float))
-                                       r = dBodyGetQuaternion(self._OdeBodyID)
-                                       p = dBodyGetPosition(self._OdeBodyID)
+                                       r = <dReal*> 
dBodyGetQuaternion(self._OdeBodyID) # Cast for const correction
+                                       p = <dReal*> 
dBodyGetPosition(self._OdeBodyID) # Cast for const correction
                                        t = 1.0 - self._t
                
                                        # Linearly interpolate between the 
current quaternion and the last
--- a/cal3d_wrapper.h
+++ b/cal3d_wrapper.h
@@ -188,7 +188,7 @@
 // CalCoreAnimation wrapper functions declaration                             
//
 
//****************************************************************************//
 
-  CAL3D_WRAPPER_API struct CalCoreAnimation *CalCoreAnimation_New();
+  CAL3D_WRAPPER_API struct CalCoreAnimation *CalCoreAnimation_New(void);
   CAL3D_WRAPPER_API void CalCoreAnimation_Delete(struct CalCoreAnimation 
*self);
 
   CAL3D_WRAPPER_API void CalCoreAnimation_AddCoreTrack(struct CalCoreAnimation 
*self, struct CalCoreTrack *pCoreTrack);
@@ -231,7 +231,7 @@
   CAL3D_WRAPPER_API struct CalQuaternion *CalCoreKeyframe_GetRotation(struct 
CalCoreKeyframe *self);
   CAL3D_WRAPPER_API float CalCoreKeyframe_GetTime(struct CalCoreKeyframe 
*self);
   CAL3D_WRAPPER_API struct CalVector *CalCoreKeyframe_GetTranslation(struct 
CalCoreKeyframe *self);
-  CAL3D_WRAPPER_API struct CalCoreKeyframe *CalCoreKeyframe_New();
+  CAL3D_WRAPPER_API struct CalCoreKeyframe *CalCoreKeyframe_New(void);
   CAL3D_WRAPPER_API void CalCoreKeyframe_SetRotation(struct CalCoreKeyframe 
*self, struct CalQuaternion *pRotation);
   CAL3D_WRAPPER_API void CalCoreKeyframe_SetTime(struct CalCoreKeyframe *self, 
float time);
   CAL3D_WRAPPER_API void CalCoreKeyframe_SetTranslation(struct CalCoreKeyframe 
*self, struct CalVector *pTranslation);
@@ -240,7 +240,7 @@
 // CalCoreMaterial wrapper functions declaration                              
//
 
//****************************************************************************//
 
-  CAL3D_WRAPPER_API struct CalCoreMaterial *CalCoreMaterial_New();
+  CAL3D_WRAPPER_API struct CalCoreMaterial *CalCoreMaterial_New(void);
   CAL3D_WRAPPER_API void CalCoreMaterial_Delete(struct CalCoreMaterial *self);
 
 //  CAL3D_WRAPPER_API CalCoreMaterial::Color 
*CalCoreMaterial_GetAmbientColor(struct CalCoreMaterial *self);
@@ -265,7 +265,7 @@
 // CalCoreMesh wrapper functions declaration                                  
//
 
//****************************************************************************//
 
-  CAL3D_WRAPPER_API struct CalCoreMesh *CalCoreMesh_New();
+  CAL3D_WRAPPER_API struct CalCoreMesh *CalCoreMesh_New(void);
   CAL3D_WRAPPER_API void CalCoreMesh_Delete(struct CalCoreMesh *self);
 
   CAL3D_WRAPPER_API int CalCoreMesh_AddCoreSubmesh(struct CalCoreMesh *self, 
struct CalCoreSubmesh *pCoreSubmesh);
@@ -308,7 +308,7 @@
 // CalCoreSkeleton wrapper functions declaration                              
//
 
//****************************************************************************//
 
-  CAL3D_WRAPPER_API struct CalCoreSkeleton *CalCoreSkeleton_New();
+  CAL3D_WRAPPER_API struct CalCoreSkeleton *CalCoreSkeleton_New(void);
   CAL3D_WRAPPER_API void CalCoreSkeleton_Delete(struct CalCoreSkeleton* self);
 
   CAL3D_WRAPPER_API int CalCoreSkeleton_AddCoreBone(struct CalCoreSkeleton 
*self, struct CalCoreBone *pCoreBone);
@@ -334,7 +334,7 @@
 //  CAL3D_WRAPPER_API 
std::vector<std::vector<CalCoreSubmesh::TextureCoordinate> >& 
CalCoreSubmesh_GetVectorVectorTextureCoordinate(struct CalCoreSubmesh *self);
 //  CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::Vertex>& 
CalCoreSubmesh_GetVectorVertex(struct CalCoreSubmesh *self);
   CAL3D_WRAPPER_API int CalCoreSubmesh_GetVertexCount(struct CalCoreSubmesh 
*self);
-  CAL3D_WRAPPER_API struct CalCoreSubmesh *CalCoreSubmesh_New();
+  CAL3D_WRAPPER_API struct CalCoreSubmesh *CalCoreSubmesh_New(void);
   CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_Reserve(struct CalCoreSubmesh 
*self, int vertexCount, int textureCoordinateCount, int faceCount, int 
springCount);
   CAL3D_WRAPPER_API void CalCoreSubmesh_SetCoreMaterialThreadId(struct 
CalCoreSubmesh *self, int coreMaterialThreadId);
 //  CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetFace(struct 
CalCoreSubmesh *self, int faceId, struct CalCoreSubmesh::Face *pFace);
@@ -355,7 +355,7 @@
   CAL3D_WRAPPER_API int CalCoreTrack_GetCoreBoneId(struct CalCoreTrack *self);
 //  CAL3D_WRAPPER_API std::map<float, CalCoreKeyframe *>& 
CalCoreTrack_GetMapCoreKeyframe(struct CalCoreTrack *self);
   CAL3D_WRAPPER_API enum Boolean CalCoreTrack_GetState(struct CalCoreTrack 
*self, float time, struct CalVector *pTranslation, struct CalQuaternion 
*pRotation);
-  CAL3D_WRAPPER_API struct CalCoreTrack *CalCoreTrack_New();
+  CAL3D_WRAPPER_API struct CalCoreTrack *CalCoreTrack_New(void);
   CAL3D_WRAPPER_API enum Boolean CalCoreTrack_SetCoreBoneId(struct 
CalCoreTrack *self, int coreBoneId);
 
 
//****************************************************************************//
@@ -385,19 +385,19 @@
     ERROR_CODE_MAX_ERROR_CODE
   };
 
-  CAL3D_WRAPPER_API enum CalErrorCode CalError_GetLastErrorCode();
-  CAL3D_WRAPPER_API char *CalError_GetLastErrorDescription();
-  CAL3D_WRAPPER_API char *CalError_GetLastErrorFile();
-  CAL3D_WRAPPER_API int CalError_GetLastErrorLine();
-  CAL3D_WRAPPER_API char *CalError_GetLastErrorText();
-  CAL3D_WRAPPER_API void CalError_PrintLastError();
+  CAL3D_WRAPPER_API enum CalErrorCode CalError_GetLastErrorCode(void);
+  CAL3D_WRAPPER_API char *CalError_GetLastErrorDescription(void);
+  CAL3D_WRAPPER_API char *CalError_GetLastErrorFile(void);
+  CAL3D_WRAPPER_API int CalError_GetLastErrorLine(void);
+  CAL3D_WRAPPER_API char *CalError_GetLastErrorText(void);
+  CAL3D_WRAPPER_API void CalError_PrintLastError(void);
 //  CAL3D_WRAPPER_API void CalError_SetLastError(enum CalErrorCode code, char 
*strFile, int line, char *strText);
 
 
//****************************************************************************//
 // CalLoader wrapper functions declaration                                    
//
 
//****************************************************************************//
 
-  CAL3D_WRAPPER_API struct CalLoader *CalLoader_New();
+  CAL3D_WRAPPER_API struct CalLoader *CalLoader_New(void);
   CAL3D_WRAPPER_API void CalLoader_Delete(struct CalLoader *self);
   CAL3D_WRAPPER_API struct CalCoreAnimation 
*CalLoader_LoadCoreAnimation(struct CalLoader *self, char *strFilename);
   CAL3D_WRAPPER_API struct CalCoreMaterial *CalLoader_LoadCoreMaterial(struct 
CalLoader *self, char *strFilename);
@@ -481,7 +481,7 @@
   CAL3D_WRAPPER_API float *CalQuaternion_Get(struct CalQuaternion *self);
   CAL3D_WRAPPER_API void CalQuaternion_Multiply(struct CalQuaternion *self, 
struct CalQuaternion *pQ);
   CAL3D_WRAPPER_API void CalQuaternion_MultiplyVector(struct CalQuaternion 
*self, struct CalVector *pV);
-  CAL3D_WRAPPER_API struct CalQuaternion *CalQuaternion_New();
+  CAL3D_WRAPPER_API struct CalQuaternion *CalQuaternion_New(void);
   CAL3D_WRAPPER_API void CalQuaternion_Op_Multiply(struct CalQuaternion 
*pResult, struct CalQuaternion *pQ, struct CalQuaternion *pR);
   CAL3D_WRAPPER_API void CalQuaternion_Set(struct CalQuaternion *self, float 
qx, float qy, float qz, float qw);
 
@@ -518,7 +518,7 @@
 
//****************************************************************************//
 
   CAL3D_WRAPPER_API void CalSaver_Delete(struct CalSaver *self);
-  CAL3D_WRAPPER_API struct CalSaver *CalSaver_New();
+  CAL3D_WRAPPER_API struct CalSaver *CalSaver_New(void);
   CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreAnimation(struct CalSaver 
*self, char *strFilename, struct  CalCoreAnimation *pCoreAnimation);
   CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreMaterial(struct CalSaver 
*self, char *strFilename, struct CalCoreMaterial *pCoreMaterial);
   CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreMesh(struct CalSaver *self, 
char *strFilename, struct CalCoreMesh *pCoreMesh);
@@ -584,7 +584,7 @@
   CAL3D_WRAPPER_API void CalVector_InverseScale(struct CalVector *self, float 
d);
   CAL3D_WRAPPER_API float *CalVector_Get(struct CalVector *self);
   CAL3D_WRAPPER_API float CalVector_Length(struct CalVector *self);
-  CAL3D_WRAPPER_API struct CalVector *CalVector_New();
+  CAL3D_WRAPPER_API struct CalVector *CalVector_New(void);
   CAL3D_WRAPPER_API float CalVector_Normalize(struct CalVector *self);
   CAL3D_WRAPPER_API void CalVector_Op_Add(struct CalVector *pResult, struct 
CalVector *pV, struct CalVector *pU);
   CAL3D_WRAPPER_API void CalVector_Op_Subtract(struct CalVector *pResult, 
struct CalVector *pV, struct CalVector *pU);
--- a/sound/sound.pyx
+++ b/sound/sound.pyx
@@ -154,7 +154,7 @@
        cdef        int    _format
        cdef        int    _framerate
        
-       def __new__(self, *args, **kargs):
+       def __cinit__(self, *args, **kargs):
                self._buffers = []
                
        def __dealloc__(self):
@@ -301,6 +301,10 @@
                elif self._format == AL_FORMAT_MONO16  : size = 16384
                elif self._format == AL_FORMAT_STEREO8 : size = 16384
                elif self._format == AL_FORMAT_MONO8   : size = 16384 / 2
+               # Greg Ewing, March 2007 ([EMAIL PROTECTED])
+               # Else clause added to fix uninitialised variable warning
+               else:
+                       raise ValueError("Unknown size")
 
                # Catching exception seems to memory leak in pyrex
                #try:    self._file.pcm_seek(i * 8192)
@@ -352,7 +356,7 @@
        cdef int    _current_buffer_id
        cdef float  _old_pos[3]
        
-       def __new__(self, *args, **kargs):
+       def __cinit__(self, *args, **kargs):
                alGenSources(1, &self._source)
                alSourcef(self._source, AL_REFERENCE_DISTANCE, 
_reference_distance)
                
--- a/model/model.pyx
+++ b/model/model.pyx
@@ -78,10 +78,10 @@
 #  int      normal
 #  int      v[4] # v[3] is optional (only for quad, unused for triangle)
        
-cdef int face_vertices_number(ModelFace* self):
-       if   self.option & FACE_TRIANGLE: return 3
-       elif self.option & FACE_QUAD:     return 4
-       return 0
+#U#cdef int face_vertices_number(ModelFace* self):
+#U#    if   self.option & FACE_TRIANGLE: return 3
+#U#    elif self.option & FACE_QUAD:     return 4
+#U#    return 0
 
 
 cdef class _SimpleModel(_Model):
@@ -739,7 +739,7 @@
                # find face neighbors
                if self._option & MODEL_NEIGHBORS:
                        self._neighbors      = <int *> malloc(self._nb_faces * 
4 * sizeof(int ))
-                       self._neighbors_side = <char*> malloc(self._nb_faces * 
4 * sizeof(char))
+                       self._neighbors_side = <signed char*> 
malloc(self._nb_faces * 4 * sizeof(char))
                        self._compute_face_neighbors(faces, vertex2ivertex, 
ivertex2vertices, self._neighbors, self._neighbors_side)
                        
                # find face simple neighbors (doesn't take angle into account)
@@ -747,7 +747,7 @@
                        # Re-identify vertices, because for simple neighbors we 
don't take angle into account
                        vertex2ivertex, ivertex2vertices = 
self._identify_vertices(faces, 360.0)
                        self._simple_neighbors      = <int *> 
malloc(self._nb_faces * 4 * sizeof(int ))
-                       self._simple_neighbors_side = <char*> 
malloc(self._nb_faces * 4 * sizeof(char))
+                       self._simple_neighbors_side = <signed char*> 
malloc(self._nb_faces * 4 * sizeof(char))
                        self._compute_face_neighbors(faces, vertex2ivertex, 
ivertex2vertices, self._simple_neighbors, self._simple_neighbors_side)
                        
                # TO DO ?
--- a/model/terrain.pyx
+++ b/model/terrain.pyx
@@ -203,19 +203,19 @@
        k[0] = (- (x - ptr[0]) * w[1] + (z - ptr[2]) * w[0]) * q
 
 
-cdef void terrain_drawColor_radeon(float* vect):
-       glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, vect)
+#U#cdef void terrain_drawColor_radeon(float* vect):
+#U#    glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, vect)
        
 cdef void noop():
        pass
 
-cdef void terrain_disableColor_radeon():
-       #glColor4fv(white) # XXX really needed ?
-       glDisable(GL_COLOR_MATERIAL)
-       glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, white)
+#U#cdef void terrain_disableColor_radeon():
+#U#    #glColor4fv(white) # XXX really needed ?
+#U#    glDisable(GL_COLOR_MATERIAL)
+#U#    glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, white)
        
-cdef void terrain_enableColor_radeon():
-       glEnable(GL_COLOR_MATERIAL)
+#U#cdef void terrain_enableColor_radeon():
+#U#    glEnable(GL_COLOR_MATERIAL)
 
 #ctypedef void (*terrain_drawColor_FUNC   )(float*)
 #ctypedef void (*terrain_disableColor_FUNC)()
@@ -225,7 +225,7 @@
 cdef terrain_disableColor_FUNC terrain_disableColor
 cdef terrain_enableColor_FUNC  terrain_enableColor
 
-terrain_drawColor    = glColor4fv
+terrain_drawColor    = <terrain_drawColor_FUNC> glColor4fv # Const cast
 terrain_disableColor = noop
 terrain_enableColor  = noop
 
@@ -749,6 +749,9 @@
                cshadow_color[2] = shadow_color[2]
                cshadow_color[3] = shadow_color[3]
                
+               scolor = 0 # Greg Ewing, March 2007 ([EMAIL PROTECTED])
+               wcolor = 0 # Uninitialised variables. POSSIBLE BUG.
+               
                # initialize vertex colors if needed
                old_colors = self._colors
                self._colors = NULL
--- a/chunk.pxd
+++ b/chunk.pxd
@@ -17,19 +17,13 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-ctypedef struct Chunk:
-       void* content
-       int   nb
-       int   max
-       
 cdef extern from "chunk.h":
-#   cdef struct _Chunk:
-#     void* content
-#     int   nb
-#     int   max
-               
-#   ctypedef _Chunk Chunk
-               
+
+       ctypedef struct Chunk:
+               void* content
+               int   nb
+               int   max
+
        Chunk*    chunk_new         ()
        int       chunk_dealloc     (Chunk*)
        int       chunk_check_error ()
@@ -50,8 +44,8 @@
        int       drop_chunk        (Chunk*)
 
 
-       int   chunk_add_chars_endian_safe (Chunk*, char* , int)
-       int   chunk_get_chars_endian_safe (Chunk*, char* , int)
+       int   chunk_add_chars_endian_safe (Chunk*, void* , int)
+       int   chunk_get_chars_endian_safe (Chunk*, void* , int)
 
        int   chunk_add_ints_endian_safe  (Chunk*, int*  , int)
        int   chunk_get_ints_endian_safe  (Chunk*, int*  , int)
--- a/base.pyx
+++ b/base.pyx
@@ -60,7 +60,7 @@
 
 cdef Renderer renderer
 
-cdef int MAX_LIGHTS, MAX_CLIP_PLANES, MAX_TEXTURES, MAX_TEXTURE_SIZE
+cdef GLint MAX_LIGHTS, MAX_CLIP_PLANES, MAX_TEXTURES, MAX_TEXTURE_SIZE
 
 def get_max_texture_size():
        return MAX_TEXTURE_SIZE
@@ -113,8 +113,13 @@
                pass
        
        def __getstate__(self):
-               if getattr(self, "__dict__", 0): return self.__getcstate__(), 
self.__dict__
-               else:                            return self.__getcstate__(),
+               cdef object d
+               try:
+                       d = getattr(self, "__dict__")
+               except:
+                       return self.__getcstate__()
+               else:
+                       return self.__getcstate__(), d
                
        def __setstate__(self, state):
                self.__setcstate__(state[0])
@@ -136,8 +141,8 @@
                return clone
 
 
-cdef chunk_to_string(Chunk* chunk):
-       return PyString_FromStringAndSize(<char*> chunk.content, chunk.nb)
+#U#cdef chunk_to_string(Chunk* chunk):
+#U#    return PyString_FromStringAndSize(<char*> chunk.content, chunk.nb)
 
 cdef drop_chunk_to_string(Chunk* chunk):
        cdef string
--- a/ode/geom-terrain.pyx
+++ b/ode/geom-terrain.pyx
@@ -455,8 +455,8 @@
                raise RuntimeError("TerrainGeom can't collide with non 
primitive Geom")
 
 
-cdef int _TerrainAABBTest(dGeomID o1, dGeomID o2, dReal aabb2[6]):
-               pass
+#U#cdef int _TerrainAABBTest(dGeomID o1, dGeomID o2, dReal aabb2[6]):
+#U#            pass
 
 
 cdef dGeomClass dTerrainGeomClass
--- a/ode/collision.pyx
+++ b/ode/collision.pyx
@@ -101,50 +101,50 @@
 
        return res
 
-cdef int collide_edge(GLfloat *A, GLfloat *B,
-                        GLfloat *AB, GLfloat *normalA,
-                        GLfloat *normalB,
-                        dGeomID o1, dGeomID o2, int max_contacts, 
-                        int flags, dContactGeom *contact):
-               """Check for collision with one triangle edge. Uses a normal
-               that's halfway between the precomputed normals of the vertices
-               that make up the edge."""
-               cdef dGeomID _land_ray   # Reusable ray geom #XXX misplaced
-
-
-               cdef int n, num_contacts, nA, nB
-               cdef dContactGeom contactA, contactB
-               cdef _Geom other
-               _land_ray = dCreateRay(NULL, 1.0)#XXX misplaced
-
-               # First, do one direction
-               dGeomRaySetLength(_land_ray, point_distance_to(A, B))
-               dGeomRaySet(_land_ray, A[0], A[1], A[2], AB[0], AB[1], AB[2])
-               nA = dCollide(_land_ray, o2, flags, &contactA, 
sizeof(dContactGeom))
-       
-
-               # Then the other
-               dGeomRaySet(_land_ray, B[0], B[1], B[2], -AB[0], -AB[1], -AB[2])
-               nB = dCollide(_land_ray, o2, flags, &contactB, 
sizeof(dContactGeom))
-               dGeomDestroy(_land_ray)
-               
-               if nA and nB:
-                               contact.pos[0] = (contactA.pos[0] + 
contactB.pos[0]) / 2.0
-                               contact.pos[1] = (contactA.pos[1] + 
contactB.pos[1]) / 2.0
-                               contact.pos[2] = (contactA.pos[2] + 
contactB.pos[2]) / 2.0
-
-                               # D
-                               contact.normal[0] = (normalA[0] + normalB[0]) / 
2.0
-                               contact.normal[1] = (normalA[1] + normalB[1]) / 
2.0
-                               contact.normal[2] = (normalA[2] + normalB[2]) / 
2.0
-
-                               # Get the depth of the contact point in the 
colliding geom
-                               other = <_Geom>dGeomGetData(o2)
-                               contact.depth = 
other._point_depth(contact.pos[0], contact.pos[1], 
-                                                                               
                                                                                
         contact.pos[2])
-                               contact.g1 = o1
-                               contact.g2 = o2
-
-                               return 1
-
-               return 0
+#U#cdef int collide_edge(GLfloat *A, GLfloat *B,
+#U#                     GLfloat *AB, GLfloat *normalA,
+#U#                     GLfloat *normalB,
+#U#                     dGeomID o1, dGeomID o2, int max_contacts, 
+#U#                     int flags, dContactGeom *contact):
+#U#            """Check for collision with one triangle edge. Uses a normal
+#U#            that's halfway between the precomputed normals of the vertices
+#U#            that make up the edge."""
+#U#            cdef dGeomID _land_ray   # Reusable ray geom #XXX misplaced
+#U#
+#U#
+#U#            cdef int n, num_contacts, nA, nB
+#U#            cdef dContactGeom contactA, contactB
+#U#            cdef _Geom other
+#U#            _land_ray = dCreateRay(NULL, 1.0)#XXX misplaced
+#U#
+#U#            # First, do one direction
+#U#            dGeomRaySetLength(_land_ray, point_distance_to(A, B))
+#U#            dGeomRaySet(_land_ray, A[0], A[1], A[2], AB[0], AB[1], AB[2])
+#U#            nA = dCollide(_land_ray, o2, flags, &contactA, 
sizeof(dContactGeom))
+#U#    
+#U#
+#U#            # Then the other
+#U#            dGeomRaySet(_land_ray, B[0], B[1], B[2], -AB[0], -AB[1], -AB[2])
+#U#            nB = dCollide(_land_ray, o2, flags, &contactB, 
sizeof(dContactGeom))
+#U#            dGeomDestroy(_land_ray)
+#U#            
+#U#            if nA and nB:
+#U#                            contact.pos[0] = (contactA.pos[0] + 
contactB.pos[0]) / 2.0
+#U#                            contact.pos[1] = (contactA.pos[1] + 
contactB.pos[1]) / 2.0
+#U#                            contact.pos[2] = (contactA.pos[2] + 
contactB.pos[2]) / 2.0
+#U#
+#U#                            # D
+#U#                            contact.normal[0] = (normalA[0] + normalB[0]) / 
2.0
+#U#                            contact.normal[1] = (normalA[1] + normalB[1]) / 
2.0
+#U#                            contact.normal[2] = (normalA[2] + normalB[2]) / 
2.0
+#U#
+#U#                            # Get the depth of the contact point in the 
colliding geom
+#U#                            other = <_Geom>dGeomGetData(o2)
+#U#                            contact.depth = 
other._point_depth(contact.pos[0], contact.pos[1], 
+#U#                                                                            
                                                                                
         contact.pos[2])
+#U#                            contact.g1 = o1
+#U#                            contact.g2 = o2
+#U#
+#U#                            return 1
+#U#
+#U#            return 0
--- a/ode/contact.pyx
+++ b/ode/contact.pyx
@@ -19,7 +19,7 @@
                """
                
 
-               def __new__(self, *args, **kw):
+               def __cinit__(self, *args, **kw):
                                self._contact.surface.mode = ContactBounce
                                self._contact.surface.mu   = dInfinity
 

Reply via email to