mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-9525 fix casts as per http://www.stroustrup.com/bs_faq2.html#static-cast and also fix string quoting gcc47
X-SVN-Rev: 32307
This commit is contained in:
parent
e3d804e289
commit
79a59bfdef
7 changed files with 48 additions and 30 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2001-2011, International Business Machines
|
||||
* Copyright (c) 2001-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
|
@ -27,7 +27,10 @@ UnicodeFilter::~UnicodeFilter() {}
|
|||
* and return the pointer.
|
||||
*/
|
||||
UnicodeMatcher* UnicodeFilter::toMatcher() const {
|
||||
return (UnicodeMatcher*) this;
|
||||
UnicodeFilter *nonconst_this = const_cast<UnicodeFilter *>(this);
|
||||
UnicodeMatcher *nonconst_base = static_cast<UnicodeMatcher *>(nonconst_this);
|
||||
|
||||
return nonconst_base;
|
||||
}
|
||||
|
||||
void UnicodeFilter::setData(const TransliterationRuleData*) {}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2002-2011, International Business Machines Corporation
|
||||
* Copyright (c) 2002-2012, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
|
@ -66,7 +66,10 @@ UnicodeFunctor* FunctionReplacer::clone() const {
|
|||
* and return the pointer.
|
||||
*/
|
||||
UnicodeReplacer* FunctionReplacer::toReplacer() const {
|
||||
return (UnicodeReplacer*) this;
|
||||
FunctionReplacer *nonconst_this = const_cast<FunctionReplacer *>(this);
|
||||
UnicodeReplacer *nonconst_base = static_cast<UnicodeReplacer *>(nonconst_this);
|
||||
|
||||
return nonconst_base;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 2001-2008, International Business Machines
|
||||
* Copyright (C) 2001-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
|
@ -54,7 +54,10 @@ UnicodeFunctor* Quantifier::clone() const {
|
|||
* and return the pointer.
|
||||
*/
|
||||
UnicodeMatcher* Quantifier::toMatcher() const {
|
||||
return (UnicodeMatcher*) this;
|
||||
Quantifier *nonconst_this = const_cast<Quantifier *>(this);
|
||||
UnicodeMatcher *nonconst_base = static_cast<UnicodeMatcher *>(nonconst_this);
|
||||
|
||||
return nonconst_base;
|
||||
}
|
||||
|
||||
UMatchDegree Quantifier::matches(const Replaceable& text,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2001-2011, International Business Machines Corporation
|
||||
* Copyright (c) 2001-2012, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
|
@ -65,7 +65,10 @@ UnicodeFunctor* StringMatcher::clone() const {
|
|||
* and return the pointer.
|
||||
*/
|
||||
UnicodeMatcher* StringMatcher::toMatcher() const {
|
||||
return (UnicodeMatcher*) this;
|
||||
StringMatcher *nonconst_this = const_cast<StringMatcher *>(this);
|
||||
UnicodeMatcher *nonconst_base = static_cast<UnicodeMatcher *>(nonconst_this);
|
||||
|
||||
return nonconst_base;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,7 +76,10 @@ UnicodeMatcher* StringMatcher::toMatcher() const {
|
|||
* and return the pointer.
|
||||
*/
|
||||
UnicodeReplacer* StringMatcher::toReplacer() const {
|
||||
return (UnicodeReplacer*) this;
|
||||
StringMatcher *nonconst_this = const_cast<StringMatcher *>(this);
|
||||
UnicodeReplacer *nonconst_base = static_cast<UnicodeReplacer *>(nonconst_this);
|
||||
|
||||
return nonconst_base;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2002-2011, International Business Machines Corporation
|
||||
* Copyright (c) 2002-2012, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
|
@ -93,7 +93,10 @@ UnicodeFunctor* StringReplacer::clone() const {
|
|||
* Implement UnicodeFunctor
|
||||
*/
|
||||
UnicodeReplacer* StringReplacer::toReplacer() const {
|
||||
return (UnicodeReplacer*) this;
|
||||
StringReplacer *nonconst_this = const_cast<StringReplacer *>(this);
|
||||
UnicodeReplacer *nonconst_base = static_cast<UnicodeReplacer *>(nonconst_this);
|
||||
|
||||
return nonconst_base;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1436,10 +1436,10 @@ const char* IntlTest::loadTestData(UErrorCode& err){
|
|||
const char* tdrelativepath;
|
||||
|
||||
#if defined (U_TOPBUILDDIR)
|
||||
tdrelativepath = "test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING"out"U_FILE_SEP_STRING;
|
||||
tdrelativepath = "test" U_FILE_SEP_STRING "testdata" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
directory = U_TOPBUILDDIR;
|
||||
#else
|
||||
tdrelativepath = ".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING"out"U_FILE_SEP_STRING;
|
||||
tdrelativepath = ".." U_FILE_SEP_STRING "test" U_FILE_SEP_STRING "testdata" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
directory = pathToDataDirectory();
|
||||
#endif
|
||||
|
||||
|
@ -1475,17 +1475,17 @@ const char* IntlTest::getTestDataPath(UErrorCode& err) {
|
|||
const char *IntlTest::getSourceTestData(UErrorCode& /*err*/) {
|
||||
const char *srcDataDir = NULL;
|
||||
#ifdef U_TOPSRCDIR
|
||||
srcDataDir = U_TOPSRCDIR U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
|
||||
srcDataDir = U_TOPSRCDIR U_FILE_SEP_STRING"test" U_FILE_SEP_STRING "testdata" U_FILE_SEP_STRING;
|
||||
#else
|
||||
srcDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
|
||||
FILE *f = fopen(".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING"rbbitst.txt", "r");
|
||||
srcDataDir = ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "test" U_FILE_SEP_STRING "testdata" U_FILE_SEP_STRING;
|
||||
FILE *f = fopen(".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "test" U_FILE_SEP_STRING "testdata" U_FILE_SEP_STRING "rbbitst.txt", "r");
|
||||
if (f) {
|
||||
/* We're in icu/source/test/intltest/ */
|
||||
fclose(f);
|
||||
}
|
||||
else {
|
||||
/* We're in icu/source/test/intltest/Platform/(Debug|Release) */
|
||||
srcDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING;
|
||||
srcDataDir = ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "test" U_FILE_SEP_STRING "testdata"U_FILE_SEP_STRING;
|
||||
}
|
||||
#endif
|
||||
return srcDataDir;
|
||||
|
@ -1543,13 +1543,13 @@ const char * IntlTest::pathToDataDirectory()
|
|||
}
|
||||
else {
|
||||
/* __FILE__ on MSVC7 does not contain the directory */
|
||||
FILE *file = fopen(".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "Makefile.in", "r");
|
||||
FILE *file = fopen(".." U_FILE_SEP_STRING ".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "Makefile.in", "r");
|
||||
if (file) {
|
||||
fclose(file);
|
||||
fgDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING;
|
||||
fgDataDir = ".." U_FILE_SEP_STRING ".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING;
|
||||
}
|
||||
else {
|
||||
fgDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING;
|
||||
fgDataDir = ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING ".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 2002-2011, International Business Machines
|
||||
* Copyright (C) 2002-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* file name: iotest.cpp
|
||||
|
@ -109,13 +109,13 @@ public:
|
|||
}
|
||||
else {
|
||||
/* __FILE__ on MSVC7 does not contain the directory */
|
||||
FILE *file = fopen(".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "Makefile.in", "r");
|
||||
FILE *file = fopen(".." U_FILE_SEP_STRING".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "Makefile.in", "r");
|
||||
if (file) {
|
||||
fclose(file);
|
||||
fgDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING;
|
||||
fgDataDir = ".." U_FILE_SEP_STRING".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING;
|
||||
}
|
||||
else {
|
||||
fgDataDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING;
|
||||
fgDataDir = ".." U_FILE_SEP_STRING".." U_FILE_SEP_STRING".." U_FILE_SEP_STRING".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,10 +133,10 @@ public:
|
|||
const char* tdrelativepath;
|
||||
|
||||
#if defined (U_TOPBUILDDIR)
|
||||
tdrelativepath = "test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING"out"U_FILE_SEP_STRING;
|
||||
tdrelativepath = "test" U_FILE_SEP_STRING "testdata" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
directory = U_TOPBUILDDIR;
|
||||
#else
|
||||
tdrelativepath = ".."U_FILE_SEP_STRING"test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING"out"U_FILE_SEP_STRING;
|
||||
tdrelativepath = ".." U_FILE_SEP_STRING "test" U_FILE_SEP_STRING "testdata" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
directory = pathToDataDirectory();
|
||||
#endif
|
||||
|
||||
|
@ -718,7 +718,7 @@ static const char *ctest_dataOutDir()
|
|||
*/
|
||||
#if defined (U_TOPBUILDDIR)
|
||||
{
|
||||
dataOutDir = U_TOPBUILDDIR "data"U_FILE_SEP_STRING"out"U_FILE_SEP_STRING;
|
||||
dataOutDir = U_TOPBUILDDIR "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
}
|
||||
#else
|
||||
|
||||
|
@ -750,13 +750,13 @@ static const char *ctest_dataOutDir()
|
|||
}
|
||||
else {
|
||||
/* __FILE__ on MSVC7 does not contain the directory */
|
||||
FILE *file = fopen(".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "Makefile.in", "r");
|
||||
FILE *file = fopen(".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "Makefile.in", "r");
|
||||
if (file) {
|
||||
fclose(file);
|
||||
dataOutDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
dataOutDir = ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
}
|
||||
else {
|
||||
dataOutDir = ".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING".."U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
dataOutDir = ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue