diff --git a/src/gamecode/laws.c b/src/gamecode/laws.c index 3b332fec7..3e7ca3595 100755 --- a/src/gamecode/laws.c +++ b/src/gamecode/laws.c @@ -1327,7 +1327,7 @@ static void do_contact(region * r) } } -void do_enter(struct region *r, int is_final_attempt) +void do_enter(struct region *r, bool is_final_attempt) { unit **uptr; diff --git a/src/gamecode/laws.h b/src/gamecode/laws.h index 3cc5882e5..7f96db564 100755 --- a/src/gamecode/laws.h +++ b/src/gamecode/laws.h @@ -56,7 +56,7 @@ extern "C" { extern void restack_units(void); extern void update_long_order(struct unit *u); extern void sinkships(struct region * r); - extern void do_enter(struct region *r, int is_final_attempt); + extern void do_enter(struct region *r, bool is_final_attempt); extern int password_cmd(struct unit *u, struct order *ord); extern int banner_cmd(struct unit *u, struct order *ord); diff --git a/src/kernel/config.c b/src/kernel/config.c index 08970f71b..a6db38377 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -1403,13 +1403,13 @@ param_t findparam_ex(const char *s, const struct locale * lang) return (result == P_BUILDING) ? P_GEBAEUDE : result; } -int isparam(const char *s, const struct locale * lang, param_t param) +bool isparam(const char *s, const struct locale * lang, param_t param) { if (s[0]>'@') { param_t p = (param==P_GEBAEUDE) ? findparam_ex(s, lang) : findparam(s, lang); return p==param; } - return 0; + return false; } param_t getparam(const struct locale * lang) diff --git a/src/kernel/config.h b/src/kernel/config.h index e85325bc1..75be214e0 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -174,7 +174,7 @@ extern "C" { param_t findparam(const char *s, const struct locale *lang); param_t findparam_ex(const char *s, const struct locale * lang); - int isparam(const char *s, const struct locale * lang, param_t param); + bool isparam(const char *s, const struct locale * lang, param_t param); param_t getparam(const struct locale *lang); extern int getid(void); diff --git a/src/kernel/move.c b/src/kernel/move.c index 7eed52d5f..80bdfbd5a 100644 --- a/src/kernel/move.c +++ b/src/kernel/move.c @@ -633,7 +633,7 @@ static bool is_freezing(const unit * u) #define SA_NO_INSECT -1 #define SA_NO_COAST -2 -static int is_ship_allowed(struct ship *sh, const region * r) +static bool is_ship_allowed(struct ship *sh, const region * r) { int c = 0; static const building_type *bt_harbour = NULL; diff --git a/src/kernel/order.c b/src/kernel/order.c index 9004fd4db..d7105e8eb 100644 --- a/src/kernel/order.c +++ b/src/kernel/order.c @@ -373,7 +373,7 @@ order *parse_order(const char *s, const struct locale * lang) * \return true if the order is long * \sa is_exclusive(), is_repeated(), is_persistent() */ -int is_repeated(const order * ord) +bool is_repeated(const order * ord) { keyword_t kwd = ORD_KEYWORD(ord); const struct locale *lang = ORD_LOCALE(ord); @@ -439,7 +439,7 @@ int is_repeated(const order * ord) * \return true if the order is long * \sa is_exclusive(), is_repeated(), is_persistent() */ -int is_exclusive(const order * ord) +bool is_exclusive(const order * ord) { keyword_t kwd = ORD_KEYWORD(ord); const struct locale *lang = ORD_LOCALE(ord); @@ -500,11 +500,11 @@ int is_exclusive(const order * ord) * \return true if the order is long * \sa is_exclusive(), is_repeated(), is_persistent() */ -int is_long(const order * ord) +bool is_long(const order * ord) { keyword_t kwd = ORD_KEYWORD(ord); const struct locale *lang = ORD_LOCALE(ord); - int result = 0; + bool result = false; switch (kwd) { case K_CAST: @@ -550,7 +550,7 @@ int is_long(const order * ord) parser_popstate(); break; default: - result = 0; + result = false; } return result; } @@ -564,7 +564,7 @@ int is_long(const order * ord) * \return true if the order is persistent * \sa is_exclusive(), is_repeated(), is_persistent() */ -int is_persistent(const order * ord) +bool is_persistent(const order * ord) { keyword_t kwd = ORD_KEYWORD(ord); int persist = ord->_persistent != 0; diff --git a/src/kernel/order.h b/src/kernel/order.h index 9e0ebeef5..6e2159687 100644 --- a/src/kernel/order.h +++ b/src/kernel/order.h @@ -51,10 +51,10 @@ extern "C" { extern keyword_t get_keyword(const order * ord); extern void set_order(order ** destp, order * src); extern char *getcommand(const order * ord); - extern int is_persistent(const order * ord); - extern int is_exclusive(const order * ord); - extern int is_repeated(const order * ord); - extern int is_long(const order * ord); + extern bool is_persistent(const order * ord); + extern bool is_exclusive(const order * ord); + extern bool is_repeated(const order * ord); + extern bool is_long(const order * ord); extern char *write_order(const order * ord, char *buffer, size_t size); diff --git a/src/kernel/region.c b/src/kernel/region.c index bfaaab804..bdd16de12 100644 --- a/src/kernel/region.c +++ b/src/kernel/region.c @@ -817,17 +817,17 @@ bool r_isforest(const region * r) return false; } -int is_coastregion(region * r) +bool is_coastregion(region * r) { direction_t i; int res = 0; - for (i = 0; i < MAXDIRECTIONS; i++) { + for (i = 0; !res && i < MAXDIRECTIONS; i++) { region *rn = rconnect(r, i); if (rn && fval(rn->terrain, SEA_REGION)) res++; } - return res; + return res!=0; } int rpeasants(const region * r) diff --git a/src/kernel/region.h b/src/kernel/region.h index 88764586a..2cdd3dd95 100644 --- a/src/kernel/region.h +++ b/src/kernel/region.h @@ -210,7 +210,7 @@ extern "C" { short rroad(const struct region *r, direction_t d); void rsetroad(struct region *r, direction_t d, short value); - int is_coastregion(struct region *r); + bool is_coastregion(struct region *r); int rtrees(const struct region *r, int ageclass); enum {