Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Goulet
Tor
Commits
d1ad950c
Commit
d1ad950c
authored
Mar 29, 2007
by
Nick Mathewson
🎨
Browse files
Turn bool_neq and bool_eq into macros.
svn:r9914
parent
98ae4bbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/common/util.h
View file @
d1ad950c
...
...
@@ -136,6 +136,12 @@ extern int dmalloc_free(const char *file, const int line, void *pnt,
#define SUBTYPE_P(p, subtype, basemember) \
((void*) ( ((char*)(p)) - STRUCT_OFFSET(subtype, basemember) ))
/* Logic */
/** Macro: true if two values have the same boolean value. */
#define bool_eq(a,b) (!(a)==!(b))
/** Macro: true if two values have different boolean values. */
#define bool_neq(a,b) (!(a)!=!(b))
/* String manipulation */
/** Allowable characters in a hexadecimal string. */
...
...
src/or/dirserv.c
View file @
d1ad950c
...
...
@@ -582,14 +582,6 @@ dirserv_add_descriptor(const char *desc, const char **msg)
}
}
/** Helper: return true iff the boolean values of <b>a</b> and <b>b</b> are
* different. */
static
INLINE
int
bool_neq
(
int
a
,
int
b
)
{
return
(
a
)
?
!
b
:
b
;
}
/** Remove all descriptors whose nicknames or fingerprints no longer
* are allowed by our fingerprint list. (Descriptors that used to be
* good can become bad when we reload the fingerprint list.)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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