Commits

marcus  committed e892641

Minor compiler warning fixes

  • Participants
  • Parent commits b304629

Comments (0)

Files changed (3)

File src/bufferproxy.c

         return RAISE (PyExc_IndexError, "bytes to write exceed buffer size");
     }
 
-    memcpy (buffer->buffer + offset, buf, length);
+    memcpy (buffer->buffer + offset, buf, (size_t) length);
 
     Py_RETURN_NONE;
 }   
 
     /* create the module */
     module = Py_InitModule3 ("bufferproxy", NULL,
-        "TODO");
+        "A generic proxy module that can spend arbitrary objects a buffer " \
+        "interface");
     PyBufferProxy_Type.tp_getattro = PyObject_GenericGetAttr;
     Py_INCREF (&PyBufferProxy_Type);
     PyModule_AddObject (module, "BufferProxy", (PyObject *)&PyBufferProxy_Type);

File src/imageext.c

 #include "pygamedocs.h"
 #include <SDL_image.h>
 
-SDL_Surface* opengltosdl (void);
-
 static char*
 find_extension (char* fullname)
 {
 
 #ifdef PNG_H
 
-int
+static int
 write_png (char *file_name, png_bytep *rows, int w, int h, int colortype,
            int bitdepth)
 {
     return -1;
 }
 
-int
+static int
 SavePNG (SDL_Surface *surface, char *file)
 {
     static unsigned char** ss_rows;
 
 #ifdef JPEGLIB_H
 
-int
+static int
 write_jpeg (char *file_name, unsigned char** image_buffer,  int image_width,
             int image_height, int quality)
 {
     return 0;
 }
 
-int
+static int
 SaveJPEG (SDL_Surface *surface, char *file)
 {
     static unsigned char** ss_rows;
    need to share it between both.
 */
 
-SDL_Surface* opengltosdl (void)
+static SDL_Surface* opengltosdl (void)
 {
     /*we need to get ahold of the pyopengl glReadPixels function*/
     /*we use pyopengl's so we don't need to link with opengl at compiletime*/
 
     for (i=0; i<surf->h; ++i)
         memcpy (((char *) surf->pixels) + surf->pitch * i,
-                pixels + 3 * surf->w * (surf->h - i - 1), surf->w * 3);
+            pixels + 3 * surf->w * (surf->h - i - 1), (size_t) surf->w * 3);
 
     Py_DECREF (data);
     return surf;
 #define PyMask_AsBitmap(x) (((PyMaskObject*)x)->mask)
 
 
-
 /* mask object methods */
 
 static PyObject* mask_get_size(PyObject* self, PyObject* args)
 
 
 
-PyObject* mask_from_surface(PyObject* self, PyObject* args)
+static PyObject* mask_from_surface(PyObject* self, PyObject* args)
 {
 	bitmask_t *mask;
 	SDL_Surface* surf;
 // returns an array of regions in regions which is 
 static GAME_Rect* get_bounding_rects(bitmask_t *mask, int *num_bounding_boxes) {
 
-    int x, y, p, i, n, width, height;
+    int x, y, p, i, width, height;
     GAME_Rect **used_pixels;
     GAME_Rect *a_used_pixels;
     GAME_Rect *direction_used_pixels;
-    GAME_Rect *more_used_pixels;
     GAME_Rect *regions;
 
     GAME_Rect *aregion, *the_regions;
 
 static PyObject* mask_get_bounding_rects(PyObject* self, PyObject* args)
 {
-    GAME_Rect *used_pixels;
     GAME_Rect *regions;
     GAME_Rect *aregion;
     int num_bounding_boxes, i;
 	{ "get_bounding_rects", mask_get_bounding_rects, METH_VARARGS,
           DOC_MASKGETBOUNDINGRECTS },
 
-	{ NULL, NULL }
+	{ NULL, NULL, 0, NULL }
 };
 
 
 
 static PyTypeObject PyMask_Type = 
 {
-	PyObject_HEAD_INIT(NULL)
-	0,
-	"Mask",
-	sizeof(PyMaskObject),
-	0,
-	mask_dealloc,	
-	0,
-	mask_getattr,
-	0,
-	0,
-	0,
-	0,
-	NULL,
-	0, 
-	(hashfunc)NULL,
-	(ternaryfunc)NULL,
-	(reprfunc)NULL,
-	0L,0L,0L,0L,
-	DOC_PYGAMEMASK /* Documentation string */
+ 	PyObject_HEAD_INIT(NULL)
+        0,
+        "Mask",
+        sizeof(PyMaskObject),
+        0,
+        mask_dealloc,
+        0,
+        mask_getattr,
+        0,
+        0,
+        0,
+        0,
+        NULL,
+        0, 
+        (hashfunc)NULL,
+        (ternaryfunc)NULL,
+        (reprfunc)NULL,
+        0L,0L,0L,0L,
+        DOC_PYGAMEMASK /* Documentation string */
 };
 
 
-
 /*mask module methods*/
 
 static PyObject* Mask(PyObject* self, PyObject* args)
 
 static PyMethodDef mask_builtins[] =
 {
-	{ "Mask", Mask, 1, DOC_PYGAMEMASK },
+	{ "Mask", Mask, METH_VARARGS, DOC_PYGAMEMASK },
 	{ "from_surface", mask_from_surface, METH_VARARGS,
           DOC_PYGAMEMASKFROMSURFACE},
-	{ NULL, NULL }
+	{ NULL, NULL, 0, NULL }
 };
 
 void initmask(void)