diff options
-rw-r--r-- | engines/glk/picture.cpp | 3 | ||||
-rw-r--r-- | engines/glk/tads/tads2/ler.cpp | 2 | ||||
-rw-r--r-- | engines/glk/tads/tads2/os.cpp | 6 | ||||
-rw-r--r-- | engines/glk/tads/tads2/regex.cpp | 9 |
4 files changed, 13 insertions, 7 deletions
diff --git a/engines/glk/picture.cpp b/engines/glk/picture.cpp index 4422e46710..631f9bed6c 100644 --- a/engines/glk/picture.cpp +++ b/engines/glk/picture.cpp @@ -146,7 +146,8 @@ Picture *Pictures::load(uint32 id) { pal[idx] = pic->format.RGBToColor(palette[idx * 3], palette[idx * 3 + 1], palette[idx * 3 + 2]); - byte *srcP = (byte *)img->getPixels(), *destP = (byte *)pic->getPixels(); + const byte *srcP = (const byte *)img->getPixels(); + byte *destP = (byte *)pic->getPixels(); for (int idx = 0; idx < img->w * img->h; ++idx, srcP++, destP += pic->format.bytesPerPixel) { uint val = (*srcP >= palCount) ? 0 : pal[*srcP]; if (pic->format.bytesPerPixel == 2) diff --git a/engines/glk/tads/tads2/ler.cpp b/engines/glk/tads/tads2/ler.cpp index 930fdf02a1..970fe31d67 100644 --- a/engines/glk/tads/tads2/ler.cpp +++ b/engines/glk/tads/tads2/ler.cpp @@ -33,7 +33,7 @@ int errcxdef::errfmt(char *outbuf, int outbufl, char *fmt, int argc, erradef *ar int argi = 0; int len; char buf[20]; - char *p = nullptr; + const char *p = nullptr; char fmtchar; while (*fmt != '\0' && outbufl > 1) { diff --git a/engines/glk/tads/tads2/os.cpp b/engines/glk/tads/tads2/os.cpp index 514a912bd5..17bdc346e5 100644 --- a/engines/glk/tads/tads2/os.cpp +++ b/engines/glk/tads/tads2/os.cpp @@ -51,6 +51,7 @@ glui32 OS::oss_convert_file_type(int type) { } glui32 OS::oss_convert_fileref_to_string(frefid_t file_to_convert, char *buffer, int buf_len) { +#ifdef TODO char temp_string[32]; glui32 value, i = 0, digit, digit_flag = false, // Have we put a digit in the string yet? @@ -74,10 +75,12 @@ glui32 OS::oss_convert_fileref_to_string(frefid_t file_to_convert, char *buffer, return false; sprintf(buffer, "%s%s%s", OSS_FILEREF_STRING_PREFIX, temp_string, OSS_FILEREF_STRING_SUFFIX); +#endif return true; } frefid_t OS::oss_convert_string_to_fileref(char *buffer, glui32 usage) { +#ifdef TODO char temp_string[32]; glui32 value = 0, i, multiplier = 1; @@ -97,6 +100,9 @@ frefid_t OS::oss_convert_string_to_fileref(char *buffer, glui32 usage) { // If not, return the new fileref return (glk_fileref_create_by_name(usage, os_get_root_name(buffer), 0)); +#else + return nullptr; +#endif } bool OS::oss_is_string_a_fileref(char *buffer) { diff --git a/engines/glk/tads/tads2/regex.cpp b/engines/glk/tads/tads2/regex.cpp index f6a009a0a9..d5eee3ac4a 100644 --- a/engines/glk/tads/tads2/regex.cpp +++ b/engines/glk/tads/tads2/regex.cpp @@ -1069,19 +1069,18 @@ int re_context::match(const char *entire_str, const char *str, size_t origlen, case RE_RANGE: case RE_RANGE_EXCL: { - int match; + int match_val; // make sure we have a character to match if (curlen == 0) return -1; // see if we match - match = re_is_bit_set(tuple->char_range, - (int)(unsigned char)*p); + match_val = re_is_bit_set(tuple->char_range, (int)(unsigned char)*p); // make sure we got what we wanted - if ((tuple->ch == RE_RANGE && !match) - || (tuple->ch == RE_RANGE_EXCL && match)) + if ((tuple->ch == RE_RANGE && !match_val) + || (tuple->ch == RE_RANGE_EXCL && match_val)) return -1; // skip this character of the input |