Merge branch 'master' of gitea.larke.org:klarke/libcw
This commit is contained in:
commit
c156a2fe85
@ -625,7 +625,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 )
|
||||
|
@ -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 )
|
||||
|
@ -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); }
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user