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
d707abbb
Commit
d707abbb
authored
Jun 15, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typesafe_cb: fix fallout from API changes.
parent
061e6302
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
28 deletions
+6
-28
ccan/asearch/asearch.h
ccan/asearch/asearch.h
+2
-2
ccan/asort/asort.h
ccan/asort/asort.h
+1
-1
ccan/asort/test/run-strings.c
ccan/asort/test/run-strings.c
+0
-22
ccan/hashtable/hashtable.h
ccan/hashtable/hashtable.h
+2
-2
ccan/talloc/talloc.h
ccan/talloc/talloc.h
+1
-1
No files found.
ccan/asearch/asearch.h
View file @
d707abbb
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <ccan/typesafe_cb/typesafe_cb.h>
#include <ccan/typesafe_cb/typesafe_cb.h>
/*
/*
*
* asearch - search an array of elements
* asearch - search an array of elements
* @key: pointer to item being searched for
* @key: pointer to item being searched for
* @base: pointer to data to sort
* @base: pointer to data to sort
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#define asearch(key, base, num, cmp) \
#define asearch(key, base, num, cmp) \
((__typeof__(*(base))*)(bsearch((key), (base), (num), sizeof(*(base)), \
((__typeof__(*(base))*)(bsearch((key), (base), (num), sizeof(*(base)), \
cast_if_type(int (*)(const void *, const void *), \
cast_if_type(int (*)(const void *, const void *), \
(cmp),
\
(cmp),
&*(cmp),
\
int (*)(const __typeof__(*(key)) *, \
int (*)(const __typeof__(*(key)) *, \
const __typeof__(*(base)) *)))))
const __typeof__(*(base)) *)))))
#else
#else
...
...
ccan/asort/asort.h
View file @
d707abbb
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#define asort(base, num, cmp, ctx) \
#define asort(base, num, cmp, ctx) \
_asort((base), (num), sizeof(*(base)), \
_asort((base), (num), sizeof(*(base)), \
cast_if_type(int (*)(const void *, const void *, const void *), \
cast_if_type(int (*)(const void *, const void *, const void *), \
(cmp),
\
(cmp),
&*(cmp),
\
int (*)(const __typeof__(*(base)) *, \
int (*)(const __typeof__(*(base)) *, \
const __typeof__(*(base)) *, \
const __typeof__(*(base)) *, \
__typeof__(ctx))), (ctx))
__typeof__(ctx))), (ctx))
...
...
ccan/asort/test/run-strings.c
deleted
100644 → 0
View file @
061e6302
#include <ccan/asearch/asearch.h>
#include <ccan/array_size/array_size.h>
#include <ccan/tap/tap.h>
#include <stdlib.h>
static
int
cmp
(
const
int
*
key
,
const
char
*
const
*
elem
)
{
return
*
key
-
atoi
(
*
elem
);
}
int
main
(
void
)
{
const
char
*
args
[]
=
{
"1"
,
"4"
,
"7"
,
"9"
};
int
key
=
7
;
const
char
**
p
;
plan_tests
(
1
);
p
=
asearch
(
&
key
,
args
,
ARRAY_SIZE
(
args
),
cmp
);
ok1
(
p
==
&
args
[
2
]);
return
exit_status
();
}
ccan/hashtable/hashtable.h
View file @
d707abbb
...
@@ -75,14 +75,14 @@ bool hashtable_del(struct hashtable *ht, unsigned long hash, const void *p);
...
@@ -75,14 +75,14 @@ bool hashtable_del(struct hashtable *ht, unsigned long hash, const void *p);
_hashtable_traverse(ht, cast_if_type(bool (*)(void *, void *), \
_hashtable_traverse(ht, cast_if_type(bool (*)(void *, void *), \
cast_if_any(bool (*)(void *, \
cast_if_any(bool (*)(void *, \
void *), \
void *), \
(cb), (cb), \
(cb),
&*
(cb), \
bool (*)(const type *, \
bool (*)(const type *, \
const typeof(*cbarg) *), \
const typeof(*cbarg) *), \
bool (*)(type *, \
bool (*)(type *, \
const typeof(*cbarg) *), \
const typeof(*cbarg) *), \
bool (*)(const type *, \
bool (*)(const type *, \
typeof(*cbarg) *)), \
typeof(*cbarg) *)), \
(cb), \
&*
(cb), \
bool (*)(type *, typeof(*cbarg) *)), \
bool (*)(type *, typeof(*cbarg) *)), \
(cbarg))
(cbarg))
...
...
ccan/talloc/talloc.h
View file @
d707abbb
...
@@ -196,7 +196,7 @@ int talloc_free(const void *ptr);
...
@@ -196,7 +196,7 @@ int talloc_free(const void *ptr);
* talloc, talloc_free
* talloc, talloc_free
*/
*/
#define talloc_set_destructor(ptr, function) \
#define talloc_set_destructor(ptr, function) \
_talloc_set_destructor((ptr), typesafe_cb(int, (function), (ptr)))
_talloc_set_destructor((ptr), typesafe_cb
_def
(int, (function), (ptr)))
/**
/**
* talloc_zero - allocate zeroed dynamic memory for a type
* talloc_zero - allocate zeroed dynamic memory for a type
...
...
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