aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-12-02 10:53:18 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit7212924b1ead017b4c769ca4fb8cdad6bf95e78e (patch)
tree08e1e9970932ecd9e4e7f002cfa70f8ac4bd9edc
parentc68542dba8ecf7a9ad061c015061832eaa4bb016 (diff)
downloadscummvm-rg350-7212924b1ead017b4c769ca4fb8cdad6bf95e78e.tar.gz
scummvm-rg350-7212924b1ead017b4c769ca4fb8cdad6bf95e78e.tar.bz2
scummvm-rg350-7212924b1ead017b4c769ca4fb8cdad6bf95e78e.zip
GLK: TADS: Compilation fixes
-rw-r--r--engines/glk/picture.cpp3
-rw-r--r--engines/glk/tads/tads2/ler.cpp2
-rw-r--r--engines/glk/tads/tads2/os.cpp6
-rw-r--r--engines/glk/tads/tads2/regex.cpp9
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