From 784793cae380bcdd98295d44732eaa14cf15206d Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 3 Mar 2019 15:18:58 -0330 Subject: [PATCH] Fix compile warnings from clang8; this class still needs more work though. --- src/emucore/MT24LC256.cxx | 22 +++++++++------------- src/emucore/MT24LC256.hxx | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/emucore/MT24LC256.cxx b/src/emucore/MT24LC256.cxx index 308f6a242..e509ad281 100644 --- a/src/emucore/MT24LC256.cxx +++ b/src/emucore/MT24LC256.cxx @@ -18,29 +18,25 @@ #include #include "System.hxx" - #include "OSystem.hxx" - #include "Settings.hxx" - #include "MT24LC256.hxx" -#define DEBUG_EEPROM 0 +//#define DEBUG_EEPROM -// FIXME - Change to more proper C++ code, to eliminate warnings from clang8 -// It seems we only need OSystem here to print a message; I think this +// FIXME - It seems we only need OSystem here to print a message; I think this // can be abstracted away from the class; perhaps use a lambda to // register a callback when a write happens?? -#if DEBUG_EEPROM - char jpee_msg[256]; +#ifdef DEBUG_EEPROM + static char jpee_msg[256]; #define JPEE_LOG0(msg) jpee_logproc(msg) #define JPEE_LOG1(msg,arg1) sprintf(jpee_msg,(msg),(arg1)), jpee_logproc(jpee_msg) #define JPEE_LOG2(msg,arg1,arg2) sprintf(jpee_msg,(msg),(arg1),(arg2)), jpee_logproc(jpee_msg) #else - #define JPEE_LOG0(msg) { } - #define JPEE_LOG1(msg,arg1) { } - #define JPEE_LOG2(msg,arg1,arg2) { } + #define JPEE_LOG0(msg) + #define JPEE_LOG1(msg,arg1) + #define JPEE_LOG2(msg,arg1,arg2) #endif /* @@ -147,7 +143,7 @@ void MT24LC256::update() // we only do the write when they have the same 'timestamp' if(myCyclesWhenSDASet == myCyclesWhenSCLSet) { -#if DEBUG_EEPROM +#ifdef DEBUG_EEPROM cerr << endl << " I2C_PIN_WRITE(SCL = " << mySCL << ", SDA = " << mySDA << ")" << " @ " << mySystem.cycles() << endl; #endif @@ -414,7 +410,7 @@ bool MT24LC256::jpee_timercheck(int mode) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int MT24LC256::jpee_logproc(char const *st) +int MT24LC256::jpee_logproc(const char* const st) { cerr << " " << st << endl; return 0; diff --git a/src/emucore/MT24LC256.hxx b/src/emucore/MT24LC256.hxx index 9f2612f24..5a009c3f3 100644 --- a/src/emucore/MT24LC256.hxx +++ b/src/emucore/MT24LC256.hxx @@ -77,7 +77,7 @@ class MT24LC256 void jpee_data_start(); void jpee_data_stop(); void jpee_clock_fall(); - int jpee_logproc(char const *st); + int jpee_logproc(const char* const st); bool jpee_timercheck(int mode); void update();