Commit aa1b7f38 authored by Alexander Korotkov's avatar Alexander Korotkov

Apply const qualifier to keywords of jsonpath_scan.l

Discussion: https://postgr.es/m/CAEeOP_a-Pfy%3DU9-f%3DgQ0AsB8FrxrC8xCTVq%2BeO71-2VoWP5cag%40mail.gmail.com
Author: Mark G
parent c183a07f
...@@ -284,10 +284,10 @@ jsonpath_yyerror(JsonPathParseResult **result, const char *message) ...@@ -284,10 +284,10 @@ jsonpath_yyerror(JsonPathParseResult **result, const char *message)
typedef struct keyword typedef struct keyword
{ {
int16 len; int16 len;
bool lowercase; bool lowercase;
int val; int val;
char *keyword; const char *keyword;
} keyword; } keyword;
/* /*
...@@ -295,7 +295,7 @@ typedef struct keyword ...@@ -295,7 +295,7 @@ typedef struct keyword
* alphabetical order * alphabetical order
*/ */
static keyword keywords[] = { static const keyword keywords[] = {
{ 2, false, IS_P, "is"}, { 2, false, IS_P, "is"},
{ 2, false, TO_P, "to"}, { 2, false, TO_P, "to"},
{ 3, false, ABS_P, "abs"}, { 3, false, ABS_P, "abs"},
...@@ -322,11 +322,11 @@ static keyword keywords[] = { ...@@ -322,11 +322,11 @@ static keyword keywords[] = {
static int static int
checkSpecialVal() checkSpecialVal()
{ {
int res = IDENT_P; int res = IDENT_P;
int diff; int diff;
keyword *StopLow = keywords, const keyword *StopLow = keywords,
*StopHigh = keywords + lengthof(keywords), *StopHigh = keywords + lengthof(keywords),
*StopMiddle; *StopMiddle;
if (scanstring.len > keywords[lengthof(keywords) - 1].len) if (scanstring.len > keywords[lengthof(keywords) - 1].len)
return res; return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment