Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
3baf0eff
Commit
3baf0eff
authored
Aug 23, 2011
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jbitset: fix examples, remove test memory leak.
parent
a209c6d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
ccan/jbitset/jbitset.h
ccan/jbitset/jbitset.h
+3
-3
ccan/jbitset/test/run-type.c
ccan/jbitset/test/run-type.c
+3
-0
No files found.
ccan/jbitset/jbitset.h
View file @
3baf0eff
...
...
@@ -156,7 +156,7 @@ static inline unsigned long jbit_popcount(const struct jbitset *set,
* assert(!jbit_test(set, 0));
* for (i = 0; (val = jbit_nth(set, i, 0)) != 0; i++) {
* assert(jbit_popcount(set, 0, val) == i);
* printf("Value %
zu = %z
u\n", i, val);
* printf("Value %
lu = %l
u\n", i, val);
* }
*/
static
inline
unsigned
long
jbit_nth
(
const
struct
jbitset
*
set
,
...
...
@@ -179,7 +179,7 @@ static inline unsigned long jbit_nth(const struct jbitset *set,
* assert(!jbit_test(set, 0));
* printf("Set contents (increasing order):");
* for (i = jbit_first(set, 0); i; i = jbit_next(set, i, 0))
* printf(" %
z
u", i);
* printf(" %
l
u", i);
* printf("\n");
*/
static
inline
unsigned
long
jbit_first
(
const
struct
jbitset
*
set
,
...
...
@@ -222,7 +222,7 @@ static inline unsigned long jbit_next(const struct jbitset *set,
* assert(!jbit_test(set, 0));
* printf("Set contents (decreasing order):");
* for (i = jbit_last(set, 0); i; i = jbit_prev(set, i, 0))
* printf(" %
z
u", i);
* printf(" %
l
u", i);
* printf("\n");
*/
static
inline
unsigned
long
jbit_last
(
const
struct
jbitset
*
set
,
...
...
ccan/jbitset/test/run-type.c
View file @
3baf0eff
...
...
@@ -53,5 +53,8 @@ int main(int argc, char *argv[])
ok1
(
jbit_foo_error
(
set
)
==
NULL
);
jbit_foo_free
(
set
);
for
(
i
=
0
;
i
<
NUM
;
i
++
)
free
(
foo
[
i
]);
return
exit_status
();
}
Write
Preview
Markdown
is supported
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