aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/level9
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/level9')
-rw-r--r--engines/glk/level9/detection.cpp10
-rw-r--r--engines/glk/level9/os_glk.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/engines/glk/level9/detection.cpp b/engines/glk/level9/detection.cpp
index a366bc0f9b..fef1baec46 100644
--- a/engines/glk/level9/detection.cpp
+++ b/engines/glk/level9/detection.cpp
@@ -542,8 +542,8 @@ gln_game_tableref_t GameDetection::gln_gameid_identify_game() {
&& _startData[21] == _startData[23];
length = is_version2
- ? _startData[28] | _startData[29] << BITS_PER_CHAR
- : _startData[0] | _startData[1] << BITS_PER_CHAR;
+ ? _startData[28] | _startData[29] << BITS_PER_BYTE
+ : _startData[0] | _startData[1] << BITS_PER_BYTE;
if (length >= _fileSize)
return nullptr;
@@ -596,7 +596,7 @@ uint16 GameDetection::gln_get_buffer_crc(const void *void_buffer, size_t length,
int bit;
crc = (uint16)index;
- for (bit = 0; bit < BITS_PER_CHAR; bit++)
+ for (bit = 0; bit < BITS_PER_BYTE; bit++)
crc = crc & 1 ? GLN_CRC_POLYNOMIAL ^ (crc >> 1) : crc >> 1;
_crcTable[index] = crc;
@@ -611,11 +611,11 @@ uint16 GameDetection::gln_get_buffer_crc(const void *void_buffer, size_t length,
/* Start with zero in the crc, then update using table entries. */
crc = 0;
for (index = 0; index < length; index++)
- crc = _crcTable[(crc ^ buffer[index]) & BYTE_MAX] ^ (crc >> BITS_PER_CHAR);
+ crc = _crcTable[(crc ^ buffer[index]) & BYTE_MAX] ^ (crc >> BITS_PER_BYTE);
/* Add in any requested NUL padding bytes. */
for (index = 0; index < padding; index++)
- crc = _crcTable[crc & BYTE_MAX] ^ (crc >> BITS_PER_CHAR);
+ crc = _crcTable[crc & BYTE_MAX] ^ (crc >> BITS_PER_BYTE);
return crc;
}
diff --git a/engines/glk/level9/os_glk.h b/engines/glk/level9/os_glk.h
index d617fb37c3..a4880b9a2d 100644
--- a/engines/glk/level9/os_glk.h
+++ b/engines/glk/level9/os_glk.h
@@ -26,8 +26,8 @@
namespace Glk {
namespace Level9 {
-#define BYTE_MAX 0xff
-#define BITS_PER_CHAR 8
+enum { BYTE_MAX = 0xff };
+enum { BITS_PER_BYTE = 8 };
extern bool gln_graphics_enabled;
extern bool gln_graphics_possible;