Author: pepeto Date: Tue Jan 13 16:40:41 2015 New Revision: 27664 URL: http://svn.gna.org/viewcvs/freeciv?rev=27664&view=rev Log: Remove a couple of functionalities made inside fc_assert_XXX() calls.
See gna patch #5700 Modified: branches/S2_6/client/options.c branches/S2_6/server/savegame2.c branches/S2_6/utility/support.c Modified: branches/S2_6/client/options.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.c?rev=27664&r1=27663&r2=27664&view=diff ============================================================================== --- branches/S2_6/client/options.c (original) +++ branches/S2_6/client/options.c Tue Jan 13 16:40:41 2015 @@ -5688,12 +5688,20 @@ static void mapimg_changed_callback(struct option *poption) { if (!mapimg_client_define()) { + bool success; + log_normal("Error setting the value for %s (%s). Restoring the default " "value.", option_name(poption), mapimg_error()); /* Reset the value to the default value. */ - fc_assert_ret(TRUE == option_reset(poption)); - fc_assert_ret(TRUE == mapimg_client_define()); + success = option_reset(poption); + fc_assert_msg(success == TRUE, + "Failed to reset the option \"%s\".", + option_name(poption)); + success = mapimg_client_define(); + fc_assert_msg(success == TRUE, + "Failed to restore mapimg definition for option \"%s\".", + option_name(poption)); } } Modified: branches/S2_6/server/savegame2.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/savegame2.c?rev=27664&r1=27663&r2=27664&view=diff ============================================================================== --- branches/S2_6/server/savegame2.c (original) +++ branches/S2_6/server/savegame2.c Tue Jan 13 16:40:41 2015 @@ -5558,7 +5558,9 @@ fc_assert_action(id_trans == -1 || ptrans != NULL, continue); if (ptrans) { - fc_assert_action(unit_transport_load(punit, ptrans, TRUE), continue); + bool load_success = unit_transport_load(punit, ptrans, TRUE); + + fc_assert_action(load_success == TRUE, continue); } } } Modified: branches/S2_6/utility/support.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/support.c?rev=27664&r1=27663&r2=27664&view=diff ============================================================================== --- branches/S2_6/utility/support.c (original) +++ branches/S2_6/utility/support.c Tue Jan 13 16:40:41 2015 @@ -490,6 +490,7 @@ const char *replace) { size_t len_max; + bool success; fc_assert_ret_val(str != NULL, NULL); fc_assert_ret_val(len != NULL, NULL); @@ -505,8 +506,9 @@ str = fc_realloc(str, len_max); } + success = fc_strrep(str, (*len), search, replace); /* should never happen */ - fc_assert_ret_val_msg(fc_strrep(str, (*len), search, replace), NULL, + fc_assert_ret_val_msg(success == TRUE, NULL, "Can't replace '%s' by '%s' in '%s'. To small " "size after reallocation: %lu.", search, replace, str, (long unsigned int)*len); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits