? diff ? diff2 Index: common/astring.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/astring.c,v retrieving revision 1.5 diff -u -r1.5 astring.c --- common/astring.c 2002/02/12 04:22:28 1.5 +++ common/astring.c 2002/02/12 19:49:56 @@ -90,7 +90,7 @@ assert(astr != NULL); assert(astr->n_alloc>=0); - if (astr->n_alloc) { + if (astr->n_alloc > 0) { assert(astr->str != NULL); free(astr->str); } @@ -148,7 +148,7 @@ assert(ath->n_alloc>=0); size = ath->size; - if (ath->n_alloc) { + if (ath->n_alloc > 0) { assert(ath->ptr != NULL); free(ath->ptr); } Index: common/capability.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/capability.c,v retrieving revision 1.6 diff -u -r1.6 capability.c --- common/capability.c 2002/02/10 19:26:25 1.6 +++ common/capability.c 2002/02/12 19:49:56 @@ -26,7 +26,7 @@ start++; \ } \ /* skip to end of token */ \ - for (end = start; *end && !isspace(*end) && *end != ','; end++) \ + for (end = start; *end != '\0' && !isspace(*end) && *end != ','; end++) \ ; \ } Index: common/city.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/city.c,v retrieving revision 1.141 diff -u -r1.141 city.c --- common/city.c 2002/02/12 10:08:03 1.141 +++ common/city.c 2002/02/12 19:49:57 @@ -266,7 +266,7 @@ default: break; } } else if (is_wonder(id)) { - if (game.global_wonders[id]) { + if (game.global_wonders[id] != 0) { state = Q_("?built:B"); } else { state = Q_("?wonder:w"); @@ -303,7 +303,7 @@ if(is_wonder(pcity->currently_building)) cost*=2; } - if(!build) + if(build == 0) cost*=2; return cost; } @@ -465,7 +465,7 @@ if (!improvement_exists(id)) return FALSE; else - return (pcity->improvements[id]); + return (pcity->improvements[id] != I_NONE); } /************************************************************************** @@ -577,9 +577,9 @@ if (tile_t==T_OCEAN && city_got_building(pcity, B_OFFSHORE)) s++; /* government shield bonus & penalty */ - if (s) + if (s > 0) s += (is_celebrating ? g->celeb_shield_bonus : g->shield_bonus); - if (before_penalty && s > before_penalty) + if (before_penalty > 0 && s > before_penalty) s--; if (spec_t & S_POLLUTION) s-=(s*terrain_control.pollution_shield_penalty)/100; /* The shields here are icky */ @@ -614,7 +614,7 @@ if (spec_t & S_ROAD) { t += (get_tile_type(tile_t))->road_trade_incr; } - if (t) { + if (t > 0) { if (spec_t & S_RAILROAD) t+=(t*terrain_control.rail_trade_bonus)/100; @@ -664,7 +664,7 @@ if (spec_t & S_ROAD) { t += (get_tile_type(tile_t))->road_trade_incr; } - if (t) { + if (t > 0) { int before_penalty = (is_celebrating ? g->celeb_trade_before_penalty : g->trade_before_penalty); @@ -673,7 +673,7 @@ /* Civ1 specifically documents that Railroad trade increase is before * Democracy/Republic [government in general now -- SKi] bonus -AJS */ - if (t) + if (t > 0) t += (is_celebrating ? g->celeb_trade_bonus : g->trade_bonus); if(city_affected_by_wonder(pcity, B_COLLOSSUS)) @@ -682,7 +682,7 @@ t+=(t*terrain_control.road_superhighway_trade_bonus)/100; /* government trade penalty -- SKi */ - if (before_penalty && t > before_penalty) + if (before_penalty > 0 && t > before_penalty) t--; if (spec_t & S_POLLUTION) t-=(t*terrain_control.pollution_trade_penalty)/100; /* The trade here is dirty */ @@ -788,9 +788,9 @@ if (spec_t & S_RAILROAD) f+=(f*terrain_control.rail_food_bonus)/100; - if (f) + if (f > 0) f += (is_celebrating ? g->celeb_food_bonus : g->food_bonus); - if (before_penalty && f > before_penalty) + if (before_penalty > 0 && f > before_penalty) f--; if (spec_t & S_POLLUTION) @@ -880,7 +880,7 @@ { int i,n; for(i=0,n=0; i<4; i++) - if(pcity->trade[i]) n++; + if(pcity->trade[i] != 0) n++; return n; } @@ -1040,7 +1040,7 @@ **************************************************************************/ struct city *city_list_find_id(struct city_list *This, int id) { - if(id) { + if(id != 0) { struct genlist_iterator myiter; genlist_iterator_init(&myiter, &This->list, 0); @@ -1204,7 +1204,7 @@ new_class=TYPE_NORMAL_IMPROVEMENT; put_penalty = (orig_class != new_class && - game_next_year(pcity->turn_last_built) < game.year)? 1 : 0; + game_next_year(pcity->turn_last_built) < game.year); if (put_penalty) shield_stock_after_adjustment = pcity->before_change_shields/2; @@ -1417,7 +1417,7 @@ if (is_wonder(id)) { state = _("Wonder"); - if (game.global_wonders[id]) + if (game.global_wonders[id] != 0) state = _("Built"); if (wonder_obsolete(id)) state = _("Obsolete"); @@ -1449,7 +1449,7 @@ if (cities > basis) { content--; - if (step) + if (step != 0) content -= (cities - basis - 1) / step; /* the first penalty is at (basis + 1) cities; the next is at (basis + step + 1), _not_ (basis + step) */ @@ -1566,7 +1566,7 @@ } } - while (rate) { + while (rate > 0) { if (get_gov_pcity(pcity)->index != game.government_when_anarchy) { tax += tax_rate; sci += sci_rate; @@ -1574,17 +1574,17 @@ } else { /* ANARCHY */ lux += 100; } - if (tax >= 100 && rate) { + if (tax >= 100 && rate > 0) { tax -= 100; pcity->tax_total++; rate--; } - if (sci >= 100 && rate) { + if (sci >= 100 && rate > 0) { sci -= 100; pcity->science_total++; rate--; } - if (lux >= 100 && rate) { + if (lux >= 100 && rate > 0) { lux -= 100; pcity->luxury_total++; rate--; @@ -1663,22 +1663,22 @@ angry citizen are eliminated first, then content are made happy, then unhappy content, etc. each conversions costs 2 luxuries. */ - while (x >= 2 && pcity->ppl_angry[1]) { + while (x >= 2 && pcity->ppl_angry[1] > 0) { pcity->ppl_angry[1]--; pcity->ppl_unhappy[1]++; x -= 2; } - while (x >= 2 && pcity->ppl_content[1]) { + while (x >= 2 && pcity->ppl_content[1] > 0) { pcity->ppl_content[1]--; pcity->ppl_happy[1]++; x -= 2; } - while (x >= 4 && pcity->ppl_unhappy[1]) { + while (x >= 4 && pcity->ppl_unhappy[1] > 0) { pcity->ppl_unhappy[1]--; pcity->ppl_happy[1]++; x -= 4; } - if (x >= 2 && pcity->ppl_unhappy[1]) { + if (x >= 2 && pcity->ppl_unhappy[1] > 0) { pcity->ppl_unhappy[1]--; pcity->ppl_content[1]++; x -= 2; @@ -1691,12 +1691,12 @@ **************************************************************************/ static void citizen_happy_units(struct city *pcity, int unhap) { - while (unhap > 0 && pcity->ppl_content[3]) { + while (unhap > 0 && pcity->ppl_content[3] > 0) { pcity->ppl_content[3]--; pcity->ppl_unhappy[3]++; unhap--; } - while (unhap >= 2 && pcity->ppl_happy[3]) { + while (unhap >= 2 && pcity->ppl_happy[3] > 0) { pcity->ppl_happy[3]--; pcity->ppl_unhappy[3]++; unhap -= 2; @@ -1733,12 +1733,12 @@ faces += get_cathedral_power(pcity); /* make people content (but not happy): get rid of angry first, then make unhappy content. */ - while (faces && pcity->ppl_angry[2]) { + while (faces > 0 && pcity->ppl_angry[2] > 0) { pcity->ppl_angry[2]--; pcity->ppl_unhappy[2]++; faces--; } - while (faces && pcity->ppl_unhappy[2]) { + while (faces > 0 && pcity->ppl_unhappy[2] > 0) { pcity->ppl_unhappy[2]--; pcity->ppl_content[2]++; faces--; @@ -1768,7 +1768,7 @@ bonus += 1; if (city_got_building(pcity, B_HANGING)) bonus += 2; - while (bonus && pcity->ppl_content[4]) { + while (bonus > 0 && pcity->ppl_content[4] > 0) { pcity->ppl_content[4]--; pcity->ppl_happy[4]++; bonus--; @@ -1781,12 +1781,12 @@ if (city_affected_by_wonder(pcity, B_CURE)) bonus += 1; /* get rid of angry first, then make unhappy content */ - while (bonus && pcity->ppl_angry[4]) { + while (bonus > 0 && pcity->ppl_angry[4] > 0) { pcity->ppl_angry[4]--; pcity->ppl_unhappy[4]++; bonus--; } - while (bonus && pcity->ppl_unhappy[4]) { + while (bonus > 0 && pcity->ppl_unhappy[4] > 0) { pcity->ppl_unhappy[4]--; pcity->ppl_content[4]++; bonus--; @@ -1926,12 +1926,12 @@ unit_list_iterate_end; city_units *= g->martial_law_per; /* get rid of angry first, then make unhappy content */ - while (city_units > 0 && pcity->ppl_angry[3]) { + while (city_units > 0 && pcity->ppl_angry[3] > 0) { pcity->ppl_angry[3]--; pcity->ppl_unhappy[3]++; city_units--; } - while (city_units > 0 && pcity->ppl_unhappy[3]) { + while (city_units > 0 && pcity->ppl_unhappy[3] > 0) { pcity->ppl_unhappy[3]--; pcity->ppl_content[3]++; city_units--; @@ -2080,7 +2080,7 @@ if (g->corruption_level == 0) { return trade_penalty; } - if (g->fixed_corruption_distance) { + if (g->fixed_corruption_distance != 0) { dist = g->fixed_corruption_distance; } else { capital = find_palace(city_owner(pcity)); Index: common/combat.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/combat.c,v retrieving revision 1.16 diff -u -r1.16 combat.c --- common/combat.c 2002/02/12 04:26:17 1.16 +++ common/combat.c 2002/02/12 19:49:58 @@ -474,7 +474,7 @@ } } unit_list_iterate_end; - if (count && !bestdef) { + if (count > 0 && !bestdef) { struct unit *debug_unit = unit_list_get(&map_get_tile(x, y)->units, 0); freelog(LOG_ERROR, "Get_def bugged at (%d,%d). The most likely course" " is a unit on an ocean square without a transport. The owner" Index: common/connection.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/connection.c,v retrieving revision 1.22 diff -u -r1.22 connection.c --- common/connection.c 2002/02/12 04:29:26 1.22 +++ common/connection.c 2002/02/12 19:49:58 @@ -59,7 +59,7 @@ If it is set the disconnection of conns is posponed. This is sometimes neccesary as removing a random connection while we are iterating through a connection list might corrupt the list. */ -int delayed_disconnect = FALSE; +int delayed_disconnect = 0; /************************************************************************** Command access levels for client-side use; at present, they are only @@ -162,7 +162,7 @@ int start, nput, nblock; if (pc->delayed_disconnect) { - if (delayed_disconnect) { + if (delayed_disconnect > 0) { return 0; } else { if (close_callback) { @@ -188,7 +188,7 @@ } if (FD_ISSET(pc->sock, &exceptfs)) { - if (delayed_disconnect) { + if (delayed_disconnect > 0) { pc->delayed_disconnect = TRUE; return 0; } else { @@ -208,7 +208,7 @@ break; } #endif - if (delayed_disconnect) { + if (delayed_disconnect > 0) { pc->delayed_disconnect = TRUE; return 0; } else { @@ -236,11 +236,11 @@ **************************************************************************/ void flush_connection_send_buffer_all(struct connection *pc) { - if(pc && pc->used && pc->send_buffer->ndata) { + if(pc && pc->used && pc->send_buffer->ndata > 0) { write_socket_data(pc, pc->send_buffer, 0); if (pc->notify_of_writable_data) { pc->notify_of_writable_data(pc, pc->send_buffer - && pc->send_buffer->ndata); + && pc->send_buffer->ndata > 0); } } } @@ -266,7 +266,7 @@ int len) { if (pc && pc->delayed_disconnect) { - if (delayed_disconnect) { + if (delayed_disconnect > 0) { return TRUE; } else { if (close_callback) { @@ -287,7 +287,7 @@ /* added this check so we don't gobble up too much mem */ if (buf->nsize > MAX_LEN_BUFFER) { - if (delayed_disconnect) { + if (delayed_disconnect > 0) { pc->delayed_disconnect = TRUE; return TRUE; } else { @@ -313,7 +313,7 @@ void send_connection_data(struct connection *pc, unsigned char *data, int len) { if (pc && pc->used) { - if(pc->send_buffer->do_buffer_sends) { + if(pc->send_buffer->do_buffer_sends > 0) { flush_connection_send_buffer_packets(pc); if (!add_connection_data(pc, data, len)) { freelog(LOG_ERROR, "cut connection %s due to huge send buffer (1)", @@ -477,7 +477,7 @@ buffer[0] = '\0'; - if (*pconn->name) { + if (*pconn->name != '\0') { my_snprintf(buffer, sizeof(buffer), _("%s from %s"), pconn->name, pconn->addr); } else { Index: common/game.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/game.c,v retrieving revision 1.125 diff -u -r1.125 game.c --- common/game.c 2002/02/12 09:36:52 1.125 +++ common/game.c 2002/02/12 19:49:59 @@ -300,8 +300,8 @@ midedge = &(pcmap->edges[map.xsize * map.ysize]); for (accum = 1, turn = 1; accum > 0; turn++) { - thisedge = (turn & 0x1) ? pcmap->edges : midedge; - nextedge = (turn & 0x1) ? midedge : pcmap->edges; + thisedge = ((turn & 0x1) == 1) ? pcmap->edges : midedge; + nextedge = ((turn & 0x1) == 1) ? midedge : pcmap->edges; for (accum = 0; thisedge->x >= 0; thisedge++) { x = thisedge->x; @@ -807,7 +807,7 @@ if (game.spacerace) { for(i=0; parts[i] < B_LAST; i++) { int t = improvement_types[parts[i]].tech_req; - if(tech_exists(t) && game.global_advances[t]) + if (tech_exists(t) && game.global_advances[t] != 0) spaceshipparts++; } } Index: common/genlist.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/genlist.c,v retrieving revision 1.8 diff -u -r1.8 genlist.c --- common/genlist.c 2002/02/12 04:49:51 1.8 +++ common/genlist.c 2002/02/12 19:50:00 @@ -61,7 +61,7 @@ ************************************************************************/ void genlist_unlink_all(struct genlist *pgenlist) { - if(pgenlist->nelements) { + if(pgenlist->nelements > 0) { struct genlist_link *plink=pgenlist->head_link, *plink2; do { @@ -84,7 +84,7 @@ ************************************************************************/ void genlist_unlink(struct genlist *pgenlist, void *punlink) { - if(pgenlist->nelements) { + if(pgenlist->nelements > 0) { struct genlist_link *plink=pgenlist->head_link; while(plink!=&pgenlist->null_link && plink->dataptr!=punlink) @@ -117,7 +117,7 @@ ************************************************************************/ void genlist_insert(struct genlist *pgenlist, void *data, int pos) { - if(!pgenlist->nelements) { /*list is empty, ignore pos */ + if(pgenlist->nelements == 0) { /*list is empty, ignore pos */ struct genlist_link *plink=(struct genlist_link *) fc_malloc(sizeof(struct genlist_link)); @@ -194,11 +194,11 @@ return &pgenlist->null_link; if(posnelements/2) /* fastest to do forward search */ - for(plink=pgenlist->head_link; pos; pos--) + for(plink=pgenlist->head_link; pos != 0; pos--) plink=plink->next; else /* fastest to do backward search */ - for(plink=pgenlist->tail_link,pos=pgenlist->nelements-pos-1; pos; pos--) + for(plink=pgenlist->tail_link,pos=pgenlist->nelements-pos-1; pos != 0; pos--) plink=plink->prev; return plink; Index: common/hash.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/hash.c,v retrieving revision 1.17 diff -u -r1.17 hash.c --- common/hash.c 2002/02/12 04:49:52 1.17 +++ common/hash.c 2002/02/12 19:50:00 @@ -181,7 +181,7 @@ const char *key = (const char*)vkey; unsigned long result=0; - for(; *key; ++key) { + for(; *key != '\0'; ++key) { result *= 5; result += *key; } Index: common/improvement.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/improvement.c,v retrieving revision 1.15 diff -u -r1.15 improvement.c --- common/improvement.c 2002/02/11 10:38:03 1.15 +++ common/improvement.c 2002/02/12 19:50:01 @@ -365,7 +365,7 @@ { if (improvement_types[id].obsolete_by==A_NONE) return FALSE; - return (game.global_advances[improvement_types[id].obsolete_by]); + return (game.global_advances[improvement_types[id].obsolete_by] != 0); } /************************************************************************** @@ -409,7 +409,7 @@ while ((type = peffect->type) != EFT_LAST) { if (type == EFT_SPACE_PART) { /* TODO: remove this */ - if (!game.global_wonders[B_APOLLO]) + if (game.global_wonders[B_APOLLO] == 0) return FALSE; if (p->spaceship.state >= SSHIP_LAUNCHED) return FALSE; @@ -425,7 +425,7 @@ } if (is_wonder(id)) { /* Can't build wonder if already built */ - if (game.global_wonders[id]) return FALSE; + if (game.global_wonders[id] != 0) return FALSE; } else { /* Can't build if obsolette */ if (improvement_obsolete(p, id)) return FALSE; Index: common/inputfile.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/inputfile.c,v retrieving revision 1.18 diff -u -r1.18 inputfile.c --- common/inputfile.c 2002/02/12 04:49:52 1.18 +++ common/inputfile.c 2002/02/12 19:50:02 @@ -236,7 +236,7 @@ freelog(LOG_DEBUG, "inputfile: sub-closing \"%s\"", inf->filename); - if (fz_ferror(inf->fp)) { + if (fz_ferror(inf->fp) != 0) { freelog(LOG_ERROR, "Error before closing %s: %s", inf->filename, fz_strerror(inf->fp)); fz_fclose(inf->fp); @@ -336,7 +336,7 @@ /* skip any whitespace: */ inf->cur_line_pos = len; c = inf->cur_line.str + len; - while (*c && isspace(*c)) c++; + while (*c != '\0' && isspace(*c)) c++; if (*c != '\"') { inf_die(inf, "Did not find opening doublequote for '*include' line"); @@ -345,7 +345,7 @@ inf->cur_line_pos = c - inf->cur_line.str; bare_name = c; - while (*c && *c!='\"') c++; + while (*c != '\0' && *c!='\"') c++; if (*c != '\"') { inf_die(inf, "Did not find closing doublequote for '*include' line"); } @@ -353,7 +353,7 @@ inf->cur_line_pos = c - inf->cur_line.str; /* check rest of line is well-formed: */ - while (*c && isspace(*c) && !my_is_comment(*c)) c++; + while (*c != '\0' && isspace(*c) && !my_is_comment(*c)) c++; if (!(*c=='\0' || my_is_comment(*c))) { inf_die(inf, "Junk after filename for '*include' line"); } @@ -468,7 +468,7 @@ inf->line_num++; inf->cur_line_pos = 0; - astr_minsize(&inf->copy_line, inf->cur_line.n + (inf->cur_line.n==0)); + astr_minsize(&inf->copy_line, inf->cur_line.n + ((inf->cur_line.n == 0) ? 1 : 0)); strcpy(inf->copy_line.str, inf->cur_line.str); if (check_include(inf)) { @@ -619,7 +619,7 @@ if (*c++ != '[') return NULL; start = c; - while (*c && *c != ']') { + while (*c != '\0' && *c != ']') { c++; } if (*c != ']') @@ -641,19 +641,19 @@ assert(have_line(inf)); c = inf->cur_line.str + inf->cur_line_pos; - while(*c && isspace(*c)) { + while(*c != '\0' && isspace(*c)) { c++; } - if (!*c) + if (*c == '\0') return NULL; start = c; - while (*c && !isspace(*c) && *c != '=' && !my_is_comment(*c)) { + while (*c != '\0' && !isspace(*c) && *c != '=' && !my_is_comment(*c)) { c++; } - if (!(*c && (isspace(*c) || *c == '='))) + if (!(*c != '\0' && (isspace(*c) || *c == '='))) return NULL; end = c; - while (*c && *c != '=' && !my_is_comment(*c)) { + while (*c != '\0' && *c != '=' && !my_is_comment(*c)) { c++; } if (*c != '=') { @@ -677,7 +677,7 @@ if (!at_eol(inf)) { c = inf->cur_line.str + inf->cur_line_pos; - while(*c && isspace(*c)) { + while(*c != '\0' && isspace(*c)) { c++; } if (*c != '\0' && !my_is_comment(*c)) @@ -704,7 +704,7 @@ assert(have_line(inf)); c = inf->cur_line.str + inf->cur_line_pos; - while(*c && isspace(*c)) { + while(*c != '\0' && isspace(*c)) { c++; } if (*c != target) @@ -751,20 +751,20 @@ assert(have_line(inf)); c = inf->cur_line.str + inf->cur_line_pos; - while(*c && isspace(*c)) { + while(*c != '\0' && isspace(*c)) { c++; } - if (!*c) + if (*c == '\0') return NULL; if (*c == '-' || isdigit(*c)) { /* a number: */ start = c++; - while(*c && isdigit(*c)) { + while(*c != '\0' && isdigit(*c)) { c++; } /* check that the trailing stuff is ok: */ - if (!(!*c || *c == ',' || isspace(*c) || my_is_comment(*c))) { + if (!(*c == '\0' || *c == ',' || isspace(*c) || my_is_comment(*c))) { return NULL; } /* If its a comma, we don't want to obliterate it permanently, @@ -784,10 +784,10 @@ if (*c == '_' && *(c+1) == '(') { has_i18n_marking = TRUE; c += 2; - while(*c && isspace(*c)) { + while(*c != '\0' && isspace(*c)) { c++; } - if (!*c) + if (*c == '\0') return NULL; } Index: common/log.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/log.c,v retrieving revision 1.29 diff -u -r1.29 log.c --- common/log.c 2002/02/12 04:49:52 1.29 +++ common/log.c 2002/02/12 19:50:02 @@ -127,7 +127,7 @@ c++; pc = c; c = strchr(c, ','); - if (c && *pc && *(c+1)) { + if (c && *pc != '\0' && c[1] != '\0') { c[0] = '\0'; logd_files[i].min = atoi(pc); logd_files[i].max = atoi(c+1); Index: common/map.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.c,v retrieving revision 1.110 diff -u -r1.110 map.c --- common/map.c 2002/02/12 08:42:26 1.110 +++ common/map.c 2002/02/12 19:50:03 @@ -278,7 +278,7 @@ int i; for (i = 0; i < ARRAY_SIZE(tile_special_type_names); i++) { - if (type & 0x1) { + if ((type & 0x1) == 1) { return tile_special_type_names[i]; } type >>= 1; Index: common/map.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.h,v retrieving revision 1.117 diff -u -r1.117 map.h --- common/map.h 2002/02/11 13:55:49 1.117 +++ common/map.h 2002/02/12 19:50:04 @@ -636,12 +636,12 @@ #define MAP_MIN_GENERATOR 1 #define MAP_MAX_GENERATOR 4 -#define MAP_DEFAULT_TINYISLES 0 -#define MAP_MIN_TINYISLES 0 -#define MAP_MAX_TINYISLES 1 +#define MAP_DEFAULT_TINYISLES FALSE +#define MAP_MIN_TINYISLES FALSE +#define MAP_MAX_TINYISLES TRUE -#define MAP_DEFAULT_SEPARATE_POLES 1 -#define MAP_MIN_SEPARATE_POLES 0 -#define MAP_MAX_SEPARATE_POLES 1 +#define MAP_DEFAULT_SEPARATE_POLES TRUE +#define MAP_MIN_SEPARATE_POLES FALSE +#define MAP_MAX_SEPARATE_POLES TRUE #endif /* FC__MAP_H */ Index: common/packets.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/packets.c,v retrieving revision 1.178 diff -u -r1.178 packets.c --- common/packets.c 2002/02/12 08:59:58 1.178 +++ common/packets.c 2002/02/12 19:50:07 @@ -242,7 +242,7 @@ int len, type; *presult = FALSE; - if (pc->used==0) + if (!pc->used) return NULL; /* connection was closed, stop reading */ if(pc->buffer->ndata<3) Index: common/player.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/player.c,v retrieving revision 1.80 diff -u -r1.80 player.c --- common/player.c 2002/02/12 10:08:04 1.80 +++ common/player.c 2002/02/12 19:50:08 @@ -475,7 +475,7 @@ **************************************************************************/ int ai_fuzzy(struct player *pplayer, int normal_decision) { - if (!pplayer->ai.control || !pplayer->ai.fuzzy) return normal_decision; + if (!pplayer->ai.control || pplayer->ai.fuzzy == 0) return normal_decision; if (myrand(1000) >= pplayer->ai.fuzzy) return normal_decision; return !normal_decision; } Index: common/registry.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/registry.c,v retrieving revision 1.42 diff -u -r1.42 registry.c --- common/registry.c 2002/02/11 10:38:05 1.42 +++ common/registry.c 2002/02/12 19:50:09 @@ -303,7 +303,7 @@ section_list_iterate(*file->sections, psection) { entry_list_iterate(psection->entries, pentry) { - if (!pentry->used) { + if (pentry->used == 0) { if (any == 0 && filename) { freelog(LOG_NORMAL, "Unused entries in file %s:", filename); any = 1; @@ -343,7 +343,7 @@ freelog(LOG_DEBUG, "entry %s %d", name, pentry->ivalue); } } - pentry->used = 0; + pentry->used = FALSE; return pentry; } @@ -605,11 +605,11 @@ if(!SAVE_TABLES) break; c = first = pentry->name; - if(!*c || !isalpha(*c)) break; - for( ; *c && isalpha(*c); c++); + if(*c == '\0' || !isalpha(*c)) break; + for( ; *c != '\0' && isalpha(*c); c++); if(strncmp(c,"0.",2) != 0) break; c+=2; - if(!*c || !isalnum(*c)) break; + if(*c == '\0' || !isalnum(*c)) break; offset = c - first; first[offset-2] = '\0'; @@ -696,7 +696,7 @@ moutstr(NULL); /* free internal buffer */ - if (fz_ferror(fs)) { + if (fz_ferror(fs) != 0) { freelog(LOG_ERROR, "Error before closing %s: %s", filename, fz_strerror(fs)); fz_fclose(fs); @@ -948,8 +948,7 @@ my_vsnprintf(buf, sizeof(buf), path, ap); va_end(ap); - return BOOL_VAL(section_file_lookup_internal(my_section_file, buf) != - NULL); + return section_file_lookup_internal(my_section_file, buf) != NULL; } @@ -1270,7 +1269,7 @@ char *dest = sbuf_malloc(sb, strlen(str)+1); char *d2=dest; if(dest) { - while (*str) { + while (*str != '\0') { if (*str=='\\') { str++; if (*str=='\\') { @@ -1320,7 +1319,7 @@ } len = strlen(str)+1; - for(c=str; *c; c++) { + for(c=str; *c != '\0'; c++) { if (*c == '\n' || *c == '\\' || *c == '\"') { len++; } @@ -1331,7 +1330,7 @@ } dest = buf; - while(*str) { + while(*str != '\0') { if (*str == '\n' || *str == '\\' || *str == '\"') { *dest++ = '\\'; if (*str == '\n') { Index: common/sbuffer.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/sbuffer.c,v retrieving revision 1.5 diff -u -r1.5 sbuffer.c --- common/sbuffer.c 2002/02/12 04:49:52 1.5 +++ common/sbuffer.c 2002/02/12 19:50:09 @@ -94,7 +94,7 @@ assert(sb && (sb->offset>0)); align_offset = sb->offset % SBUF_ALIGN_SIZE; - if (align_offset) { + if (align_offset != 0) { sb->offset += SBUF_ALIGN_SIZE - align_offset; } } Index: common/shared.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/shared.c,v retrieving revision 1.74 diff -u -r1.74 shared.c --- common/shared.c 2002/02/12 09:36:53 1.74 +++ common/shared.c 2002/02/12 19:50:10 @@ -83,7 +83,7 @@ int curlen = 0; int nlines = 1; - for(cp=s; *cp; cp++) { + for(cp=s; *cp != '\0'; cp++) { if(*cp!='\n') curlen++; else { @@ -99,7 +99,7 @@ r=rn=fc_malloc(nlines*(maxlen+1)); curlen=0; - for(cp0=cp=s; *cp; cp++) { + for(cp0=cp=s; *cp != '\0'; cp++) { if(*cp!='\n') curlen++; else { @@ -274,7 +274,7 @@ char *cp; /* must not be NULL or empty */ - if (!name || !(*name)) { + if (!name || *name == '\0') { return NULL; } @@ -285,7 +285,7 @@ /* must be composed entirely of printable ISO 8859-1 characters */ for (cp = name; is_iso_latin1(*cp); cp++) ; - if (*cp) { + if (*cp != '\0') { return NULL; } @@ -341,7 +341,7 @@ char *skip_leading_spaces(char *s) { assert(s!=NULL); - while(*s && isspace(*s)) { + while(*s != '\0' && isspace(*s)) { s++; } return s; @@ -358,7 +358,7 @@ assert(s!=NULL); t = skip_leading_spaces(s); if (t != s) { - while (*t) { + while (*t != '\0') { *s++ = *t++; } *s = '\0'; @@ -376,7 +376,7 @@ assert(s!=NULL); len = strlen(s); - if (len) { + if (len > 0) { t = s + len -1; while(isspace(*t)) { *t = '\0'; @@ -426,7 +426,7 @@ /* At top of this loop, s points to the rest of string, * either at start or after inserted newline: */ top: - if (s && *s && slen > len) { + if (s && *s != '\0' && slen > len) { char *c; num_lines++; @@ -451,7 +451,7 @@ } /* couldn't find a good break; settle for a bad one... */ - for(c=s+len+1; *c; c++) { + for(c=s+len+1; *c != '\0'; c++) { if (isspace(*c)) { *c = '\n'; slen -= c+1 - s; @@ -791,7 +791,7 @@ grouping = &m; } else { size_t len; - for (len = 0; lc->grouping[len] && lc->grouping[len] != CHAR_MAX; len++) + for (len = 0; lc->grouping[len] != '\0' && lc->grouping[len] != CHAR_MAX; len++) ; len++; grouping = fc_malloc(len); Index: common/unit.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/unit.c,v retrieving revision 1.146 diff -u -r1.146 unit.c --- common/unit.c 2002/02/12 10:08:04 1.146 +++ common/unit.c 2002/02/12 19:50:12 @@ -264,7 +264,7 @@ **************************************************************************/ int is_ground_units_transport(struct unit *punit) { - return (get_transporter_capacity(punit) + return (get_transporter_capacity(punit) > 0 && !unit_flag(punit, F_MISSILE_CARRIER) && !unit_flag(punit, F_CARRIER)); } @@ -274,7 +274,7 @@ **************************************************************************/ int is_air_units_transport(struct unit *punit) { - return (get_transporter_capacity(punit) + return (get_transporter_capacity(punit) > 0 && (unit_flag(punit, F_MISSILE_CARRIER) || unit_flag(punit, F_CARRIER))); } @@ -851,7 +851,7 @@ int rate,f; rate=unit_type(punit)->move_rate/SINGLE_MOVE; f=((punit->fuel)-1); - if(punit->moves_left%SINGLE_MOVE) { + if ((punit->moves_left % SINGLE_MOVE) != 0) { if(punit->moves_left/SINGLE_MOVE>0) { my_snprintf(text, sizeof(text), "%s: (%d)%d %d/%d", moves_str, ((rate*f)+(punit->moves_left/SINGLE_MOVE)), @@ -868,7 +868,7 @@ punit->moves_left/SINGLE_MOVE); } } else { - if(punit->moves_left%SINGLE_MOVE) { + if ((punit->moves_left % SINGLE_MOVE) != 0) { if(punit->moves_left/SINGLE_MOVE>0) { my_snprintf(text, sizeof(text), "%s: %d %d/%d", moves_str, punit->moves_left/SINGLE_MOVE, punit->moves_left%SINGLE_MOVE, Index: common/unittype.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/unittype.c,v retrieving revision 1.11 diff -u -r1.11 unittype.c --- common/unittype.c 2002/02/12 08:59:59 1.11 +++ common/unittype.c 2002/02/12 19:50:12 @@ -259,14 +259,14 @@ if(count==1) return mystrdup(unit_name(get_role_unit(flag,0))); - if(count) { + if(count > 0) { struct astring astr; astr_init(&astr); astr_minsize(&astr,1); astr.str[0] = 0; - while(count--) { + while((count--) > 0) { int u = get_role_unit(flag,count); char *unitname = unit_name(u); @@ -418,7 +418,7 @@ { if (!unit_type_exists(id)) return FALSE; - if (unit_type_flag(id, F_NUCLEAR) && !game.global_wonders[B_MANHATTEN]) + if (unit_type_flag(id, F_NUCLEAR) && game.global_wonders[B_MANHATTEN] == 0) return FALSE; if (unit_type_flag(id, F_FANATIC) && !government_has_flag(get_gov_pplayer(p), G_FANATIC_TROOPS))