Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tiger
monoburg
Commits
aee6f211
Commit
aee6f211
authored
Feb 07, 2006
by
Roland Levillain
Browse files
- src/parser.y (STATIC_STRLEN, IS_TOKEN, EAT): Protect macros
from side effects.
parent
6193da53
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
aee6f211
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.
...
...
src/parser.y
View file @
aee6f211
...
...
@@ -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)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment