From 0a0c826043f16a350bb7f6d7dce0b1e7181d7814 Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 17 May 2007 19:11:30 +0000 Subject: [PATCH] Regenerate configure (once again) and indent CZNC::UpdateTrafficStats() with *tabs* git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@807 726aef4b-f618-498e-8847-2d620e286838 --- configure | 21 +++++++++++++++++---- znc.cpp | 26 +++++++++++++------------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/configure b/configure index a5759876..cd9349db 100755 --- a/configure +++ b/configure @@ -2403,9 +2403,11 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + CXXFLAGS="-D_GNU_SOURCE" INCLUDES="" LIBS="" + function appendLib { if test "$LIBS" != ""; then LIBS="$LIBS $*" @@ -2438,16 +2440,27 @@ function appendLD { fi } -if `echo $host_os | grep -i 'freebsd' >/dev/null 2>/dev/null`; then +case "${host_os}" in + freebsd*) appendInc -I/usr/local/include appendLib -L/usr/local/lib -lcompat appendCXX -D__GNU_LIBRARY__ -elif `echo $host_os | grep -i 'sol' >/dev/null 2>/dev/null`; then + ;; + solaris*) appendLib -lsocket -lnsl ISSUN=1 -fi + ;; + cygwin) + ISCYGWIN=1 + ;; +esac -appendCXX -fPIC +# cygwin +# warning: -fPIC ignored for target (all code is position independent) + +if test -z "$ISCYGWIN" ; then + appendCXX -fPIC +fi # Check whether --with-openssl was given. diff --git a/znc.cpp b/znc.cpp index 2b6ca6fa..f6cf5ab0 100644 --- a/znc.cpp +++ b/znc.cpp @@ -1310,19 +1310,19 @@ CZNC& CZNC::Get() { void CZNC::UpdateTrafficStats() { CSockManager* p = &m_Manager; for (unsigned int a = 0; a < p->size(); a++) { - if ((*p)[a]->GetSockName().Left(5) == "IRC::") { - CIRCSock *i = (CIRCSock *)(*p)[a]; - i->GetUser()->AddBytesRead((*p)[a]->GetBytesRead()); - (*p)[a]->ResetBytesRead(); - i->GetUser()->AddBytesWritten((*p)[a]->GetBytesWritten()); - (*p)[a]->ResetBytesWritten(); - } else if ((*p)[a]->GetSockName().Left(5) == "USR::") { - CClient *c = (CClient *)(*p)[a]; - c->GetUser()->AddBytesRead((*p)[a]->GetBytesRead()); - (*p)[a]->ResetBytesRead(); - c->GetUser()->AddBytesWritten((*p)[a]->GetBytesWritten()); - (*p)[a]->ResetBytesWritten(); - } + if ((*p)[a]->GetSockName().Left(5) == "IRC::") { + CIRCSock *i = (CIRCSock *)(*p)[a]; + i->GetUser()->AddBytesRead((*p)[a]->GetBytesRead()); + (*p)[a]->ResetBytesRead(); + i->GetUser()->AddBytesWritten((*p)[a]->GetBytesWritten()); + (*p)[a]->ResetBytesWritten(); + } else if ((*p)[a]->GetSockName().Left(5) == "USR::") { + CClient *c = (CClient *)(*p)[a]; + c->GetUser()->AddBytesRead((*p)[a]->GetBytesRead()); + (*p)[a]->ResetBytesRead(); + c->GetUser()->AddBytesWritten((*p)[a]->GetBytesWritten()); + (*p)[a]->ResetBytesWritten(); + } } }