]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
Fixed another possible implementation specific bug thanks to this progressive splint...
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index ee8fd4a4f82552d9520fd4d44085ac1b8d218043..43182c335ae93ef94bf262ce82c065375a9b1423 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -736,6 +736,8 @@ static bool lex_finish_frames(lex_file *lex)
         vec_shrinkto(lex->tok.value, 0);
         vec_push(lex->frames, m);
     } while (true);
+
+    return false;
 }
 
 static int GMQCC_WARN lex_finish_string(lex_file *lex, int quote)
@@ -858,7 +860,7 @@ static int GMQCC_WARN lex_finish_string(lex_file *lex, int quote)
                     }
                 }
                 if (OPTS_FLAG(UTF8) && ch >= 128) {
-                    u8len = u8_fromchar((Uchar)ch, u8buf, sizeof(u8buf));
+                    u8len = u8_fromchar((uchar_t)ch, u8buf, sizeof(u8buf));
                     if (!u8len)
                         ch = 0;
                     else {
@@ -1427,10 +1429,13 @@ int lex_do(lex_file *lex)
         else
         {
             if (!lex->flags.preprocessing && strlen(lex->tok.value) > 1) {
-                Uchar u8char;
+                uchar_t u8char;
                 /* check for a valid utf8 character */
                 if (!OPTS_FLAG(UTF8) || !u8_analyze(lex->tok.value, NULL, NULL, &u8char, 8)) {
-                    if (lexwarn(lex, WARN_MULTIBYTE_CHARACTER, "multibyte character: `%s`", lex->tok.value))
+                    if (lexwarn(lex, WARN_MULTIBYTE_CHARACTER,
+                                ( OPTS_FLAG(UTF8) ? "invalid multibyte character sequence `%s`"
+                                                  : "multibyte character: `%s`" ),
+                                lex->tok.value))
                         return (lex->tok.ttype = TOKEN_ERROR);
                 }
                 else