Fail when the return value is not used
This commit is contained in:
parent
e240937e58
commit
d394bb88c3
@ -58,11 +58,12 @@ struct bay {
|
|||||||
struct bay_chan *dirty;
|
struct bay_chan *dirty;
|
||||||
};
|
};
|
||||||
|
|
||||||
void bay_init(struct bay *bay);
|
void bay_init(struct bay *bay);
|
||||||
int bay_register(struct bay *bay, struct chan *chan);
|
USE_RET int bay_register(struct bay *bay, struct chan *chan);
|
||||||
int bay_remove(struct bay *bay, struct chan *chan);
|
USE_RET int bay_remove(struct bay *bay, struct chan *chan);
|
||||||
struct chan *bay_find(struct bay *bay, const char *name);
|
USE_RET struct chan *bay_find(struct bay *bay, const char *name);
|
||||||
int bay_add_cb(struct bay *bay, enum bay_cb_type type, struct chan *chan, bay_cb_func_t func, void *arg);
|
USE_RET int bay_add_cb(struct bay *bay, enum bay_cb_type type,
|
||||||
int bay_propagate(struct bay *bay);
|
struct chan *chan, bay_cb_func_t func, void *arg);
|
||||||
|
USE_RET int bay_propagate(struct bay *bay);
|
||||||
|
|
||||||
#endif /* BAY_H */
|
#endif /* BAY_H */
|
||||||
|
@ -19,6 +19,7 @@ enum chan_type {
|
|||||||
enum chan_prop {
|
enum chan_prop {
|
||||||
CHAN_DIRTY_WRITE = 0,
|
CHAN_DIRTY_WRITE = 0,
|
||||||
CHAN_DUPLICATES,
|
CHAN_DUPLICATES,
|
||||||
|
CHAN_ROW,
|
||||||
CHAN_MAXPROP,
|
CHAN_MAXPROP,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -47,22 +48,15 @@ struct chan {
|
|||||||
void *dirty_arg;
|
void *dirty_arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
//int chan_enable(struct chan *chan);
|
void chan_init(struct chan *chan, enum chan_type type, const char *name);
|
||||||
//int chan_disable(struct chan *chan);
|
USE_RET int chan_set(struct chan *chan, struct value value);
|
||||||
//int chan_is_enabled(const struct chan *chan);
|
USE_RET int chan_push(struct chan *chan, struct value value);
|
||||||
|
USE_RET int chan_pop(struct chan *chan, struct value expected);
|
||||||
void chan_init(struct chan *chan, enum chan_type type, const char *name);
|
USE_RET int chan_read(struct chan *chan, struct value *value);
|
||||||
int chan_set(struct chan *chan, struct value value);
|
USE_RET enum chan_type chan_get_type(struct chan *chan);
|
||||||
int chan_push(struct chan *chan, struct value value);
|
USE_RET int chan_flush(struct chan *chan);
|
||||||
int chan_pop(struct chan *chan, struct value expected);
|
void chan_prop_set(struct chan *chan, enum chan_prop prop, int value);
|
||||||
int chan_read(struct chan *chan, struct value *value);
|
USE_RET int chan_prop_get(struct chan *chan, enum chan_prop prop);
|
||||||
enum chan_type chan_get_type(struct chan *chan);
|
void chan_set_dirty_cb(struct chan *chan, chan_cb_t func, void *arg);
|
||||||
int chan_flush(struct chan *chan);
|
|
||||||
|
|
||||||
void chan_prop_set(struct chan *chan, enum chan_prop prop, int value);
|
|
||||||
int chan_prop_get(struct chan *chan, enum chan_prop prop);
|
|
||||||
|
|
||||||
/* Called when it becomes dirty */
|
|
||||||
void chan_set_dirty_cb(struct chan *chan, chan_cb_t func, void *arg);
|
|
||||||
|
|
||||||
#endif /* CHAN_H */
|
#endif /* CHAN_H */
|
||||||
|
@ -30,20 +30,20 @@ void mux_input_init(struct mux_input *mux,
|
|||||||
struct value key,
|
struct value key,
|
||||||
struct chan *chan);
|
struct chan *chan);
|
||||||
|
|
||||||
int mux_init(struct mux *mux,
|
USE_RET int mux_init(struct mux *mux,
|
||||||
struct bay *bay,
|
struct bay *bay,
|
||||||
struct chan *select,
|
struct chan *select,
|
||||||
struct chan *output,
|
struct chan *output,
|
||||||
mux_select_func_t select_func);
|
mux_select_func_t select_func);
|
||||||
|
|
||||||
struct mux_input *mux_find_input(struct mux *mux,
|
USE_RET struct mux_input *mux_find_input(struct mux *mux,
|
||||||
struct value key);
|
struct value key);
|
||||||
|
|
||||||
int mux_add_input(struct mux *mux,
|
USE_RET int mux_add_input(struct mux *mux,
|
||||||
struct value key,
|
struct value key,
|
||||||
struct chan *input);
|
struct chan *input);
|
||||||
|
|
||||||
int mux_register(struct mux *mux,
|
USE_RET int mux_register(struct mux *mux,
|
||||||
struct bay *bay);
|
struct bay *bay);
|
||||||
|
|
||||||
#endif /* MUX_H */
|
#endif /* MUX_H */
|
||||||
|
@ -242,8 +242,10 @@ main(void)
|
|||||||
if (mux_init(&mux, &bay, &select, &output, NULL) != 0)
|
if (mux_init(&mux, &bay, &select, &output, NULL) != 0)
|
||||||
die("mux_init failed\n");
|
die("mux_init failed\n");
|
||||||
|
|
||||||
for (int i = 0; i < N; i++)
|
for (int i = 0; i < N; i++) {
|
||||||
mux_add_input(&mux, value_int64(i), &inputs[i]);
|
if (mux_add_input(&mux, value_int64(i), &inputs[i]) != 0)
|
||||||
|
die("mux_add_input failed\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* Write something to the input channels */
|
/* Write something to the input channels */
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user