<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40616 >
> [[email protected] - Thu Jan 01 04:14:04 2009]:
>
> Hello,
>
> I can confirm that the gtk 2 client does compile smoothly with
> the patch that you sent applied. I can also build with the
> "--enable-debug" and "--enable-client=sdl" versions. I have
> not tried the other two.
For completeness here is a version of the patch for trunk too
(and a minor formatting fix for the S2_1 version).
-----------------------------------------------------------------------
機知に富んだ何かがここにあったが、もう出た。
diff --git a/client/gui-gtk-2.0/repodlgs.c b/client/gui-gtk-2.0/repodlgs.c
index 587cd69..bf9c920 100644
--- a/client/gui-gtk-2.0/repodlgs.c
+++ b/client/gui-gtk-2.0/repodlgs.c
@@ -1200,7 +1200,7 @@ void activeunits_report_dialog_update(void)
{
struct repoinfo {
int active_count;
- int upkeep[O_COUNT];
+ int upkeep[O_MAX];
int building_count;
};
diff --git a/client/helpdata.c b/client/helpdata.c
index 7920a58..a781794 100644
--- a/client/helpdata.c
+++ b/client/helpdata.c
@@ -259,39 +259,39 @@ static void insert_allows(struct universal *psource,
buf[0] = '\0';
/* FIXME: show other data like range and survives. */
-#define COREQ_APPEND(s) \
- (coreq_buf[0] != '\0' \
- ? cat_snprintf(coreq_buf, sizeof(coreq_buf), Q_("?clistmore:, %s"), (s)) \
- : sz_strlcpy(coreq_buf, (s)))
improvement_iterate(pimprove) {
requirement_vector_iterate(&pimprove->reqs, req) {
if (are_universals_equal(psource, &req->source)) {
- char coreq_buf[512] = "";
-
- requirement_vector_iterate(&pimprove->reqs, coreq) {
- if (!are_universals_equal(psource, &coreq->source)) {
- char buf2[512];
-
- COREQ_APPEND(universal_name_translation(&coreq->source,
- buf2, sizeof(buf2)));
- }
- } requirement_vector_iterate_end;
-
- if (coreq_buf[0] == '\0') {
- cat_snprintf(buf, bufsz, _("Allows %s."),
- improvement_name_translation(pimprove));
- } else {
- cat_snprintf(buf, bufsz, _("Allows %s (with %s)."),
- improvement_name_translation(pimprove),
- coreq_buf);
- }
- cat_snprintf(buf, bufsz, "\n");
+ char coreq_buf[512] = "";
+
+ requirement_vector_iterate(&pimprove->reqs, coreq) {
+ if (!are_universals_equal(psource, &coreq->source)) {
+ char buf2[512] = "";
+
+ universal_name_translation(&coreq->source, buf2,
+ sizeof(buf2));
+ if (coreq_buf[0] == '\0') {
+ sz_strlcpy(coreq_buf, buf2);
+ } else {
+ cat_snprintf(coreq_buf, sizeof(coreq_buf),
+ Q_("?clistmore:, %s"), buf2);
+ }
+ }
+ } requirement_vector_iterate_end;
+
+ if (coreq_buf[0] == '\0') {
+ cat_snprintf(buf, bufsz, _("Allows %s."),
+ improvement_name_translation(pimprove));
+ } else {
+ cat_snprintf(buf, bufsz, _("Allows %s (with %s)."),
+ improvement_name_translation(pimprove),
+ coreq_buf);
+ }
+ cat_snprintf(buf, bufsz, "\n");
}
} requirement_vector_iterate_end;
} improvement_iterate_end;
-
-#undef COREQ_APPEND
}
/****************************************************************
diff --git a/client/gui-gtk-2.0/repodlgs.c b/client/gui-gtk-2.0/repodlgs.c
index 7f40ea1..1272966 100644
--- a/client/gui-gtk-2.0/repodlgs.c
+++ b/client/gui-gtk-2.0/repodlgs.c
@@ -1178,7 +1178,7 @@ void activeunits_report_dialog_update(void)
{
struct repoinfo {
int active_count;
- int upkeep[O_COUNT];
+ int upkeep[O_MAX];
int building_count;
};
diff --git a/client/helpdata.c b/client/helpdata.c
index 45850e2..fa8f6be 100644
--- a/client/helpdata.c
+++ b/client/helpdata.c
@@ -237,42 +237,40 @@ static void insert_allows(struct req_source *psource,
buf[0] = '\0';
/* FIXME: show other data like range and survives. */
-#define COREQ_APPEND(s) \
- (coreq_buf[0] != '\0' \
- ? cat_snprintf(coreq_buf, sizeof(coreq_buf), Q_("?clistmore:, %s"), (s)) \
- : sz_strlcpy(coreq_buf, (s)))
-
impr_type_iterate(impr_id) {
struct impr_type *building = improvement_by_number(impr_id);
requirement_vector_iterate(&building->reqs, req) {
if (are_req_sources_equal(psource, &req->source)) {
- char coreq_buf[512] = "";
-
- requirement_vector_iterate(&building->reqs, coreq) {
- if (!are_req_sources_equal(psource, &coreq->source)) {
- char buf2[512];
-
- COREQ_APPEND(get_req_source_text(&coreq->source,
- buf2, sizeof(buf2)));
- }
- } requirement_vector_iterate_end;
+ char coreq_buf[512] = "";
+
+ requirement_vector_iterate(&building->reqs, coreq) {
+ if (!are_req_sources_equal(psource, &coreq->source)) {
+ char buf2[512] = "";
+
+ get_req_source_text(&coreq->source, buf2, sizeof(buf2));
+ if (coreq_buf[0] == '\0') {
+ sz_strlcpy(coreq_buf, buf2);
+ } else {
+ cat_snprintf(coreq_buf, sizeof(coreq_buf),
+ Q_("?clistmore:, %s"), buf2);
+ }
+ }
+ } requirement_vector_iterate_end;
- if (coreq_buf[0] == '\0') {
- cat_snprintf(buf, bufsz, _("Allows %s."),
- improvement_name_translation(impr_id));
- } else {
- cat_snprintf(buf, bufsz, _("Allows %s (with %s)."),
- improvement_name_translation(impr_id),
- coreq_buf);
- }
- cat_snprintf(buf, bufsz, "\n");
+ if (coreq_buf[0] == '\0') {
+ cat_snprintf(buf, bufsz, _("Allows %s."),
+ improvement_name_translation(impr_id));
+ } else {
+ cat_snprintf(buf, bufsz, _("Allows %s (with %s)."),
+ improvement_name_translation(impr_id),
+ coreq_buf);
+ }
+ cat_snprintf(buf, bufsz, "\n");
}
} requirement_vector_iterate_end;
} impr_type_iterate_end;
-
-#undef COREQ_APPEND
}
/****************************************************************
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev