GLK: MAGNETIC: Compilation fix

This commit is contained in:
Paul Gilbert
2019-11-22 21:15:20 -08:00
parent 852e359277
commit 09b33cdc86
4 changed files with 11 additions and 11 deletions
+5 -5
View File
@@ -182,7 +182,7 @@ GMS_HINT_DEFAULT_HEIGHT = 25;
* quit from hints subsystem.
*/
static const type16 GMS_HINT_ROOT_NODE = 0,
GMS_HINTS_DONE = UINT16_MAX;
GMS_HINTS_DONE = UINT16_MAX_VAL;
/* Generic hint topic for the root hints node. */
static const char *const GMS_GENERIC_TOPIC = "Hints Menu";
@@ -289,7 +289,7 @@ glui32 Magnetic::gms_get_buffer_crc(const void *void_buffer, size_t length) {
*/
crc = 0xffffffff;
for (index = 0; index < length; index++)
crc = crc_table[(crc ^ buf[index]) & BYTE_MAX] ^ (crc >> BITS_PER_BYTE);
crc = crc_table[(crc ^ buf[index]) & BYTE_MAX_VAL] ^ (crc >> BITS_PER_BYTE);
return crc ^ 0xffffffff;
}
@@ -554,7 +554,7 @@ gms_gammaref_t Magnetic::gms_graphics_equal_contrast_gamma(type16 palette[], lon
assert(palette && color_usage);
result = NULL;
lowest_variance = INT32_MAX;
lowest_variance = INT32_MAX_VAL;
/* Search the gamma table for the entry with the lowest contrast variance. */
for (gamma = GMS_GAMMA_TABLE; gamma->level; gamma++) {
@@ -2345,7 +2345,7 @@ type16 Magnetic::gms_hint_handle_folder(const ms_hint hints_[],
response = 'Q';
break;
default:
response = keycode <= BYTE_MAX ? glk_char_to_upper(keycode) : 0;
response = keycode <= BYTE_MAX_VAL ? glk_char_to_upper(keycode) : 0;
break;
}
@@ -2406,7 +2406,7 @@ type16 Magnetic::gms_hint_handle_text(const ms_hint hints_[],
response = 'Q';
break;
default:
response = keycode <= BYTE_MAX ? glk_char_to_upper(keycode) : 0;
response = keycode <= BYTE_MAX_VAL ? glk_char_to_upper(keycode) : 0;
break;
}
+2 -2
View File
@@ -79,7 +79,7 @@ Magnetic::Magnetic(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(s
undo_stat[0] = undo_stat[1] = 0;
Common::fill(&buffer[0], &buffer[80], 0);
Common::fill(&filename[0], &filename[256], 0);
Common::fill(&crc_table[0], &crc_table[BYTE_MAX + 1], 0);
Common::fill(&crc_table[0], &crc_table[BYTE_MAX_VAL + 1], 0);
#ifndef NO_ANIMATION
Common::fill(&pos_table_count[0], &pos_table_count[MAX_POSITIONS], 0);
@@ -131,7 +131,7 @@ void Magnetic::initializeCRC() {
const glui32 GMS_CRC_POLYNOMIAL = 0xedb88320;
uint32 crc;
for (uint index = 0; index < BYTE_MAX + 1; ++index) {
for (uint index = 0; index < BYTE_MAX_VAL + 1; ++index) {
int bit;
crc = index;
+1 -1
View File
@@ -262,7 +262,7 @@ private:
Common::DumpFile *log1, *log2;
private:
/* Method local statics in original code */
glui32 crc_table[BYTE_MAX + 1];
glui32 crc_table[BYTE_MAX_VAL + 1];
int luminance_weighting;
gms_gammaref_t linear_gamma;
uint32 pic_current_crc; /* CRC of the current picture */
+3 -3
View File
@@ -42,10 +42,10 @@ typedef int16 type16s;
typedef uint32 type32;
typedef int32 type32s;
enum { BYTE_MAX = 255 };
enum { BYTE_MAX_VAL = 255 };
enum { BITS_PER_BYTE = 8 };
enum { UINT16_MAX = 0xffff };
enum { INT32_MAX = 0x7fffffff };
enum { UINT16_MAX_VAL = 0xffff };
enum { INT32_MAX_VAL = 0x7fffffff };
#define MAX_HINTS 260
#define MAX_HCONTENTS 30000