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, pywrap has been updated via ce520ce10439ac3e63d5819e136ee623d5531206 (commit) via 7a8c83f1ad322edbb2043c40fe8d653cdad0a881 (commit) via ac154bd7aed285ba0abd85c0ba30ffe6d913b0b9 (commit) from 5827000a1971b8ffd2a91f01bbd65da6e4779e9e (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/ce520ce10439ac3e63d5819e136ee623d5531...
commit ce520ce10439ac3e63d5819e136ee623d5531206 Author: Tomas Gavenciak gavento@ucw.cz Date: Sat Nov 26 23:52:44 2011 +0100
Fix abort message buffer size
Forgotten at 24 bytes from testing
diff --git a/include/core/GP_Common.h b/include/core/GP_Common.h index 14eee71..0b96897 100644 --- a/include/core/GP_Common.h +++ b/include/core/GP_Common.h @@ -83,7 +83,7 @@
void SWIG_exception(const char *msg);
-#define GP_INTERNAL_ABORT_BUFSIZE 24 +#define GP_INTERNAL_ABORT_BUFSIZE 1024 #define GP_INTERNAL_ABORT(str_abort_msg_, ...) do { char bufstart[GP_INTERNAL_ABORT_BUFSIZE], *buf = bufstart; char *bufend = buf + GP_INTERNAL_ABORT_BUFSIZE; http://repo.or.cz/w/gfxprim.git/commit/7a8c83f1ad322edbb2043c40fe8d653cdad0a...
commit 7a8c83f1ad322edbb2043c40fe8d653cdad0a881 Author: Tomas Gavenciak gavento@ucw.cz Date: Sat Nov 26 23:51:24 2011 +0100
Add macro to check for valid PixelType
.. and use it instead of GP_PIXEL_MAX
diff --git a/include/core/GP_Pixel.h b/include/core/GP_Pixel.h index 2b06cee..294c022 100644 --- a/include/core/GP_Pixel.h +++ b/include/core/GP_Pixel.h @@ -117,13 +117,16 @@ typedef struct {
extern const GP_PixelTypeDescription const GP_PixelTypes[];
+#define GP_CHECK_VALID_PIXELTYPE(type) + GP_CHECK(((type) > 0) && ((type) < GP_PIXEL_MAX), "Invalid PixelType %d", (type)) + /* * Convert pixel type to name. */
static inline const char *GP_PixelTypeName(GP_PixelType type) { - GP_CHECK(type < GP_PIXEL_MAX); + GP_CHECK_VALID_PIXELTYPE(type); return GP_PixelTypes[type].name; }
@@ -133,7 +136,7 @@ static inline const char *GP_PixelTypeName(GP_PixelType type)
static inline uint32_t GP_PixelSize(GP_PixelType type) { - GP_CHECK(type < GP_PIXEL_MAX); + GP_CHECK_VALID_PIXELTYPE(type); return GP_PixelTypes[type].size; }
diff --git a/libs/core/GP_Context.c b/libs/core/GP_Context.c index 73e926e..48c3315 100644 --- a/libs/core/GP_Context.c +++ b/libs/core/GP_Context.c @@ -72,6 +72,7 @@ GP_Context *GP_ContextCopy(const GP_Context *src, int flag)
GP_Context *GP_ContextAlloc(GP_Size w, GP_Size h, GP_PixelType type) { + GP_CHECK_VALID_PIXELTYPE(type); GP_Context *context = malloc(sizeof(GP_Context)); uint32_t bpp = GP_PixelSize(type); uint32_t bpr = (bpp * w) / 8 + !!((bpp * w) % 8);
http://repo.or.cz/w/gfxprim.git/commit/ac154bd7aed285ba0abd85c0ba30ffe6d913b...
commit ac154bd7aed285ba0abd85c0ba30ffe6d913b0b9 Author: Tomas Gavenciak gavento@ucw.cz Date: Sat Nov 26 23:32:06 2011 +0100
Remove forgotten debug messages
diff --git a/pylib/context.py b/pylib/context.py index e7c8c41..d65008a 100644 --- a/pylib/context.py +++ b/pylib/context.py @@ -70,10 +70,7 @@ def extend_context_class(_context_class = core.Context): """Converts context to a different pixel type, allocates new context. See GP_ContextConvert() for details.""" pixeltype_no = target_type ## TODO also accept PixelType - print "A1" - c = core.GP_ContextConvert(self, pixeltype_no) - print "A2" - return c + return core.GP_ContextConvert(self, pixeltype_no)
@extend(_context_class)
-----------------------------------------------------------------------
Summary of changes: include/core/GP_Common.h | 2 +- include/core/GP_Pixel.h | 7 +++++-- libs/core/GP_Context.c | 1 + pylib/context.py | 5 +---- 4 files changed, 8 insertions(+), 7 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.