From 4c1e3a69acb6d27445bfce5af9d1196beedd5979 Mon Sep 17 00:00:00 2001 From: ehouse Date: Thu, 13 Jan 2005 02:26:05 +0000 Subject: [PATCH] overload symReplaceStr --- symbian/src/symutil.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/symbian/src/symutil.cpp b/symbian/src/symutil.cpp index 722ca0cb6..306e5ec8e 100644 --- a/symbian/src/symutil.cpp +++ b/symbian/src/symutil.cpp @@ -51,6 +51,22 @@ symReplaceStrIfDiff( MPFORMAL XP_UCHAR** loc, const TDesC16& desc ) *loc = newStr; } /* symReplaceStr */ +void +symReplaceStrIfDiff( MPFORMAL XP_UCHAR** loc, const XP_UCHAR* str ) +{ + if ( *loc != NULL ) { + if ( 0 == XP_STRCMP( *loc, str ) ) { + return; /* nothing to do */ + } + /* need to free */ + XP_FREE( mpool, *loc ); + } + + TInt len = XP_STRLEN( str ) + 1; + *loc = (XP_UCHAR*)XP_MALLOC( mpool, len ); + XP_MEMCPY( (void*)*loc, (void*)str, len ); +} /* symReplaceStrIfDiff */ + extern "C" { int @@ -83,7 +99,7 @@ void sym_debugf( char* aFmt, ... ) #else -void p_ignore(...) {} +void p_ignore( char* , ...) {} #endif