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 a5f3ffffa6adc218386bcec41f5cd1ebe691a7df (commit) from 54a1f43dff8349c620ab43306651236f9143e5ee (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/a5f3ffffa6adc218386bcec41f5cd1ebe691a...
commit a5f3ffffa6adc218386bcec41f5cd1ebe691a7df Author: Cyril Hrubis metan@ucw.cz Date: Fri Oct 19 22:16:01 2012 +0200
core+all: Finally GP_RetCode free.
diff --git a/doc/drawing_api.txt b/doc/drawing_api.txt index 75b6aa2..0304138 100644 --- a/doc/drawing_api.txt +++ b/doc/drawing_api.txt @@ -247,8 +247,8 @@ typedef enum GP_TextAlign { GP_VALIGN_BELOW = 0x40 /* below the point */ } GP_TextAlign;
-GP_RetCode GP_Text(GP_Context *context, const GP_TextStyle *style, - int x, int y, int align, const char *str, GP_Pixel pixel); +void GP_Text(GP_Context *context, const GP_TextStyle *style, + int x, int y, int align, const char *str, GP_Pixel pixel); --------------------------------------------------------------------------------
Draws text at the position x and y; the alignment of the text in relation diff --git a/include/SDL/GP_SDL_Context.h b/include/SDL/GP_SDL_Context.h index af53f54..5f27a4a 100644 --- a/include/SDL/GP_SDL_Context.h +++ b/include/SDL/GP_SDL_Context.h @@ -27,8 +27,7 @@ #define GP_SDL_CONTEXT_H
#include "GP.h" -#include "core/GP_RetCode.h"
-GP_RetCode GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf); +int GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf);
#endif /* GP_SDL_CONTEXT_H */ diff --git a/include/SDL/GP_SDL_VideoInit.h b/include/SDL/GP_SDL_VideoInit.h index 99927b6..ad26c10 100644 --- a/include/SDL/GP_SDL_VideoInit.h +++ b/include/SDL/GP_SDL_VideoInit.h @@ -27,9 +27,8 @@ #define GP_SDL_VIDEOINIT_H
#include "GP.h" -#include "core/GP_RetCode.h"
-GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height, +int GP_SDL_VideoInit(GP_Context *context, int width, int height, int argc, char **argv);
#endif /* GP_SDL_VIDEOINIT_H */ diff --git a/include/core/GP_RetCode.h b/include/core/GP_RetCode.h deleted file mode 100644 index ce875fd..0000000 --- a/include/core/GP_RetCode.h +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************************** - * This file is part of gfxprim library. * - * * - * Gfxprim is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * Gfxprim is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with gfxprim; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - -#ifndef CORE_GP_RETCODE_H -#define CORE_GP_RETCODE_H - -typedef enum GP_RetCode { - GP_ESUCCESS, - GP_EINVAL, - GP_ENOIMPL, - GP_EUNPRECISE, - GP_ENULLPTR, /* some argument was unexpectedly NULL */ - GP_ENOBACKEND, /* no backend available */ - GP_EBACKENDLOST, /* lost connection to the backend */ - GP_EBADCONTEXT, /* context contains invalid data */ - GP_EBADFILE, /* error in file, or bad file format */ - GP_ENOENT, /* no such file or another object */ - GP_ENOMEM, /* not enough memory */ - GP_EINTR, /* operation interrupted by user */ - GP_EMAX, -} GP_RetCode; - -const char *GP_RetCodeName(GP_RetCode code); - -#endif /* CORE_GP_RETCODE_H */ diff --git a/libs/SDL/GP_SDL_Context.c b/libs/SDL/GP_SDL_Context.c index 5ced9cc..cbe5ca4 100644 --- a/libs/SDL/GP_SDL_Context.c +++ b/libs/SDL/GP_SDL_Context.c @@ -31,14 +31,14 @@
#include "GP_SDL.h"
-GP_RetCode GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf) +int GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf) { if (surf == NULL || surf->pixels == NULL || context == NULL) - return GP_ENULLPTR; + return 1;
/* sanity checks on the SDL surface */ if (surf->format->BytesPerPixel == 0 || surf->format->BytesPerPixel > 4) - return GP_ENOIMPL; + return 1; enum GP_PixelType pixeltype = GP_PixelRGBMatch(surf->format->Rmask, surf->format->Gmask, @@ -47,7 +47,7 @@ GP_RetCode GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf) surf->format->BitsPerPixel);
if (pixeltype == GP_PIXEL_UNKNOWN) - return GP_ENOIMPL; + return 1;
/* basic structure and size */ context->pixels = surf->pixels; @@ -62,7 +62,7 @@ GP_RetCode GP_SDL_ContextFromSurface(GP_Context *context, SDL_Surface *surf) context->x_swap = 0; context->y_swap = 0;
- return GP_ESUCCESS; + return 0; }
#endif /* HAVE_LIBSDL */ diff --git a/libs/SDL/GP_SDL_VideoInit.c b/libs/SDL/GP_SDL_VideoInit.c index 8ce6419..b7462ff 100644 --- a/libs/SDL/GP_SDL_VideoInit.c +++ b/libs/SDL/GP_SDL_VideoInit.c @@ -33,11 +33,11 @@ #include <stdio.h> #include <string.h>
-GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height, +int GP_SDL_VideoInit(GP_Context *context, int width, int height, int argc, char **argv) { if (context == NULL) - return GP_ENULLPTR; + return 1;
/* switches that can be set on the command line */ int display_bpp = 0; @@ -46,7 +46,7 @@ GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height, if (argc > 0) {
if (argv == NULL) - return GP_ENULLPTR; + return 1;
/* extract settings from the command line */ int i; @@ -69,7 +69,7 @@ GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height, fprintf(stderr, "Error: Could not initialize SDL: %sn", SDL_GetError()); } - return GP_EBACKENDLOST; + return 1; }
SDL_Surface *display = NULL; @@ -80,7 +80,7 @@ GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height, SDL_GetError()); } SDL_Quit(); - return GP_EINVAL; + return 1; }
if (debug) { @@ -94,18 +94,16 @@ GP_RetCode GP_SDL_VideoInit(GP_Context *context, int width, int height, display->format->Bmask, display->format->Amask); }
- GP_RetCode retcode; - retcode = GP_SDL_ContextFromSurface(context, display); - if (retcode != GP_ESUCCESS) { + int retcode = GP_SDL_ContextFromSurface(context, display); + if (retcode != 0) { if (debug) { - fprintf(stderr, "Error: Could not create context: %sn", - GP_RetCodeName(retcode)); + fprintf(stderr, "Error: Could not create context"); } SDL_Quit(); return retcode; }
- return GP_ESUCCESS; + return 0; }
#endif /* HAVE_LIBSDL */ diff --git a/libs/core/GP_RetCode.c b/libs/core/GP_RetCode.c deleted file mode 100644 index f14b5cc..0000000 --- a/libs/core/GP_RetCode.c +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************** - * This file is part of gfxprim library. * - * * - * Gfxprim is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * Gfxprim is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with gfxprim; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - -#include "GP_RetCode.h" - -/* Names of return codes; must be in the same order as the codes */ -static char *ret_code_names[] = { - "Success", - "Invalid operation", - "Not implemented", - "Imprecise result", - "Unexpected null pointer", - "No backend available", - "Connection with backend lost", - "Bad context", - "Bad file", - "Not found", - "Not enough memory", - "Operation interrupted" -}; - -const char *GP_RetCodeName(GP_RetCode code) -{ - if (code >= GP_EMAX) - return "Invalid return code"; - - return ret_code_names[code]; -}
-----------------------------------------------------------------------
Summary of changes: doc/drawing_api.txt | 4 +- include/SDL/GP_SDL_Context.h | 3 +- include/SDL/GP_SDL_VideoInit.h | 3 +- include/core/GP_RetCode.h | 47 ------------------------------------- libs/SDL/GP_SDL_Context.c | 10 ++++---- libs/SDL/GP_SDL_VideoInit.c | 20 +++++++-------- libs/core/GP_RetCode.c | 50 ---------------------------------------- 7 files changed, 18 insertions(+), 119 deletions(-) delete mode 100644 include/core/GP_RetCode.h delete mode 100644 libs/core/GP_RetCode.c
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.