From 729487deb380bd8f0fa6591a8f6184595080a490 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Sat, 3 Mar 2007 08:27:52 +0000 Subject: [PATCH] better conversion; cannot use event_err here. svn:r344 --- evrpc.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/evrpc.h b/evrpc.h index 86ea933c..86a6bd83 100644 --- a/evrpc.h +++ b/evrpc.h @@ -192,8 +192,10 @@ int evrpc_send_request_##rpcname(struct evrpc_pool *pool, \ #define EVRPC_REGISTER_OBJECT(rpc, name, request, reply) \ do { \ (rpc)->uri = strdup(#name); \ - if ((rpc)->uri == NULL) \ - event_err(1, "failed to register object"); \ + if ((rpc)->uri == NULL) { \ + fprintf(stderr, "failed to register object\n"); \ + exit(1); \ + } \ (rpc)->request_new = (void *(*)(void))request##_new; \ (rpc)->request_free = (void (*)(void *))request##_free; \ (rpc)->request_unmarshal = (int (*)(void *, struct evbuffer *))request##_unmarshal; \ @@ -201,7 +203,7 @@ int evrpc_send_request_##rpcname(struct evrpc_pool *pool, \ (rpc)->reply_free = (void (*)(void *))reply##_free; \ (rpc)->reply_complete = (int (*)(void *))reply##_complete; \ (rpc)->reply_marshal = (void (*)(struct evbuffer*, void *))reply##_marshal; \ - } while(0) + } while (0) struct evrpc_base; struct evhttp; @@ -212,7 +214,7 @@ struct evrpc_base *evrpc_init(struct evhttp *server); /* this macro is used to register RPCs with the HTTP Server */ #define EVRPC_REGISTER(base, name, request, reply, callback, cbarg) \ do { \ - struct evrpc* rpc = calloc(1, sizeof(struct evrpc)); \ + struct evrpc* rpc = (struct evrpc *)calloc(1, sizeof(struct evrpc)); \ EVRPC_REGISTER_OBJECT(rpc, name, request, reply); \ evrpc_register_rpc(base, rpc, \ (void (*)(struct evrpc_req_generic*, void *))callback, cbarg); \ -- 2.40.0