1. pygame
  2. Untitled project
  3. pygame

Commits

marcus  committed a8e4327

Minor header cleanups for proper compat inclusion.

  • Participants
  • Parent commits 5bf4d71
  • Branches pgreloaded

Comments (0)

Files changed (23)

File src/base/internals.h

View file
 #ifndef _PYGAME_BASE_INTERNALS_H_
 #define _PYGAME_BASE_INTERNALS_H_
 
-#include <Python.h>
 #include "pgcompat.h"
 #include "pgtypes.h"
 

File src/base/pgbase.h

View file
 #ifndef _PYGAME_BASE_H_
 #define _PYGAME_BASE_H_
 
-#include <Python.h>
 #include "pgcompat.h"
 #include "pgdefines.h"
 

File src/freetype/ft_mod.h

View file
 #ifndef _PYGAME_FREETYPEMOD_H_
 #define _PYGAME_FREETYPEMOD_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 
 #define PYGAME_FREETYPE_INTERNAL
 #define PYGAME_FREETYPE_FONT_INTERNAL

File src/mask/maskmod.h

View file
 
 #define PYGAME_MASK_INTERNAL
 
-#include <Python.h>
 #include <math.h>
+#include "pgcompat.h"
 #include "pgdefines.h"
 #include "bitmask.h"
 

File src/mask/pgmask.h

View file
 #ifndef _PYGAME_MASK_H_
 #define _PYGAME_MASK_H_
 
-#include <Python.h>
 #include "bitmask.h"
 #include "pgbase.h"
 

File src/physics/pgphysics.h

View file
 #define _PHYSICS_H_
 
 #include <math.h>
-#include <Python.h>
-#include "pgcompat.h"
 #include "pgbase.h"
 
 #ifdef __cplusplus

File src/physics/physicsmod.h

View file
 #ifndef _PHYSICS_PHYSICSMOD_H_
 #define _PHYSICS_PHYSICSMOD_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <structmember.h>
 
 #define PHYSICS_MATH_INTERNAL

File src/sdl/cdrommod.h

View file
 #ifndef _PYGAME_SDLCDROM_H_
 #define _PYGAME_SDLCDROM_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL.h>
 
 #define PYGAME_SDLCDROM_INTERNAL

File src/sdl/eventmod.h

View file
 #ifndef _PYGAME_SDLEVENT_H_
 #define _PYGAME_SDLEVENT_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL.h>
 
 #define PYGAME_SDLEVENT_INTERNAL

File src/sdl/joystickmod.h

View file
 #ifndef _PYGAME_SDLJOYSTICK_H_
 #define _PYGAME_SDLJOYSTICK_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL.h>
 
 #define PYGAME_SDLJOYSTICK_INTERNAL

File src/sdl/mousemod.h

View file
 #ifndef _PYGAME_SDLMOUSE_H_
 #define _PYGAME_SDLMOUSE_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL.h>
 
 #define PYGAME_SDLCURSOR_INTERNAL

File src/sdl/pgsdl.h

View file
 #ifndef _PYGAME_SDL_H_
 #define _PYGAME_SDL_H_
 
-#include <Python.h>
 #include <SDL.h>
 
 #include "pgbase.h"

File src/sdl/sdlmod.c

View file
     int initialized : 1;
 } _SDLState;
 
-#ifdef IS_PYTHON_3
-static struct PyModuleDef _sdlmodule = {
-    PyModuleDef_HEAD_INIT,
-    "base",
-    DOC_BASE,
-    sizeof (_SDLState),
-    _sdl_methods,
-    NULL,
-    NULL,
-    NULL,
-    NULL
-};
-#define SDL_MOD_STATE(mod) ((_BaseState*)PyModule_GetState(mod))
-#define SDL_STATE SDL_MOD_STATE(PyState_FindModule(&_sdlmodule))
-#else
-_SDLState _modstate;
-#define SDL_MOD_STATE(mod) (&_modstate)
-#define SDL_STATE SDL_MOD_STATE(NULL)
-#endif
-
 static void _quit (void);
 static int _check_sdl (void);
 
     { NULL, NULL, 0, NULL },
 };
 
