aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/unarj.cpp8
-rw-r--r--common/unarj.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/common/unarj.cpp b/common/unarj.cpp
index 64203d5c66..58f326c1ac 100644
--- a/common/unarj.cpp
+++ b/common/unarj.cpp
@@ -550,7 +550,7 @@ void ArjFile::decode() {
r = 0;
while (count < _origsize) {
- if ((c = decode_c()) <= UCHAR_MAX) {
+ if ((c = decode_c()) <= ARJ_UCHAR_MAX) {
_text[r] = (byte) c;
count++;
if (++r >= DDICSIZ) {
@@ -558,7 +558,7 @@ void ArjFile::decode() {
_outstream->write(_text, DDICSIZ);
}
} else {
- j = c - (UCHAR_MAX + 1 - THRESHOLD);
+ j = c - (ARJ_UCHAR_MAX + 1 - THRESHOLD);
count += j;
i = decode_p();
if ((i = r - i - 1) < 0)
@@ -591,7 +591,7 @@ void ArjFile::decode() {
#define GETBITS(c,l) {if(_getlen<l)BFIL c=(uint16)_getbuf>>(CODE_BIT-l);BPUL(l)}
int16 ArjFile::decode_ptr() {
- int16 c;
+ int16 c = 0;
int16 width;
int16 plus;
int16 pwr;
@@ -612,7 +612,7 @@ int16 ArjFile::decode_ptr() {
}
int16 ArjFile::decode_len() {
- int16 c;
+ int16 c = 0;
int16 width;
int16 plus;
int16 pwr;
diff --git a/common/unarj.h b/common/unarj.h
index 28424f70bd..289ab52ad0 100644
--- a/common/unarj.h
+++ b/common/unarj.h
@@ -44,13 +44,13 @@ namespace Common {
#define CODE_BIT 16
#define CHAR_BIT 8
-#define UCHAR_MAX 255
+#define ARJ_UCHAR_MAX 255 // UCHAR_MAX is defined in limits.h in MSVC
#define THRESHOLD 3
#define DDICSIZ 26624
#define MAXDICBIT 16
#define MATCHBIT 8
#define MAXMATCH 256
-#define NC (UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
+#define NC (ARJ_UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
#define NP (MAXDICBIT + 1)
#define CBIT 9
#define NT (CODE_BIT + 3)