[Scummvm-git-logs] scummvm master -> ca54a720721d1ffb827b1573da7857b75227c1df

whiterandrek whiterandrek at gmail.com
Sun Aug 5 20:59:56 CEST 2018


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9948b2452f COMMON: named CodePage enum
ca54a72072 COMMON: made code pages conversion arrays static and constant


Commit: 9948b2452f61ff0b9af0132822ab17de2655bbda
    https://github.com/scummvm/scummvm/commit/9948b2452f61ff0b9af0132822ab17de2655bbda
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2018-08-05T21:53:31+03:00

Commit Message:
COMMON: named CodePage enum

Changed paths:
    common/ustr.cpp
    common/ustr.h


diff --git a/common/ustr.cpp b/common/ustr.cpp
index f314eb1..c3dbdb3 100644
--- a/common/ustr.cpp
+++ b/common/ustr.cpp
@@ -428,9 +428,9 @@ uint32 g_windows1255ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0192, 0x201E,
 										 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
 										 0x05E8, 0x05E9, 0x05EA, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x00FF};
 
-U32String convertToU32String(const char *str, uint codePage) {
+U32String convertToU32String(const char *str, CodePage page) {
 	const String string(str);
-	if (codePage == kAscii) {
+	if (page == kAscii) {
 		return convertUtf8ToUtf32(string);
 	}
 
@@ -443,7 +443,7 @@ U32String convertToU32String(const char *str, uint codePage) {
 
 		byte index = string[i] - 0x80;
 
-		switch (codePage) {
+		switch (page) {
 		case kWindows1250:
 			unicodeString += g_windows1250ConversionTable[index];
 			break;
diff --git a/common/ustr.h b/common/ustr.h
index 57657c9..219d462 100644
--- a/common/ustr.h
+++ b/common/ustr.h
@@ -195,7 +195,7 @@ private:
 
 U32String convertUtf8ToUtf32(const String &str);
 
-enum {
+enum CodePage {
 	kAscii,
 	kWindows1250,
 	kWindows1251,
@@ -203,7 +203,7 @@ enum {
 	kWindows1255
 };
 
-U32String convertToU32String(const char *str, uint codePage = kAscii);
+U32String convertToU32String(const char *str, CodePage page = kAscii);
 
 } // End of namespace Common
 


Commit: ca54a720721d1ffb827b1573da7857b75227c1df
    https://github.com/scummvm/scummvm/commit/ca54a720721d1ffb827b1573da7857b75227c1df
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2018-08-05T21:57:36+03:00

Commit Message:
COMMON: made code pages conversion arrays static and constant

Changed paths:
    common/ustr.cpp


diff --git a/common/ustr.cpp b/common/ustr.cpp
index c3dbdb3..b6845b2 100644
--- a/common/ustr.cpp
+++ b/common/ustr.cpp
@@ -360,7 +360,7 @@ U32String convertUtf8ToUtf32(const String &str) {
 	return u32str;
 }
 
-uint32 g_windows1250ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0083, 0x201E, 0x2026, 0x2020, 0x2021,
+static const uint32 g_windows1250ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0083, 0x201E, 0x2026, 0x2020, 0x2021,
 										 0x0088, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
 										 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
 										 0x0098, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
@@ -377,7 +377,7 @@ uint32 g_windows1250ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0083, 0x201E,
 										 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7,
 										 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9};
 
-uint32 g_windows1251ConversionTable[] = {0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
+static const uint32 g_windows1251ConversionTable[] = {0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
 										 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
 										 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
 										 0x0098, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
@@ -394,7 +394,7 @@ uint32 g_windows1251ConversionTable[] = {0x0402, 0x0403, 0x201A, 0x0453, 0x201E,
 										 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
 										 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F};
 
-uint32 g_windows1252ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
+static const uint32 g_windows1252ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
 										 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F,
 										 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
 										 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178,
@@ -411,7 +411,7 @@ uint32 g_windows1252ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0192, 0x201E,
 										 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
 										 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF};
 
-uint32 g_windows1255ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
+static const uint32 g_windows1255ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
 										 0x02C6, 0x2030, 0x008A, 0x2039, 0x008C, 0x008D, 0x008E, 0x008F,
 										 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
 										 0x02DC, 0x2122, 0x009A, 0x203A, 0x009C, 0x009D, 0x009E, 0x009F,





More information about the Scummvm-git-logs mailing list