From 2c43bde47c657a35909c74fd83b7fc6853ec8886 Mon Sep 17 00:00:00 2001 From: stan Date: Wed, 1 Jul 2009 12:28:40 +0000 Subject: [PATCH] Corrected some format specifiers to account for different size of size_t types on 64 bit systems git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2942 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_comms.h | 6 +++--- src/zm_event.cpp | 2 +- src/zm_signal.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/zm_comms.h b/src/zm_comms.h index 1d5007e8f..60d4a3ad4 100644 --- a/src/zm_comms.h +++ b/src/zm_comms.h @@ -320,7 +320,7 @@ public: { ssize_t nBytes = ::send( mSd, msg.data(), msg.size(), 0 ); if ( nBytes < 0 ) - Debug( 1, "Send of string '%s' (%d bytes) on sd %d failed: %s", msg.c_str(), msg.size(), mSd, strerror(errno) ); + Debug( 1, "Send of string '%s' (%zd bytes) on sd %d failed: %s", msg.c_str(), msg.size(), mSd, strerror(errno) ); return( nBytes ); } virtual int recv( std::string &msg ) const @@ -329,7 +329,7 @@ public: int nBytes = 0; if ( (nBytes = ::recv( mSd, buffer, sizeof(buffer), 0 )) < 0 ) { - Debug( 1, "Recv of %d bytes max to string on sd %d failed: %s", sizeof(buffer), mSd, strerror(errno) ); + Debug( 1, "Recv of %zd bytes max to string on sd %d failed: %s", sizeof(buffer), mSd, strerror(errno) ); return( nBytes ); } buffer[nBytes] = '\0'; @@ -342,7 +342,7 @@ public: int nBytes = 0; if ( (nBytes = ::recv( mSd, buffer, sizeof(buffer), 0 )) < 0 ) { - Debug( 1, "Recv of %d bytes max to string on sd %d failed: %s", maxLen, mSd, strerror(errno) ); + Debug( 1, "Recv of %zd bytes max to string on sd %d failed: %s", maxLen, mSd, strerror(errno) ); return( nBytes ); } buffer[nBytes] = '\0'; diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 323229da7..f89e2e5de 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -315,7 +315,7 @@ bool Event::SendFrameImage( const Image *image, bool alarm_frame ) } else { - Error( "Incomplete frame write: %d of %d bytes written", writev_result, writev_size ); + Error( "Incomplete frame write: %zd of %zd bytes written", writev_result, writev_size ); close( sd ); sd = -1; } diff --git a/src/zm_signal.cpp b/src/zm_signal.cpp index ae98696e0..908397615 100644 --- a/src/zm_signal.cpp +++ b/src/zm_signal.cpp @@ -87,7 +87,7 @@ RETSIGTYPE zm_die_handler( int signal ) // overwrite sigaction with caller's address trace[1] = (void *)context.eip; #elif HAVE_STRUCT_SIGCONTEXT - Error( "Signal address is %p, no eip", context.cr2 ); + Error( "Signal address is %p, no eip", (void *)context.cr2 ); trace_size = backtrace( trace, TRACE_SIZE ); #else // HAVE_STRUCT_SIGCONTEXT