Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11278) [C++] common/nation.h has struct member "cl
Home

[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:35:29 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11278 >

This patch handles the big class->category renaming for struct
nation_type and struct packet_ruleset_nation.  It solves both #11278 and
#11280.


-- 
             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 -r1.428 packhand.c
2591,2592c2591,2592
<   if (p->class[0] != '\0') {
<     pl->class = mystrdup(p->class);
---
>   if (p->category[0] != '\0') {
>     pl->category = mystrdup(p->category);
2594c2594
<     pl->class = mystrdup("Other");
---
>     pl->category = mystrdup("Other");
Index: common/nation.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/nation.c,v
retrieving revision 1.40
diff -r1.40 nation.c
226,228c226,228
<   if (p->class) {
<     free(p->class);
<     p->class = NULL;
---
>   if (p->category) {
>     free(p->category);
>     p->category = NULL;
Index: common/nation.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/nation.h,v
retrieving revision 1.32
diff -r1.32 nation.h
79c79
<   char *class;                                /* may be empty */
---
>   char *category;                             /* may be empty */
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.61
diff -r1.61 packets.def
1121c1121
<   STRING class[MAX_LEN_NAME];
---
>   STRING category[MAX_LEN_NAME];
Index: common/packets_gen.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets_gen.c,v
retrieving revision 1.64
diff -r1.64 packets_gen.c
26719c26719
<     dio_get_string(&din, real_packet->class, sizeof(real_packet->class));
---
>     dio_get_string(&din, real_packet->category, 
> sizeof(real_packet->category));
26825c26825
<   differ = (strcmp(old->class, real_packet->class) != 0);
---
>   differ = (strcmp(old->category, real_packet->category) != 0);
26911c26911
<     dio_put_string(&dout, real_packet->class);
---
>     dio_put_string(&dout, real_packet->category);
Index: common/packets_gen.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets_gen.h,v
retrieving revision 1.54
diff -r1.54 packets_gen.h
868c868
<   char class[MAX_LEN_NAME];
---
>   char category[MAX_LEN_NAME];
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.205
diff -r1.205 ruleset.c
2470c2470
<     pl->class =
---
>     pl->category =
2472,2473c2472,2473
<     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';
3117c3117
<     sz_strlcpy(packet.class, n->class);
---
>     sz_strlcpy(packet.category, n->category);
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.212
diff -r1.212 srv_main.c
1239c1239
<     assert(nation->class != NULL);
---
>     assert(nation->category != NULL);
1242,1243c1242,1243
<       class = nation->class;
<     } else if (strcmp(nation->class, class) != 0) {
---
>       class = nation->category;
>     } else if (strcmp(nation->category, class) != 0) {
1266c1266
<       && (class == NULL || strcmp(nation->class, class) == 0)) {
---
>       && (class == NULL || strcmp(nation->category, class) == 0)) {

[Prev in Thread] Current Thread [Next in Thread]