Commit aee6f211 authored by Roland Levillain's avatar Roland Levillain

- src/parser.y (STATIC_STRLEN, IS_TOKEN, EAT): Protect macros

from side effects.
parent 6193da53
2006-02-07 Roland Levillain <roland@lrde.epita.fr>
* src/parser.y (STATIC_STRLEN, IS_TOKEN, EAT): Protect macros
from side effects.
2006-02-06 Roland Levillain <roland@lrde.epita.fr>
Remove hard-coded numeric values.
......
......@@ -144,18 +144,18 @@ optvarname: /* empty */ { $$ = NULL; }
%%
#define STATIC_STRLEN(Literal_Str) \
sizeof (Literal_Str) - 1
(sizeof (Literal_Str) - 1)
/* A call to strcmp() bounded by the length of LITERAL_STR. */
#define BOUND_STRCMP(Str, Literal_Str) \
strncmp (Str, Literal_Str, STATIC_STRLEN (Literal_Str))
#define IS_TOKEN(Token, Str) \
!BOUND_STRCMP(Str, Token) && \
isspace (*((Str) + STATIC_STRLEN (Token)))
(!BOUND_STRCMP(Str, Token) && \
isspace (*((Str) + STATIC_STRLEN (Token))))
#define EAT(Token, Str) \
Str += STATIC_STRLEN (Token)
(Str += STATIC_STRLEN (Token))
#define LASTINPUT ((File *) g_list_last (inputs)->data)
......
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