From 2dab88b1189b1eeceb25bdafc7e15772aa81e024 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 25 Jun 2017 08:21:14 +0200 Subject: [PATCH] cmistake no return value, no mistakes --- src/kernel/messages.c | 11 +++++------ src/kernel/messages.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/kernel/messages.c b/src/kernel/messages.c index d3cd4f99b..b8d33f08c 100644 --- a/src/kernel/messages.c +++ b/src/kernel/messages.c @@ -258,15 +258,14 @@ message * msg_error(const unit * u, struct order *ord, int mno) { return msg_feedback(u, ord, msgname, ""); } -message * cmistake(const unit * u, struct order *ord, int mno, int mtype) +void cmistake(const unit * u, struct order *ord, int mno, int mtype) { - message * result; + message * msg; UNUSED_ARG(mtype); - result = msg_error(u, ord, mno); - if (result) { - ADDMSG(&u->faction->msgs, result); + msg = msg_error(u, ord, mno); + if (msg) { + ADDMSG(&u->faction->msgs, msg); } - return result; } void syntax_error(const struct unit *u, struct order *ord) diff --git a/src/kernel/messages.h b/src/kernel/messages.h index a42342153..4eca65fc1 100644 --- a/src/kernel/messages.h +++ b/src/kernel/messages.h @@ -60,7 +60,7 @@ extern "C" { #define ADDMSG(msgs, mcreate) { message * mx = mcreate; if (mx) { assert(mx->refcount>=1); add_message(msgs, mx); msg_release(mx); } } void syntax_error(const struct unit *u, struct order *ord); - struct message * cmistake(const struct unit *u, struct order *ord, int mno, int mtype); + void cmistake(const struct unit *u, struct order *ord, int mno, int mtype); struct message * msg_error(const struct unit * u, struct order *ord, int mno); #ifdef __cplusplus }