diff --git a/src/libs/cp866/cp866.c b/src/libs/cp866/cp866.c
index 90d1bbdd643dd7c2708a4f23ec66011ce8a9f16f..b8ce2a451b5c6e82f2b36779c7f3ca1ce391e63e 100644 (file)
--- a/src/libs/cp866/cp866.c
+++ b/src/libs/cp866/cp866.c
+/* Copyright (C) 2020 SovietPony
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License ONLY.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include "cp866.h"
-int cp866_isalpha (char c) {
- unsigned char ch = c;
+int cp866_isalpha (int ch) {
return (ch >= 0x41 && ch <= 0x5A) || (ch >= 0x61 && ch <= 0x7A) || (ch >= 0x80 && ch <= 0xAF) || (ch >= 0xE0 && ch <= 0xF7);
}
-int cp866_isupper (char c) {
- unsigned char ch = c;
+int cp866_isupper (int ch) {
return (ch >= 0x41 && ch <= 0x5A) || (ch >= 0x80 && ch <= 0x9F) || ch == 0xF0 || ch == 0xF2 || ch == 0xF4 || ch == 0xF6;
}
-int cp866_islower (char c) {
- unsigned char ch = c;
+int cp866_islower (int ch) {
return (ch >= 0x61 && ch <= 0x7A) || (ch >= 0xA0 && ch <= 0xAF) || (ch >= 0xE0 && ch <= 0xEF) || ch == 0xF1 || ch == 0xF3 || ch == 0xF5 || ch == 0xF7;
}
-char cp866_toupper (char c) {
- unsigned char ch = c;
+int cp866_toupper (int ch) {
if (ch >= 0x61 && ch <= 0x7A) {
return ch - 0x61 + 0x41;
} else if (ch >= 0xA0 && ch <= 0xAF) {
}
}
-char cp866_tolower (char c) {
- unsigned char ch = c;
+int cp866_tolower (int ch) {
if (ch >= 0x41 && ch <= 0x5A) {
return ch - 0x41 + 0x61;
} else if (ch >= 0x80 && ch <= 0x8F) {
return i == 0 ? 0 : *(const unsigned char *)aa - *(const unsigned char *)bb;
}
-int cp866_ctou (char c) {
- unsigned char ch = c;
+int cp866_ctou (int ch) {
switch (ch) {
case 0xB0: return 0x2591;
case 0xB1: return 0x2592;
}
}
-int cp866_ctoug (char c) {
- unsigned char ch = c;
+int cp866_ctoug (int ch) {
switch (ch) {
case 0x00: return 0x0000;
case 0x01: return 0x263A;