ROOMS: use typedef for callback function
authorWilfried Goesgens <dothebart@citadel.org>
Wed, 9 Jan 2013 22:23:06 +0000 (23:23 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Wed, 9 Jan 2013 22:23:06 +0000 (23:23 +0100)
citadel/include/ctdl_module.h
citadel/room_ops.c

index 25a00fa70d250eaef5e6cad520ebcf4e0144493c..14671171d1c4d01026d37a15e848ca4f44aa7731 100644 (file)
@@ -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,
index 1e4209bdc6867bccc3a8b9e10ed9b1d15d2bb99b..15a6031e8ab4f30e20c3758e61a03d32298c95a2 100644 (file)
@@ -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);
                }
        }
 }