Leftover code ?

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Leftover code ?

#1 Post by vincele »

I saw what I think is useless code (maybe a leftover from the past) in
SidePanel::PlanetPanel::PlanetPanel() ctor. I think m_planet_graphic
is always NULL there, since it is only allocated in RefreshPlanetGraphic(),
which BTW could probably use gards against freeing the initial NULL pointers.

[The extension diff has been deactivated and can no longer be displayed.]

All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Leftover code ?

#2 Post by Geoff the Medio »

Please post patches with file pathes relative to the FreeOrion directory, not with FreeOrion/ at the start. This one is small enough I can remove it by hand, though.

Seems harmless enough... https://sourceforge.net/p/freeorion/code/7715/

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: Leftover code ?

#3 Post by vincele »

Geoff the Medio wrote:Please post patches with file pathes relative to the FreeOrion directory, not with FreeOrion/ at the start. This one is small enough I can remove it by hand, though.
Don't your patch utility have a "-pnum or --strip=num" command-line option ?

I ask, because if I cannot find a way to hardcode the creation of patches with the right -p level into quilt config files, there's some good chance that I'll forget everytime as I don't create the patches by hand... :-/ Sometimes with "svn diff", and the rest with "quilt new"...

I can only promise to try to remember though...
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Leftover code ?

#4 Post by Dilvish »

vincele wrote:Don't your patch utility have a "-pnum or --strip=num" command-line option ?
No, he's using TortoiseSVN and it has no such option.
I ask, because if I cannot find a way to hardcode the creation of patches with the right -p level... Sometimes with "svn diff"
It should be easy for you with svn diff -- just cd one more directory level in before you do svn diff.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: Leftover code ?

#5 Post by vincele »

Dilvish wrote:
vincele wrote:Don't your patch utility have a "-pnum or --strip=num" command-line option ?
No, he's using TortoiseSVN and it has no such option.
Ouch, but there's still cygwin... [I'm out, jumped through the window] :-)
Dilvish wrote:
I ask, because if I cannot find a way to hardcode the creation of patches with the right -p level... Sometimes with "svn diff"
It should be easy for you with svn diff -- just cd one more directory level in before you do svn diff.
The problem's not how to do it, I know that, but the remembering, and that borders on NP-completeness...
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Leftover code ?

#6 Post by Dilvish »

vincele wrote:The problem's not how to do it, I know that, but the remembering, and that borders on NP-completeness...
I suggest you try what I do, which is to totally bypass that extra "FreeOrion" directory altogether:

instead of something of the form

Code: Select all

svn co https://svn.code.sf.net/p/freeorion/code/trunk freeorion 
check out the project one layer deeper:

Code: Select all

svn co https://svn.code.sf.net/p/freeorion/code/trunk/FreeOrion freeorion 
There's then nothing special to remember to do with svn diff because the extra 'FreeOrion' is simply gone. I'm not entirely sure how quilt will react to that, but I expect it would likely also work out as hoped.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply