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
29192d53
Commit
29192d53
authored
11 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Parenthesize the use if macro parameters in the macro body. Fixes
super-strangeness with the previously unfucked matchuser().
parent
bb0fc0ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/sbbs.h
+18
-16
18 additions, 16 deletions
src/sbbs3/sbbs.h
with
18 additions
and
16 deletions
src/sbbs3/sbbs.h
+
18
−
16
View file @
29192d53
...
...
@@ -113,7 +113,7 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
#define JSSTRING_TO_RASTRING(cx, str, ret, sizeptr, lenptr) \
{ \
size_t *JSSTSlenptr=lenptr; \
size_t *JSSTSlenptr=
(
lenptr
)
; \
size_t JSSTSlen; \
size_t JSSTSpos; \
const jschar *JSSTSstrval; \
...
...
@@ -123,9 +123,9 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
JSSTSlenptr=&JSSTSlen; \
if((str) != NULL) { \
if((JSSTSstrval=JS_GetStringCharsAndLength((cx), (str), JSSTSlenptr))) { \
if((*sizeptr < (*JSSTSlenptr+1 )) || (ret)==NULL) { \
*sizeptr = *JSSTSlenptr+1; \
if((JSSTStmpptr=(char *)realloc((ret), *sizeptr))==NULL) { \
if((*
(
sizeptr
)
< (*JSSTSlenptr+1 )) || (ret)==NULL) { \
*
(
sizeptr
)
= *JSSTSlenptr+1; \
if((JSSTStmpptr=(char *)realloc((ret), *
(
sizeptr))
)
==NULL) { \
JS_ReportError(cx, "Error reallocating %lu bytes at %s:%d", (*JSSTSlenptr)+1, getfname(__FILE__), __LINE__); \
(ret)=NULL; \
free(ret); \
...
...
@@ -143,7 +143,7 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
} \
else { \
if(ret) \
*ret=0; \
*
(
ret
)
=0; \
} \
}
...
...
@@ -155,7 +155,7 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
#define JSSTRING_TO_MSTRING(cx, str, ret, lenptr) \
{ \
size_t *JSSTSlenptr=lenptr; \
size_t *JSSTSlenptr=
(
lenptr
)
; \
size_t JSSTSlen; \
size_t JSSTSpos; \
const jschar *JSSTSstrval; \
...
...
@@ -170,7 +170,7 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
(ret)[JSSTSpos]=(char)JSSTSstrval[JSSTSpos]; \
(ret)[*JSSTSlenptr]=0; \
} \
else JS_ReportError(cx, "Error allocating %lu bytes at %s:%d", (*JSSTSlenptr)+1, getfname(__FILE__), __LINE__); \
else JS_ReportError(
(
cx
)
, "Error allocating %lu bytes at %s:%d", (*JSSTSlenptr)+1, getfname(__FILE__), __LINE__); \
} \
} \
}
...
...
@@ -183,19 +183,19 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
#define JSSTRING_TO_STRBUF(cx, str, ret, bufsize, lenptr) \
{ \
size_t *JSSTSlenptr=lenptr; \
size_t *JSSTSlenptr=
(
lenptr
)
; \
size_t JSSTSlen; \
size_t JSSTSpos; \
const jschar *JSSTSstrval; \
\
if(JSSTSlenptr==NULL) \
JSSTSlenptr=&JSSTSlen; \
if(bufsize < 1 || str==NULL) \
if(
(
bufsize
)
< 1 ||
(
str
)
==NULL) \
*JSSTSlenptr = 0; \
else { \
if((JSSTSstrval=JS_GetStringCharsAndLength((cx), (str), JSSTSlenptr))) { \
if(*JSSTSlenptr >= bufsize) \
*JSSTSlenptr = bufsize-1; \
if(*JSSTSlenptr >=
(
bufsize)
)
\
*JSSTSlenptr =
(
bufsize
)
-1; \
for(JSSTSpos=0; JSSTSpos<*JSSTSlenptr; JSSTSpos++) \
(ret)[JSSTSpos]=(char)JSSTSstrval[JSSTSpos]; \
} \
...
...
@@ -217,7 +217,7 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
#define JSSTRING_TO_ASTRING(cx, str, ret, maxsize, lenptr) \
{ \
size_t *JSSTSlenptr=lenptr; \
size_t *JSSTSlenptr=
(
lenptr
)
; \
size_t JSSTSlen; \
size_t JSSTSpos; \
const jschar *JSSTSstrval; \
...
...
@@ -227,14 +227,16 @@ extern int thread_suid_broken; /* NPTL is no longer broken */
(ret)=NULL; \
if((str) != NULL) { \
if((JSSTSstrval=JS_GetStringCharsAndLength((cx), (str), JSSTSlenptr))) { \
if(*JSSTSlenptr >= maxsize) \
*JSSTSlenptr = maxsize-1; \
if(*JSSTSlenptr >= (maxsize)) { \
*JSSTSlenptr = (maxsize)-1; \
} \
if(((ret)=(char *)alloca(*JSSTSlenptr+1))) { \
for(JSSTSpos=0; JSSTSpos<*JSSTSlenptr; JSSTSpos++) \
for(JSSTSpos=0; JSSTSpos<*JSSTSlenptr; JSSTSpos++)
{
\
(ret)[JSSTSpos]=(char)JSSTSstrval[JSSTSpos]; \
} \
(ret)[*JSSTSlenptr]=0; \
} \
else JS_ReportError(cx, "Error allocating %lu bytes on stack at %s:%d", (*JSSTSlenptr)+1, getfname(__FILE__), __LINE__); \
else JS_ReportError(
(
cx
)
, "Error allocating %lu bytes on stack at %s:%d", (*JSSTSlenptr)+1, getfname(__FILE__), __LINE__); \
} \
} \
}
...
...
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