Merge branch 'master' of gitea.larke.org:klarke/libcw

This commit is contained in:
kevin.larke 2020-04-17 11:16:59 -04:00
commit c156a2fe85
6 changed files with 7 additions and 4 deletions

View File

@ -625,7 +625,7 @@ namespace cw
const char* name = (const char*)(u+6); const char* name = (const char*)(u+6);
const char* label = "MC Mix - "; 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 this a 'MC Mix' DNS-SD SRV reply
if( strncmp(label, name+1, strlen(label)) == 0 ) if( strncmp(label, name+1, strlen(label)) == 0 )

View File

@ -127,6 +127,7 @@ void cw::log::defaultOutput( void* arg, unsigned level, const char* text )
{ {
FILE* f = level >= kWarning_LogLevel ? stderr : stdout; FILE* f = level >= kWarning_LogLevel ? stderr : stdout;
fprintf(f,"%s",text); 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 ) 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 )

View File

@ -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( 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( 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( 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( 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); } cw::rc_t cw::object_t::value( const char*& v ) const { return type->value(this,kCStringTId,&v); }

View File

@ -126,6 +126,7 @@ namespace cw
rc_t value( uint64_t& v ) const; rc_t value( uint64_t& v ) const;
rc_t value( float& v ) const; rc_t value( float& v ) const;
rc_t value( double& v ) const; rc_t value( double& v ) const;
rc_t value( bool& v ) const;
rc_t value( char*& v ) const; rc_t value( char*& v ) const;
rc_t value( const char*& v ) const; rc_t value( const char*& v ) const;

View File

@ -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 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 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) 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; n0 = iN;
} }

View File

@ -625,7 +625,7 @@ cw::rc_t cw::net::socket::select_receive(handle_t h, char* buf, unsigned bufByte
else else
{ {
// check for overflow // check for overflow
if( retByteCnt == bufByteCnt ) if( retByteCnt == (ssize_t)bufByteCnt )
rc = cwLogError(kBufTooSmallRC,"The receive buffer requires more than %i bytes.",bufByteCnt); rc = cwLogError(kBufTooSmallRC,"The receive buffer requires more than %i bytes.",bufByteCnt);
if( recvByteCntRef != nullptr ) if( recvByteCntRef != nullptr )