From d79338d4b3d99c481740a66e746f80d5b98e47ac Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Wed, 9 Jan 2013 23:23:06 +0100 Subject: [PATCH] ROOMS: use typedef for callback function --- citadel/include/ctdl_module.h | 4 ++-- citadel/room_ops.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/citadel/include/ctdl_module.h b/citadel/include/ctdl_module.h index 25a00fa70..14671171d 100644 --- a/citadel/include/ctdl_module.h +++ b/citadel/include/ctdl_module.h @@ -240,8 +240,8 @@ int CtdlDoIHavePermissionToDeleteThisRoom(struct ctdlroom *qr); void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf, int *result, int *view); void CtdlPutRoomLock(struct ctdlroom *qrbuf); -void CtdlForEachRoom(void (*CallBack)(struct ctdlroom *EachRoom, void *out_data), - void *in_data); +typedef void (*ForEachRoomCallBack)(struct ctdlroom *EachRoom, void *out_data); +void CtdlForEachRoom(ForEachRoomCallBack CB, void *in_data); void CtdlDeleteRoom(struct ctdlroom *qrbuf); int CtdlRenameRoom(char *old_name, char *new_name, int new_floor); void CtdlUserGoto (char *where, int display_result, int transiently, diff --git a/citadel/room_ops.c b/citadel/room_ops.c index 1e4209bdc..15a6031e8 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -565,8 +565,7 @@ void lputfloor(struct floor *flbuf, int floor_num) /* * Traverse the room file... */ -void CtdlForEachRoom(void (*CallBack) (struct ctdlroom *EachRoom, void *out_data), - void *in_data) +void CtdlForEachRoom(ForEachRoomCallBack CB, void *in_data) { struct ctdlroom qrbuf; struct cdbdata *cdbqr; @@ -582,7 +581,7 @@ void CtdlForEachRoom(void (*CallBack) (struct ctdlroom *EachRoom, void *out_data cdb_free(cdbqr); room_sanity_check(&qrbuf); if (qrbuf.QRflags & QR_INUSE) { - (*CallBack)(&qrbuf, in_data); + CB(&qrbuf, in_data); } } } -- 2.30.2