From be05deb8b2c7e5c6eb4c535617cd855bc403ea03 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 6 Mar 2023 15:50:50 +0300
Subject: [PATCH] IMG_xxx.c is never meant for building: clean that up...
---
Android.mk | 4 +--
IMG_xxx.c | 33 ++++++++++++-----------
VisualC/SDL_image.vcxproj | 1 -
VisualC/SDL_image.vcxproj.filters | 3 ---
Xcode/SDL_image.xcodeproj/project.pbxproj | 6 -----
5 files changed, 18 insertions(+), 29 deletions(-)
diff --git a/Android.mk b/Android.mk
index 0f1fbde2..d93d282b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -90,8 +90,7 @@ LOCAL_SRC_FILES := \
IMG_WIC.c \
IMG_xcf.c \
IMG_xpm.c.arm \
- IMG_xv.c \
- IMG_xxx.c
+ IMG_xv.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
@@ -168,4 +167,3 @@ LOCAL_LDLIBS :=
LOCAL_EXPORT_LDLIBS :=
include $(BUILD_STATIC_LIBRARY)
-
diff --git a/IMG_xxx.c b/IMG_xxx.c
index f37136d6..e967c4ca 100644
--- a/IMG_xxx.c
+++ b/IMG_xxx.c
@@ -24,72 +24,73 @@
#include <SDL3/SDL_image.h>
#include "IMG.h"
-/* Declare 'extern' and move those function to IMG.h */
-static int IMG_isXXX(SDL_RWops *src);
-static SDL_Surface *IMG_LoadXXX_RW(SDL_RWops *src);
-
#ifdef LOAD_XXX
/* See if an image is contained in a data source */
+/* Remember to declare this procedure in IMG.h . */
int IMG_isXXX(SDL_RWops *src)
{
int start;
int is_XXX;
- if ( !src )
+ if (!src) {
return 0;
+ }
+
start = SDL_RWtell(src);
is_XXX = 0;
/* Detect the image here */
SDL_RWseek(src, start, SDL_RW_SEEK_SET);
- return(is_XXX);
+ return is_XXX;
}
-/* Load a XXX type image from an SDL datasource */
+/* Load an XXX type image from an SDL datasource */
+/* Remember to declare this procedure in IMG.h . */
SDL_Surface *IMG_LoadXXX_RW(SDL_RWops *src)
{
int start;
const char *error = NULL;
SDL_Surface *surface = NULL;
- if ( !src ) {
+ if (!src) {
/* The error message has been set in SDL_RWFromFile */
return NULL;
}
+
start = SDL_RWtell(src);
/* Load the image here */
- if ( error ) {
+ if (error) {
SDL_RWseek(src, start, SDL_RW_SEEK_SET);
- if ( surface ) {
+ if (surface) {
SDL_DestroySurface(surface);
surface = NULL;
}
IMG_SetError("%s", error);
}
+
return surface;
}
#else
+
#if _MSC_VER >= 1300
#pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
#endif
-/* See if an image is contained in a data source */
int IMG_isXXX(SDL_RWops *src)
{
- (void)src;
- return(0);
+ (void) src;
+ return 0;
}
-/* Load a XXX type image from an SDL datasource */
SDL_Surface *IMG_LoadXXX_RW(SDL_RWops *src)
{
- (void)src;
- return(NULL);
+ (void) src;
+ return NULL;
}
#endif /* LOAD_XXX */
diff --git a/VisualC/SDL_image.vcxproj b/VisualC/SDL_image.vcxproj
index 9096d30e..9c9537e5 100644
--- a/VisualC/SDL_image.vcxproj
+++ b/VisualC/SDL_image.vcxproj
@@ -226,7 +226,6 @@
<ClCompile Include="..\IMG_xcf.c" />
<ClCompile Include="..\IMG_xpm.c" />
<ClCompile Include="..\IMG_xv.c" />
- <ClCompile Include="..\IMG_xxx.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Version.rc" />
diff --git a/VisualC/SDL_image.vcxproj.filters b/VisualC/SDL_image.vcxproj.filters
index f7ca5822..1bdf0661 100644
--- a/VisualC/SDL_image.vcxproj.filters
+++ b/VisualC/SDL_image.vcxproj.filters
@@ -43,9 +43,6 @@
<ClCompile Include="..\IMG_xv.c">
<Filter>Sources</Filter>
</ClCompile>
- <ClCompile Include="..\IMG_xxx.c">
- <Filter>Sources</Filter>
- </ClCompile>
<ClCompile Include="..\IMG_svg.c">
<Filter>Sources</Filter>
</ClCompile>
diff --git a/Xcode/SDL_image.xcodeproj/project.pbxproj b/Xcode/SDL_image.xcodeproj/project.pbxproj
index 6dae3d21..8b1aea76 100644
--- a/Xcode/SDL_image.xcodeproj/project.pbxproj
+++ b/Xcode/SDL_image.xcodeproj/project.pbxproj
@@ -53,8 +53,6 @@
AA579E0B161C07E7005F809B /* IMG_xpm.c in Sources */ = {isa = PBXBuildFile; fileRef = AA579DEE161C07E6005F809B /* IMG_xpm.c */; };
AA579E0C161C07E7005F809B /* IMG_xv.c in Sources */ = {isa = PBXBuildFile; fileRef = AA579DEF161C07E6005F809B /* IMG_xv.c */; };
AA579E0D161C07E7005F809B /* IMG_xv.c in Sources */ = {isa = PBXBuildFile; fileRef = AA579DEF161C07E6005F809B /* IMG_xv.c */; };
- AA579E0E161C07E7005F809B /* IMG_xxx.c in Sources */ = {isa = PBXBuildFile; fileRef = AA579DF0161C07E6005F809B /* IMG_xxx.c */; };
- AA579E0F161C07E7005F809B /* IMG_xxx.c in Sources */ = {isa = PBXBuildFile; fileRef = AA579DF0161C07E6005F809B /* IMG_xxx.c */; };
AA579E10161C07E7005F809B /* IMG.c in Sources */ = {isa = PBXBuildFile; fileRef = AA579DF1161C07E6005F809B /* IMG.c */; };
AA579E11161C07E7005F809B /* IMG.c in Sources */ = {isa = PBXBuildFile; fileRef = AA579DF1161C07E6005F809B /* IMG.c */; };
AADBAC89175C6B4C004F8ED2 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007288A60F0DA79800C302A9 /* ApplicationServices.framework */; platformFilters = (macos, ); };
@@ -181,7 +179,6 @@
AA579DED161C07E6005F809B /* IMG_xcf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IMG_xcf.c; path = ../IMG_xcf.c; sourceTree = "<group>"; };
AA579DEE161C07E6005F809B /* IMG_xpm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IMG_xpm.c; path = ../IMG_xpm.c; sourceTree = "<group>"; };
AA579DEF161C07E6005F809B /* IMG_xv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IMG_xv.c; path = ../IMG_xv.c; sourceTree = "<group>"; };
- AA579DF0161C07E6005F809B /* IMG_xxx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IMG_xxx.c; path = ../IMG_xxx.c; sourceTree = "<group>"; };
AA579DF1161C07E6005F809B /* IMG.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IMG.c; path = ../IMG.c; sourceTree = "<group>"; };
BE1FA72D07AF4C44004B6283 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = "<group>"; };
BE1FA72E07AF4C45004B6283 /* SDL3_image.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL3_image.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -299,7 +296,6 @@
AA579DED161C07E6005F809B /* IMG_xcf.c */,
AA579DEE161C07E6005F809B /* IMG_xpm.c */,
AA579DEF161C07E6005F809B /* IMG_xv.c */,
- AA579DF0161C07E6005F809B /* IMG_xxx.c */,
);
name = "Library Source";
sourceTree = "<group>";
@@ -629,7 +625,6 @@
AA579E0A161C07E7005F809B /* IMG_xpm.c in Sources */,
F354743E2828CA66007E9EDA /* IMG_jxl.c in Sources */,
AA579E0C161C07E7005F809B /* IMG_xv.c in Sources */,
- AA579E0E161C07E7005F809B /* IMG_xxx.c in Sources */,
AA579E10161C07E7005F809B /* IMG.c in Sources */,
AA50AA471F9C7C50003B9C0C /* IMG_svg.c in Sources */,
F31094C3282AE42D008EF641 /* IMG_stb.c in Sources */,
@@ -657,7 +652,6 @@
AA579E0B161C07E7005F809B /* IMG_xpm.c in Sources */,
F354743F2828CA66007E9EDA /* IMG_jxl.c in Sources */,
AA579E0D161C07E7005F809B /* IMG_xv.c in Sources */,
- AA579E0F161C07E7005F809B /* IMG_xxx.c in Sources */,
AA579E11161C07E7005F809B /* IMG.c in Sources */,
AA23FC7D20A2A1B90017DFB9 /* IMG_svg.c in Sources */,
F31094C4282AE42D008EF641 /* IMG_stb.c in Sources */,