Fixes for ISO C89

This commit is contained in:
William S Fulton 2022-03-28 09:15:57 +01:00
commit 2ded25d138
3 changed files with 4 additions and 3 deletions

View file

@ -955,6 +955,7 @@ int yylex(void) {
} else {
/* SWIG directives */
String *stext = 0;
if (strcmp(yytext, "%module") == 0)
return (MODULE);
if (strcmp(yytext, "%insert") == 0)
@ -1041,7 +1042,7 @@ int yylex(void) {
* the operator.
*/
cparse_unknown_directive = NewString(yytext);
String *stext = NewString(yytext + 1);
stext = NewString(yytext + 1);
Seek(stext,0,SEEK_SET);
Setfile(stext,cparse_file);
Setline(stext,cparse_line);

View file

@ -1101,6 +1101,7 @@ static int name_regexmatch_value(Node *n, String *pattern, String *s) {
int errornum;
size_t errpos;
int rc;
pcre2_match_data *match_data = 0;
compiled_pat = pcre2_compile((PCRE2_SPTR8)Char(pattern), PCRE2_ZERO_TERMINATED, 0, &errornum, &errpos, NULL);
if (!compiled_pat) {
@ -1111,7 +1112,6 @@ static int name_regexmatch_value(Node *n, String *pattern, String *s) {
Exit(EXIT_FAILURE);
}
pcre2_match_data *match_data = 0;
match_data = pcre2_match_data_create_from_pattern (compiled_pat, NULL);
rc = pcre2_match(compiled_pat, (PCRE2_SPTR8)Char(s), PCRE2_ZERO_TERMINATED, 0, 0, match_data, 0);
pcre2_code_free(compiled_pat);

View file

@ -80,6 +80,7 @@ static void print_indent(int l) {
void Swig_print_node(Node *obj) {
Iterator ki;
Node *cobj;
List *keys = Keys(obj);
print_indent(0);
if (debug_quiet)
@ -87,7 +88,6 @@ void Swig_print_node(Node *obj) {
else
Printf(stdout, "+++ %s - %p ----------------------------------------\n", nodeType(obj), obj);
List *keys = Keys(obj);
SortList(keys, 0);
ki = First(keys);
while (ki.item) {