Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
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
The Tor Project
Core
Tor
Commits
77bc65bb
Commit
77bc65bb
authored
6 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Move bool_eq and bool_neq to lib/intmath
parent
40199b18
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/util.h
+1
-6
1 addition, 6 deletions
src/common/util.h
src/lib/intmath/include.am
+1
-0
1 addition, 0 deletions
src/lib/intmath/include.am
src/lib/intmath/logic.h
+14
-0
14 additions, 0 deletions
src/lib/intmath/logic.h
with
16 additions
and
6 deletions
src/common/util.h
+
1
−
6
View file @
77bc65bb
...
...
@@ -30,6 +30,7 @@
#include
"lib/string/scanf.h"
#include
"lib/intmath/bits.h"
#include
"lib/intmath/addsub.h"
#include
"lib/intmath/logic.h"
#include
"lib/intmath/muldiv.h"
#include
"lib/intmath/cmp.h"
#include
"lib/log/ratelim.h"
...
...
@@ -54,12 +55,6 @@
#define SUBTYPE_P(p, subtype, basemember) \
((void*) ( ((char*)(p)) - offsetof(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))
/* Math functions */
/* String manipulation */
...
...
This diff is collapsed.
Click to expand it.
src/lib/intmath/include.am
+
1
−
0
View file @
77bc65bb
...
...
@@ -20,5 +20,6 @@ noinst_HEADERS += \
src/lib/intmath/addsub.h \
src/lib/intmath/cmp.h \
src/lib/intmath/bits.h \
src/lib/intmath/logic.h \
src/lib/intmath/muldiv.h \
src/lib/intmath/weakrng.h
This diff is collapsed.
Click to expand it.
src/lib/intmath/logic.h
0 → 100644
+
14
−
0
View file @
77bc65bb
/* Copyright (c) 2003-2004, Roger Dingledine
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#ifndef HAVE_TOR_LOGIC_H
#define HAVE_TOR_LOGIC_H
/** 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))
#endif
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