[Freeciv-Dev] (PR#39904) use mystrdup
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39904 One place in log.c uses strdup instead of mystrdup. Patch for 2.1, probably applies to 2.2 and trunk also. -jason Index: utility/log.c === --- utility/log.c (revision 14048) +++ utility/log.c (working copy) @@ -183,7 +183,7 @@ log_filename = NULL; } if (filename strlen(filename) 0) { -log_filename = strdup(filename); +log_filename = mystrdup(filename); } else { log_filename = NULL; } ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39905) variable declarations in client/
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39905 Two places in the client/ code define variables midway through functions. This can break older compilers unnecessarily and has been reported on IRC today as a problem when compiling on beos. This patch fixes it - for 2.1, should apply to 2.2 and trunk as well. There are more such places in gui-sdl as well. -jason Index: client/reqtree.c === --- client/reqtree.c (revision 14048) +++ client/reqtree.c (working copy) @@ -907,6 +907,8 @@ static enum reqtree_edge_type get_edge_type(struct tree_node *node, struct tree_node *dest_node) { + struct player_research* research; + if (dest_node == NULL) { /* assume node is a dummy */ dest_node = node; @@ -921,9 +923,10 @@ /* find destination advance by recursing in dest_node-provide[] * watch out: recursion */ if (dest_node-is_dummy) { -assert(dest_node-nprovide 0); enum reqtree_edge_type sum_type = REQTREE_EDGE; int i; + +assert(dest_node-nprovide 0); for (i = 0; i dest_node-nprovide; ++i) { enum reqtree_edge_type type = get_edge_type(node, dest_node-provide[i]); switch (type) { @@ -942,7 +945,7 @@ return sum_type; } - struct player_research* research = get_player_research(game.player_ptr); + research = get_player_research(game.player_ptr); if (!game.player_ptr || !research) { return REQTREE_KNOWN_EDGE; /* Global observer case */ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39906) gui-sdl gcc2.95 compile errors
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39906 On IRC a number of errors were reported in compiling gui-sdl on beos with gcc 2.95. This patch should fix the problems in the gui-sdl code. Most errors are simply caused by declaring variables mid-function. This is supported in C99 but still not a freeciv standard (no configure check for it). One other place in colors.h had a function header that didn't match the function declaration. This is simply fixed. Patch for 2.1; it doesn't quite commit cleanly to trunk. -jason Index: client/gui-sdl/citydlg.c === --- client/gui-sdl/citydlg.c (revision 14048) +++ client/gui-sdl/citydlg.c (working copy) @@ -1566,9 +1566,7 @@ (float)adj_size(249) / pBuf-w : (float)adj_size(159) / pBuf-h); - SDL_Surface *pRet = zoomSurface(pBuf, city_map_zoom, city_map_zoom, 1); - - return pRet; + return zoomSurface(pBuf, city_map_zoom, city_map_zoom, 1); } /** Index: client/gui-sdl/mapview.c === --- client/gui-sdl/mapview.c (revision 14048) +++ client/gui-sdl/mapview.c (working copy) @@ -381,18 +381,22 @@ SDL_Surface *pTmp = NULL; char buffer[512]; +#ifdef SMALL_SCREEN + SDL_Rect area = {0, 0, 0, 0}; +#else + SDL_Rect area = {0, 3, 0, 0}; +#endif + SDL_String16 *pText; if (get_client_page() != PAGE_GAME) { return; } - #ifdef SMALL_SCREEN - SDL_Rect area = {0, 0, 0, 0}; - SDL_String16 *pText = create_string16(NULL, 0, 8); - #else - SDL_Rect area = {0, 3, 0, 0}; - SDL_String16 *pText = create_string16(NULL, 0, 10); - #endif +#ifdef SMALL_SCREEN + pText = create_string16(NULL, 0, 8); +#else + pText = create_string16(NULL, 0, 10); +#endif /* set text settings */ pText-style |= TTF_STYLE_BOLD; Index: client/gui-sdl/themespec.c === --- client/gui-sdl/themespec.c (revision 14048) +++ client/gui-sdl/themespec.c (working copy) @@ -690,6 +690,7 @@ char *file_capstr; bool duplicates_ok; struct theme *t = theme_new(); + char *langname; fname = themespec_fullname(theme_name); if (!fname) { @@ -722,7 +723,7 @@ sz_strlcpy(t-name, theme_name); t-priority = secfile_lookup_int(file, themespec.priority); - char *langname = get_langname(); + langname = get_langname(); if (langname) { if (strstr(langname, zh_CN) != NULL) { c = secfile_lookup_str(file, themespec.font_file_zh_CN); Index: client/gui-sdl/widget_button.c === --- client/gui-sdl/widget_button.c (revision 14048) +++ client/gui-sdl/widget_button.c (working copy) @@ -229,6 +229,7 @@ { int iRet = 0; SDL_Surface *pIcon; + SDL_Surface *pCopy_Of_Icon_Theme; iRet = (*baseclass_redraw)(pTIButton); if (iRet != 0) { @@ -236,7 +237,7 @@ } pIcon = create_icon_from_theme(pTIButton-theme2, get_wstate(pTIButton)); - SDL_Surface *pCopy_Of_Icon_Theme = pTIButton-theme2; + pCopy_Of_Icon_Theme = pTIButton-theme2; pTIButton-theme2 = pIcon; Index: client/gui-sdl/dialogs.c === --- client/gui-sdl/dialogs.c (revision 14048) +++ client/gui-sdl/dialogs.c (working copy) @@ -2667,7 +2667,8 @@ float zoom; struct NAT *pSetup; SDL_Rect area; - + int i; + #define TARGETS_ROW 5 #define TARGETS_COL 1 @@ -2836,7 +2837,7 @@ add_to_gui_list(ID_NATION_WIZARD_CHANGE_SEX_BUTTON, pWidget); /* -- */ - int i = 0; + i = 0; zoom = DEFAULT_ZOOM * 1.0; while (i game.control.styles_count) { if (!city_style_has_requirements(city_styles[i])) { Index: client/gui-sdl/graphics.c === --- client/gui-sdl/graphics.c (revision 14048) +++ client/gui-sdl/graphics.c (working copy) @@ -3689,12 +3689,12 @@ Uint16 new_width, Uint16 new_height, int smooth, bool scale_up, bool absolute_dimensions) { + SDL_Surface *tmpSurface, *result; + if (pSrc == NULL) { return NULL; } - SDL_Surface *tmpSurface, *result; - if (!((scale_up == FALSE) ((new_width = pSrc-w) (new_height = pSrc-h { if ((new_width - pSrc-w) = (new_height - pSrc-h)) { /* horizontal limit */ @@ -3717,12 +3717,12 @@ } if (absolute_dimensions) { -result = create_surf_alpha(new_width, new_height, SDL_SWSURFACE); SDL_Rect area = { (new_width - tmpSurface-w) / 2, (new_height - tmpSurface-h) / 2, 0, 0 }; +result = create_surf_alpha(new_width, new_height, SDL_SWSURFACE); alphablit(tmpSurface, NULL, result, area); FREESURFACE(tmpSurface); } else { Index:
[Freeciv-Dev] Tagging 2.1.1 tomorrow
Don't feel too well tonight, so I'll wait about 12 hrs from now before tagging 2.1.1. Use the time you're given wisely. ;) ~Daniel ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39866) Tracking 2.1.1 release
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39866 Daniel Markstedt wrote: What is the x11 client? gui-xaw. Yes, yes, I know that GTK and SDL can use x11, but Project Athena widgets are the native interface ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39900) _Update button in city report
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39900 Daniel Markstedt wrote: I thought we agreed that only clearly broken strings in S_1 were to be touched... Go back and read the report. The old _Popup interfered with other _P. Also, this was the only place in the code that a button was called popup -- really a programming concept, not a user concept. Broken on two counts. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39900) _Update button in city report
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39900 Just renamed from Popup (PR#23078). Nobody complained (or otherwise commented) during the standard review period There's another similar button elsewhere named Update City. Would that be better here? Update and Update City are both wrong. There's nothing to be updated. Take Open City, Open City Window, or just city window. Popup City or Popup might be ok as well. Christian -- Christian Knoke* * *http://cknoke.de * * * * * * * * * Ceterum censeo Microsoft esse dividendum. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39901) Patch: Fix permission on open() call
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39901 William Allen Simpson wrote: Is this a Fedora only kind of thing? So, I did a bit of Googling, and there are a number of other reports about Fedora and this new requirement As a long-time BSD contributor, one of the things that annoys me about certain Linux practices is the failure to follow the documentation (in this case, may really should be optional). Never-the-less, I tested, and there is another bug on the same line. The server overwrites parts of the client generated log. It needs O_APPEND. There is also a comment that isn't implemented. I added FIXME, until the issue is better understood. In fact, this whole logging section seems incompletely implemented. Why is the debug level for the server always set to 3, no matter what the level on the client? Anyway, since this actually has a bug, I'll commit immediately. Thanks! Committed S2_1 revision 14050. Committed S2_2 revision 14051. Committed trunk revision 14052. Index: client/connectdlg_common.c === --- client/connectdlg_common.c (revision 14049) +++ client/connectdlg_common.c (working copy) @@ -250,9 +250,9 @@ fclose(stdout); fclose(stderr); -/* include the port to avoid duplication */ +/* FIXME: include the port to avoid duplication? */ if (logfile) { - fd = open(logfile, O_WRONLY | O_CREAT); + fd = open(logfile, O_WRONLY | O_CREAT | O_APPEND, 0644); if (fd != 1) { dup2(fd, 1); ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39901) Patch: Fix permission on open() call
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39901 Please use the email interface, your comments were not sent to the list. Not really, it's more of a security thing. Quote from one of our kernel guys: The problem is that without a mode being passed, the kernel uses whatever the stack contents are. And yes, its conceivable the stack contents could create a world writable setuid file which cannot ever be the intended operation. Speaking as a long-time Internet security guy, that sounds like a serious userland/kernel interface implementation bug First of all, according to the documentation, the mask is optional -- you really need to use varargs here, that's what the ... means in the documentation prototype. Secondly, according to the documentation, the mask is AND'd with the current umask. There *MUST NOT* be any way for AND to set new bits! I'll pass this along to the Linux NFS kernel maintainers when I see them on Wednesday ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39900) _Update button in city report
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39900 There must be a language barrier here, or you didn't read the relevant problem report. (1) The buttons (in this dialog) are phrased as a desired user action. Select, Display, Update, etc. (2) The user doesn't want to Open the city, they want to Change, Modify, or Update the city itself. Open Window or Popup have no actionable meaning here (other than to a programmer). (3) You cannot use any of _O, _C, or _W; they are already taken. The original problem report is about the inability to use Alt- to activate the menu items, a serious usability issue! (4) When translating, you do understand that you have to select _ keys based on the GUI panes visible? Each translation can have different keys, correct? Think about Human Interface Guidelines, not like a programmer. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39895) deterministic borders (part 1)
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39895 Per I. Mathisen wrote: The patch that introduced it did not mention it, and none of the references to it that I could find, in the code and in your patch, said anything about what it was or what it was supposed to do. It is quite hopeless to try to keep up with what is happening if you do not even try to annotate. Sadly, this is the result of dividing large and complicated patches into smaller ones. Not all of the comments and definitions are present. Some are intended to be used later But, it's a symbol. It's supposed to be self-documenting. Of course, it would have been so much more helpful to simply use a 0 there instead of a symbol (as was done by a predecessor in srv_main itself). [that's sarcasm for the humor impaired.] ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39901) Re: Patch: Fix permission on open() call
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39901 [wsimpson - Sun Nov 25 00:40:20 2007]: That's not accurate. Only when you wish to restrict the file mode mask. Without looking hard at this code, I don't see any reason we'd want to restrict the mask. That's not traditional. Is this a Fedora only kind of thing? Not really, it's more of a security thing. Quote from one of our kernel guys: The problem is that without a mode being passed, the kernel uses whatever the stack contents are. And yes, its conceivable the stack contents could create a world writable setuid file which cannot ever be the intended operation. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39895) deterministic borders (part 1)
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39895 During the lull preparing 2.1.1 -- this won't interfere with that. Committed S2_2 revision 14054. Committed trunk revision 14055. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39541) [Bug] Unit help claims that only spy can investigate cities
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39541 The fuzzy process correctly caught the spy text change, but the diplomat was too different. Hand built the fuzzy translations. Committed S2_1 revision 14056. Index: po/cs.po === --- po/cs.po(revision 14055) +++ po/cs.po(working copy) @@ -21296,6 +21296,7 @@ #: data/default/units.ruleset:1698 data/civ2/units.ruleset:1649 #: data/civ1/units.ruleset:993 +#, fuzzy msgid A Diplomat is an official that carries your dispatches and is authorized to deal with foreign dignitaries. He may also undertake various covert @@ -21316,6 +21317,21 @@ the enemy. Little wonder that Diplomats are often viewed with suspicion and fear! msgstr + - Diplomaté mohou zÅÃzovat ambasády u ostatnÃch civilizacà tak, že +vstoupà do jejich mÄst.\n +\n + - Mohou sabotovat nepÅátelskou produkci nebo ukrást technologii (z mÄsta +může být ukradena jen jedna technologie)\n +\n +Diplomat může podplatit nepÅátelskou jednotku, pokud ta je na svém +polÃÄku sama\n +\n + - Mohou vyvolat revoluci v nepÅátelském mÄstÄ a dostat je tak pod +vlastnà kontrolu, pokud na to máte finance!\n +\n + - V nÄkterých strategiÃch mohou být stáda diplomatů použity k pustoÅ¡enà +nepÅÃtele. Nenà se Äemu divit, že se na diplomaty Äasto hledà s +oprávnÄným strachem. #: data/default/units.ruleset:1723 data/civ2/units.ruleset:1674 msgid Spy Index: po/pt_BR.po === --- po/pt_BR.po (revision 14055) +++ po/pt_BR.po (working copy) @@ -21147,6 +21147,7 @@ #: data/default/units.ruleset:1698 data/civ2/units.ruleset:1649 #: data/civ1/units.ruleset:993 +#, fuzzy msgid A Diplomat is an official that carries your dispatches and is authorized to deal with foreign dignitaries. He may also undertake various covert @@ -21167,6 +21168,22 @@ the enemy. Little wonder that Diplomats are often viewed with suspicion and fear! msgstr +Um Diplomata pode estabelecer uma embaixada junto de outras civilizações +movendo-se para dentro de uma cidade de outro jogador.\n +\n +- Diplomatas podem também tentar sabotar a produção inimiga ou roubar um +avanço cientÃfico de uma cidade inimiga. (Um avanço apenas pode ser +roubado uma vez por cidade).\n +\n +- Um Diplomata pode ainda subornar uma unidade inimiga, se ela estiver +sozinha numa quadrÃcula.\n +\n +- Diplomatas podem até iniciar uma revolução numa cidade inimiga e torna- +la sua, caso possua as moedas necessárias!\n +\n +- Nalgumas estratégias de jogo, hordas de Diplomatas podem ser utilizados +para causar o caos nas fileiras inimigas. Não admira assim que os +Diplomatas sejam muitas vezes olhados com suspeita e medo! #: data/default/units.ruleset:1723 data/civ2/units.ruleset:1674 msgid Spy Index: po/es.po === --- po/es.po(revision 14055) +++ po/es.po(working copy) @@ -21720,6 +21720,7 @@ #: data/default/units.ruleset:1698 data/civ2/units.ruleset:1649 #: data/civ1/units.ruleset:993 +#, fuzzy msgid A Diplomat is an official that carries your dispatches and is authorized to deal with foreign dignitaries. He may also undertake various covert @@ -21740,6 +21741,19 @@ the enemy. Little wonder that Diplomats are often viewed with suspicion and fear! msgstr +- Un Diplomático puede establecer embajadas con otras civilizaciones +entrando en la ciudad de otro jugador.\n +\n +- Los Diplomáticos también pueden intentar sabotear la producción +enemiga, o robar un avance de una ciudad enemiga (sólo se puede robar un +avance de cada ciudad).\n +\n +- ¡Un Diplomático puede incluso provocar una sublevación en una ciudad +enemiga, y hacer que pase a ser tuya, si tienes suficiente oro!\n +\n +- En algunas estrategias de juego, se puede usar hordas de Diplomáticos +para debilitar al enemigo. ¡No es de extrañar que a menudo se mire a los +Diplomáticos con sospecha y temor! #: data/default/units.ruleset:1723 data/civ2/units.ruleset:1674 msgid Spy Index: po/no.po === --- po/no.po(revision 14055) +++ po/no.po(working copy) @@ -21398,6 +21398,7 @@ #: data/default/units.ruleset:1698 data/civ2/units.ruleset:1649 #: data/civ1/units.ruleset:993 +#, fuzzy msgid A Diplomat is an official that carries your dispatches and is authorized to deal with foreign dignitaries. He may also undertake various covert @@ -21418,6 +21419,22 @@ the enemy. Little wonder that Diplomats are often viewed with suspicion and fear! msgstr +- En diplomat kan opprette ambassader hos andre sivilisasjoner ved å +flytte inn i en annen spillers by.\n +\n +- Diplomater kan også sabotere fiendens produksjon, eller stjele et +fremskritt fra en fiendtlig by. (Kun et fremskritt kan stjeles fra en +by).\n +\n +- En
[Freeciv-Dev] (PR#39722) Change CMA by F1 panel don't work (gcc-4.2 specific bug)
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39722 I'm going to commit a fix for this (why not) but I'd like more details. What platform are you using? Are you really saying that GINT_TO_POINTER is not reversible for negative numbers on your platform? If that's the case we need to audit a lot more users I think...and would need to complain to the glib people to get the macro to barf when given a negative. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39883) Gtk2 client tends to flake out after a while
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39883 Jason Short: [Jacob Nevins:] There is a fair amount of error reportage on the client's stderr. This seems to be disappointingly normal for this Linux system -- there are some errors that show up for every X program -- but perhaps some of them may be diagnostic; I haven't attempted to see if any of them are correlated with the reported symptoms. I could dig deeper. You could send the stderr reports and we could glance through them. Most likely nothing useful will be there though. OK, I've done this and I think there is a clue here. Here's what I see on the console (stdout/stderr): Startup. I think the following is due to system misconfiguration. At least the BadDevice stuff is, it happens for every X client. open /dev/sequencer: No such file or directory X Error: BadDevice, invalid or uninitialized input device 169 Major opcode: 147 Minor opcode: 3 Resource id: 0x0 Failed to open device X Error: BadDevice, invalid or uninitialized input device 169 Major opcode: 147 Minor opcode: 3 Resource id: 0x0 Failed to open device (civclient:13234): Gtk-WARNING **: Unable to locate theme engine in module_path: pixmap, (this message x25) Now it's displaying the initial do-you-want-to-start-a-game-or-what screen. I load a savegame, select nation, and start the game. 2: Old attributes detected and removed. This probably isn't relevant to this bug, but this message appears to be generated by the game restore code. I note in passing that the savegame I'm loading was created by the same version of Freeciv, 2.1.0, that I'm using to load it, so if this is a backwards compatibility measure it looks like something's gone wrong. QPixmap::operator=: Cannot assign to pixmap during painting This error message comes up frequently during gameplay. It can even occur on repaints (Alt-Tab away and back). Since it appears to be something to do with Qt, and Freeciv doesn't touch Qt directly, I speculate that this would only be seen when running under KDE (which is what I'm doing, in case it wasn't obvious from the initial report). We get thousands of these QPixmap messages during about 2.5 hours of gameplay. Just before the point where I notice my symptoms occurring, these other messages appear at various intervals: (civclient:13234): Gdk-WARNING **: GdkWindow 0x376242b unexpectedly destroyed (civclient:13234): Gdk-WARNING **: GdkWindow 0x376242e unexpectedly destroyed (civclient:13234): Gdk-WARNING **: GdkWindow 0x3764519 unexpectedly destroyed (civclient:13234): Gdk-WARNING **: GdkWindow 0x3764523 unexpectedly destroyed At this point I notice that it's gone wonky and start preparing to save and quit. I get more errors mixed in with QPixmap nonsense, then a crash :( (civclient:13234): Gdk-WARNING **: GdkWindow 0x3764576 unexpectedly destroyed (civclient:13234): Gdk-WARNING **: GdkWindow 0x376450d unexpectedly destroyed (civclient:13234): Gdk-WARNING **: GdkWindow 0x37645b8 unexpectedly destroyed Segmentation fault It doesn't usually crash before I manage to save. Unfortunately, I don't have a coredump. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev