Author: cazfi
Date: Mon Apr 20 02:58:57 2015
New Revision: 28821

URL: http://svn.gna.org/viewcvs/freeciv?rev=28821&view=rev
Log:
Fixed warnings from gcc-5 and cppcheck

- Fixed a bug in sdl-clients' where array was referenced via pointer after it 
was out-of-scope
- Cleaned out extra "not" from comparisons of boolean effect values

Patch by Per I. Mathisen <per> and myself

See patch #5994

Modified:
    branches/S2_4/client/gui-sdl/graphics.c
    branches/S2_4/common/improvement.c

Modified: branches/S2_4/client/gui-sdl/graphics.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_4/client/gui-sdl/graphics.c?rev=28821&r1=28820&r2=28821&view=diff
==============================================================================
--- branches/S2_4/client/gui-sdl/graphics.c     (original)
+++ branches/S2_4/client/gui-sdl/graphics.c     Mon Apr 20 02:58:57 2015
@@ -374,6 +374,7 @@
                                   SDL_Color * pColor, bool add_alpha)
 {
   SDL_Surface *pNew;
+  SDL_Color color = {255, 255, 255, 128};
 
   if (add_alpha) {
     pNew = create_surf_alpha(w, h, iFlags);
@@ -387,7 +388,6 @@
 
   if (!pColor) {
     /* pColor->unused == ALPHA */
-    SDL_Color color ={255, 255, 255, 128};
     pColor = &color;
   }
 

Modified: branches/S2_4/common/improvement.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_4/common/improvement.c?rev=28821&r1=28820&r2=28821&view=diff
==============================================================================
--- branches/S2_4/common/improvement.c  (original)
+++ branches/S2_4/common/improvement.c  Mon Apr 20 02:58:57 2015
@@ -426,7 +426,7 @@
     }
   }
   if (space_part &&
-      (!get_player_bonus(p, EFT_ENABLE_SPACE) > 0
+      (get_player_bonus(p, EFT_ENABLE_SPACE) <= 0
        || p->spaceship.state >= SSHIP_LAUNCHED)) {
     return FALSE;
   }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to