Commits

Lenard Lindstrom committed 9fcb7ab

Remove some gcc 4.7.2 compiler warnings

Comments (0)

Files changed (7)

 
 MODINIT_DEFINE (draw)
 {
-        PyObject *module;
-
 #if PY3
         static struct PyModuleDef _module = {
             PyModuleDef_HEAD_INIT,
 
 	/* create the module */
 #if PY3
-        module = PyModule_Create (&_module);
+        return PyModule_Create (&_module);
 #else
-	module = Py_InitModule3(MODPREFIX "draw", _draw_methods, DOC_PYGAMEDRAW);
+	Py_InitModule3(MODPREFIX "draw", _draw_methods, DOC_PYGAMEDRAW);
 #endif
-        MODINIT_RETURN (module);
 }
 
 

src/freetype/ft_layout.c

     FontGlyph   *glyph = 0;
     FontGlyph   **glyph_array = 0;
     FontMetrics *metrics;
-    FT_BitmapGlyph image;
     TextContext context;
 
     FT_Face     font;
             --ftext->length;
             continue;
         }
-        image = glyph->image;
         glyph_width = glyph->width;
         glyph_height = glyph->height;
 
 {
     int channelnum = PyChannel_AsInt (self);
     float volume, stereovolume=-1.11f;
+#ifdef Py_DEBUG
     int result;
+#endif
     Uint8 left, right;
 
     if (!PyArg_ParseTuple (args, "f|f", &volume, &stereovolume))
         volume = (volume + stereovolume) * 0.5f;
 #endif
 
-    result = Mix_Volume (channelnum, (int)(volume*128));
+#ifdef Py_DEBUG
+    result = 
+#endif
+    Mix_Volume (channelnum, (int)(volume*128));
     Py_RETURN_NONE;
 }
 

src/pixelarray_methods.c

     Py_ssize_t y;
     PyPixelArray *new_array;
     PyObject *new_surface;
-    SDL_Surface *new_surf;
     SDL_PixelFormat *new_format;
     Py_ssize_t stride0;
     Py_ssize_t stride1;
         return 0;
     }
 
-    new_surf = PySurface_AsSurface(new_surface);
     new_format = surf->format;
     stride0 = new_array->stride0;
     stride1 = new_array->stride1;
     Py_intptr_t dz_pix;
     Py_intptr_t x, y, z;
     Uint8 r, g, b, a;
-    Uint8 *element;
+    Uint8 *element = 0;
     _pc_pixel_t pixel = { 0 };
     Uint32 colorkey;
 
 
 MODINIT_DEFINE(pixelcopy)
 {
-    PyObject *module;
-
 #if PY3
     static struct PyModuleDef _module = {
         PyModuleDef_HEAD_INIT,
     }
 
 #if PY3
-    module = PyModule_Create(&_module);
+    return PyModule_Create(&_module);
 #else
-    module = Py_InitModule3("pixelcopy",
-                            _pixelcopy_methods,
-                            DOC_PYGAMEPIXELCOPY);
+    Py_InitModule3("pixelcopy", _pixelcopy_methods, DOC_PYGAMEPIXELCOPY);
 #endif
-    MODINIT_RETURN(module);
 }
 
 MODINIT_DEFINE (scrap)
 {
-    PyObject *module;
-
 #if PY3
     static struct PyModuleDef _module = {
         PyModuleDef_HEAD_INIT,
 
     /* create the module */
 #if PY3
-    module = PyModule_Create (&_module);
+    return PyModule_Create (&_module);
 #else
-    module = Py_InitModule3 (MODPREFIX "scrap", scrap_builtins, NULL);
+    Py_InitModule3 (MODPREFIX "scrap", scrap_builtins, NULL);
 #endif
-
-    MODINIT_RETURN (module);
 }
 MODINIT_DEFINE (time)
 #endif    
 {
-    PyObject *module;
-    
 #if PY3
     static struct PyModuleDef _module = {
         PyModuleDef_HEAD_INIT,
     
     /* create the module */
 #if PY3
-    module = PyModule_Create (&_module);
+    return PyModule_Create (&_module);
 #else
-    module = Py_InitModule3 (MODPREFIX "time", _time_methods, DOC_PYGAMETIME);
+    Py_InitModule3 (MODPREFIX "time", _time_methods, DOC_PYGAMETIME);
 #endif
-    MODINIT_RETURN (module);
 }