[Freeciv-Dev] Re: (PR#11278) [C++] common/nation.h has struct member "cl
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] Re: (PR#11278) [C++] common/nation.h has struct member "class" |
From: |
"Frédéric Brière" <fbriere@xxxxxxxxxxx> |
Date: |
Wed, 1 Dec 2004 14:40:56 -0800 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=11278 >
On Wed, Dec 01, 2004 at 02:39:06PM -0800, Mike Kaufman wrote:
> use unified diffs please.
Yeah, sorry about that screwup. Here's the unified version.
--
Frédéric Brière <*> fbriere@xxxxxxxxxxx
=> <fbriere@xxxxxxxxxx> IS NO MORE: <http://www.abacomsucks.com> <=
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.428
diff -u -r1.428 packhand.c
--- client/packhand.c 30 Nov 2004 08:37:02 -0000 1.428
+++ client/packhand.c 1 Dec 2004 22:37:51 -0000
@@ -2588,10 +2588,10 @@
}
pl->city_style = p->city_style;
- if (p->class[0] != '\0') {
- pl->class = mystrdup(p->class);
+ if (p->category[0] != '\0') {
+ pl->category = mystrdup(p->category);
} else {
- pl->class = mystrdup("Other");
+ pl->category = mystrdup("Other");
}
if (p->legend[0] != '\0') {
Index: common/nation.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/nation.c,v
retrieving revision 1.40
diff -u -r1.40 nation.c
--- common/nation.c 23 Oct 2004 19:03:09 -0000 1.40
+++ common/nation.c 1 Dec 2004 22:37:51 -0000
@@ -223,9 +223,9 @@
p->leaders = NULL;
}
- if (p->class) {
- free(p->class);
- p->class = NULL;
+ if (p->category) {
+ free(p->category);
+ p->category = NULL;
}
if (p->legend) {
Index: common/nation.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/nation.h,v
retrieving revision 1.32
diff -u -r1.32 nation.h
--- common/nation.h 10 Nov 2004 17:02:00 -0000 1.32
+++ common/nation.h 1 Dec 2004 22:37:51 -0000
@@ -76,7 +76,7 @@
int city_style;
struct city_name *city_names; /* The default city names. */
struct Sprite *flag_sprite;
- char *class; /* may be empty */
+ char *category; /* may be empty */
char *legend; /* may be empty */
/* civilwar_nations is a NO_NATION_SELECTED-terminated list of index of
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.61
diff -u -r1.61 packets.def
--- common/packets.def 30 Nov 2004 06:54:06 -0000 1.61
+++ common/packets.def 1 Dec 2004 22:37:51 -0000
@@ -1118,7 +1118,7 @@
STRING name_plural[MAX_LEN_NAME];
STRING graphic_str[MAX_LEN_NAME];
STRING graphic_alt[MAX_LEN_NAME];
- STRING class[MAX_LEN_NAME];
+ STRING category[MAX_LEN_NAME];
STRING legend[MAX_LEN_MSG];
UINT8 city_style;
Index: common/packets_gen.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets_gen.c,v
retrieving revision 1.64
diff -u -r1.64 packets_gen.c
--- common/packets_gen.c 30 Nov 2004 06:54:06 -0000 1.64
+++ common/packets_gen.c 1 Dec 2004 22:37:51 -0000
@@ -26716,7 +26716,7 @@
dio_get_string(&din, real_packet->graphic_alt,
sizeof(real_packet->graphic_alt));
}
if (BV_ISSET(fields, 5)) {
- dio_get_string(&din, real_packet->class, sizeof(real_packet->class));
+ dio_get_string(&din, real_packet->category, sizeof(real_packet->category));
}
if (BV_ISSET(fields, 6)) {
dio_get_string(&din, real_packet->legend, sizeof(real_packet->legend));
@@ -26822,7 +26822,7 @@
if(differ) {different++;}
if(differ) {BV_SET(fields, 4);}
- differ = (strcmp(old->class, real_packet->class) != 0);
+ differ = (strcmp(old->category, real_packet->category) != 0);
if(differ) {different++;}
if(differ) {BV_SET(fields, 5);}
@@ -26908,7 +26908,7 @@
dio_put_string(&dout, real_packet->graphic_alt);
}
if (BV_ISSET(fields, 5)) {
- dio_put_string(&dout, real_packet->class);
+ dio_put_string(&dout, real_packet->category);
}
if (BV_ISSET(fields, 6)) {
dio_put_string(&dout, real_packet->legend);
Index: common/packets_gen.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets_gen.h,v
retrieving revision 1.54
diff -u -r1.54 packets_gen.h
--- common/packets_gen.h 30 Nov 2004 06:54:07 -0000 1.54
+++ common/packets_gen.h 1 Dec 2004 22:37:52 -0000
@@ -865,7 +865,7 @@
char name_plural[MAX_LEN_NAME];
char graphic_str[MAX_LEN_NAME];
char graphic_alt[MAX_LEN_NAME];
- char class[MAX_LEN_NAME];
+ char category[MAX_LEN_NAME];
char legend[MAX_LEN_MSG];
int city_style;
int init_techs[MAX_NUM_TECH_LIST];
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.205
diff -u -r1.205 ruleset.c
--- server/ruleset.c 30 Nov 2004 06:54:07 -0000 1.205
+++ server/ruleset.c 1 Dec 2004 22:37:52 -0000
@@ -2467,10 +2467,10 @@
/* class and legend */
- pl->class =
+ pl->category =
mystrdup(secfile_lookup_str_default(file, "", "%s.class", sec[i]));
- if (check_strlen(pl->class, MAX_LEN_NAME, "Class '%s' is too long")) {
- pl->class[MAX_LEN_NAME - 1] = '\0';
+ if (check_strlen(pl->category, MAX_LEN_NAME, "Class '%s' is too long")) {
+ pl->category[MAX_LEN_NAME - 1] = '\0';
}
pl->legend =
@@ -3114,7 +3114,7 @@
}
packet.city_style = n->city_style;
memcpy(packet.init_techs, n->init_techs, sizeof(packet.init_techs));
- sz_strlcpy(packet.class, n->class);
+ sz_strlcpy(packet.category, n->category);
sz_strlcpy(packet.legend, n->legend);
lsend_packet_ruleset_nation(dest, &packet);
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.212
diff -u -r1.212 srv_main.c
--- server/srv_main.c 30 Nov 2004 08:37:03 -0000 1.212
+++ server/srv_main.c 1 Dec 2004 22:37:52 -0000
@@ -1236,11 +1236,11 @@
continue;
}
nation = get_nation_by_idx(pplayer->nation);
- assert(nation->class != NULL);
+ assert(nation->category != NULL);
if (class == NULL) {
/* Set the class. */
- class = nation->class;
- } else if (strcmp(nation->class, class) != 0) {
+ class = nation->category;
+ } else if (strcmp(nation->category, class) != 0) {
/* Multiple classes are already being used. */
return NULL;
}
@@ -1263,7 +1263,7 @@
struct nation_type *nation = get_nation_by_idx(i);
if (nations_available[i]
- && (class == NULL || strcmp(nation->class, class) == 0)) {
+ && (class == NULL || strcmp(nation->category, class) == 0)) {
available[count] = i;
count++;
}
|
|