+#ifdef IS_PYTHON_3
+static struct PyModuleDef _sdlmodule = {
+    PyModuleDef_HEAD_INIT,
+    "base",
+    DOC_BASE,
+    sizeof (_SDLState),
+    _sdl_methods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+#define SDL_MOD_STATE(mod) ((_SDLState*)PyModule_GetState(mod))
+#define SDL_STATE SDL_MOD_STATE(PyState_FindModule(&_sdlmodule))
+#else
+_SDLState _modstate;
+#define SDL_MOD_STATE(mod) (&_modstate)
+#define SDL_STATE SDL_MOD_STATE(NULL)
+#endif
+
 static void
 _quit (void)
 {

File src/sdl/videomod.h

View file
 #ifndef _PYGAME_SDLVIDEO_H_
 #define _PYGAME_SDLVIDEO_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL.h>
 
 #define PYGAME_SDLSURFACE_INTERNAL

File src/sdlext/filters_32.c

View file
     templine = (Uint16 *) malloc((size_t)(dstpitch * 2));
     if (templine == 0)
         return;
-    memset(templine, 0, dstpitch * 2);
+    memset(templine, 0, (size_t)(dstpitch * 2));
 
     asm __volatile__(" /* MMX code for Y-shrink area average filter */ "
         " movl             %5,      %%ecx;           " /* ecx == ycounter */
     templine = (Uint16 *) malloc((size_t)(dstpitch * 2));
     if (templine == 0)
         return;
-    memset(templine, 0, dstpitch * 2);
+    memset(templine, 0, (size_t)(dstpitch * 2));
     asm __volatile__(" /* MMX code for Y-shrink area average filter */ "
         " movl             %5,      %%ecx;           " /* ecx == ycounter */
         " pxor          %%mm0,      %%mm0;           "

File src/sdlext/pgsdlext.h

View file
 #ifndef _PYGAME_SDLEXT_H_
 #define _PYGAME_SDLEXT_H_
 
-#include <Python.h>
 #include <SDL.h>
 
 #include "pgbase.h"

File src/sdlext/sdlextmod.h

View file
 #ifndef _PYGAME_SDLEXTMOD_H_
 #define _PYGAME_SDLEXTMOD_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL.h>
 
 #define PYGAME_SDLEXTPIXELARRAY_INTERNAL

File src/sdlgfx/gfxmod.h

View file
 #ifndef _PYGAME_SDLGFXMOD_H_
 #define _PYGAME_SDLGFXMOD_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL.h>
 
 #define PYGAME_SDLGFXFPS_INTERNAL

File src/sdlgfx/pggfx.h

View file
 #ifndef _PYGAME_SDLGFX_H_
 #define _PYGAME_SDLGFX_H_
 
-#include <Python.h>
 #include <SDL.h>
 #include <SDL_framerate.h>
 

File src/sdlmixer/mixermod.h

View file
 #ifndef _PYGAME_SDLMIXERMOD_H_
 #define _PYGAME_SDLMIXERMOD_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL_mixer.h>
 
 #define PYGAME_SDLMIXER_INTERNAL

File src/sdlmixer/pgmixer.h

View file
 #ifndef _PYGAME_SDLMIXER_H_
 #define _PYGAME_SDLMIXER_H_
 
-#include <Python.h>
 #include <SDL.h>
 #include <SDL_mixer.h>
 

File src/sdlttf/pgttf.h

View file
 #ifndef _PYGAME_SDLTTF_H_
 #define _PYGAME_SDLTTF_H_
 
-#include <Python.h>
 #include <SDL.h>
 #include <SDL_ttf.h>
 
 #include "pgbase.h"
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif

File src/sdlttf/ttfmod.h

View file
 #ifndef _PYGAME_SDLTTFMOD_H_
 #define _PYGAME_SDLTTFMOD_H_
 
-#include <Python.h>
+#include "pgcompat.h"
 #include <SDL.h>
 
 #define PYGAME_SDLTTF_INTERNAL