From 61bdee4d78a62ef3ed173c70d2968d2453d823fd Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 6 Aug 2017 01:30:58 -0400 Subject: [PATCH] __PHYSFS_platformDeinit() should return void. What are you going to do if this fails, anyhow? --- src/physfs.c | 3 +-- src/physfs_internal.h | 5 +---- src/physfs_platform_haiku.cpp | 4 ++-- src/physfs_platform_macos.c | 4 ++-- src/physfs_platform_os2.c | 4 +--- src/physfs_platform_unix.c | 4 ++-- src/physfs_platform_windows.c | 3 +-- 7 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/physfs.c b/src/physfs.c index 71755c9a..2834d873 100644 --- a/src/physfs.c +++ b/src/physfs.c @@ -1362,8 +1362,7 @@ static int doDeinit(void) errorLock = stateLock = NULL; - /* !!! FIXME: what on earth are you supposed to do if this fails? */ - BAIL_IF_ERRPASS(!__PHYSFS_platformDeinit(), 0); + __PHYSFS_platformDeinit(); return 1; } /* doDeinit */ diff --git a/src/physfs_internal.h b/src/physfs_internal.h index 201cc8d2..b60acfee 100644 --- a/src/physfs_internal.h +++ b/src/physfs_internal.h @@ -431,11 +431,8 @@ int __PHYSFS_platformInit(void); * Deinitialize the platform. This is called when PHYSFS_deinit() is called * from the application. You can use this to clean up anything you've * allocated in your platform driver. - * - * Return zero if there was a catastrophic failure (which prevents you from - * functioning at all), and non-zero otherwise. */ -int __PHYSFS_platformDeinit(void); +void __PHYSFS_platformDeinit(void); /* diff --git a/src/physfs_platform_haiku.cpp b/src/physfs_platform_haiku.cpp index 4b8780ba..4a7f2fc8 100644 --- a/src/physfs_platform_haiku.cpp +++ b/src/physfs_platform_haiku.cpp @@ -32,9 +32,9 @@ int __PHYSFS_platformInit(void) } /* __PHYSFS_platformInit */ -int __PHYSFS_platformDeinit(void) +void __PHYSFS_platformDeinit(void) { - return 1; /* always succeed. */ + /* no-op */ } /* __PHYSFS_platformDeinit */ diff --git a/src/physfs_platform_macos.c b/src/physfs_platform_macos.c index 9498b6d8..3b790147 100644 --- a/src/physfs_platform_macos.c +++ b/src/physfs_platform_macos.c @@ -27,9 +27,9 @@ int __PHYSFS_platformInit(void) } /* __PHYSFS_platformInit */ -int __PHYSFS_platformDeinit(void) +void __PHYSFS_platformDeinit(void) { - return 1; /* always succeed. */ + /* no-op */ } /* __PHYSFS_platformDeinit */ diff --git a/src/physfs_platform_os2.c b/src/physfs_platform_os2.c index 95bd6c3e..d97ea71a 100644 --- a/src/physfs_platform_os2.c +++ b/src/physfs_platform_os2.c @@ -271,7 +271,7 @@ int __PHYSFS_platformInit(void) } /* __PHYSFS_platformInit */ -int __PHYSFS_platformDeinit(void) +void __PHYSFS_platformDeinit(void) { if (uconvdll) { @@ -280,8 +280,6 @@ int __PHYSFS_platformDeinit(void) DosFreeModule(uconvdll); uconvdll = 0; } /* if */ - - return 1; /* success. */ } /* __PHYSFS_platformDeinit */ diff --git a/src/physfs_platform_unix.c b/src/physfs_platform_unix.c index a27b14a6..73bba5ca 100644 --- a/src/physfs_platform_unix.c +++ b/src/physfs_platform_unix.c @@ -65,9 +65,9 @@ int __PHYSFS_platformInit(void) } /* __PHYSFS_platformInit */ -int __PHYSFS_platformDeinit(void) +void __PHYSFS_platformDeinit(void) { - return 1; /* always succeed. */ + /* no-op */ } /* __PHYSFS_platformDeinit */ diff --git a/src/physfs_platform_windows.c b/src/physfs_platform_windows.c index 3b0dbef0..6ae86f90 100644 --- a/src/physfs_platform_windows.c +++ b/src/physfs_platform_windows.c @@ -612,10 +612,9 @@ int __PHYSFS_platformInit(void) } /* __PHYSFS_platformInit */ -int __PHYSFS_platformDeinit(void) +void __PHYSFS_platformDeinit(void) { deinitCDThread(); - return 1; /* It's all good */ } /* __PHYSFS_platformDeinit */