Commit f2d75dc3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Constify the comparison function prototype

parent 15d4d99f
......@@ -550,10 +550,10 @@ exp_expire(struct exp_priv *ep, double now)
* object expires, accounting also for graceability, it is killed.
*/
static int
object_cmp(void *priv, void *a, void *b)
static int __match_proto__(binheap_cmp_t)
object_cmp(void *priv, const void *a, const void *b)
{
struct objcore *aa, *bb;
const struct objcore *aa, *bb;
(void)priv;
CAST_OBJ_NOTNULL(aa, a, OBJCORE_MAGIC);
......@@ -561,7 +561,7 @@ object_cmp(void *priv, void *a, void *b)
return (aa->timer_when < bb->timer_when);
}
static void
static void __match_proto__(binheap_update_t)
object_update(void *priv, void *p, unsigned u)
{
struct objcore *oc;
......
......@@ -35,7 +35,7 @@
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.
* Should return true if item 'a' should be closer to the root
......
......@@ -38,6 +38,7 @@
#include <string.h>
#include <time.h>
#include "vdef.h"
#include "miniobj.h"
#include "vas.h"
......@@ -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)
{
struct vev_base *evb;
......@@ -104,11 +105,11 @@ vev_bh_update(void *priv, void *a, unsigned u)
e->__binheap_idx = u;
}
static int
vev_bh_cmp(void *priv, void *a, void *b)
static int __match_proto__(binheap_cmp_t)
vev_bh_cmp(void *priv, const void *a, const void *b)
{
struct vev_base *evb;
struct vev *ea, *eb;
const struct vev *ea, *eb;
CAST_OBJ_NOTNULL(evb, priv, VEV_BASE_MAGIC);
CAST_OBJ_NOTNULL(ea, a, VEV_MAGIC);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment