From 97617284334c2f060f8c3bbc3333b0f13bca7c94 Mon Sep 17 00:00:00 2001 From: "kevin.larke" Date: Thu, 16 Apr 2020 11:05:38 -0400 Subject: [PATCH 1/5] cwObject.h/cpp : Enabled 'bool' variables via getv() --- cwObject.cpp | 1 + cwObject.h | 1 + 2 files changed, 2 insertions(+) diff --git a/cwObject.cpp b/cwObject.cpp index 454c95b..48a3a21 100644 --- a/cwObject.cpp +++ b/cwObject.cpp @@ -480,6 +480,7 @@ cw::rc_t cw::object_t::value( int64_t& v ) const { return type->value(this,kInt cw::rc_t cw::object_t::value( uint64_t& v ) const { return type->value(this,kUInt64TId,&v); } cw::rc_t cw::object_t::value( float& v ) const { return type->value(this,kFloatTId,&v); } cw::rc_t cw::object_t::value( double& v ) const { return type->value(this,kDoubleTId,&v); } +cw::rc_t cw::object_t::value( bool& v ) const { return type->value(this,kBoolTId,&v); } cw::rc_t cw::object_t::value( char*& v ) const { return type->value(this,kStringTId,&v); } cw::rc_t cw::object_t::value( const char*& v ) const { return type->value(this,kCStringTId,&v); } diff --git a/cwObject.h b/cwObject.h index 25b1542..41eab29 100644 --- a/cwObject.h +++ b/cwObject.h @@ -126,6 +126,7 @@ namespace cw rc_t value( uint64_t& v ) const; rc_t value( float& v ) const; rc_t value( double& v ) const; + rc_t value( bool& v ) const; rc_t value( char*& v ) const; rc_t value( const char*& v ) const; From e5bddf6a7e7bf70ea9a8f630f3218edf0a0759c7 Mon Sep 17 00:00:00 2001 From: "kevin.larke" Date: Thu, 16 Apr 2020 11:11:09 -0400 Subject: [PATCH 2/5] cwTcpSocket.cpp : Fixed signed/unsigned compare. --- cwTcpSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cwTcpSocket.cpp b/cwTcpSocket.cpp index be6d4db..0316d09 100644 --- a/cwTcpSocket.cpp +++ b/cwTcpSocket.cpp @@ -625,7 +625,7 @@ cw::rc_t cw::net::socket::select_receive(handle_t h, char* buf, unsigned bufByte else { // check for overflow - if( retByteCnt == bufByteCnt ) + if( retByteCnt == (ssize_t)bufByteCnt ) rc = cwLogError(kBufTooSmallRC,"The receive buffer requires more than %i bytes.",bufByteCnt); if( recvByteCntRef != nullptr ) From 85993dcc426775110ce60ee51feccea72622a523 Mon Sep 17 00:00:00 2001 From: "kevin.larke" Date: Thu, 16 Apr 2020 11:11:23 -0400 Subject: [PATCH 3/5] cwSpScBuf.cpp : Fixed signed/unsigned compare. --- cwSpScBuf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cwSpScBuf.cpp b/cwSpScBuf.cpp index 72b0f91..ddd007b 100644 --- a/cwSpScBuf.cpp +++ b/cwSpScBuf.cpp @@ -99,7 +99,7 @@ cw::rc_t cw::spsc_buf::copyIn( handle_t h, const void* iBuf, unsigned iN ) { // if there is space between w and the EOB to accept the write ... - if( iN <= e-w ) + if( iN <= (unsigned)(e-w) ) { n0 = iN; // fill the space after w @@ -122,7 +122,7 @@ cw::rc_t cw::spsc_buf::copyIn( handle_t h, const void* iBuf, unsigned iN ) } else // r > w : r is in front of w (the write will not split) { - if( iN < r - w ) + if( iN < (unsigned)(r - w) ) { n0 = iN; } From ddfd1be7bb48edae7465ba757808d19923a01cbd Mon Sep 17 00:00:00 2001 From: "kevin.larke" Date: Thu, 16 Apr 2020 11:11:44 -0400 Subject: [PATCH 4/5] cwEuCon.cpp : Fixed printf() format specifier warning. --- cwEuCon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cwEuCon.cpp b/cwEuCon.cpp index bd650d5..1704f70 100644 --- a/cwEuCon.cpp +++ b/cwEuCon.cpp @@ -604,7 +604,7 @@ namespace cw const char* name = (const char*)(u+6); const char* label = "MC Mix - "; - printf("%.*s|%li\n", name[0], name+1, strlen(label) ); + printf("%.*s|%i\n", name[0], name+1, strlen(label) ); // if this a 'MC Mix' DNS-SD SRV reply if( strncmp(label, name+1, strlen(label)) == 0 ) From 7fad3df66733566a63eccdde61585c5b98642585 Mon Sep 17 00:00:00 2001 From: "kevin.larke" Date: Thu, 16 Apr 2020 20:09:13 -0400 Subject: [PATCH 5/5] cwLog.cpp : flush() output in defaultOutput(). --- cwLog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cwLog.cpp b/cwLog.cpp index 366d0b8..201ea38 100644 --- a/cwLog.cpp +++ b/cwLog.cpp @@ -127,6 +127,7 @@ void cw::log::defaultOutput( void* arg, unsigned level, const char* text ) { FILE* f = level >= kWarning_LogLevel ? stderr : stdout; fprintf(f,"%s",text); + fflush(f); } void cw::log::defaultFormatter( void* cbArg, logOutputCbFunc_t outFunc, void* outCbArg, unsigned level, const char* function, const char* filename, unsigned lineno, int sys_errno, rc_t rc, const char* msg )