From: Holger Schemel Date: Fri, 21 Oct 2022 13:28:16 +0000 (+0200) Subject: removed unused functions X-Git-Tag: 4.3.3.0~40 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a30a27ce6c313e56cc92dc7183d599f63f8ca1f2;p=rocksndiamonds.git removed unused functions This issue was found by Cppcheck (static C/C++ code analysis tool). --- diff --git a/src/game_mm/export.h b/src/game_mm/export.h index 710d2ee9..21e20cdc 100644 --- a/src/game_mm/export.h +++ b/src/game_mm/export.h @@ -211,7 +211,6 @@ extern struct EngineSnapshotInfo_MM engine_snapshot_mm; extern short Ur[MM_MAX_PLAYFIELD_WIDTH][MM_MAX_PLAYFIELD_HEIGHT]; void mm_open_all(void); -void mm_close_all(void); void InitElementProperties_MM(void); diff --git a/src/game_mm/mm_init.c b/src/game_mm/mm_init.c index 0fe4c9fc..6ed89c95 100644 --- a/src/game_mm/mm_init.c +++ b/src/game_mm/mm_init.c @@ -239,7 +239,3 @@ void mm_open_all(void) { InitElementProperties_MM(); } - -void mm_close_all(void) -{ -} diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index 044c83a3..3fb8b4bb 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -260,12 +260,6 @@ void DrawGraphicShifted_MM(int x,int y, int dx,int dy, int graphic, MarkTileDirty(x,y); } -void DrawGraphicShiftedThruMask_MM(int x,int y, int dx,int dy, int graphic, - int cut_mode) -{ - DrawGraphicShifted_MM(x, y, dx, dy, graphic, cut_mode, USE_MASKING); -} - void DrawScreenElementExt_MM(int x, int y, int dx, int dy, int element, int cut_mode, int mask_mode) { @@ -309,38 +303,11 @@ void DrawScreenElementShifted_MM(int x, int y, int dx, int dy, int element, DrawScreenElementExt_MM(x, y, dx, dy, element, cut_mode, NO_MASKING); } -void DrawLevelElementShifted_MM(int x, int y, int dx, int dy, int element, - int cut_mode) -{ - DrawLevelElementExt_MM(x, y, dx, dy, element, cut_mode, NO_MASKING); -} - -void DrawScreenElementThruMask_MM(int x, int y, int element) -{ - DrawScreenElementExt_MM(x, y, 0, 0, element, NO_CUTTING, USE_MASKING); -} - -void DrawLevelElementThruMask_MM(int x, int y, int element) -{ - DrawLevelElementExt_MM(x, y, 0, 0, element, NO_CUTTING, USE_MASKING); -} - -void DrawLevelFieldThruMask_MM(int x, int y) -{ - DrawLevelElementExt_MM(x, y, 0, 0, Tile[x][y], NO_CUTTING, USE_MASKING); -} - void DrawScreenElement_MM(int x, int y, int element) { DrawScreenElementExt_MM(x, y, 0, 0, element, NO_CUTTING, NO_MASKING); } -void DrawLevelElement_MM(int x, int y, int element) -{ - if (IN_LEV_FIELD(x, y) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) - DrawScreenElement_MM(SCREENX(x), SCREENY(y), element); -} - void DrawScreenField_MM(int x, int y) { int element = Tile[x][y]; @@ -617,17 +584,6 @@ static void DrawMicroLevelExt_MM(int xpos, int ypos) } #endif -void DrawMiniLevel_MM(int size_x, int size_y, int scroll_x, int scroll_y) -{ - int x, y; - - for (x = 0; x < size_x; x++) - for (y = 0; y < size_y; y++) - DrawMiniElementOrWall_MM(x, y, scroll_x, scroll_y); - - redraw_mask |= REDRAW_FIELD; -} - // ---------------------------------------------------------------------------- // XSN diff --git a/src/game_mm/mm_tools.h b/src/game_mm/mm_tools.h index 97b48f43..74cfe298 100644 --- a/src/game_mm/mm_tools.h +++ b/src/game_mm/mm_tools.h @@ -69,17 +69,11 @@ void DrawMiniGraphic_MM(int, int, int); void getMiniGraphicSource(int, Bitmap **, int *, int *); void DrawMiniGraphicExt_MM(DrawBuffer *, int, int, int); void DrawGraphicShifted_MM(int, int, int, int, int, int, int); -void DrawGraphicShiftedThruMask_MM(int, int, int, int, int, int); void DrawScreenElementExt_MM(int, int, int, int, int, int, int); void DrawLevelElementExt_MM(int, int, int, int, int, int, int); void DrawScreenElementShifted_MM(int, int, int, int, int, int); -void DrawLevelElementShifted_MM(int, int, int, int, int, int); -void DrawScreenElementThruMask_MM(int, int, int); -void DrawLevelElementThruMask_MM(int, int, int); -void DrawLevelFieldThruMask_MM(int, int); void ErdreichAnbroeckeln(int, int); void DrawScreenElement_MM(int, int, int); -void DrawLevelElement_MM(int, int, int); void DrawScreenField_MM(int, int); void DrawLevelField_MM(int, int); void DrawMiniElement_MM(int, int, int); @@ -92,7 +86,6 @@ void DrawElement_MM(int, int, int); void DrawWallsExt_MM(int, int, int, int); void DrawWalls_MM(int, int, int); void DrawWallsAnimation_MM(int, int, int, int, int); -void DrawMiniLevel_MM(int, int, int, int); void DrawMicroLevel_MM(int, int, boolean); void DrawTileCursor_MM(int, boolean); diff --git a/src/libgame/image.c b/src/libgame/image.c index 1a61ff92..e182a495 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -139,13 +139,6 @@ char *getTokenFromImageID(int graphic) return (file_list != NULL ? file_list->token : NULL); } -char *getFilenameFromImageID(int graphic) -{ - struct FileInfo *file_list = getImageListEntryFromImageID(graphic); - - return (file_list != NULL ? file_list->filename : NULL); -} - int getImageIDFromToken(char *token) { struct FileInfo *file_list = image_info->file_list; diff --git a/src/libgame/image.h b/src/libgame/image.h index 9be07c5b..04952e74 100644 --- a/src/libgame/image.h +++ b/src/libgame/image.h @@ -76,7 +76,6 @@ Bitmap **getBitmapsFromImageID(int); int getOriginalImageWidthFromImageID(int); int getOriginalImageHeightFromImageID(int); char *getTokenFromImageID(int); -char *getFilenameFromImageID(int); int getImageIDFromToken(char *); char *getImageConfigFilename(void); int getImageListPropertyMappingSize(void); diff --git a/src/libgame/joystick.c b/src/libgame/joystick.c index 4a1bc7d5..14ba7d2c 100644 --- a/src/libgame/joystick.c +++ b/src/libgame/joystick.c @@ -21,71 +21,6 @@ // platform independent joystick functions // ============================================================================ -#define TRANSLATE_JOYSYMBOL_TO_JOYNAME 0 -#define TRANSLATE_JOYNAME_TO_JOYSYMBOL 1 - -static void translate_joyname(int *joysymbol, char **name, int mode) -{ - static struct - { - int joysymbol; - char *name; - } translate_joy[] = - { - { JOY_LEFT, "joystick_left" }, - { JOY_RIGHT, "joystick_right" }, - { JOY_UP, "joystick_up" }, - { JOY_DOWN, "joystick_down" }, - { JOY_BUTTON_1, "joystick_button_1" }, - { JOY_BUTTON_2, "joystick_button_2" }, - }; - - int i; - - if (mode == TRANSLATE_JOYSYMBOL_TO_JOYNAME) - { - *name = "[undefined]"; - - for (i = 0; i < 6; i++) - { - if (*joysymbol == translate_joy[i].joysymbol) - { - *name = translate_joy[i].name; - break; - } - } - } - else if (mode == TRANSLATE_JOYNAME_TO_JOYSYMBOL) - { - *joysymbol = 0; - - for (i = 0; i < 6; i++) - { - if (strEqual(*name, translate_joy[i].name)) - { - *joysymbol = translate_joy[i].joysymbol; - break; - } - } - } -} - -char *getJoyNameFromJoySymbol(int joysymbol) -{ - char *name; - - translate_joyname(&joysymbol, &name, TRANSLATE_JOYSYMBOL_TO_JOYNAME); - return name; -} - -int getJoySymbolFromJoyName(char *name) -{ - int joysymbol; - - translate_joyname(&joysymbol, &name, TRANSLATE_JOYNAME_TO_JOYSYMBOL); - return joysymbol; -} - int getJoystickNrFromDeviceName(char *device_name) { char c; @@ -173,25 +108,6 @@ static int JoystickPositionPercent(int center, int border, int actual) return percent; } -void CheckJoystickData(void) -{ - int i; - int distance = 100; - - for (i = 0; i < MAX_PLAYERS; i++) - { - if (setup.input[i].joy.xleft >= setup.input[i].joy.xmiddle) - setup.input[i].joy.xleft = setup.input[i].joy.xmiddle - distance; - if (setup.input[i].joy.xright <= setup.input[i].joy.xmiddle) - setup.input[i].joy.xright = setup.input[i].joy.xmiddle + distance; - - if (setup.input[i].joy.yupper >= setup.input[i].joy.ymiddle) - setup.input[i].joy.yupper = setup.input[i].joy.ymiddle - distance; - if (setup.input[i].joy.ylower <= setup.input[i].joy.ymiddle) - setup.input[i].joy.ylower = setup.input[i].joy.ymiddle + distance; - } -} - int JoystickExt(int player_nr, boolean use_as_joystick_nr) { int joystick_nr = joystick.nr[player_nr]; @@ -305,24 +221,3 @@ int AnyJoystickButton(void) return result; } - -void DeactivateJoystick(void) -{ - /* Temporarily deactivate joystick. This is needed for calibration - screens, where the player has to select a joystick device that - should be calibrated. If there is a totally uncalibrated joystick - active, it may be impossible (due to messed up input from joystick) - to select the joystick device to calibrate even when trying to use - the mouse or keyboard to select the device. */ - - if (joystick.status & JOYSTICK_AVAILABLE) - joystick.status &= ~JOYSTICK_ACTIVE; -} - -void ActivateJoystick(void) -{ - // reactivate temporarily deactivated joystick - - if (joystick.status & JOYSTICK_AVAILABLE) - joystick.status |= JOYSTICK_ACTIVE; -} diff --git a/src/libgame/joystick.h b/src/libgame/joystick.h index e43844ed..6da683f3 100644 --- a/src/libgame/joystick.h +++ b/src/libgame/joystick.h @@ -67,20 +67,14 @@ #define JOY_BUTTON_NEW_PRESSED 2 #define JOY_BUTTON_NEW_RELEASED 3 -char *getJoyNameFromJoySymbol(int); -int getJoySymbolFromJoyName(char *); int getJoystickNrFromDeviceName(char *); char *getDeviceNameFromJoystickNr(int); char *getFormattedJoystickName(const char *); -void CheckJoystickData(void); int Joystick(int); int JoystickExt(int, boolean); int JoystickButton(int); int AnyJoystick(void); int AnyJoystickButton(void); -void DeactivateJoystick(void); -void ActivateJoystick(void); - #endif // JOYSTICK_H diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 094b6565..baa53340 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -1903,22 +1903,6 @@ void SDLPutPixel(Bitmap *dst_bitmap, int x, int y, Pixel pixel) // quick (no, it's slow) and dirty hack to "invert" rectangle inside SDL surface // ---------------------------------------------------------------------------- -void SDLInvertArea(Bitmap *bitmap, int src_x, int src_y, - int width, int height, Uint32 color) -{ - int x, y; - - for (y = src_y; y < src_y + height; y++) - { - for (x = src_x; x < src_x + width; x++) - { - Uint32 pixel = SDLGetPixel(bitmap, x, y); - - SDLPutPixel(bitmap, x, y, pixel == BLACK_PIXEL ? color : BLACK_PIXEL); - } - } -} - void SDLCopyInverseMasked(Bitmap *src_bitmap, Bitmap *dst_bitmap, int src_x, int src_y, int width, int height, int dst_x, int dst_y) diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index a45e68ec..f279ebc4 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -428,7 +428,6 @@ void SDLDrawLine(Bitmap *, int, int, int, int, Uint32); Pixel SDLGetPixel(Bitmap *, int, int); void SDLPutPixel(Bitmap *, int, int, Pixel); -void SDLInvertArea(Bitmap *, int, int, int, int, Uint32); void SDLCopyInverseMasked(Bitmap *, Bitmap *, int, int, int, int, int, int); Bitmap *SDLZoomBitmap(Bitmap *, int, int); diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 5c16feb5..6b10a51e 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -47,8 +47,6 @@ static char *levelclass_desc[NUM_LEVELCLASS_DESC] = #define TOKEN_VALUE_POSITION_DEFAULT 40 #define TOKEN_COMMENT_POSITION_DEFAULT 60 -#define MAX_COOKIE_LEN 256 - #define TREE_NODE_TYPE_DEFAULT 0 #define TREE_NODE_TYPE_PARENT 1 #define TREE_NODE_TYPE_GROUP 2 @@ -2003,21 +2001,6 @@ void SetFilePermissions(char *filename, int permission_class) chmod(filename, perms); } -char *getCookie(char *file_type) -{ - static char cookie[MAX_COOKIE_LEN + 1]; - - if (strlen(program.cookie_prefix) + 1 + - strlen(file_type) + strlen("_FILE_VERSION_x.x") > MAX_COOKIE_LEN) - return "[COOKIE ERROR]"; // should never happen - - sprintf(cookie, "%s_%s_FILE_VERSION_%d.%d", - program.cookie_prefix, file_type, - program.version_super, program.version_major); - - return cookie; -} - void fprintFileHeader(FILE *file, char *basename) { char *prefix = "# "; diff --git a/src/libgame/setup.h b/src/libgame/setup.h index bf1bf785..b06d5f87 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -345,7 +345,6 @@ void InitMainUserDataDirectory(void); void InitUserDataDirectory(void); void SetFilePermissions(char *, int); -char *getCookie(char *); void fprintFileHeader(FILE *, char *); int getFileVersionFromCookieString(const char *); boolean checkCookieString(const char *, const char *); diff --git a/src/libgame/system.c b/src/libgame/system.c index 5916fdcc..97b4269c 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -1012,12 +1012,6 @@ void BlitToScreenMasked(Bitmap *bitmap, BlitTextureMasked(bitmap, src_x, src_y, width, height, dst_x, dst_y); } -void DrawSimpleBlackLine(Bitmap *bitmap, int from_x, int from_y, - int to_x, int to_y) -{ - SDLDrawSimpleLine(bitmap, from_x, from_y, to_x, to_y, BLACK_PIXEL); -} - void DrawSimpleWhiteLine(Bitmap *bitmap, int from_x, int from_y, int to_x, int to_y) { @@ -1086,15 +1080,6 @@ Pixel GetPixelFromRGB(Bitmap *bitmap, unsigned int color_r, return SDL_MapRGB(bitmap->surface->format, color_r, color_g, color_b); } -Pixel GetPixelFromRGBcompact(Bitmap *bitmap, unsigned int color) -{ - unsigned int color_r = (color >> 16) & 0xff; - unsigned int color_g = (color >> 8) & 0xff; - unsigned int color_b = (color >> 0) & 0xff; - - return GetPixelFromRGB(bitmap, color_r, color_g, color_b); -} - void KeyboardAutoRepeatOn(void) { keyrepeat_status = TRUE; diff --git a/src/libgame/system.h b/src/libgame/system.h index 4dbcaab9..115a234e 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -2009,12 +2009,10 @@ void BlitTexture(Bitmap *, int, int, int, int, int, int); void BlitTextureMasked(Bitmap *, int, int, int, int, int, int); void BlitToScreen(Bitmap *, int, int, int, int, int, int); void BlitToScreenMasked(Bitmap *, int, int, int, int, int, int); -void DrawSimpleBlackLine(Bitmap *, int, int, int, int); void DrawSimpleWhiteLine(Bitmap *, int, int, int, int); void DrawLines(Bitmap *, struct XY *, int, Pixel); Pixel GetPixel(Bitmap *, int, int); Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int); -Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int); void KeyboardAutoRepeatOn(void); void KeyboardAutoRepeatOff(void); diff --git a/src/libgame/text.c b/src/libgame/text.c index e198c810..280aae8a 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -223,12 +223,6 @@ void DrawTextSAligned(int x, int y, char *text, int font_nr, int align) gfx.sy + y, text, font_nr); } -void DrawTextAligned(int x, int y, char *text, int font_nr, int align) -{ - DrawText(ALIGNED_XPOS(x, getTextWidth(text, font_nr), align), - y, text, font_nr); -} - void DrawText(int x, int y, char *text, int font_nr) { int mask_mode = BLIT_OPAQUE; diff --git a/src/libgame/text.h b/src/libgame/text.h index fff639f6..840bf368 100644 --- a/src/libgame/text.h +++ b/src/libgame/text.h @@ -100,7 +100,6 @@ void DrawTextFCentered(int, int, char *, ...); void DrawTextS(int, int, int, char *); void DrawTextSCentered(int, int, char *); void DrawTextSAligned(int, int, char *, int, int); -void DrawTextAligned(int, int, char *, int, int); void DrawText(int, int, char *, int); void DrawTextExt(DrawBuffer *, int, int, char *, int, int); diff --git a/src/libgame/zip/ioapi.c b/src/libgame/zip/ioapi.c index 5b6fcc63..5d9c10bd 100644 --- a/src/libgame/zip/ioapi.c +++ b/src/libgame/zip/ioapi.c @@ -81,7 +81,6 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def *p_filef p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; } -static voidpf ZCALLBACK fopen_file_func(ZIP_UNUSED voidpf opaque, const char *filename, int mode); static uint32_t ZCALLBACK fread_file_func(voidpf opaque, voidpf stream, void* buf, uint32_t size); static uint32_t ZCALLBACK fwrite_file_func(voidpf opaque, voidpf stream, const void *buf, uint32_t size); static uint64_t ZCALLBACK ftell64_file_func(voidpf opaque, voidpf stream); @@ -109,25 +108,6 @@ static voidpf file_build_ioposix(FILE *file, const char *filename) return (voidpf)ioposix; } -static voidpf ZCALLBACK fopen_file_func(ZIP_UNUSED voidpf opaque, const char *filename, int mode) -{ - FILE* file = NULL; - const char *mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename != NULL) && (mode_fopen != NULL)) - { - file = fopen(filename, mode_fopen); - return file_build_ioposix(file, filename); - } - return file; -} - static voidpf ZCALLBACK fopen64_file_func(ZIP_UNUSED voidpf opaque, const void *filename, int mode) { FILE* file = NULL; @@ -172,31 +152,6 @@ static voidpf ZCALLBACK fopendisk64_file_func(voidpf opaque, voidpf stream, uint return ret; } -static voidpf ZCALLBACK fopendisk_file_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode) -{ - FILE_IOPOSIX *ioposix = NULL; - char *diskFilename = NULL; - voidpf ret = NULL; - int i = 0; - - if (stream == NULL) - return NULL; - ioposix = (FILE_IOPOSIX*)stream; - diskFilename = (char*)malloc(ioposix->filenameLength * sizeof(char)); - strncpy(diskFilename, (const char*)ioposix->filename, ioposix->filenameLength); - for (i = ioposix->filenameLength - 1; i >= 0; i -= 1) - { - if (diskFilename[i] != '.') - continue; - snprintf(&diskFilename[i], ioposix->filenameLength - i, ".z%02u", number_disk + 1); - break; - } - if (i >= 0) - ret = fopen_file_func(opaque, diskFilename, mode); - free(diskFilename); - return ret; -} - static uint32_t ZCALLBACK fread_file_func(ZIP_UNUSED voidpf opaque, voidpf stream, void* buf, uint32_t size) { FILE_IOPOSIX *ioposix = NULL; @@ -219,17 +174,6 @@ static uint32_t ZCALLBACK fwrite_file_func(ZIP_UNUSED voidpf opaque, voidpf stre return written; } -static long ZCALLBACK ftell_file_func(ZIP_UNUSED voidpf opaque, voidpf stream) -{ - FILE_IOPOSIX *ioposix = NULL; - long ret = -1; - if (stream == NULL) - return ret; - ioposix = (FILE_IOPOSIX*)stream; - ret = ftell(ioposix->file); - return ret; -} - static uint64_t ZCALLBACK ftell64_file_func(ZIP_UNUSED voidpf opaque, voidpf stream) { FILE_IOPOSIX *ioposix = NULL; @@ -241,35 +185,6 @@ static uint64_t ZCALLBACK ftell64_file_func(ZIP_UNUSED voidpf opaque, voidpf str return ret; } -static long ZCALLBACK fseek_file_func(ZIP_UNUSED voidpf opaque, voidpf stream, uint32_t offset, int origin) -{ - FILE_IOPOSIX *ioposix = NULL; - int fseek_origin = 0; - long ret = 0; - - if (stream == NULL) - return -1; - ioposix = (FILE_IOPOSIX*)stream; - - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR: - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END: - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET: - fseek_origin = SEEK_SET; - break; - default: - return -1; - } - if (fseek(ioposix->file, offset, fseek_origin) != 0) - ret = -1; - return ret; -} - static long ZCALLBACK fseek64_file_func(ZIP_UNUSED voidpf opaque, voidpf stream, uint64_t offset, int origin) { FILE_IOPOSIX *ioposix = NULL; @@ -326,19 +241,6 @@ static int ZCALLBACK ferror_file_func(ZIP_UNUSED voidpf opaque, voidpf stream) return ret; } -void fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen_file = fopen_file_func; - pzlib_filefunc_def->zopendisk_file = fopendisk_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell_file = ftell_file_func; - pzlib_filefunc_def->zseek_file = fseek_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} - void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def) { pzlib_filefunc_def->zopen64_file = fopen64_file_func; diff --git a/src/libgame/zip/ioapi.h b/src/libgame/zip/ioapi.h index 4b21ef34..3689881d 100644 --- a/src/libgame/zip/ioapi.h +++ b/src/libgame/zip/ioapi.h @@ -115,7 +115,6 @@ typedef struct zlib_filefunc64_def_s voidpf opaque; } zlib_filefunc64_def; -void fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def); void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def); /* now internal definition, only for zip.c and unzip.h */ diff --git a/src/libgame/zip/iowin32.c b/src/libgame/zip/iowin32.c index 53a96e65..2f739cd4 100644 --- a/src/libgame/zip/iowin32.c +++ b/src/libgame/zip/iowin32.c @@ -536,32 +536,6 @@ int ZCALLBACK win32_error_file_func(voidpf opaque, voidpf stream) return ret; } -void fill_win32_filefunc(zlib_filefunc_def *pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen_file = win32_open_file_func; - pzlib_filefunc_def->zopendisk_file = win32_opendisk_file_func; - pzlib_filefunc_def->zread_file = win32_read_file_func; - pzlib_filefunc_def->zwrite_file = win32_write_file_func; - pzlib_filefunc_def->ztell_file = win32_tell_file_func; - pzlib_filefunc_def->zseek_file = win32_seek_file_func; - pzlib_filefunc_def->zclose_file = win32_close_file_func; - pzlib_filefunc_def->zerror_file = win32_error_file_func; - pzlib_filefunc_def->opaque = NULL; -} - -void fill_win32_filefunc64(zlib_filefunc64_def *pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen64_file = win32_open64_file_func; - pzlib_filefunc_def->zopendisk64_file = win32_opendisk64_file_func; - pzlib_filefunc_def->zread_file = win32_read_file_func; - pzlib_filefunc_def->zwrite_file = win32_write_file_func; - pzlib_filefunc_def->ztell64_file = win32_tell64_file_func; - pzlib_filefunc_def->zseek64_file = win32_seek64_file_func; - pzlib_filefunc_def->zclose_file = win32_close_file_func; - pzlib_filefunc_def->zerror_file = win32_error_file_func; - pzlib_filefunc_def->opaque = NULL; -} - void fill_win32_filefunc64A(zlib_filefunc64_def *pzlib_filefunc_def) { pzlib_filefunc_def->zopen64_file = win32_open64_file_funcA; @@ -575,17 +549,4 @@ void fill_win32_filefunc64A(zlib_filefunc64_def *pzlib_filefunc_def) pzlib_filefunc_def->opaque = NULL; } -void fill_win32_filefunc64W(zlib_filefunc64_def *pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen64_file = win32_open64_file_funcW; - pzlib_filefunc_def->zopendisk64_file = win32_opendisk64_file_funcW; - pzlib_filefunc_def->zread_file = win32_read_file_func; - pzlib_filefunc_def->zwrite_file = win32_write_file_func; - pzlib_filefunc_def->ztell64_file = win32_tell64_file_func; - pzlib_filefunc_def->zseek64_file = win32_seek64_file_func; - pzlib_filefunc_def->zclose_file = win32_close_file_func; - pzlib_filefunc_def->zerror_file = win32_error_file_func; - pzlib_filefunc_def->opaque = NULL; -} - #endif // _WIN32 diff --git a/src/libgame/zip/iowin32.h b/src/libgame/zip/iowin32.h index 7ce4fc9f..a6265ea3 100644 --- a/src/libgame/zip/iowin32.h +++ b/src/libgame/zip/iowin32.h @@ -23,10 +23,7 @@ extern "C" { #endif -void fill_win32_filefunc(zlib_filefunc_def *pzlib_filefunc_def); -void fill_win32_filefunc64(zlib_filefunc64_def *pzlib_filefunc_def); void fill_win32_filefunc64A(zlib_filefunc64_def *pzlib_filefunc_def); -void fill_win32_filefunc64W(zlib_filefunc64_def *pzlib_filefunc_def); #ifdef __cplusplus }