[Freeciv-Dev] [bug #17846] astring interface/usage encourages memory leaks

2011-10-22 Thread Jacob Nevins

Follow-up Comment #2, bug #17846 (project freeciv):

Oops. Now I come to look at it, I think I misunderstood, and the memory leaks
I mentioned don't exist (but I may have added some myself since).

There's actually a valid alternative pattern of use of astring that's used in
some places, including the client/text.c ones I mentioned.

Suppose you declare a _static_ struct astring in a function returning  const
char * . In that case, the malloc'd storage will be re-used next time your
function is called, rather than lost; you can release the caller from the
burden of freeing the returned string, in return for 'leaking' one string over
the lifetime of the program. This is the moral equivalent of the "static char
buf[128]" type strategy that astring (probably) replaced, except that the
memory tied up in  'static' astrings is in principle unbounded (although in
practice probably not).

In that case, you definitely *don't* want your caller to be able to free() or
realloc() the memory, as that will cause the static astring to become
inconsistent and cause havoc next time your function is called. So 'const char
*' is an appropriate return type; if the caller wants to mess with the string,
they will have to take a copy (which isn't always *strictly* necessary, but
close enough).

This pattern and the one I proposed can't really coexist. Since this one is
incumbent, probably what should happen is that it should be commented more
explicitly, and a check done that everyone's using astring in a compatible
manner (which probably means reworking some code I've written while
misunderstanding this).

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2883] [lua116] lua function to save a game (as 'manual' save)

2011-10-22 Thread Jacob Nevins

Follow-up Comment #3, patch #2883 (project freeciv):

This script command can overwrite any chosen file on the server that
freeciv-server has access to, I think (with a Freeciv save file, not arbitrary
contents). Do we need to worry about security?

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18835] please support vertical tabs

2011-10-22 Thread Jaakko Heusala

Follow-up Comment #3, bug #18835 (project freeciv):

Yes, left or right side, one tab header on each line. Text should still be
normally horizontally to save space. Some browsers support it this way, too.
I'm using tree-style-tab
 with my
Firefox.


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18547] fix number of bulbs for global goal

2011-10-22 Thread Jacob Nevins

Follow-up Comment #3, bug #18547 (project freeciv):

For the record: unlike bug #18499, the behaviour being changed here was
fairly long-standing, since S2_1 at least. (But the new behaviour does make
more sense, to me at least.)

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18499] Science progress shows incorrect number of turns

2011-10-22 Thread Jacob Nevins

Follow-up Comment #17, bug #18499 (project freeciv):

For the record (I'll want this for release notes):

> This is how it used to be in previous versions, if I remember 
> correctly.

I've confirmed that this is indeed a regression from S2_2. I believe it came
in with tech upkeep (patch #1264).

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18641] allow remove command for access level >= ADMIN in running games

2011-10-22 Thread Jacob Nevins

Update of bug #18641 (project freeciv):

 Open/Closed:  Closed => Open   

___

Follow-up Comment #5:

The error message in this patch isn't quite right (it says things like
"Command level basic needed to remove a player [...]" if the player has
cmdlevel basic). Patch attached.

Is there any reason this whole patch wouldn't be safe to backport to S2_3 as
well? I suspect it'd be of more use to Michal there.

(file #14237)
___

Additional Item Attachment:

File name: trunk-remove-running-message.diff Size:0 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] svn ignore

2011-10-22 Thread Jacob Nevins
Matthias Pfafferodt writes:
> I'm not familiar with the internals of svn but after the changes to the lua 
> script code there are some files which should be added to the ignore list. 
> Could somebody do it?

I've done it (r20323). For reference, here's how.

(You have to do it from a svn checkout -- git-svn doesn't preserve svn
properties.)

$ svn propedit svn:ignore client/luascript/

This brings up your editor with a blank file. Add the files to be
ignored, one per line:

Makefile.in
Makefile
.deps
tolua_client_gen.c
tolua_client_gen.h

You can see what's set up for existing directories with a command like

$ svn proplist -v client/

Makefile, Makefile.in, and .deps are standard in most directories.

If you've removed autogenerated files from other places, you should
generally remove them from the svn:ignore property of the relevant
directories.

Once you've done this, you can check it's right in your local copy with
"svn status", then you have to commit the property changes with "svn
commit" as usual.

> Furthermore, the rights to the new directory must be changed, or?

I don't think there's anything that needs doing to the permissions of
client/luascript/ ?

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2873] [lua108] client lua script console (gtk3)

2011-10-22 Thread Jacob Nevins

Update of patch #2873 (project freeciv):

 Open/Closed:  Closed => Open   


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2873] [lua108] client lua script console (gtk3)

2011-10-22 Thread Jacob Nevins

Follow-up Comment #3, patch #2873 (project freeciv):

This accidentally uses some Gtk2 compile-time and runtime flags where the
gtk3 versions should be used. Patch attached.
(This is also untested, as I still haven't sorted out being able to compile
the gtk3 client.)

(file #14236)
___

Additional Item Attachment:

File name: trunk-luaconsole-gtk3-fixes.diff Size:1 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18818] The server couldn't allocate starting positions

2011-10-22 Thread Jacob Nevins

Follow-up Comment #13, bug #18818 (project freeciv):

I wondered if some server settings had been changed from the default (e.g.,
map size or number of AIs).

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18835] please support vertical tabs

2011-10-22 Thread Jacob Nevins

Update of bug #18835 (project freeciv):

Category:  client => client-gtk-2.0 

___

Follow-up Comment #2:

You mean having the tab labels going down (say) the right hand side of the
main area, rather than along the bottom?

That might be a better use of today's widescreen real-estate.

Looks like GtkNotebook supports tabs along any edge (via
gtk_notebook_set_tab_pos()), so it might not be that hard to implement
(although I slightly fear our Gtk widget layout code).

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18549] Sanity check fails on city in swamp

2011-10-22 Thread Jacob Nevins

Follow-up Comment #20, bug #18549 (project freeciv):

The new patch depends on patch #2957 being applied first.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18549] Sanity check fails on city in swamp

2011-10-22 Thread Joan Creus

Follow-up Comment #19, bug #18549 (project freeciv):

Sorry for the delay. I didn't realise this was a different patch. I have
reverted the previous one, and tested the new one, but I get a linking error:

../common/.libs/libfreeciv.a(tile.o): In function `tile_set_terrain':
/home/joanc/freeciv/freeciv-2.3/common/tile.c:128: undefined reference to
`tile_virtual_check'

I must be doing something wrong... I have even run autogen.sh again, just in
case, but I still get the same error.


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18837] Several typos in nation descriptions

2011-10-22 Thread Joan Creus

URL:
  

 Summary: Several typos in nation descriptions
 Project: Freeciv
Submitted by: jcreus
Submitted on: Sat Oct 22 10:26:55 2011
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: trunk
 Discussion Lock: Any
Operating System: GNU/Linux
 Planned Release: 2.4.0

___

Details:

During translation, I have found a few typos in nation descriptions. They are
all in trunk, so it would be good to fix them before branching.

Patch included.



___

File Attachments:


---
Date: Sat Oct 22 10:26:55 2011  Name: corr.diff  Size: 4kB   By: jcreus
Patches for nation typos


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev