From de6216b37b5b0976465c22310acf950f0ce17f3e Mon Sep 17 00:00:00 2001 From: np511 Date: Sun, 29 Jan 2017 04:27:43 -0500 Subject: [PATCH] Remove warnings about ISO C++11 conformance --- common/include/PS2Edefs.h | 2 +- plugins/CDVDnull/CDVD.cpp | 2 +- plugins/FWnull/FW.cpp | 2 +- plugins/GSnull/GS.cpp | 7 +++++-- plugins/GSnull/GS.h | 4 ++-- plugins/GSnull/GSLog.cpp | 4 ++-- plugins/PadNull/Pad.cpp | 4 ++-- plugins/SPU2null/SPU2.cpp | 8 ++++---- plugins/SPU2null/SPU2.h | 4 ++-- plugins/USBnull/USB.cpp | 2 +- plugins/USBqemu/USB.cpp | 2 +- plugins/cdvdGigaherz/src/CDVD.cpp | 2 +- plugins/dev9ghzdrk/DEV9.cpp | 2 +- plugins/dev9null/DEV9.cpp | 2 +- plugins/onepad/onepad.cpp | 2 +- plugins/zerogs/dx/GSmain.cpp | 2 +- plugins/zerogs/opengl/GSmain.cpp | 2 +- plugins/zerospu2/zerospu2.cpp | 2 +- plugins/zzogl-pg/opengl/GSmain.cpp | 4 ++-- 19 files changed, 31 insertions(+), 28 deletions(-) diff --git a/common/include/PS2Edefs.h b/common/include/PS2Edefs.h index 6c5836284f..6611dc24b9 100644 --- a/common/include/PS2Edefs.h +++ b/common/include/PS2Edefs.h @@ -126,7 +126,7 @@ extern "C" { u32 CALLBACK PS2EgetLibType(void); u32 CALLBACK PS2EgetLibVersion2(u32 type); -char *CALLBACK PS2EgetLibName(void); +const char *CALLBACK PS2EgetLibName(void); #ifdef __cplusplus } diff --git a/plugins/CDVDnull/CDVD.cpp b/plugins/CDVDnull/CDVD.cpp index b78567ee14..6d2e32e0ff 100644 --- a/plugins/CDVDnull/CDVD.cpp +++ b/plugins/CDVDnull/CDVD.cpp @@ -27,7 +27,7 @@ const unsigned char version = PS2E_CDVD_VERSION; const unsigned char revision = 0; const unsigned char build = 6; -EXPORT_C_(char *) +EXPORT_C_(const char *) PS2EgetLibName() { snprintf(libraryName, 255, "CDVDnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : ""); diff --git a/plugins/FWnull/FW.cpp b/plugins/FWnull/FW.cpp index 49be9c01da..b31ab95503 100644 --- a/plugins/FWnull/FW.cpp +++ b/plugins/FWnull/FW.cpp @@ -66,7 +66,7 @@ PS2EgetLibType() return PS2E_LT_FW; } -EXPORT_C_(char *) +EXPORT_C_(const char *) PS2EgetLibName() { snprintf(libraryName, 255, "FWnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : ""); diff --git a/plugins/GSnull/GS.cpp b/plugins/GSnull/GS.cpp index 471557975c..052f5561a7 100644 --- a/plugins/GSnull/GS.cpp +++ b/plugins/GSnull/GS.cpp @@ -35,7 +35,6 @@ const unsigned char version = PS2E_GS_VERSION; const unsigned char revision = 0; const unsigned char build = 1; // increase that with each version -static char libraryName[256]; Config conf; u32 GSKeyEvent = 0; bool GSShift = false, GSAlt = false; @@ -62,7 +61,11 @@ PS2EgetLibType() return PS2E_LT_GS; } -EXPORT_C_(char *) +#ifdef _MSC_VER +static char libraryName[256]; +#endif + +EXPORT_C_(const char *) PS2EgetLibName() { #ifdef _MSC_VER diff --git a/plugins/GSnull/GS.h b/plugins/GSnull/GS.h index 995f7dfe6c..bcb2bbeaac 100644 --- a/plugins/GSnull/GS.h +++ b/plugins/GSnull/GS.h @@ -81,8 +81,8 @@ namespace GSLog { extern bool Open(); extern void Close(); -extern void Log(char *fmt, ...); -extern void Message(char *fmt, ...); +extern void Log(const char *fmt, ...); +extern void Message(const char *fmt, ...); extern void Print(const char *fmt, ...); extern void WriteLn(const char *fmt, ...); }; diff --git a/plugins/GSnull/GSLog.cpp b/plugins/GSnull/GSLog.cpp index e2249ebe95..81c77c6f59 100644 --- a/plugins/GSnull/GSLog.cpp +++ b/plugins/GSnull/GSLog.cpp @@ -63,7 +63,7 @@ void Close() } } -void Log(char *fmt, ...) +void Log(const char *fmt, ...) { va_list list; @@ -75,7 +75,7 @@ void Log(char *fmt, ...) va_end(list); } -void Message(char *fmt, ...) +void Message(const char *fmt, ...) { va_list list; char msg[512]; diff --git a/plugins/PadNull/Pad.cpp b/plugins/PadNull/Pad.cpp index 4f5543f9c5..fad95ce03d 100644 --- a/plugins/PadNull/Pad.cpp +++ b/plugins/PadNull/Pad.cpp @@ -23,7 +23,7 @@ using namespace std; const u8 version = PS2E_PAD_VERSION; const u8 revision = 0; -const u8 build = 1; // increase that with each version +const u8 build = 1; // increase that with each version #ifdef _MSC_VER #define snprintf sprintf_s @@ -43,7 +43,7 @@ PS2EgetLibType() return PS2E_LT_PAD; } -EXPORT_C_(char *) +EXPORT_C_(const char *) PS2EgetLibName() { snprintf(libraryName, 255, "Padnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : ""); diff --git a/plugins/SPU2null/SPU2.cpp b/plugins/SPU2null/SPU2.cpp index c368dc4cae..d7b2c67bf4 100644 --- a/plugins/SPU2null/SPU2.cpp +++ b/plugins/SPU2null/SPU2.cpp @@ -36,9 +36,9 @@ const u32 minor = 0; // increase that with each version #define RELEASE_MS 437L #ifdef PCSX2_DEBUG -char *libraryName = "SPU2null (Debug)"; +const char *libraryName = "SPU2null (Debug)"; #else -char *libraryName = "SPU2null "; +const char *libraryName = "SPU2null "; #endif string s_strIniPath = "inis/"; string s_strLogPath = "logs/"; @@ -89,7 +89,7 @@ PS2EgetLibType() return PS2E_LT_SPU2; } -EXPORT_C_(char *) +EXPORT_C_(const char *) PS2EgetLibName() { return libraryName; @@ -101,7 +101,7 @@ PS2EgetLibVersion2(u32 type) return (version << 16) | (revision << 8) | build | (minor << 24); } -void __Log(char *fmt, ...) +void __Log(const char *fmt, ...) { va_list list; diff --git a/plugins/SPU2null/SPU2.h b/plugins/SPU2null/SPU2.h index 0c95a3a8c1..4f900c9ff3 100644 --- a/plugins/SPU2null/SPU2.h +++ b/plugins/SPU2null/SPU2.h @@ -48,7 +48,7 @@ extern const u8 version; extern const u8 revision; extern const u8 build; extern const u32 minor; -extern char *libraryName; +extern const char *libraryName; typedef struct { @@ -57,7 +57,7 @@ typedef struct extern Config conf; -void __Log(char *fmt, ...); +void __Log(const char *fmt, ...); void SaveConfig(); void LoadConfig(); void SysMessage(char *fmt, ...); diff --git a/plugins/USBnull/USB.cpp b/plugins/USBnull/USB.cpp index 4ec9984c8c..1b1506519a 100644 --- a/plugins/USBnull/USB.cpp +++ b/plugins/USBnull/USB.cpp @@ -60,7 +60,7 @@ PS2EgetLibType() return PS2E_LT_USB; } -EXPORT_C_(char *) +EXPORT_C_(const char *) PS2EgetLibName() { snprintf(libraryName, 255, "USBnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : ""); diff --git a/plugins/USBqemu/USB.cpp b/plugins/USBqemu/USB.cpp index dcf6671c55..d52cf4c6c6 100644 --- a/plugins/USBqemu/USB.cpp +++ b/plugins/USBqemu/USB.cpp @@ -113,7 +113,7 @@ u32 CALLBACK PS2EgetLibType() { return PS2E_LT_USB; } -char* CALLBACK PS2EgetLibName() +const char* CALLBACK PS2EgetLibName() { InitLibraryName(); return libraryName; diff --git a/plugins/cdvdGigaherz/src/CDVD.cpp b/plugins/cdvdGigaherz/src/CDVD.cpp index 4fefcb9b92..a27eeafdf0 100644 --- a/plugins/cdvdGigaherz/src/CDVD.cpp +++ b/plugins/cdvdGigaherz/src/CDVD.cpp @@ -60,7 +60,7 @@ const unsigned char version = PS2E_CDVD_VERSION; const unsigned char revision = 0; const unsigned char build = 11; -EXPORT char *CALLBACK PS2EgetLibName() +EXPORT const char *CALLBACK PS2EgetLibName() { return LibName; } diff --git a/plugins/dev9ghzdrk/DEV9.cpp b/plugins/dev9ghzdrk/DEV9.cpp index fbd2218058..b056bb8a8c 100644 --- a/plugins/dev9ghzdrk/DEV9.cpp +++ b/plugins/dev9ghzdrk/DEV9.cpp @@ -72,7 +72,7 @@ u32 CALLBACK PS2EgetLibType() { return PS2E_LT_DEV9; } -char* CALLBACK PS2EgetLibName() { +const char* CALLBACK PS2EgetLibName() { return libraryName; } diff --git a/plugins/dev9null/DEV9.cpp b/plugins/dev9null/DEV9.cpp index de46b3f77d..91c551455a 100644 --- a/plugins/dev9null/DEV9.cpp +++ b/plugins/dev9null/DEV9.cpp @@ -77,7 +77,7 @@ PS2EgetLibType() return PS2E_LT_DEV9; } -EXPORT_C_(char *) +EXPORT_C_(const char *) PS2EgetLibName() { snprintf(libraryName, 255, "DEV9null Driver %lld%s", SVN_REV, SVN_MODS ? "m" : ""); diff --git a/plugins/onepad/onepad.cpp b/plugins/onepad/onepad.cpp index 9b48bd86ce..add8c38f0d 100644 --- a/plugins/onepad/onepad.cpp +++ b/plugins/onepad/onepad.cpp @@ -91,7 +91,7 @@ PS2EgetLibType() return PS2E_LT_PAD; } -EXPORT_C_(char *) +EXPORT_C_(const char *) PS2EgetLibName() { InitLibraryName(); diff --git a/plugins/zerogs/dx/GSmain.cpp b/plugins/zerogs/dx/GSmain.cpp index 3e04de6654..8ee6eefcbd 100644 --- a/plugins/zerogs/dx/GSmain.cpp +++ b/plugins/zerogs/dx/GSmain.cpp @@ -105,7 +105,7 @@ u32 CALLBACK PS2EgetLibType() { return PS2E_LT_GS; } -char* CALLBACK PS2EgetLibName() { +const char* CALLBACK PS2EgetLibName() { return libraryName; } diff --git a/plugins/zerogs/opengl/GSmain.cpp b/plugins/zerogs/opengl/GSmain.cpp index 40f86aafdd..311ae343a0 100644 --- a/plugins/zerogs/opengl/GSmain.cpp +++ b/plugins/zerogs/opengl/GSmain.cpp @@ -97,7 +97,7 @@ u32 CALLBACK PS2EgetLibType() { return PS2E_LT_GS; } -char* CALLBACK PS2EgetLibName() { +const char* CALLBACK PS2EgetLibName() { return libraryName; } diff --git a/plugins/zerospu2/zerospu2.cpp b/plugins/zerospu2/zerospu2.cpp index 1b35f6d12b..5dfd0ba612 100644 --- a/plugins/zerospu2/zerospu2.cpp +++ b/plugins/zerospu2/zerospu2.cpp @@ -162,7 +162,7 @@ u32 CALLBACK PS2EgetLibType() return PS2E_LT_SPU2; } -char* CALLBACK PS2EgetLibName() +const char* CALLBACK PS2EgetLibName() { InitLibraryName(); return libraryName; diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index 95c27eac7f..b98a102ad7 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -97,9 +97,9 @@ EXPORT_C_(u32) PS2EgetLibType() return PS2E_LT_GS; } -EXPORT_C_(char*) PS2EgetLibName() +EXPORT_C_(const char*) PS2EgetLibName() { - return (char*) libraryName; + return libraryName; } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type)