Remove SIMP_TO_TRAD_NR
authorPeng Huang <shawn.p.huang@gmail.com>
Mon, 18 Jan 2010 08:41:22 +0000 (16:41 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Mon, 18 Jan 2010 08:41:22 +0000 (16:41 +0800)
src/SimpTradConverter.cc
src/SimpTradConverterTable.h
src/update-simptrad-table.py

index 98e68f0..6d34492 100644 (file)
@@ -38,7 +38,7 @@ SimpTradConverter::simpToTrad (const gchar *in, String &out)
         for (; i > 0; i--) {
             buf[i] = 0;
             result = (const gunichar **) bsearch (buf, simp_to_trad,
-                                            SIMP_TO_TRAD_NR, sizeof (simp_to_trad[0]),
+                                            G_N_ELEMENTS (simp_to_trad), sizeof (simp_to_trad[0]),
                                             _cmp);
             if (G_UNLIKELY (result != NULL))
                 break;
index d5403c4..739161b 100644 (file)
@@ -7561,4 +7561,3 @@ const wchar_t *simp_to_trad[][2] = {
     { L"龟", L"龜" },
 };
 #define SIMP_TO_TRAD_MAX_LEN (6)
-#define SIMP_TO_TRAD_NR (sizeof (simp_to_trad) / sizeof (simp_to_trad[0]))
index 0c50a0f..d51c3e5 100755 (executable)
@@ -49,7 +49,6 @@ def main():
         print '    { L"%s", L"%s" },' % (s.encode("utf8"), ts.encode("utf8"))
     print "};"
     print '#define SIMP_TO_TRAD_MAX_LEN (%d)' % maxlen
-    print '#define SIMP_TO_TRAD_NR (sizeof (simp_to_trad) / sizeof (simp_to_trad[0]))'
 
 if __name__ == "__main__":
     main()