diff --git a/icu4c/source/common/rbbicst.pl b/icu4c/source/common/rbbicst.pl index a9716ed5328..362e043f0ac 100755 --- a/icu4c/source/common/rbbicst.pl +++ b/icu4c/source/common/rbbicst.pl @@ -233,7 +233,7 @@ foreach $setName (keys %charClasses) { $charClasses{$setName} = 252;} else { # Normal character class. Fill in array with a ptr to the corresponding UnicodeSet in the state machine. - print " const uint8_t kRuleSet_$setName = $i;\n"; + print " static const uint8_t kRuleSet_$setName = $i;\n"; $charClasses{$setName} = $i; $i++; } @@ -270,7 +270,7 @@ print "};\n\n"; # # emit the state transition table # -print "struct RBBIRuleTableEl gRuleParseStateTable[] = {\n"; +print "static const struct RBBIRuleTableEl gRuleParseStateTable[] = {\n"; print " {doNOP, 0, 0, 0, TRUE}\n"; # State 0 is a dummy. Real states start with index = 1. for ($state=1; $state < $num_states; $state++) { print " , {$state_func_name[$state],"; @@ -307,7 +307,7 @@ print " };\n"; # # This array is used for producing debugging output from the rule parser. # -print "const char *RBBIRuleStateNames[] = {"; +print "static const char *RBBIRuleStateNames[] = {"; for ($state=0; $state<$num_states; $state++) { if ($stateNames[$state] ne "") { print " \"$stateNames[$state]\",\n"; diff --git a/icu4c/source/common/rbbirpt.h b/icu4c/source/common/rbbirpt.h index 88af39839fb..af19e20b36e 100644 --- a/icu4c/source/common/rbbirpt.h +++ b/icu4c/source/common/rbbirpt.h @@ -17,11 +17,11 @@ U_NAMESPACE_BEGIN // // Character classes for RBBI rule scanning. // - const uint8_t kRuleSet_digit_char = 128; - const uint8_t kRuleSet_rule_char = 129; - const uint8_t kRuleSet_white_space = 130; - const uint8_t kRuleSet_name_char = 131; - const uint8_t kRuleSet_name_start_char = 132; + static const uint8_t kRuleSet_digit_char = 128; + static const uint8_t kRuleSet_rule_char = 129; + static const uint8_t kRuleSet_white_space = 130; + static const uint8_t kRuleSet_name_char = 131; + static const uint8_t kRuleSet_name_start_char = 132; enum RBBI_RuleParseAction { @@ -71,7 +71,7 @@ struct RBBIRuleTableEl { UBool fNextChar; }; -struct RBBIRuleTableEl gRuleParseStateTable[] = { +static const struct RBBIRuleTableEl gRuleParseStateTable[] = { {doNOP, 0, 0, 0, TRUE} , {doExprStart, 254, 12, 8, FALSE} // 1 start , {doNOP, 130, 1,0, TRUE} // 2 @@ -159,7 +159,7 @@ struct RBBIRuleTableEl gRuleParseStateTable[] = { , {doRuleErrorAssignExpr, 255, 85,0, FALSE} // 84 , {doExit, 255, 85,0, TRUE} // 85 errorDeath }; -const char *RBBIRuleStateNames[] = { 0, +static const char *RBBIRuleStateNames[] = { 0, "start", 0, 0, diff --git a/icu4c/source/common/rbbiscan.cpp b/icu4c/source/common/rbbiscan.cpp index aff376feb94..947737dc3e1 100644 --- a/icu4c/source/common/rbbiscan.cpp +++ b/icu4c/source/common/rbbiscan.cpp @@ -838,8 +838,8 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) { // //--------------------------------------------------------------------------------- void RBBIRuleScanner::parse() { - uint16_t state; - RBBIRuleTableEl *tableEl; + uint16_t state; + const RBBIRuleTableEl *tableEl; if (U_FAILURE(*fRB->fStatus)) { return;