Skip to content

Commit

Permalink
cleanup: use "mh" for flux_msg_handler_t var
Browse files Browse the repository at this point in the history
Use a more sensible variable name for flux_msg_handler_t
than "w", etc..

Fixes flux-framework#1219
  • Loading branch information
garlick committed Nov 9, 2017
1 parent b989b36 commit 772074a
Show file tree
Hide file tree
Showing 40 changed files with 347 additions and 350 deletions.
4 changes: 2 additions & 2 deletions doc/man3/treduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void reduce (flux_reduce_t *r, int batchnum, void *arg)
}
}

void forward_cb (flux_t *h, flux_msg_handler_t *w,
void forward_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
struct context *ctx = arg;
Expand All @@ -94,7 +94,7 @@ void forward_cb (flux_t *h, flux_msg_handler_t *w,
Jput (in);
}

void heartbeat_cb (flux_t *h, flux_msg_handler_t *w,
void heartbeat_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
struct context *ctx = arg;
Expand Down
6 changes: 3 additions & 3 deletions src/broker/attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ const char *attr_next (attr_t *attrs)
** Service
**/

void getattr_request_cb (flux_t *h, flux_msg_handler_t *w,
void getattr_request_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
attr_t *attrs = arg;
Expand All @@ -342,7 +342,7 @@ void getattr_request_cb (flux_t *h, flux_msg_handler_t *w,
FLUX_LOG_ERROR (h);
}

void setattr_request_cb (flux_t *h, flux_msg_handler_t *w,
void setattr_request_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
attr_t *attrs = arg;
Expand Down Expand Up @@ -375,7 +375,7 @@ void setattr_request_cb (flux_t *h, flux_msg_handler_t *w,
FLUX_LOG_ERROR (h);
}

void lsattr_request_cb (flux_t *h, flux_msg_handler_t *w,
void lsattr_request_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
attr_t *attrs = arg;
Expand Down
18 changes: 9 additions & 9 deletions src/broker/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ static void broker_unhandle_signals (zlist_t *sigwatchers)
** Built-in services
**/

static void cmb_rmmod_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_rmmod_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
broker_ctx_t *ctx = arg;
Expand All @@ -1521,7 +1521,7 @@ static void cmb_rmmod_cb (flux_t *h, flux_msg_handler_t *w,
free (name);
}

static void cmb_insmod_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_insmod_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
broker_ctx_t *ctx = arg;
Expand Down Expand Up @@ -1550,7 +1550,7 @@ static void cmb_insmod_cb (flux_t *h, flux_msg_handler_t *w,
free (argz);
}

static void cmb_lsmod_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_lsmod_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
broker_ctx_t *ctx = arg;
Expand All @@ -1575,7 +1575,7 @@ static void cmb_lsmod_cb (flux_t *h, flux_msg_handler_t *w,
flux_modlist_destroy (mods);
}

static void cmb_lspeer_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_lspeer_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
broker_ctx_t *ctx = arg;
Expand All @@ -1591,7 +1591,7 @@ static void cmb_lspeer_cb (flux_t *h, flux_msg_handler_t *w,
free (out);
}

static void cmb_panic_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_panic_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
const char *s = NULL;
Expand All @@ -1608,7 +1608,7 @@ static void cmb_panic_cb (flux_t *h, flux_msg_handler_t *w,
flux_log_error (h, "%s: flux_respond", __FUNCTION__);
}

static void cmb_event_mute_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_event_mute_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
broker_ctx_t *ctx = arg;
Expand All @@ -1620,7 +1620,7 @@ static void cmb_event_mute_cb (flux_t *h, flux_msg_handler_t *w,
/* no response */
}

static void cmb_disconnect_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_disconnect_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
char *sender = NULL;;
Expand All @@ -1632,7 +1632,7 @@ static void cmb_disconnect_cb (flux_t *h, flux_msg_handler_t *w,
/* no response */
}

static void cmb_sub_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_sub_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
broker_ctx_t *ctx = arg;
Expand All @@ -1659,7 +1659,7 @@ static void cmb_sub_cb (flux_t *h, flux_msg_handler_t *w,
free (uuid);
}

static void cmb_unsub_cb (flux_t *h, flux_msg_handler_t *w,
static void cmb_unsub_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
broker_ctx_t *ctx = arg;
Expand Down
14 changes: 7 additions & 7 deletions src/broker/content-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static int cache_load (content_cache_t *cache, struct cache_entry *e)
return rc;
}

void content_load_request (flux_t *h, flux_msg_handler_t *w,
void content_load_request (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
content_cache_t *cache = arg;
Expand Down Expand Up @@ -514,7 +514,7 @@ static int cache_store (content_cache_t *cache, struct cache_entry *e)
return rc;
}

static void content_store_request (flux_t *h, flux_msg_handler_t *w,
static void content_store_request (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
content_cache_t *cache = arg;
Expand Down Expand Up @@ -632,7 +632,7 @@ static int cache_flush (content_cache_t *cache)
return rc;
}

static void content_backing_request (flux_t *h, flux_msg_handler_t *w,
static void content_backing_request (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
content_cache_t *cache = arg;
Expand Down Expand Up @@ -672,7 +672,7 @@ static void content_backing_request (flux_t *h, flux_msg_handler_t *w,
* N.B. this walks the entire cache in one go.
*/

static void content_dropcache_request (flux_t *h, flux_msg_handler_t *w,
static void content_dropcache_request (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
content_cache_t *cache = arg;
Expand Down Expand Up @@ -715,7 +715,7 @@ static void content_dropcache_request (flux_t *h, flux_msg_handler_t *w,
/* Return stats about the cache.
*/

static void content_stats_request (flux_t *h, flux_msg_handler_t *w,
static void content_stats_request (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
content_cache_t *cache = arg;
Expand Down Expand Up @@ -758,7 +758,7 @@ static void flush_respond (content_cache_t *cache)
__FUNCTION__);
}

static void content_flush_request (flux_t *h, flux_msg_handler_t *w,
static void content_flush_request (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
content_cache_t *cache = arg;
Expand Down Expand Up @@ -841,7 +841,7 @@ static int cache_purge (content_cache_t *cache)
return rc;
}

static void heartbeat_event (flux_t *h, flux_msg_handler_t *w,
static void heartbeat_event (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
content_cache_t *cache = arg;
Expand Down
8 changes: 4 additions & 4 deletions src/broker/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static int write_to_child (struct subprocess *p, const char *s)
return rc;
}

static void write_request_cb (flux_t *h, flux_msg_handler_t *w,
static void write_request_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
exec_t *x = arg;
Expand Down Expand Up @@ -235,7 +235,7 @@ static void write_request_cb (flux_t *h, flux_msg_handler_t *w,
flux_log_error (h, "write_request_cb: flux_respond_pack");
}

static void signal_request_cb (flux_t *h, flux_msg_handler_t *w,
static void signal_request_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
exec_t *x = arg;
Expand Down Expand Up @@ -346,7 +346,7 @@ static int prepare_subprocess (exec_t *x,
return -1;
}

static void exec_request_cb (flux_t *h, flux_msg_handler_t *w,
static void exec_request_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
exec_t *x = arg;
Expand Down Expand Up @@ -475,7 +475,7 @@ static json_t *subprocess_json_info (struct subprocess *p)
return NULL;
}

static void ps_request_cb (flux_t *h, flux_msg_handler_t *w,
static void ps_request_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
struct subprocess *p;
Expand Down
6 changes: 3 additions & 3 deletions src/broker/heaptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <flux/core.h>
#include "heaptrace.h"

static void start_cb (flux_t *h, flux_msg_handler_t *w,
static void start_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
const char *filename;
Expand All @@ -63,7 +63,7 @@ static void start_cb (flux_t *h, flux_msg_handler_t *w,
FLUX_LOG_ERROR (h);
}

static void dump_cb (flux_t *h, flux_msg_handler_t *w,
static void dump_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
const char *reason;
Expand All @@ -88,7 +88,7 @@ static void dump_cb (flux_t *h, flux_msg_handler_t *w,
FLUX_LOG_ERROR (h);
}

static void stop_cb (flux_t *h, flux_msg_handler_t *w,
static void stop_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
if (flux_request_decode (msg, NULL, NULL) < 0)
Expand Down
14 changes: 7 additions & 7 deletions src/broker/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct heartbeat_struct {
flux_t *h;
double rate;
flux_watcher_t *timer;
flux_msg_handler_t *handler;
flux_msg_handler_t *mh;
int send_epoch;
int epoch;
};
Expand All @@ -52,7 +52,7 @@ void heartbeat_destroy (heartbeat_t *hb)
{
if (hb) {
flux_watcher_destroy (hb->timer);
flux_msg_handler_destroy (hb->handler);
flux_msg_handler_destroy (hb->mh);
free (hb);
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ int heartbeat_get_epoch (heartbeat_t *hb)
return hb->epoch;
}

static void event_cb (flux_t *h, flux_msg_handler_t *w,
static void event_cb (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
heartbeat_t *hb = arg;
Expand Down Expand Up @@ -167,18 +167,18 @@ int heartbeat_start (heartbeat_t *hb)
flux_watcher_start (hb->timer);
}
match.topic_glob = "hb";
if (!(hb->handler = flux_msg_handler_create (hb->h, match, event_cb, hb)))
if (!(hb->mh = flux_msg_handler_create (hb->h, match, event_cb, hb)))
return -1;
flux_msg_handler_start (hb->handler);
flux_msg_handler_start (hb->mh);
return 0;
}

void heartbeat_stop (heartbeat_t *hb)
{
if (hb->timer)
flux_watcher_stop (hb->timer);
if (hb->handler)
flux_msg_handler_stop (hb->handler);
if (hb->mh)
flux_msg_handler_stop (hb->mh);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions src/broker/hello.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct hello_struct {
flux_reduce_t *reduce;
};

static void join_request (flux_t *h, flux_msg_handler_t *w,
static void join_request (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg);

static void r_reduce (flux_reduce_t *r, int batch, void *arg);
Expand Down Expand Up @@ -212,7 +212,7 @@ int hello_start (hello_t *hello)

/* handle a message sent from downstream via downstream's r_forward op.
*/
static void join_request (flux_t *h, flux_msg_handler_t *w,
static void join_request (flux_t *h, flux_msg_handler_t *mh,
const flux_msg_t *msg, void *arg)
{
hello_t *hello = arg;
Expand Down
Loading

0 comments on commit 772074a

Please sign in to comment.