ICU-5955 Mark data const

X-SVN-Rev: 23158
This commit is contained in:
George Rhoten 2008-01-03 10:07:47 +00:00
parent 13c6adb8cb
commit dd845e9520
5 changed files with 21 additions and 28 deletions

View file

@ -1,6 +1,6 @@
/*
***************************************************************************
* Copyright (C) 1999-2007 International Business Machines Corporation *
* Copyright (C) 1999-2008 International Business Machines Corporation *
* and others. All rights reserved. *
***************************************************************************
*/
@ -321,7 +321,7 @@ void RuleBasedBreakIterator::setText(UText *ut, UErrorCode &status) {
// we can come to signaling a failure.
// (GetText() is obsolete, this failure is sort of OK)
if (fDCharIter == NULL) {
static UChar c = 0;
static const UChar c = 0;
fDCharIter = new UCharCharacterIterator(&c, 0);
}

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (c) 2001-2007, International Business Machines
* Copyright (c) 2001-2008, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
@ -62,9 +62,6 @@ UnicodeString& ICU_Utility::appendNumber(UnicodeString& result, int32_t n,
return result;
}
static const UChar HEX[16] = {48,49,50,51,52,53,54,55, // 0-7
56,57,65,66,67,68,69,70}; // 8-9 A-F
/**
* Return true if the character is NOT printable ASCII.
*/
@ -83,17 +80,17 @@ UBool ICU_Utility::escapeUnprintable(UnicodeString& result, UChar32 c) {
result.append(BACKSLASH);
if (c & ~0xFFFF) {
result.append(UPPER_U);
result.append(HEX[0xF&(c>>28)]);
result.append(HEX[0xF&(c>>24)]);
result.append(HEX[0xF&(c>>20)]);
result.append(HEX[0xF&(c>>16)]);
result.append(DIGITS[0xF&(c>>28)]);
result.append(DIGITS[0xF&(c>>24)]);
result.append(DIGITS[0xF&(c>>20)]);
result.append(DIGITS[0xF&(c>>16)]);
} else {
result.append(LOWER_U);
}
result.append(HEX[0xF&(c>>12)]);
result.append(HEX[0xF&(c>>8)]);
result.append(HEX[0xF&(c>>4)]);
result.append(HEX[0xF&c]);
result.append(DIGITS[0xF&(c>>12)]);
result.append(DIGITS[0xF&(c>>8)]);
result.append(DIGITS[0xF&(c>>4)]);
result.append(DIGITS[0xF&c]);
return TRUE;
}
return FALSE;

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2008, International Business Machines Corporation and
* Copyright (C) 2007-2008, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
@ -35,10 +35,6 @@
#include "dtptngen_impl.h"
#if defined U_DEBUG_DTPTN
#include <stdio.h>
#endif
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
U_NAMESPACE_BEGIN
@ -105,17 +101,17 @@ static const dtTypeElem dtTypes[] = {
{0, UDATPG_FIELD_COUNT, 0, 0, 0} , // last row of dtTypes[]
};
static const char* CLDR_FIELD_APPEND[] = {
static const char* const CLDR_FIELD_APPEND[] = {
"Era", "Year", "Quarter", "Month", "Week", "*", "Day-Of-Week", "Day", "*", "*", "*",
"Hour", "Minute", "Second", "*", "Timezone"
};
static const char* CLDR_FIELD_NAME[] = {
static const char* const CLDR_FIELD_NAME[] = {
"era", "year", "quarter", "month", "week", "*", "weekday", "day", "*", "*", "dayperiod",
"hour", "minute", "second", "*", "zone"
};
static const char* Resource_Fields[] = {
static const char* const Resource_Fields[] = {
"day", "dayperiod", "era", "hour", "minute", "month", "second", "week",
"weekday", "year", "zone", "quarter" };

View file

@ -2,7 +2,7 @@
//
// file: regexcmp.cpp
//
// Copyright (C) 2002-2007 International Business Machines Corporation and others.
// Copyright (C) 2002-2008 International Business Machines Corporation and others.
// All Rights Reserved.
//
// This file contains the ICU regular expression compiler, which is responsible
@ -4022,7 +4022,7 @@ UnicodeSet *RegexCompile::createSetForProperty(const UnicodeString &propName, UB
// TODO: Redo to remove dependency on code page conversion of (char *) strings.
//
#define IDENTIFIER_IGNORABLE "[\\u0000-\\u0008\\u000e-\\u001b\\u007f-\\u009f\\p{Cf}]"
static const char *javaProps[][2] = {
static const char * const javaProps[][2] = {
{"javaDefined", "\\P{Cn}"},
{"javaDigit", "\\p{Nd}"},
{"javaIdentifierIgnorable", IDENTIFIER_IGNORABLE},

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2007, International Business Machines
* Copyright (C) 1996-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: ucol.cpp
@ -72,9 +72,9 @@ static const uint16_t *fcdTrieIndex=NULL;
// implicit generation and supressing sort key compression
// they should regularly be in the UCA, but if one
// is running without UCA, it could be a problem
static int32_t maxRegularPrimary = 0xA0;
static int32_t minImplicitPrimary = 0xE0;
static int32_t maxImplicitPrimary = 0xE4;
static const int32_t maxRegularPrimary = 0xA0;
static const int32_t minImplicitPrimary = 0xE0;
static const int32_t maxImplicitPrimary = 0xE4;
U_CDECL_BEGIN
static UBool U_CALLCONV