diff options
| author | Christian Göttsche | 2024-05-29 20:38:23 +0200 |
|---|---|---|
| committer | jvoisin | 2024-06-06 16:27:35 +0200 |
| commit | f40955e03cd361966f927acfaa477cfceb8930e5 (patch) | |
| tree | be4213dd027ea2a8f0784068c5c84e2b5fd837ef /src/sp_config_scanner.h | |
| parent | d82ab8d20191a9ebdb83f918c62fc6c32f068b01 (diff) | |
Avoid dropping const qualifier in casts
Adjusts casts to void dropping const qualifiers. This helps to avoid
mistakes, e.g. modifying string literals.
Also use size_t for length, similar to the upstream php interfaces.
Diffstat (limited to 'src/sp_config_scanner.h')
| -rw-r--r-- | src/sp_config_scanner.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sp_config_scanner.h b/src/sp_config_scanner.h index 71f8f7e..560ea6e 100644 --- a/src/sp_config_scanner.h +++ b/src/sp_config_scanner.h | |||
| @@ -10,9 +10,9 @@ typedef enum { | |||
| 10 | } sp_argtype; | 10 | } sp_argtype; |
| 11 | 11 | ||
| 12 | typedef struct { | 12 | typedef struct { |
| 13 | char *kw; // keyword points directly to the parsed input text and as such is not null-terminated | 13 | const char *kw; // keyword points directly to the parsed input text and as such is not null-terminated |
| 14 | size_t kwlen; | 14 | size_t kwlen; |
| 15 | char *arg; // optional argument / can be not null terminated | 15 | const char *arg; // optional argument / can be not null terminated |
| 16 | size_t arglen; | 16 | size_t arglen; |
| 17 | sp_argtype argtype; | 17 | sp_argtype argtype; |
| 18 | long lineno; | 18 | long lineno; |
