Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
b036dd91
Commit
b036dd91
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Using parenthesis around pointer macro values.
parent
8e1e5c9c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/gen_defs.h
+15
-15
15 additions, 15 deletions
src/xpdev/gen_defs.h
with
15 additions
and
15 deletions
src/xpdev/gen_defs.h
+
15
−
15
View file @
b036dd91
...
...
@@ -186,23 +186,23 @@ typedef struct {
#define SAFECOPY(dst,src) sprintf(dst,"%.*s",(int)sizeof(dst)-1,src)
/* Replace every occurance of c1 in str with c2, using p as a temporary char pointer */
#define REPLACE_CHARS(str,c1,c2,p) for(
p
=(str);*
p;p
++) if(*
p
==(c1)) *
p
=(c2);
#define REPLACE_CHARS(str,c1,c2,p) for(
(p)
=(str);*
(p);(p)
++) if(*
(p)
==(c1)) *
(p)
=(c2);
/* ASCIIZ char* parsing helper macros */
#define SKIP_WHITESPACE(p) while(*
p
&& isspace(*p))
p
++;
#define FIND_WHITESPACE(p) while(*
p
&& !isspace(*
p
))
p
++;
#define SKIP_CHAR(p,c) while(*
p
==c)
p
++;
#define FIND_CHAR(p,c) while(*
p
&& *
p
!=c)
p
++;
#define SKIP_CHARSET(p,s) while(*
p
&& strchr(s,*p)!=NULL)
p
++;
#define FIND_CHARSET(p,s) while(*
p
&& strchr(s,*p)==NULL)
p
++;
#define SKIP_ALPHA(p) while(*
p
&& isalpha(*p))
p
++;
#define FIND_ALPHA(p) while(*
p
&& !isalpha(*
p
))
p
++;
#define SKIP_ALPHANUMERIC(p) while(*
p
&& isalnum(*p))
p
++;
#define FIND_ALPHANUMERIC(p) while(*
p
&& !isalnum(*
p
))
p
++;
#define SKIP_DIGIT(p) while(*
p
&& isdigit(*p))
p
++;
#define FIND_DIGIT(p) while(*
p
&& !isdigit(*
p
))
p
++;
#define SKIP_HEXDIGIT(p) while(*
p
&& isxdigit(*
p
))
p
++;
#define FIND_HEXDIGIT(p) while(*
p
&& !isxdigit(*
p
))
p
++;
#define SKIP_WHITESPACE(p) while(*
(p)
&& isspace(*
(
p))
)
(p)
++;
#define FIND_WHITESPACE(p) while(*
(p)
&& !isspace(*
(p)
))
(p)
++;
#define SKIP_CHAR(p,c) while(*
(p)
==c)
(p)
++;
#define FIND_CHAR(p,c) while(*
(p)
&& *
(p)
!=c)
(p)
++;
#define SKIP_CHARSET(p,s) while(*
(p)
&& strchr(s,*
(
p)
)
!=NULL)
(p)
++;
#define FIND_CHARSET(p,s) while(*
(p)
&& strchr(s,*
(
p)
)
==NULL)
(p)
++;
#define SKIP_ALPHA(p) while(*
(p)
&& isalpha(*
(
p))
)
(p)
++;
#define FIND_ALPHA(p) while(*
(p)
&& !isalpha(*
(p)
))
(p)
++;
#define SKIP_ALPHANUMERIC(p) while(*
(p)
&& isalnum(*
(
p))
)
(p)
++;
#define FIND_ALPHANUMERIC(p) while(*
(p)
&& !isalnum(*
(p)
))
(p)
++;
#define SKIP_DIGIT(p) while(*
(p)
&& isdigit(*
(
p))
)
(p)
++;
#define FIND_DIGIT(p) while(*
(p)
&& !isdigit(*
(p)
))
(p)
++;
#define SKIP_HEXDIGIT(p) while(*
(p)
&& isxdigit(*
(p)
))
(p)
++;
#define FIND_HEXDIGIT(p) while(*
(p)
&& !isxdigit(*
(p)
))
(p)
++;
/****************************************************************************/
/* MALLOC/FREE Macros for various compilers and environments */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment