diff --git a/src/util/scanner.c b/src/util/scanner.c index f986d8e1f..c4ed04715 100644 --- a/src/util/scanner.c +++ b/src/util/scanner.c @@ -144,7 +144,7 @@ init_scanner_info(struct scanner_info *scanner_info) scan_table[index] |= info[i].bits; } else { - char *string = info[i].data.string.source; + const char *string = info[i].data.string.source; int pos = info[i].data.string.length - 1; assert(info[i].type == SCAN_STRING && pos >= 0); diff --git a/src/util/scanner.h b/src/util/scanner.h index 69cda1231..4662be292 100644 --- a/src/util/scanner.h +++ b/src/util/scanner.h @@ -42,8 +42,8 @@ struct scanner_token { enum scan_type { SCAN_RANGE, SCAN_STRING, SCAN_END }; union scan_table_data { - struct { char *source; long length; } string; - struct { unsigned char *start; long end; } range; + struct { const char *source; long length; } string; + struct { const unsigned char *start; long end; } range; }; struct scan_table_info {