Remove unnecessary macros

Change-Id: I1d7cdea37db59f58ca100489e593b882a951d96a
This commit is contained in:
Stephan Bergmann 2013-12-12 09:45:10 +01:00
parent 5888cb101f
commit a107c6bd8c

View File

@ -60,103 +60,96 @@ langid_to_string( LANGID langid )
* language part is returned in the string. * language part is returned in the string.
*/ */
switch (PRIMARYLANGID (langid)) { switch (PRIMARYLANGID (langid)) {
#define CASE(name, primary) \ case LANG_AFRIKAANS: return "af";
case LANG_##primary: return #name case LANG_AMHARIC: return "am";
CASE(af, AFRIKAANS); case LANG_ARABIC: return "ar";
CASE(am, AMHARIC); case LANG_ASSAMESE: return "as";
CASE(ar, ARABIC); case LANG_BELARUSIAN: return "be";
CASE(as, ASSAMESE); case LANG_BULGARIAN: return "bg";
CASE(be, BELARUSIAN); case LANG_BENGALI: return "bn";
CASE(bg, BULGARIAN); case LANG_BRETON: return "br";
CASE(bn, BENGALI); case LANG_CATALAN: return "ca";
CASE(br, BRETON); case LANG_CZECH: return "cs";
CASE(ca, CATALAN); case LANG_WELSH: return "cy";
CASE(cs, CZECH); case LANG_DANISH: return "da";
CASE(cy, WELSH); case LANG_GERMAN: return "de";
CASE(da, DANISH); case LANG_GREEK: return "el";
CASE(de, GERMAN); case LANG_ENGLISH: return "en";
CASE(el, GREEK); case LANG_SPANISH: return "es";
CASE(en, ENGLISH); case LANG_ESTONIAN: return "et";
CASE(es, SPANISH); case LANG_BASQUE: return "eu";
CASE(et, ESTONIAN); case LANG_FARSI: return "fa";
CASE(eu, BASQUE); case LANG_FINNISH: return "fi";
CASE(fa, FARSI); case LANG_FAEROESE: return "fo";
CASE(fi, FINNISH); case LANG_FRENCH: return "fr";
CASE(fo, FAEROESE); case LANG_IRISH: return "ga";
CASE(fr, FRENCH); case LANG_GALICIAN: return "gl";
CASE(ga, IRISH); case LANG_GUJARATI: return "gu";
CASE(gl, GALICIAN); case LANG_HEBREW: return "he";
CASE(gu, GUJARATI); case LANG_HINDI: return "hi";
CASE(he, HEBREW); case LANG_HUNGARIAN: return "hu";
CASE(hi, HINDI); case LANG_ARMENIAN: return "hy";
CASE(hu, HUNGARIAN); case LANG_INDONESIAN: return "id";
CASE(hy, ARMENIAN); case LANG_ICELANDIC: return "is";
CASE(id, INDONESIAN); case LANG_ITALIAN: return "it";
CASE(is, ICELANDIC); case LANG_JAPANESE: return "ja";
CASE(it, ITALIAN); case LANG_GEORGIAN: return "ka";
CASE(ja, JAPANESE); case LANG_KHMER: return "km";
CASE(ka, GEORGIAN); case LANG_KANNADA: return "kn";
CASE(km, KHMER); case LANG_KOREAN: return "ko";
CASE(kn, KANNADA); case LANG_KASHMIRI: return "ks";
CASE(ko, KOREAN); case LANG_LAO: return "lo";
CASE(ks, KASHMIRI); case LANG_LITHUANIAN: return "lt";
CASE(lo, LAO); case LANG_LATVIAN: return "lv";
CASE(lt, LITHUANIAN); case LANG_MACEDONIAN: return "mk";
CASE(lv, LATVIAN); case LANG_MALAYALAM: return "ml";
CASE(mk, MACEDONIAN); case LANG_MONGOLIAN: return "mn";
CASE(ml, MALAYALAM); case LANG_MARATHI: return "mr";
CASE(mn, MONGOLIAN); case LANG_MALAY: return "ms";
CASE(mr, MARATHI); case LANG_MALTESE: return "mt";
CASE(ms, MALAY); case LANG_NEPALI: return "ne";
CASE(mt, MALTESE); case LANG_DUTCH: return "nl";
CASE(ne, NEPALI); case LANG_SOTHO: return "ns";
CASE(nl, DUTCH); case LANG_ORIYA: return "or";
CASE(ns, SOTHO); case LANG_PUNJABI: return "pa";
CASE(or, ORIYA); case LANG_POLISH: return "pl";
CASE(pa, PUNJABI); case LANG_PORTUGUESE: return "pt";
CASE(pl, POLISH); case LANG_ROMANSH: return "rm";
CASE(pt, PORTUGUESE); case LANG_ROMANIAN: return "ro";
CASE(rm, ROMANSH); case LANG_RUSSIAN: return "ru";
CASE(ro, ROMANIAN); case LANG_KINYARWANDA: return "rw";
CASE(ru, RUSSIAN); case LANG_SANSKRIT: return "sa";
CASE(rw, KINYARWANDA); case LANG_UPPER_SORBIAN: return "sb";
CASE(sa, SANSKRIT); case LANG_SINDHI: return "sd";
CASE(sb, UPPER_SORBIAN); case LANG_SLOVAK: return "sk";
CASE(sd, SINDHI); case LANG_SLOVENIAN: return "sl";
CASE(sk, SLOVAK); case LANG_ALBANIAN: return "sq";
CASE(sl, SLOVENIAN); case LANG_SWEDISH: return "sv";
CASE(sq, ALBANIAN); case LANG_SWAHILI: return "sw";
CASE(sv, SWEDISH); case LANG_TAMIL: return "ta";
CASE(sw, SWAHILI); case LANG_TELUGU: return "te";
CASE(ta, TAMIL); case LANG_TAJIK: return "tg";
CASE(te, TELUGU); case LANG_THAI: return "th";
CASE(tg, TAJIK); case LANG_TIGRIGNA: return "ti";
CASE(th, THAI); case LANG_TSWANA: return "tn";
CASE(ti, TIGRIGNA); case LANG_TURKISH: return "tr";
CASE(tn, TSWANA); case LANG_TATAR: return "tt";
CASE(tr, TURKISH); case LANG_UKRAINIAN: return "uk";
CASE(tt, TATAR); case LANG_URDU: return "ur";
CASE(uk, UKRAINIAN); case LANG_UZBEK: return "uz";
CASE(ur, URDU); case LANG_VIETNAMESE: return "vi";
CASE(uz, UZBEK); case LANG_XHOSA: return "xh";
CASE(vi, VIETNAMESE); case LANG_CHINESE: return "zh";
CASE(xh, XHOSA); case LANG_ZULU: return "zu";
CASE(zh, CHINESE);
CASE(zu, ZULU);
#undef CASE
/* Special cases */ /* Special cases */
default: default:
switch (langid) { switch (langid) {
case MAKELANGID(LANG_SERBIAN, 0x05): return "bs"; case MAKELANGID(LANG_SERBIAN, 0x05): return "bs";
#define CASE(name, primary, sub) \ case MAKELANGID(LANG_SERBIAN, SUBLANG_DEFAULT): return "hr";
case MAKELANGID(LANG_##primary, SUBLANG_##sub): return #name case MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL): return "nb";
case MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_NYNORSK): return "nn";
CASE(hr, SERBIAN, DEFAULT); case MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_LATIN): return "sh";
CASE(nb, NORWEGIAN, NORWEGIAN_BOKMAL); case MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_CYRILLIC): return "sr";
CASE(nn, NORWEGIAN, NORWEGIAN_NYNORSK);
CASE(sh, SERBIAN, SERBIAN_LATIN);
CASE(sr, SERBIAN, SERBIAN_CYRILLIC);
#undef CASE
default: return 0; default: return 0;
} }
} }