X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..f59164e3d128c7675a4d3934206346a3384e53a5:/icuSources/tools/ctestfw/uperf.cpp?ds=sidebyside diff --git a/icuSources/tools/ctestfw/uperf.cpp b/icuSources/tools/ctestfw/uperf.cpp index 587d82ef..9ff20edc 100644 --- a/icuSources/tools/ctestfw/uperf.cpp +++ b/icuSources/tools/ctestfw/uperf.cpp @@ -1,13 +1,12 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 2002-2008, International Business Machines Corporation and + * Copyright (c) 2002-2012, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ -/* z/OS needs this definition for timeval */ -#if !defined(_XOPEN_SOURCE_EXTENDED) -#define _XOPEN_SOURCE_EXTENDED 1 -#endif +// Defines _XOPEN_SOURCE for access to POSIX functions. +// Must be before any other #includes. +#include "uposixdefs.h" #include "unicode/uperf.h" #include "uoptions.h" @@ -16,6 +15,9 @@ #include #if !UCONFIG_NO_CONVERSION + +UPerfFunction::~UPerfFunction() {} + static const char delim = '/'; static int32_t execCount = 0; UPerfTest* UPerfTest::gTest = NULL; @@ -205,6 +207,12 @@ void UPerfTest::init(UOption addOptions[], int32_t addOptionsCount, } ULine* UPerfTest::getLines(UErrorCode& status){ + if (U_FAILURE(status)) { + return NULL; + } + if (lines != NULL) { + return lines; // don't do it again + } lines = new ULine[MAXLINES]; int maxLines = MAXLINES; numLines=0; @@ -314,7 +322,7 @@ void UPerfTest::setPath( char* pathVal ) } // call individual tests, to be overriden to call implementations -UPerfFunction* UPerfTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par ) +UPerfFunction* UPerfTest::runIndexedTest( int32_t /*index*/, UBool /*exec*/, const char* & /*name*/, char* /*par*/ ) { // to be overriden by a method like: /* @@ -325,7 +333,6 @@ UPerfFunction* UPerfTest::runIndexedTest( int32_t index, UBool exec, const char* } */ fprintf(stderr,"*** runIndexedTest needs to be overriden! ***"); - name = ""; exec = exec; index = index; par = par; return NULL; } @@ -486,8 +493,7 @@ void UPerfTest::usage( void ) this->runIndexedTest( index, FALSE, name ); if (!name) break; - fprintf(stdout,name); - fprintf(stdout,"\n"); + fprintf(stdout, "%s\n", name); index++; }while (name && (name[0] != 0)); verbose = save_verbose;