Bug 928231 follow-up - Rename the SIZE_OF_TABLES macro
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 22 Oct 2013 09:06:22 -0400
changeset 165501 8fcdb3653f5724b24c5618571593d1a4027e8c8a
parent 165500 6bedc085975507a4f3aa025f45ea2a4116186e8b
child 165502 fa0f355e78718f385c78b15125be040b0a588bad
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs928231
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 928231 follow-up - Rename the SIZE_OF_TABLES macro
intl/uconv/ucvja/nsUnicodeToEUCJP.cpp
intl/uconv/ucvja/nsUnicodeToISO2022JP.cpp
--- a/intl/uconv/ucvja/nsUnicodeToEUCJP.cpp
+++ b/intl/uconv/ucvja/nsUnicodeToEUCJP.cpp
@@ -12,39 +12,39 @@
 
 // Shift Table
 static const int16_t g0201ShiftOutTable[] =  {
         2,
         ShiftOutCell(u1ByteChar,         1, 0x00, 0x00, 0x00, 0x7F),
         ShiftOutCell(u1BytePrefix8EChar, 2, 0x00, 0xA1, 0x00, 0xDF)
 };
 
-#define SIZE_OF_TABLES 3
-static const uScanClassID gScanClassIDs[SIZE_OF_TABLES] = {
+#define SIZE_OF_EUCJP_TABLES 3
+static const uScanClassID gScanClassIDs[SIZE_OF_EUCJP_TABLES] = {
   u2BytesGRCharset,
   u2BytesGRCharset,
   uMultibytesCharset
 };
 
-static const int16_t *gShiftTables[SIZE_OF_TABLES] =  {
+static const int16_t *gShiftTables[SIZE_OF_EUCJP_TABLES] =  {
     0,
     0,
     g0201ShiftOutTable
 };
 
-static const uint16_t *gMappingTables[SIZE_OF_TABLES] = {
+static const uint16_t *gMappingTables[SIZE_OF_EUCJP_TABLES] = {
     g_uf0208Mapping,
     g_uf0208extMapping,
     g_uf0201Mapping
 };
 
 nsresult
 nsUnicodeToEUCJPConstructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult)
 {
-    return CreateMultiTableEncoder(SIZE_OF_TABLES,
+    return CreateMultiTableEncoder(SIZE_OF_EUCJP_TABLES,
                                    (uScanClassID*) gScanClassIDs,
                                    (uShiftOutTable**) gShiftTables, 
                                    (uMappingTable**) gMappingTables,
                                    3 /* max length = src * 3 */,
                                    aOuter, aIID, aResult);
 }
 
--- a/intl/uconv/ucvja/nsUnicodeToISO2022JP.cpp
+++ b/intl/uconv/ucvja/nsUnicodeToISO2022JP.cpp
@@ -44,26 +44,26 @@ 0x30ea,0x30eb,0x30ec,0x30ed,0x30ef,0x30f
 #define IS_MARU(u)   (0xff9f == (u))
 #define NIGORI_MODIFIER 1
 #define MARU_MODIFIER   2
 
 static const uint16_t g_ufAsciiMapping [] = {
   0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
 };
 
-#define SIZE_OF_TABLES 5
-static const uint16_t * g_ufMappingTables[SIZE_OF_TABLES] = {
+#define SIZE_OF_ISO2022JP_TABLES 5
+static const uint16_t * g_ufMappingTables[SIZE_OF_ISO2022JP_TABLES] = {
   g_ufAsciiMapping,             // ASCII           ISOREG 6
   g_uf0201GLMapping,            // JIS X 0201-1976 ISOREG 14
   g_uf0208Mapping,              // JIS X 0208-1983 ISOREG 87
   g_uf0208extMapping,           // JIS X 0208 - cp932 ext
   g_uf0208Mapping,              // JIS X 0208-1978 ISOREG 42
 };
 
-static const uScanClassID g_ufScanClassIDs[SIZE_OF_TABLES] = {
+static const uScanClassID g_ufScanClassIDs[SIZE_OF_ISO2022JP_TABLES] = {
   u1ByteCharset,                // ASCII           ISOREG 6
   u1ByteCharset,                // JIS X 0201-1976 ISOREG 14
   u2BytesCharset,               // JIS X 0208-1983 ISOREG 87
   u2BytesCharset,               // JIS X 0208- cp932 ext
   u2BytesCharset,               // JIS X 0208-1978 ISOREG 42
 };
 #define JIS_X_208_INDEX 2
 
@@ -206,26 +206,26 @@ NS_IMETHODIMP nsUnicodeToISO2022JP::Conv
   const PRUnichar * src = aSrc;
   const PRUnichar * srcEnd = aSrc + *aSrcLength;
   char * dest = aDest;
   char * destEnd = aDest + *aDestLength;
   int32_t bcr, bcw;
   int32_t i;
 
   while (src < srcEnd) {
-    for (i=0; i< SIZE_OF_TABLES ; i++) {
+    for (i=0; i< SIZE_OF_ISO2022JP_TABLES ; i++) {
       bcr = 1;
       bcw = destEnd - dest;
       res = nsUnicodeEncodeHelper::ConvertByTable(src, &bcr, dest, &bcw, 
                                       g_ufScanClassIDs[i], nullptr,
                                       (uMappingTable *) g_ufMappingTables[i]);
       if (res != NS_ERROR_UENC_NOMAPPING) break;
     }
 
-    if ( i>=  SIZE_OF_TABLES) {
+    if ( i>=  SIZE_OF_ISO2022JP_TABLES) {
       if (IS_HANKAKU(*src)) {
         bcr = srcEnd - src;
         bcw = destEnd - dest;
         res = ConvertHankaku(src, &bcr, dest, &bcw);
         dest += bcw;
         src += bcr;
         if (res == NS_OK) continue;
       } else {