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 0243aecd593c5c712078dfa1fbcf8bba1187a736 (commit) via 6d342080a27ffc532abb09f4d34485a2b44b46bd (commit) via 975521142bd84de4a192d418325cb1b47a642a60 (commit) via 524cd8c33aab67f7c64ea54ee8ab194dbee1df53 (commit) from 9270ef0f3556aa8a1bd8f4e7191d0813ec5708dc (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/0243aecd593c5c712078dfa1fbcf8bba1187a...
commit 0243aecd593c5c712078dfa1fbcf8bba1187a736 Author: Tomas Gavenciak gavento@ucw.cz Date: Mon Jun 4 14:01:16 2012 +0200
pywrap: error checking for some modules
Done for: core (except for GP_ContextDump - legacy) backends gfx (none needed) loaders (except for GP_P?M.h - legacy)
Not done: filters input text
diff --git a/pylib/gfxprim/backends/backends.i b/pylib/gfxprim/backends/backends.i index 1c909e1..fb3fb7d 100644 --- a/pylib/gfxprim/backends/backends.i +++ b/pylib/gfxprim/backends/backends.i @@ -27,20 +27,31 @@ %immutable GP_Backend::name; %ignore GP_BackendFD;
+ERROR_ON_NONZERO(GP_BackendSetCaption); +ERROR_ON_NONZERO(GP_BackendResize); + %include "GP_Backend.h"
-/* - * Particular backends. We need to list every header separately. - */ -/* Overall backend init header */ +ERROR_ON_NULL(GP_BackendInit); %newobject GP_BackendInit; %include "GP_BackendInit.h"
+/* + * Particular backends. + */ + +ERROR_ON_NULL(GP_BackendVirtualInit); +%newobject GP_BackendVirtualInit; +%include "GP_BackendVirtual.h" + +ERROR_ON_NULL(GP_BackendLinuxFBInit); %newobject GP_BackendLinuxFBInit; %include "GP_LinuxFB.h"
+ERROR_ON_NULL(GP_BackendLinuxSDLInit); %newobject GP_BackendSDLInit; %include "GP_SDL.h"
+ERROR_ON_NULL(GP_BackendLinuxX11Init); %newobject GP_BackendX11Init; %include "GP_X11.h" diff --git a/pylib/gfxprim/core/core.i b/pylib/gfxprim/core/core.i index 3e1bea5..86b0233 100644 --- a/pylib/gfxprim/core/core.i +++ b/pylib/gfxprim/core/core.i @@ -9,6 +9,8 @@ * Basic types and common methods */
+ERROR_ON_NULL(GP_GetCounter); + %include "GP_Common.h" %include "GP_Core.h" %include "GP_Debug.h" @@ -25,6 +27,8 @@ * Color and pixel types */
+ERROR_ON_NULL(GP_ColorToColorName); + %include "GP_Color.h" %include "GP_Pixel.h" %include "GP_Pixel.gen.h" /* Includes enum GP_PixelType definition */ @@ -83,6 +87,13 @@ and self.thisown.") GP_Context; } };
+/* Error handling */ +ERROR_ON_NONZERO(GP_ContextResize); +ERROR_ON_NULL(GP_ContextAlloc); +ERROR_ON_NULL(GP_ContextCopy); +ERROR_ON_NULL(GP_ContextSubContext); +ERROR_ON_NULL(GP_ContextConvert); + /* Indicate new wrapper-owned GP_Context */ %newobject GP_ContextAlloc; %newobject GP_ContextCopy; diff --git a/pylib/gfxprim/loaders/loaders.i b/pylib/gfxprim/loaders/loaders.i index bcfcaef..2e54d41 100644 --- a/pylib/gfxprim/loaders/loaders.i +++ b/pylib/gfxprim/loaders/loaders.i @@ -8,11 +8,45 @@
%import ../core/core.i
+ERROR_ON_NULL(GP_LoadImage); +ERROR_ON_NONZERO(GP_LoadMetaData); +ERROR_ON_NONZERO(GP_SaveImage); + %include "GP_Loaders.h"
+ERROR_ON_NONZERO(GP_OpenJPG); +ERROR_ON_NULL(GP_ReadJPG); +ERROR_ON_NULL(GP_LoadJPG); +ERROR_ON_NONZERO(GP_ReadJPGMetaData); +ERROR_ON_NONZERO(GP_LoadJPGMetaData); +ERROR_ON_NONZERO(GP_SaveJPG); + %include "GP_JPG.h" + +ERROR_ON_NONZERO(GP_OpenBMP); +ERROR_ON_NULL(GP_ReadBMP); +ERROR_ON_NULL(GP_LoadBMP); + +%include "GP_BMP.h" + +ERROR_ON_NONZERO(GP_OpenGIF); +ERROR_ON_NULL(GP_ReadGIF); +ERROR_ON_NULL(GP_LoadGIF); + +%include "GP_GIF.h" + +ERROR_ON_NONZERO(GP_OpenPNG); +ERROR_ON_NULL(GP_ReadPNG); +ERROR_ON_NULL(GP_LoadPNG); +ERROR_ON_NONZERO(GP_ReadPNGMetaData); +ERROR_ON_NONZERO(GP_LoadPNGMetaData); +ERROR_ON_NONZERO(GP_SavePNG); + +%include "GP_PNG.h" + +/* TODO: No error checking - legacy GP_RetCode form */ %include "GP_PBM.h" %include "GP_PGM.h" %include "GP_PPM.h" -%include "GP_PNG.h" +
http://repo.or.cz/w/gfxprim.git/commit/6d342080a27ffc532abb09f4d34485a2b44b4...
commit 6d342080a27ffc532abb09f4d34485a2b44b46bd Merge: 9755211 9270ef0 Author: Tomas Gavenciak gavento@ucw.cz Date: Mon Jun 4 13:53:02 2012 +0200
Merge branch 'master' of ssh://repo.or.cz/srv/git/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/975521142bd84de4a192d418325cb1b47a642...
commit 975521142bd84de4a192d418325cb1b47a642a60 Author: Tomas Gavenciak gavento@ucw.cz Date: Mon Jun 4 13:28:46 2012 +0200
pywrap: add error-checking wrappers
diff --git a/pylib/gfxprim/common.i b/pylib/gfxprim/common.i index 0734e1a..66b37b0 100644 --- a/pylib/gfxprim/common.i +++ b/pylib/gfxprim/common.i @@ -10,3 +10,44 @@
%nodefaultctor;
+/* + * Error handling declarations + */ + +/* + * Wrapped function is executed and the return value is checked. + * If NULL, errno is checked and an exception raised. + */ + +%define ERROR_ON_NULL(funcname) +%exception funcname { + $action + if (result == NULL) { + int errno0 = errno; + const int errbuf_len = 128; + char errbuf[errbuf_len]; + strerror_r(errno0, errbuf, errbuf_len); + PyErr_Format(PyExc_RuntimeError, "Error in function %s: %s", "$name", errbuf); + return NULL; + } +} +%enddef + +/* + * Wrapped function is executed and the return value is checked. + * If non-zero, errno is checked and an exception raised + */ + +%define ERROR_ON_NONZERO(funcname) +%exception funcname { + $action + if (result != 0) { + int errno0 = errno; + const int errbuf_len = 128; + char errbuf[errbuf_len]; + strerror_r(errno0, errbuf, errbuf_len); + PyErr_Format(PyExc_RuntimeError, "Error in function %s: %s", "$name", errbuf); + return NULL; + } +} +%enddef
http://repo.or.cz/w/gfxprim.git/commit/524cd8c33aab67f7c64ea54ee8ab194dbee1d...
commit 524cd8c33aab67f7c64ea54ee8ab194dbee1df53 Author: Tomas Gavenciak gavento@ucw.cz Date: Mon Jun 4 13:28:02 2012 +0200
Relocate some common SWIG code
diff --git a/pylib/gfxprim/backends/backends.i b/pylib/gfxprim/backends/backends.i index dd1394d..1c909e1 100644 --- a/pylib/gfxprim/backends/backends.i +++ b/pylib/gfxprim/backends/backends.i @@ -1,3 +1,4 @@ +%include "../common.i" %module(package="gfxprim.backends") backends_c
%{ @@ -6,11 +7,6 @@ #include "core/GP_Debug.h" %}
-#define __attribute__(X) -%include <stdint.i> - -%feature("autodoc"); - %import ../core/core.i
diff --git a/pylib/gfxprim/common.i b/pylib/gfxprim/common.i new file mode 100644 index 0000000..0734e1a --- /dev/null +++ b/pylib/gfxprim/common.i @@ -0,0 +1,12 @@ +/* + * common SWIG declarations for all modules + */ + +#define __attribute__(X) + +%include <stdint.i> + +%feature("autodoc"); + +%nodefaultctor; + diff --git a/pylib/gfxprim/core/core.i b/pylib/gfxprim/core/core.i index 3668c2f..3e1bea5 100644 --- a/pylib/gfxprim/core/core.i +++ b/pylib/gfxprim/core/core.i @@ -1,17 +1,10 @@ +%include "../common.i" %module(package="gfxprim.core") core_c
%{ #include "core/GP_Core.h" %}
-#define __attribute__(X) - -%include <stdint.i> - -%feature("autodoc"); - -%nodefaultctor; - /* * Basic types and common methods */ @@ -42,7 +35,6 @@ %import "GP_FnPerBpp.h" %import "GP_FnPerBpp.gen.h"
- /* * GP_Context wrapping */ @@ -99,7 +91,6 @@ and self.thisown.") GP_Context;
%include "GP_Context.h"
- /* * Context manipulation */ @@ -108,3 +99,4 @@ and self.thisown.") GP_Context; %import "GP_GetPutPixel.gen.h" %include "GP_WritePixel.h" %include "GP_Blit.h" + diff --git a/pylib/gfxprim/filters/filters.i b/pylib/gfxprim/filters/filters.i index b617508..9d3e070 100644 --- a/pylib/gfxprim/filters/filters.i +++ b/pylib/gfxprim/filters/filters.i @@ -1,17 +1,12 @@ +%include "../common.i" %module(package="gfxprim.filters") filters_c
%{ #include "filters/GP_Filters.h" %}
-#define __attribute__(X) - %import ../core/core.i
-%include <stdint.i> - -%nodefaultctor; - %include "GP_Filters.h"
/* Listed in GP_Filters.h: */ diff --git a/pylib/gfxprim/gfx/gfx.i b/pylib/gfxprim/gfx/gfx.i index 1f59443..eb684da 100644 --- a/pylib/gfxprim/gfx/gfx.i +++ b/pylib/gfxprim/gfx/gfx.i @@ -1,17 +1,12 @@ +%include "../common.i" %module(package="gfxprim.gfx") gfx_c
%{ #include "gfx/GP_Gfx.h" %}
-#define __attribute__(X) - %import ../core/core.i
-%include <stdint.i> - -%nodefaultctor; - %include "GP_Gfx.h"
/* Listed in GP_Gfx.h: */ diff --git a/pylib/gfxprim/input/input.i b/pylib/gfxprim/input/input.i index f870e10..a9899a3 100644 --- a/pylib/gfxprim/input/input.i +++ b/pylib/gfxprim/input/input.i @@ -1,3 +1,4 @@ +%include "../common.i" %module(package="gfxprim.input") input_c
%{ diff --git a/pylib/gfxprim/loaders/loaders.i b/pylib/gfxprim/loaders/loaders.i index 7939dd8..bcfcaef 100644 --- a/pylib/gfxprim/loaders/loaders.i +++ b/pylib/gfxprim/loaders/loaders.i @@ -1,3 +1,4 @@ +%include "../common.i" %module(package="gfxprim.loaders") loaders_c
%{ @@ -5,14 +6,8 @@ #include "loaders/GP_Loaders.h" %}
-#define __attribute__(X) - %import ../core/core.i
-%include <stdint.i> - -%nodefaultctor; - %include "GP_Loaders.h"
%include "GP_JPG.h" diff --git a/pylib/gfxprim/text/text.i b/pylib/gfxprim/text/text.i index 94f8baf..fe40996 100644 --- a/pylib/gfxprim/text/text.i +++ b/pylib/gfxprim/text/text.i @@ -1,3 +1,4 @@ +%include "../common.i" %module(package="gfxprim.text") text_c
%{ @@ -5,14 +6,8 @@ #include "text/GP_Font.h" %}
-#define __attribute__(X) - %import ../core/core.i
-%include <stdint.i> - -%nodefaultctor; - %ignore GP_GlyphBitmap::bitmap; %ignore GP_FontFace::glyph_offsets; %include "GP_Text.h"
-----------------------------------------------------------------------
Summary of changes: pylib/gfxprim/backends/backends.i | 25 +++++++++++------ pylib/gfxprim/common.i | 53 +++++++++++++++++++++++++++++++++++++ pylib/gfxprim/core/core.i | 23 +++++++++------- pylib/gfxprim/filters/filters.i | 7 +---- pylib/gfxprim/gfx/gfx.i | 7 +---- pylib/gfxprim/input/input.i | 1 + pylib/gfxprim/loaders/loaders.i | 41 ++++++++++++++++++++++++---- pylib/gfxprim/text/text.i | 7 +---- 8 files changed, 121 insertions(+), 43 deletions(-) create mode 100644 pylib/gfxprim/common.i
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.