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
376edd78
Commit
376edd78
authored
Mar 04, 2011
by
Andreas Schlick
Committed by
Rusty Russell
Mar 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asort: Remove constness from ctx pointer.
parent
abac6053
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
ccan/asort/asort.c
ccan/asort/asort.c
+4
-4
ccan/asort/asort.h
ccan/asort/asort.h
+3
-3
No files found.
ccan/asort/asort.c
View file @
376edd78
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
#if HAVE_NESTED_FUNCTIONS
#if HAVE_NESTED_FUNCTIONS
void
_asort
(
void
*
base
,
size_t
nmemb
,
size_t
size
,
void
_asort
(
void
*
base
,
size_t
nmemb
,
size_t
size
,
int
(
*
compar
)(
const
void
*
,
const
void
*
,
const
void
*
ctx
),
int
(
*
compar
)(
const
void
*
,
const
void
*
,
void
*
ctx
),
const
void
*
ctx
)
void
*
ctx
)
{
{
/* This gives bogus "warning: no previous prototype for ‘cmp’"
/* This gives bogus "warning: no previous prototype for ‘cmp’"
* with gcc 4 with -Wmissing-prototypes. Hence the auto crap. */
* with gcc 4 with -Wmissing-prototypes. Hence the auto crap. */
...
@@ -107,8 +107,8 @@ typedef struct
...
@@ -107,8 +107,8 @@ typedef struct
void
void
_asort
(
void
*
const
pbase
,
size_t
total_elems
,
size_t
size
,
_asort
(
void
*
const
pbase
,
size_t
total_elems
,
size_t
size
,
int
(
*
cmp
)(
const
void
*
,
const
void
*
,
const
void
*
arg
),
int
(
*
cmp
)(
const
void
*
,
const
void
*
,
void
*
arg
),
const
void
*
arg
)
void
*
arg
)
{
{
register
char
*
base_ptr
=
(
char
*
)
pbase
;
register
char
*
base_ptr
=
(
char
*
)
pbase
;
...
...
ccan/asort/asort.h
View file @
376edd78
...
@@ -18,14 +18,14 @@
...
@@ -18,14 +18,14 @@
*/
*/
#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 *, void *), \
(cmp), &*(cmp), \
(cmp), &*(cmp), \
int (*)(const __typeof__(*(base)) *, \
int (*)(const __typeof__(*(base)) *, \
const __typeof__(*(base)) *, \
const __typeof__(*(base)) *, \
__typeof__(ctx))), (ctx))
__typeof__(ctx))), (ctx))
void
_asort
(
void
*
base
,
size_t
nmemb
,
size_t
size
,
void
_asort
(
void
*
base
,
size_t
nmemb
,
size_t
size
,
int
(
*
compar
)(
const
void
*
,
const
void
*
,
const
void
*
),
int
(
*
compar
)(
const
void
*
,
const
void
*
,
void
*
),
const
void
*
ctx
);
void
*
ctx
);
#endif
/* CCAN_ASORT_H */
#endif
/* CCAN_ASORT_H */
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