forked from github/server
make some prototypes use bool, not int
This commit is contained in:
parent
1861268109
commit
a8324f16fd
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue