--- linuxsampler/trunk/src/scriptvm/scanner.l 2016/07/15 20:07:47 2951 +++ linuxsampler/trunk/src/scriptvm/scanner.l 2017/05/31 21:07:44 3260 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 Christian Schoenebeck and Andreas Persson + * Copyright (c) 2014-2017 Christian Schoenebeck and Andreas Persson * * http://www.linuxsampler.org * @@ -48,6 +48,11 @@ #define SCANNER_ERR(txt) scanner_error(yylloc, yyextra, txt) #define SCANNER_WRN(txt) scanner_warning(yylloc, yyextra, txt) +// shut up warning that 'register' keyword is deprecated as of C++11 +#if defined(__cplusplus) && __cplusplus >= 201103L +# define register +#endif + using namespace LinuxSampler; static int countNewLineChars(const char* txt) { @@ -58,7 +63,7 @@ } static int countCharsPastLastNewLine(const char* txt) { - const int n = strlen(txt); + const int n = (int)strlen(txt); for (int i = n - 1; i >= 0; --i) if (txt[i] == '\n') return n - i - 1; @@ -243,6 +248,7 @@ "mod" return MOD; "function" return FUNCTION; "call" return CALL; +"synchronized" return SYNCHRONIZED; [&,()[\]<>=*+#/-] { return *yytext; @@ -273,7 +279,10 @@ [ \t\r]+ /* eat up whitespace */ -. printf( "Unrecognized character: '%s' (line %d, column %d)\n", yytext, yylineno, yycolumn); +. { + printf( "Unrecognized character: '%s' (line %d, column %d)\n", yytext, yylineno, yycolumn); + return UNKNOWN_CHAR; +} %%