# HG changeset patch # User Lenard Lindstrom # Date 1366772016 25200 # Node ID 9fcb7abf3185ea321863fea640f8ee444170632f # Parent aa4de2e52b3e5191ab4622e4393f91838bee518e Remove some gcc 4.7.2 compiler warnings diff -r aa4de2e52b3e -r 9fcb7abf3185 src/draw.c --- a/src/draw.c Sat Mar 30 15:54:49 2013 +0100 +++ b/src/draw.c Tue Apr 23 19:53:36 2013 -0700 @@ -1564,8 +1564,6 @@ MODINIT_DEFINE (draw) { - PyObject *module; - #if PY3 static struct PyModuleDef _module = { PyModuleDef_HEAD_INIT, @@ -1599,11 +1597,10 @@ /* 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); } diff -r aa4de2e52b3e -r 9fcb7abf3185 src/freetype/ft_layout.c --- a/src/freetype/ft_layout.c Sat Mar 30 15:54:49 2013 +0100 +++ b/src/freetype/ft_layout.c Tue Apr 23 19:53:36 2013 -0700 @@ -113,7 +113,6 @@ FontGlyph *glyph = 0; FontGlyph **glyph_array = 0; FontMetrics *metrics; - FT_BitmapGlyph image; TextContext context; FT_Face font; @@ -208,7 +207,6 @@ --ftext->length; continue; } - image = glyph->image; glyph_width = glyph->width; glyph_height = glyph->height; diff -r aa4de2e52b3e -r 9fcb7abf3185 src/mixer.c --- a/src/mixer.c Sat Mar 30 15:54:49 2013 +0100 +++ b/src/mixer.c Tue Apr 23 19:53:36 2013 -0700 @@ -1116,7 +1116,9 @@ { 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)) @@ -1159,7 +1161,10 @@ 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; } diff -r aa4de2e52b3e -r 9fcb7abf3185 src/pixelarray_methods.c --- a/src/pixelarray_methods.c Sat Mar 30 15:54:49 2013 +0100 +++ b/src/pixelarray_methods.c Tue Apr 23 19:53:36 2013 -0700 @@ -782,7 +782,6 @@ 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; @@ -840,7 +839,6 @@ return 0; } - new_surf = PySurface_AsSurface(new_surface); new_format = surf->format; stride0 = new_array->stride0; stride1 = new_array->stride1; diff -r aa4de2e52b3e -r 9fcb7abf3185 src/pixelcopy.c --- a/src/pixelcopy.c Sat Mar 30 15:54:49 2013 +0100 +++ b/src/pixelcopy.c Tue Apr 23 19:53:36 2013 -0700 @@ -190,7 +190,7 @@ 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; @@ -1145,8 +1145,6 @@ MODINIT_DEFINE(pixelcopy) { - PyObject *module; - #if PY3 static struct PyModuleDef _module = { PyModuleDef_HEAD_INIT, @@ -1175,11 +1173,8 @@ } #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); } diff -r aa4de2e52b3e -r 9fcb7abf3185 src/scrap.c --- a/src/scrap.c Sat Mar 30 15:54:49 2013 +0100 +++ b/src/scrap.c Tue Apr 23 19:53:36 2013 -0700 @@ -341,8 +341,6 @@ MODINIT_DEFINE (scrap) { - PyObject *module; - #if PY3 static struct PyModuleDef _module = { PyModuleDef_HEAD_INIT, @@ -364,10 +362,8 @@ /* 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); } diff -r aa4de2e52b3e -r 9fcb7abf3185 src/time.c --- a/src/time.c Sat Mar 30 15:54:49 2013 +0100 +++ b/src/time.c Tue Apr 23 19:53:36 2013 -0700 @@ -414,8 +414,6 @@ MODINIT_DEFINE (time) #endif { - PyObject *module; - #if PY3 static struct PyModuleDef _module = { PyModuleDef_HEAD_INIT, @@ -442,9 +440,8 @@ /* 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); }