From 47604e37368cb923ea44b7f12e4db5598e550187 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Fri, 10 Jan 2020 10:55:44 +0800 Subject: [PATCH] cleanup and remove get_extension --- src/include/readbmp.h | 46 +++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/src/include/readbmp.h b/src/include/readbmp.h index 3368f7b1..7be65057 100644 --- a/src/include/readbmp.h +++ b/src/include/readbmp.h @@ -11,35 +11,35 @@ // ////////////////////////////////////////////////////////////////////////////// /* - * This file is part of MiniGUI, a mature cross-platform windowing + * This file is part of MiniGUI, a mature cross-platform windowing * and Graphics User Interface (GUI) support system for embedded systems * and smart IoT devices. - * + * * Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 1998~2002, WEI Yongming - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program 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 General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * * Or, - * + * * As this program is a library, any link to this program must follow * GNU General Public License version 3 (GPLv3). If you cannot accept * GPLv3, you need to be licensed from FMSoft. - * + * * If you have got a commercial license of this program, please use it * under the terms and conditions of the commercial license. - * + * * For more information about the commercial license, please refer to * . */ @@ -62,14 +62,14 @@ typedef struct _BITMAP_TYPE_INFO BITMAP_TYPE_INFO; * The idea comes from readbmp.c in Allegro by Shawn Hargreaves. */ struct _BITMAP_TYPE_INFO -{ +{ char ext[8]; - void* (*init) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal); - int (*load) (MG_RWops* fp, void* init_info, MYBITMAP *my_bmp, - CB_ONE_SCANLINE cb, void* context); - void (*cleanup) (void* init_info); - int (*save) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal); - BOOL (*check) (MG_RWops* fp); + void* (*init) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal); + int (*load) (MG_RWops* fp, void* init_info, MYBITMAP *my_bmp, + CB_ONE_SCANLINE cb, void* context); + void (*cleanup) (void* init_info); + int (*save) (MG_RWops* fp, MYBITMAP *my_bmp, RGB *pal); + BOOL (*check) (MG_RWops* fp); }; typedef struct _LOAD_MYBITMAP_INFO LOAD_MYBITMAP_INFO; @@ -140,20 +140,6 @@ BOOL __mg_check_png (MG_RWops* fp); int bmp_ComputePitch (int bpp, Uint32 width, Uint32 *pitch, BOOL does_round); -static inline const char* -get_extension (const char* filename) -{ - const char* ext; - - ext = strrchr (filename, '.'); - - if (ext) - return ext + 1; - - return NULL; -} - - #define fp_getc(fp) MGUI_RWgetc(fp) #define fp_igetw(fp) MGUI_ReadLE16(fp) #define fp_igetl(fp) MGUI_ReadLE32(fp)