From: Holger Schemel Date: Fri, 18 Sep 2020 23:06:43 +0000 (+0200) Subject: removed unused functions to set/get internal error messages X-Git-Tag: 4.2.0.3~21 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=52cd236064fb831a25881e6288762e96c67f985c;p=rocksndiamonds.git removed unused functions to set/get internal error messages --- diff --git a/src/libgame/image.c b/src/libgame/image.c index 820b966c..1a61ff92 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -43,8 +43,7 @@ static void *Load_Image(char *filename) if ((img_info->bitmaps[IMG_BITMAP_STANDARD] = LoadImage(filename)) == NULL) { - Warn("cannot load image file '%s': LoadImage() failed: %s", - filename, GetError()); + Warn("cannot load image file '%s': LoadImage() failed", filename); free(img_info); diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 0b70e206..a09bc20e 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1321,30 +1321,6 @@ void GetOptions(int argc, char *argv[], } -// ---------------------------------------------------------------------------- -// error handling functions -// ---------------------------------------------------------------------------- - -#define MAX_INTERNAL_ERROR_SIZE 1024 - -// used by SetError() and GetError() to store internal error messages -static char internal_error[MAX_INTERNAL_ERROR_SIZE]; - -void SetError(char *format, ...) -{ - va_list ap; - - va_start(ap, format); - vsnprintf(internal_error, MAX_INTERNAL_ERROR_SIZE, format, ap); - va_end(ap); -} - -char *GetError(void) -{ - return internal_error; -} - - // ---------------------------------------------------------------------------- // checked memory allocation and freeing functions // ---------------------------------------------------------------------------- diff --git a/src/libgame/misc.h b/src/libgame/misc.h index 32dc36c2..1c51888f 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -168,9 +168,6 @@ void GetOptions(int, char **, void (*print_usage_function)(void), void (*print_version_function)(void)); -void SetError(char *, ...); -char *GetError(void); - void *checked_malloc(unsigned int); void *checked_calloc(unsigned int); void *checked_realloc(void *, unsigned int); diff --git a/src/libgame/system.c b/src/libgame/system.c index 4e500cb2..67995e3d 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -1160,7 +1160,7 @@ Bitmap *LoadCustomImage(char *basename) Fail("LoadCustomImage(): cannot find file '%s'", basename); if ((new_bitmap = LoadImage(filename)) == NULL) - Fail("LoadImage('%s') failed: %s", basename, GetError()); + Fail("LoadImage('%s') failed", basename); return new_bitmap; } @@ -1188,7 +1188,7 @@ void ReloadCustomImage(Bitmap *bitmap, char *basename) if ((new_bitmap = LoadImage(filename)) == NULL) { - Warn("LoadImage('%s') failed: %s", basename, GetError()); + Warn("LoadImage('%s') failed", basename); return; }