This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 7479594ee56b8759d967aa72795dc1b5fdfa2327 (commit) via 5e630cee800ff49fecff7495053b9d69cc46e7bf (commit) from 7b23123f57a91074e51df400c9a0a8bee83c69e0 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/7479594ee56b8759d967aa72795dc1b5fdfa2...
commit 7479594ee56b8759d967aa72795dc1b5fdfa2327 Author: Cyril Hrubis metan@ucw.cz Date: Sat Mar 10 21:29:32 2012 +0100
libs: Fix library build when SDL is not present.
diff --git a/libs/SDL/GP_SDL_Context.c b/libs/SDL/GP_SDL_Context.c index f0a0747..5ced9cc 100644 --- a/libs/SDL/GP_SDL_Context.c +++ b/libs/SDL/GP_SDL_Context.c @@ -19,11 +19,16 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2010 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
#include "GP_Core.h" + +#include "../../config.h" + +#ifdef HAVE_LIBSDL + #include "GP_SDL.h"
GP_RetCode GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf) @@ -59,3 +64,5 @@ GP_RetCode GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf)
return GP_ESUCCESS; } + +#endif /* HAVE_LIBSDL */ diff --git a/libs/SDL/GP_SDL_VideoInit.c b/libs/SDL/GP_SDL_VideoInit.c index 4175d96..8ce6419 100644 --- a/libs/SDL/GP_SDL_VideoInit.c +++ b/libs/SDL/GP_SDL_VideoInit.c @@ -19,10 +19,14 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2010 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
+#include "../../config.h" + +#ifdef HAVE_LIBSDL + #include "GP.h" #include "GP_SDL.h"
@@ -30,11 +34,10 @@ #include <string.h>
GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height, - int argc, char **argv) + int argc, char **argv) { - if (context == NULL) { + if (context == NULL) return GP_ENULLPTR; - }
/* switches that can be set on the command line */ int display_bpp = 0; @@ -42,28 +45,22 @@ GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height,
if (argc > 0) {
- if (argv == NULL) { + if (argv == NULL) return GP_ENULLPTR; - }
/* extract settings from the command line */ int i; for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "--8bpp") == 0) { + if (strcmp(argv[i], "--8bpp") == 0) display_bpp = 8; - } - else if (strcmp(argv[i], "--16bpp") == 0) { + else if (strcmp(argv[i], "--16bpp") == 0) display_bpp = 16; - } - else if (strcmp(argv[i], "--24bpp") == 0) { + else if (strcmp(argv[i], "--24bpp") == 0) display_bpp = 24; - } - else if (strcmp(argv[i], "--32bpp") == 0) { + else if (strcmp(argv[i], "--32bpp") == 0) display_bpp = 32; - } - else if (strcmp(argv[i], "--debug") == 0) { + else if (strcmp(argv[i], "--debug") == 0) debug = 1; - } } }
@@ -110,3 +107,5 @@ GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height,
return GP_ESUCCESS; } + +#endif /* HAVE_LIBSDL */ diff --git a/libs/backends/GP_SDL.c b/libs/backends/GP_SDL.c index 809d4b6..6a8d0d4 100644 --- a/libs/backends/GP_SDL.c +++ b/libs/backends/GP_SDL.c @@ -25,13 +25,13 @@
#include "../../config.h"
+#ifdef HAVE_LIBSDL + #include "core/GP_Debug.h" #include "input/GP_InputDriverSDL.h" #include "GP_Backend.h" #include "GP_SDL.h"
-#ifdef HAVE_LIBSDL - #include <SDL/SDL.h> #include <SDL/SDL_mutex.h>
@@ -185,8 +185,13 @@ GP_Backend *GP_BackendSDLInit(GP_Size w, GP_Size h, uint8_t bpp, uint8_t flags,
#else
-GP_Backend *GP_BackendSDLInit(GP_Size w, GP_Size h, uint8_t bpp, uint8_t flags, - const char *caption) +#include "GP_Backend.h" + +GP_Backend *GP_BackendSDLInit(GP_Size w __attribute__((unused)), + GP_Size h __attribute__((unused)), + uint8_t bpp __attribute__((unused)), + uint8_t flags __attribute__((unused)), + const char *caption __attribute__((unused))) { return NULL; } diff --git a/libs/input/GP_InputDriverSDL.c b/libs/input/GP_InputDriverSDL.c index 967fdac..3b7ec01 100644 --- a/libs/input/GP_InputDriverSDL.c +++ b/libs/input/GP_InputDriverSDL.c @@ -16,10 +16,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
+#include "../../config.h" + +#ifdef HAVE_LIBSDL
#include "GP_Event.h" #include "GP_InputDriverSDL.h" @@ -134,3 +137,5 @@ void GP_InputDriverSDLEventPut(SDL_Event *ev) break; } } + +#endif /* HAVE_LIBSDL */
http://repo.or.cz/w/gfxprim.git/commit/5e630cee800ff49fecff7495053b9d69cc46e...
commit 5e630cee800ff49fecff7495053b9d69cc46e7bf Author: Cyril Hrubis metan@ucw.cz Date: Sat Mar 10 20:57:46 2012 +0100
pylib: Fixes for python 3.2, still throws some warnings.
diff --git a/pylib/gp_codegen/gfxprimconfig.py b/pylib/gp_codegen/gfxprimconfig.py index 81d3f32..39ad70f 100644 --- a/pylib/gp_codegen/gfxprimconfig.py +++ b/pylib/gp_codegen/gfxprimconfig.py @@ -40,10 +40,10 @@ class GfxPrimConfig(object): # Dictionary of all pixelsizes by BPP { bpp : list of BE, LE } self.pixelsizes_by_bpp = dict() for i in self.pixelsizes: - if i.size not in self.pixelsizes_by_bpp: - self.pixelsizes_by_bpp[i.size] = [i.bit_endian] - else: - self.pixelsizes_by_bpp[i.size].append(i.bit_endian) + if i.size not in self.pixelsizes_by_bpp: + self.pixelsizes_by_bpp[i.size] = [i.bit_endian] + else: + self.pixelsizes_by_bpp[i.size].append(i.bit_endian)
# Set of all encountered channel names self.channels = set() diff --git a/pylib/gp_codegen/pixelsize.py b/pylib/gp_codegen/pixelsize.py index 88f7364..59f7c91 100644 --- a/pylib/gp_codegen/pixelsize.py +++ b/pylib/gp_codegen/pixelsize.py @@ -20,12 +20,12 @@ class PixelSize(object): self.suffix = suffix if not self.suffix: if self.size == 0: - self.suffix = "INVALID" + self.suffix = "INVALID" else: - if bit_endian: - self.suffix = '%dBPP_%s' % (size, bit_endian) - else: - self.suffix = '%dBPP' % (size,) + if bit_endian: + self.suffix = '%dBPP_%s' % (size, bit_endian) + else: + self.suffix = '%dBPP' % (size,)
def needs_bit_endian(self): return (self.size % 8) != 0 @@ -33,7 +33,7 @@ class PixelSize(object): def description(self): if self.bit_endian: return "pixel size %d, bit endian %s, suffix %s" % (self.size, - self.bit_endian, self.suffix) + self.bit_endian, self.suffix) else: return "pixel size %d, suffix %s" % (self.size, self.suffix)
diff --git a/pylib/gp_codegen/render_utils.py b/pylib/gp_codegen/render_utils.py index 9c9c1a8..0e781db 100644 --- a/pylib/gp_codegen/render_utils.py +++ b/pylib/gp_codegen/render_utils.py @@ -31,7 +31,7 @@ def create_environment(config, template_dir): env.globals['BE'] = BE env.globals['len'] = len env.globals['error'] = template_error - env.globals['hex'] = lambda(x): hex(x).rstrip('L') + env.globals['hex'] = lambda x: hex(x).rstrip('L') # Propagate some python buildins env.globals['int'] = int; env.globals['float'] = float; @@ -92,7 +92,10 @@ def load_gfxprimconfig(config_file = None): "BE": BE, "GfxPrimConfig": GfxPrimConfig } - execfile(config_file, globals(), l) + # python 3.2 doesn't have execfile, curse you python devs + # execfile(config_file, globals(), l) + exec(compile(open(config_file).read(), config_file, 'exec'), globals(), l) + config = l["config"] return config
diff --git a/pylib/gp_codegen/test_collection.py b/pylib/gp_codegen/test_collection.py index 254cd21..ad3b78f 100644 --- a/pylib/gp_codegen/test_collection.py +++ b/pylib/gp_codegen/test_collection.py @@ -40,7 +40,7 @@ def find_tests(fname, suites): name, args = find_GP_directive("GP_SUITE", suite_re, l, fname=fname, line=i) if name: if args: - log.warning("%s:%s: Suite should have no arguments other than name.", fname, i) + log.warning("%s:%s: Suite should have no arguments other than name.", fname, i) suites.setdefault(name, []) suite = name # Look for test declaration @@ -48,10 +48,10 @@ def find_tests(fname, suites): if name: test_suite = suite if 'suite' in args: - test_suite = args['suite'] + test_suite = args['suite'] if not test_suite: - test_suite = 'default' - log.warning("%s:%s: No suite defined before test %s, using %r.", fname, i, name, test_suite) + test_suite = 'default' + log.warning("%s:%s: No suite defined before test %s, using %r.", fname, i, name, test_suite) args['name'] = name args['fname'] = fname args['line'] = i @@ -85,11 +85,11 @@ def find_GP_directive(name, regexp, l, fname='unknown', line=0): d = m.groups()[0].split(',', 1) args = {} if len(d)>1: - try: - s = 'dict( ' + d[1].strip(" tn"") + ' )' - args = eval(s) - except: - log.fatal("%s:%s: error parsing arguments: %r", fname, line, s) + try: + s = 'dict( ' + d[1].strip(" tn"") + ' )' + args = eval(s) + except: + log.fatal("%s:%s: error parsing arguments: %r", fname, line, s) return d[0].strip(), args return None, None
-----------------------------------------------------------------------
Summary of changes: libs/SDL/GP_SDL_Context.c | 9 ++++++++- libs/SDL/GP_SDL_VideoInit.c | 31 +++++++++++++++---------------- libs/backends/GP_SDL.c | 13 +++++++++---- libs/input/GP_InputDriverSDL.c | 7 ++++++- pylib/gp_codegen/gfxprimconfig.py | 8 ++++---- pylib/gp_codegen/pixelsize.py | 12 ++++++------ pylib/gp_codegen/render_utils.py | 7 +++++-- pylib/gp_codegen/test_collection.py | 18 +++++++++--------- 8 files changed, 62 insertions(+), 43 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.