Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
f2d75dc3
Commit
f2d75dc3
authored
May 27, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Constify the comparison function prototype
parent
15d4d99f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
cache_expire.c
bin/varnishd/cache/cache_expire.c
+4
-4
binary_heap.h
include/binary_heap.h
+1
-1
vev.c
lib/libvarnish/vev.c
+5
-4
No files found.
bin/varnishd/cache/cache_expire.c
View file @
f2d75dc3
...
@@ -550,10 +550,10 @@ exp_expire(struct exp_priv *ep, double now)
...
@@ -550,10 +550,10 @@ exp_expire(struct exp_priv *ep, double now)
* object expires, accounting also for graceability, it is killed.
* object expires, accounting also for graceability, it is killed.
*/
*/
static
int
static
int
__match_proto__
(
binheap_cmp_t
)
object_cmp
(
void
*
priv
,
void
*
a
,
void
*
b
)
object_cmp
(
void
*
priv
,
const
void
*
a
,
const
void
*
b
)
{
{
struct
objcore
*
aa
,
*
bb
;
const
struct
objcore
*
aa
,
*
bb
;
(
void
)
priv
;
(
void
)
priv
;
CAST_OBJ_NOTNULL
(
aa
,
a
,
OBJCORE_MAGIC
);
CAST_OBJ_NOTNULL
(
aa
,
a
,
OBJCORE_MAGIC
);
...
@@ -561,7 +561,7 @@ object_cmp(void *priv, void *a, void *b)
...
@@ -561,7 +561,7 @@ object_cmp(void *priv, void *a, void *b)
return
(
aa
->
timer_when
<
bb
->
timer_when
);
return
(
aa
->
timer_when
<
bb
->
timer_when
);
}
}
static
void
static
void
__match_proto__
(
binheap_update_t
)
object_update
(
void
*
priv
,
void
*
p
,
unsigned
u
)
object_update
(
void
*
priv
,
void
*
p
,
unsigned
u
)
{
{
struct
objcore
*
oc
;
struct
objcore
*
oc
;
...
...
include/binary_heap.h
View file @
f2d75dc3
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
struct
binheap
;
struct
binheap
;
typedef
int
binheap_cmp_t
(
void
*
priv
,
void
*
a
,
void
*
b
);
typedef
int
binheap_cmp_t
(
void
*
priv
,
const
void
*
a
,
const
void
*
b
);
/*
/*
* Comparison function.
* Comparison function.
* Should return true if item 'a' should be closer to the root
* Should return true if item 'a' should be closer to the root
...
...
lib/libvarnish/vev.c
View file @
f2d75dc3
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include <string.h>
#include <string.h>
#include <time.h>
#include <time.h>
#include "vdef.h"
#include "miniobj.h"
#include "miniobj.h"
#include "vas.h"
#include "vas.h"
...
@@ -93,7 +94,7 @@ struct vev_base {
...
@@ -93,7 +94,7 @@ struct vev_base {
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
static
void
static
void
__match_proto__
(
binheap_update_t
)
vev_bh_update
(
void
*
priv
,
void
*
a
,
unsigned
u
)
vev_bh_update
(
void
*
priv
,
void
*
a
,
unsigned
u
)
{
{
struct
vev_base
*
evb
;
struct
vev_base
*
evb
;
...
@@ -104,11 +105,11 @@ vev_bh_update(void *priv, void *a, unsigned u)
...
@@ -104,11 +105,11 @@ vev_bh_update(void *priv, void *a, unsigned u)
e
->
__binheap_idx
=
u
;
e
->
__binheap_idx
=
u
;
}
}
static
int
static
int
__match_proto__
(
binheap_cmp_t
)
vev_bh_cmp
(
void
*
priv
,
void
*
a
,
void
*
b
)
vev_bh_cmp
(
void
*
priv
,
const
void
*
a
,
const
void
*
b
)
{
{
struct
vev_base
*
evb
;
struct
vev_base
*
evb
;
struct
vev
*
ea
,
*
eb
;
const
struct
vev
*
ea
,
*
eb
;
CAST_OBJ_NOTNULL
(
evb
,
priv
,
VEV_BASE_MAGIC
);
CAST_OBJ_NOTNULL
(
evb
,
priv
,
VEV_BASE_MAGIC
);
CAST_OBJ_NOTNULL
(
ea
,
a
,
VEV_MAGIC
);
CAST_OBJ_NOTNULL
(
ea
,
a
,
VEV_MAGIC
);
...
...
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