From 7ebaebba8520e457bf374ca245f52332fbb008be Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Nov 2012 21:18:48 +0000 Subject: bye-bye old coding style in Jabber git-svn-id: http://svn.miranda-ng.org/main/trunk@2322 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/MString.cpp | 70 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'protocols/JabberG/src/MString.cpp') diff --git a/protocols/JabberG/src/MString.cpp b/protocols/JabberG/src/MString.cpp index 773871d1a5..2e11348425 100644 --- a/protocols/JabberG/src/MString.cpp +++ b/protocols/JabberG/src/MString.cpp @@ -6,7 +6,7 @@ CNilMStringData CMBaseString::m_nil; -CMStringData* CMBaseString::Allocate( int nChars, int nCharSize ) +CMStringData* CMBaseString::Allocate(int nChars, int nCharSize) { CMStringData* pData; nChars++; // nil char @@ -75,7 +75,7 @@ bool CMStringData::IsShared() const void CMStringData::Lock() { nRefs--; // Locked buffers can't be shared, so no interlocked operation necessary - if ( nRefs == 0 ) + if (nRefs == 0) nRefs = -1; } @@ -110,92 +110,92 @@ CNilMStringData::CNilMStringData() #if _MSC_VER < 1400 static HINSTANCE hCrt = NULL; -typedef int ( __cdecl *_vscprintf_func )( LPCSTR pszFormat, va_list args ); +typedef int (__cdecl *_vscprintf_func)(LPCSTR pszFormat, va_list args); static _vscprintf_func _vscprintf_ptr = NULL; -typedef int ( __cdecl *_vscwprintf_func )( LPCWSTR pszFormat, va_list args ); +typedef int (__cdecl *_vscwprintf_func)(LPCWSTR pszFormat, va_list args); static _vscwprintf_func _vscwprintf_ptr = NULL; -typedef int ( __cdecl *_vsnprintf_func )( char*, size_t, const char*, va_list ); +typedef int (__cdecl *_vsnprintf_func)(char*, size_t, const char*, va_list); static _vsnprintf_func _vsnprintf_ptr = NULL; -typedef int ( __cdecl *_vsnwprintf_func )( wchar_t *, size_t, const wchar_t *, va_list ); +typedef int (__cdecl *_vsnwprintf_func)(wchar_t *, size_t, const wchar_t *, va_list); static _vsnwprintf_func _vsnwprintf_ptr = NULL; -typedef int ( __cdecl *vswprintf_func )( wchar_t *, size_t, const wchar_t *, va_list ); +typedef int (__cdecl *vswprintf_func)(wchar_t *, size_t, const wchar_t *, va_list); static vswprintf_func vswprintf_ptr = NULL; -typedef int ( __cdecl *vsprintf_func )( char*, size_t, const char*, va_list ); +typedef int (__cdecl *vsprintf_func)(char*, size_t, const char*, va_list); static vsprintf_func vsprintf_ptr = NULL; -static void checkCrt( void ) +static void checkCrt(void) { - if ( hCrt == NULL ) { - hCrt = GetModuleHandleA( "msvcrt.dll" ); - _vscprintf_ptr = (_vscprintf_func)GetProcAddress( hCrt, "_vscprintf" ); - _vscwprintf_ptr = (_vscwprintf_func)GetProcAddress( hCrt, "_vscwprintf" ); - _vsnprintf_ptr = (_vsnprintf_func)GetProcAddress( hCrt, "_vsnprintf" ); - _vsnwprintf_ptr = (_vsnwprintf_func)GetProcAddress( hCrt, "_vsnwprintf" ); - vswprintf_ptr = (vswprintf_func)GetProcAddress( hCrt, "vswprintf" ); - vsprintf_ptr = (vsprintf_func)GetProcAddress( hCrt, "vsprintf" ); + if (hCrt == NULL) { + hCrt = GetModuleHandleA("msvcrt.dll"); + _vscprintf_ptr = (_vscprintf_func)GetProcAddress(hCrt, "_vscprintf"); + _vscwprintf_ptr = (_vscwprintf_func)GetProcAddress(hCrt, "_vscwprintf"); + _vsnprintf_ptr = (_vsnprintf_func)GetProcAddress(hCrt, "_vsnprintf"); + _vsnwprintf_ptr = (_vsnwprintf_func)GetProcAddress(hCrt, "_vsnwprintf"); + vswprintf_ptr = (vswprintf_func)GetProcAddress(hCrt, "vswprintf"); + vsprintf_ptr = (vsprintf_func)GetProcAddress(hCrt, "vsprintf"); } } #endif -int __stdcall ChTraitsCRT::GetFormattedLength( LPCWSTR pszFormat, va_list args ) +int __stdcall ChTraitsCRT::GetFormattedLength(LPCWSTR pszFormat, va_list args) { #if _MSC_VER < 1400 checkCrt(); - if ( _vscwprintf_ptr != NULL ) - return _vscwprintf_ptr( pszFormat, args ); + if (_vscwprintf_ptr != NULL) + return _vscwprintf_ptr(pszFormat, args); WCHAR buf[ 4000 ]; - return vswprintf_ptr( buf, SIZEOF(buf), pszFormat, args ); + return vswprintf_ptr(buf, SIZEOF(buf), pszFormat, args); #else - return _vscwprintf( pszFormat, args ); + return _vscwprintf(pszFormat, args); #endif } -int __stdcall ChTraitsCRT::Format( LPWSTR pszBuffer, size_t nLength, LPCWSTR pszFormat, va_list args) +int __stdcall ChTraitsCRT::Format(LPWSTR pszBuffer, size_t nLength, LPCWSTR pszFormat, va_list args) { #if _MSC_VER < 1400 checkCrt(); - if ( _vsnwprintf_ptr != NULL ) - return _vsnwprintf_ptr( pszBuffer, nLength, pszFormat, args ); + if (_vsnwprintf_ptr != NULL) + return _vsnwprintf_ptr(pszBuffer, nLength, pszFormat, args); - return vswprintf_ptr( pszBuffer, nLength, pszFormat, args ); + return vswprintf_ptr(pszBuffer, nLength, pszFormat, args); #else - return _vsnwprintf( pszBuffer, nLength, pszFormat, args ); + return _vsnwprintf(pszBuffer, nLength, pszFormat, args); #endif } ///////////////////////////////////////////////////////////////////////////////////////// // ChTraitsCRT -int __stdcall ChTraitsCRT::GetFormattedLength( LPCSTR pszFormat, va_list args ) +int __stdcall ChTraitsCRT::GetFormattedLength(LPCSTR pszFormat, va_list args) { #if _MSC_VER < 1400 checkCrt(); - if ( _vscprintf_ptr != NULL ) - return _vscprintf_ptr( pszFormat, args ); + if (_vscprintf_ptr != NULL) + return _vscprintf_ptr(pszFormat, args); char buf[4000]; - return vsprintf_ptr( buf, sizeof(buf), pszFormat, args ); + return vsprintf_ptr(buf, sizeof(buf), pszFormat, args); #else - return _vscprintf( pszFormat, args ); + return _vscprintf(pszFormat, args); #endif } -int __stdcall ChTraitsCRT::Format( LPSTR pszBuffer, size_t nlength, LPCSTR pszFormat, va_list args ) +int __stdcall ChTraitsCRT::Format(LPSTR pszBuffer, size_t nlength, LPCSTR pszFormat, va_list args) { #if _MSC_VER < 1400 checkCrt(); - return _vsnprintf( pszBuffer, nlength, pszFormat, args ); + return _vsnprintf(pszBuffer, nlength, pszFormat, args); #else - return vsprintf_s( pszBuffer, nlength, pszFormat, args ); + return vsprintf_s(pszBuffer, nlength, pszFormat, args); #endif } -- cgit v1.2.3