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 b46945e420e4e1c804fba10c0deadbe0cbc3bb6b (commit) via fa7c182aef8d59c8f1e073a726826e61bc2aece1 (commit) from bac5c04edb39e16dd0632b1d900daa77d350bdb1 (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/b46945e420e4e1c804fba10c0deadbe0cbc3b...
commit b46945e420e4e1c804fba10c0deadbe0cbc3bb6b Author: Cyril Hrubis metan@ucw.cz Date: Sat Feb 25 12:40:35 2012 +0100
backends: Fix backend string parsing.
diff --git a/libs/backends/GP_BackendInit.c b/libs/backends/GP_BackendInit.c index 61f4001..48ff440 100644 --- a/libs/backends/GP_BackendInit.c +++ b/libs/backends/GP_BackendInit.c @@ -57,8 +57,6 @@ static int sdl_params_to_flags(const char *param, GP_Size *w, GP_Size *h, int sw, sh; unsigned int n;
- printf("%s", param); - if (sscanf(param, "%i%*[xX]%i%n", &sw, &sh, &n) == 2 && n == strlen(param)) { *w = sw; *h = sh; @@ -80,21 +78,24 @@ static GP_Backend *backend_sdl_init(char *params, const char *caption, char *s = params;
- do { + for (;;) { switch (*s) { case ':': (*s) = '0'; if (sdl_params_to_flags(params, &w, &h, &flags, help)) return NULL; s++; + params = s; + break; case '0': if (sdl_params_to_flags(params, &w, &h, &flags, help)) return NULL; + + return GP_BackendSDLInit(w, h, 0, flags, caption); break; } - } while (*(s++) != '0'); - - return GP_BackendSDLInit(w, h, 0, flags, caption); + s++; + } }
static void backend_fb_help(FILE *help, const char *err)
http://repo.or.cz/w/gfxprim.git/commit/fa7c182aef8d59c8f1e073a726826e61bc2ae...
commit fa7c182aef8d59c8f1e073a726826e61bc2aece1 Author: Cyril Hrubis metan@ucw.cz Date: Sat Feb 25 14:05:14 2012 +0100
FIX
diff --git a/libs/backends/GP_BackendInit.c b/libs/backends/GP_BackendInit.c index 7b80816..61f4001 100644 --- a/libs/backends/GP_BackendInit.c +++ b/libs/backends/GP_BackendInit.c @@ -57,6 +57,8 @@ static int sdl_params_to_flags(const char *param, GP_Size *w, GP_Size *h, int sw, sh; unsigned int n;
+ printf("%s", param); + if (sscanf(param, "%i%*[xX]%i%n", &sw, &sh, &n) == 2 && n == strlen(param)) { *w = sw; *h = sh; @@ -67,7 +69,7 @@ static int sdl_params_to_flags(const char *param, GP_Size *w, GP_Size *h, return 1; }
-static GP_Backend *backend_sdl_init(const char *params, const char *caption, +static GP_Backend *backend_sdl_init(char *params, const char *caption, FILE *help) { if (params == NULL) @@ -76,17 +78,18 @@ static GP_Backend *backend_sdl_init(const char *params, const char *caption, GP_Size w = 0, h = 0; uint8_t flags = 0; - const char *s = params; + char *s = params;
do { switch (*s) { case ':': - s = '0'; - case '0': + (*s) = '0'; if (sdl_params_to_flags(params, &w, &h, &flags, help)) return NULL; s++; - params = s; + case '0': + if (sdl_params_to_flags(params, &w, &h, &flags, help)) + return NULL; break; } } while (*(s++) != '0'); @@ -107,7 +110,7 @@ static void backend_fb_help(FILE *help, const char *err) "FB:[/dev/fbX]n"); }
-static GP_Backend *backend_fb_init(const char *params, const char *caption, +static GP_Backend *backend_fb_init(char *params, const char *caption, FILE *help) { const char *fb = "/dev/fb0"; @@ -127,7 +130,7 @@ static const char *backend_names[] = { NULL, };
-static GP_Backend *(*backend_inits[])(const char *, const char *, FILE *) = { +static GP_Backend *(*backend_inits[])(char *, const char *, FILE *) = { backend_sdl_init, backend_fb_init, NULL, @@ -171,7 +174,7 @@ static int get_backend(const char *name) return -1; }
-static GP_Backend *init_backend(const char *name, const char *params, +static GP_Backend *init_backend(const char *name, char *params, const char *caption, FILE *help) { int i = get_backend(name); @@ -206,7 +209,7 @@ GP_Backend *GP_BackendInit(const char *params, const char *caption, FILE *help) } }
- GP_DEBUG(1, "Have backend name '%s'", buf); + GP_DEBUG(1, "Have backend name '%s' params '%s'", buf, backend_params);
return init_backend(buf, backend_params, caption, help); }
-----------------------------------------------------------------------
Summary of changes: libs/backends/GP_BackendInit.c | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 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.