Feature #2065 ยป 0034-manual-Replace-NULL-with-nullptr.patch
| tools/manual/fc_manual.c | ||
|---|---|---|
|
/* Needed for "About Freeciv" help */
|
||
|
const char *client_string = "freeciv-manual";
|
||
|
static char *ruleset = NULL;
|
||
|
static char *ruleset = nullptr;
|
||
|
/**********************************************************************//**
|
||
|
Replace html special characters ('&', '<' and '>').
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *tileset_name_get(struct tileset *t)
|
||
|
{
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *tileset_version(struct tileset *t)
|
||
|
{
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *tileset_summary(struct tileset *t)
|
||
|
{
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *tileset_description(struct tileset *t)
|
||
|
{
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *current_musicset_name(void)
|
||
|
{
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *current_musicset_version(void)
|
||
|
{
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *current_musicset_summary(void)
|
||
|
{
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *current_musicset_description(void)
|
||
|
{
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
|| !(doc = fc_fopen(filename, "w"))) {
|
||
|
log_error(_("Could not write manual file %s."), filename);
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
fprintf(doc, "%s", tag_info->header);
|
||
| ... | ... | |
|
/* Reset aifill to zero */
|
||
|
game.info.aifill = 0;
|
||
|
if (!load_rulesets(NULL, NULL, FALSE, NULL, FALSE, FALSE, FALSE)) {
|
||
|
if (!load_rulesets(nullptr, nullptr, FALSE, nullptr,
|
||
|
FALSE, FALSE, FALSE)) {
|
||
|
/* Failed to load correct ruleset */
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
int inx;
|
||
|
bool showhelp = FALSE;
|
||
|
bool showvers = FALSE;
|
||
|
char *option = NULL;
|
||
|
char *option = nullptr;
|
||
|
int retval = EXIT_SUCCESS;
|
||
|
struct tag_types *tag_info = &html_tags;
|
||
| ... | ... | |
|
inx = 1;
|
||
|
while (inx < argc) {
|
||
|
if ((option = get_option_malloc("--ruleset", argv, &inx, argc, TRUE))) {
|
||
|
if (ruleset != NULL) {
|
||
|
if (ruleset != nullptr) {
|
||
|
fc_fprintf(stderr, _("Multiple rulesets requested. Only one "
|
||
|
"ruleset at a time is supported.\n"));
|
||
|
} else {
|
||
| ... | ... | |
|
game_init(FALSE);
|
||
|
/* Set ruleset user requested in to use */
|
||
|
if (ruleset != NULL) {
|
||
|
if (ruleset != nullptr) {
|
||
|
sz_strlcpy(game.server.rulesetdir, ruleset);
|
||
|
}
|
||
| tools/manual/manual_buildings.c | ||
|---|---|---|
|
doc = manual_start(tag_info, manual);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
continue;
|
||
|
}
|
||
|
helptext_building(buf, sizeof(buf), NULL, NULL, pimprove);
|
||
|
helptext_building(buf, sizeof(buf), nullptr, nullptr, pimprove);
|
||
|
fprintf(doc, "<tr><td>%s%s%s</td><td>%s</td>\n"
|
||
|
"<td align=\"center\"><b>%d</b><br/>%d</td>\n<td>",
|
||
| tools/manual/manual_commands.c | ||
|---|---|---|
|
doc = manual_start(tag_info, MANUAL_COMMANDS);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| tools/manual/manual_extras.c | ||
|---|---|---|
|
doc = manual_start(tag_info, MANUAL_EXTRAS);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
extra_name_translation(pextra), tag_info->sect_title_end);
|
||
|
fprintf(doc, tag_info->subitem_begin, "helptext");
|
||
|
helptext_extra(buf, sizeof(buf), NULL, "", pextra);
|
||
|
helptext_extra(buf, sizeof(buf), nullptr, "", pextra);
|
||
|
fprintf(doc, "%s", buf);
|
||
|
fprintf(doc, "%s", tag_info->subitem_end);
|
||
| tools/manual/manual_governments.c | ||
|---|---|---|
|
doc = manual_start(tag_info, MANUAL_GOVS);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
fprintf(doc, "%s%s%s\n\n", tag_info->sect_title_begin,
|
||
|
government_name_translation(pgov), tag_info->sect_title_end);
|
||
|
fprintf(doc, tag_info->subitem_begin, "helptext");
|
||
|
helptext_government(buf, sizeof(buf), NULL, NULL, pgov);
|
||
|
helptext_government(buf, sizeof(buf), nullptr, nullptr, pgov);
|
||
|
fprintf(doc, "%s\n\n", buf);
|
||
|
fprintf(doc, "%s", tag_info->subitem_end);
|
||
|
fprintf(doc, "%s", tag_info->item_end);
|
||
| tools/manual/manual_settings.c | ||
|---|---|---|
|
doc = manual_start(tag_info, MANUAL_SETTINGS);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
* the function setting_is_changeable() */
|
||
|
if (setting_ruleset_locked(pset)) {
|
||
|
fprintf(doc, _("Is locked by the ruleset."));
|
||
|
} else if (!setting_is_changeable(pset, &dummy_conn, NULL, 0)) {
|
||
|
} else if (!setting_is_changeable(pset, &dummy_conn, nullptr, 0)) {
|
||
|
fprintf(doc, _("Can only be used in server console."));
|
||
|
}
|
||
| tools/manual/manual_techs.c | ||
|---|---|---|
|
doc = manual_start(tag_info, MANUAL_TECHS);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
advance_name_translation(ptech), tag_info->sect_title_end);
|
||
|
fprintf(doc, tag_info->subitem_begin, "helptext");
|
||
|
helptext_advance(buf, sizeof(buf), NULL, "", ptech->item_number);
|
||
|
helptext_advance(buf, sizeof(buf), nullptr, "", ptech->item_number);
|
||
|
fprintf(doc, "%s", buf);
|
||
|
fprintf(doc, "%s", tag_info->subitem_end);
|
||
| tools/manual/manual_terrain.c | ||
|---|---|---|
|
doc = manual_start(tag_info, MANUAL_TERRAIN);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
fprintf(doc, "<td><table width=\"100%%\">\n");
|
||
|
if (action_id_univs_not_blocking(ACTION_IRRIGATE,
|
||
|
NULL, &for_terr)) {
|
||
|
nullptr, &for_terr)) {
|
||
|
fprintf(doc, "<tr><td>+%d F</td>", pterrain->irrigation_food_incr);
|
||
|
if (pterrain->irrigation_time == 0) {
|
||
|
fprintf(doc, "<td align=\"right\">(-)</td></tr>\n");
|
||
| ... | ... | |
|
} else {
|
||
|
fprintf(doc, "<tr><td>%s</td></tr>\n", _("impossible"));
|
||
|
}
|
||
|
if (pterrain->cultivate_result != NULL
|
||
|
if (pterrain->cultivate_result != nullptr
|
||
|
&& action_id_univs_not_blocking(ACTION_CULTIVATE,
|
||
|
NULL, &for_terr)) {
|
||
|
nullptr, &for_terr)) {
|
||
|
fprintf(doc, "<tr><td>%s</td>",
|
||
|
terrain_name_translation(pterrain->cultivate_result));
|
||
|
if (pterrain->cultivate_time == 0) {
|
||
| ... | ... | |
|
} else {
|
||
|
fprintf(doc, "<tr><td>%s</td></tr>\n", _("impossible"));
|
||
|
}
|
||
|
if (action_id_univs_not_blocking(ACTION_MINE, NULL, &for_terr)) {
|
||
|
if (action_id_univs_not_blocking(ACTION_MINE, nullptr, &for_terr)) {
|
||
|
fprintf(doc, "<tr><td>+%d P</td>", pterrain->mining_shield_incr);
|
||
|
if (pterrain->mining_time == 0) {
|
||
|
fprintf(doc, "<td align=\"right\">(-)</td></tr>\n");
|
||
| ... | ... | |
|
} else {
|
||
|
fprintf(doc, "<tr><td>%s</td></tr>\n", _("impossible"));
|
||
|
}
|
||
|
if (pterrain->plant_result != NULL
|
||
|
if (pterrain->plant_result != nullptr
|
||
|
&& action_id_univs_not_blocking(ACTION_PLANT,
|
||
|
NULL, &for_terr)) {
|
||
|
nullptr, &for_terr)) {
|
||
|
fprintf(doc, "<tr><td>%s</td>",
|
||
|
terrain_name_translation(pterrain->plant_result));
|
||
|
if (pterrain->plant_time == 0) {
|
||
| ... | ... | |
|
if (pterrain->transform_result
|
||
|
&& action_id_univs_not_blocking(ACTION_TRANSFORM_TERRAIN,
|
||
|
NULL, &for_terr)) {
|
||
|
nullptr, &for_terr)) {
|
||
|
fprintf(doc, "<tr><td>%s</td>",
|
||
|
terrain_name_translation(pterrain->transform_result));
|
||
|
if (pterrain->transform_time == 0) {
|
||
| tools/manual/manual_uclass.c | ||
|---|---|---|
|
doc = manual_start(tag_info, MANUAL_UCLASS);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| tools/manual/manual_units.c | ||
|---|---|---|
|
doc = manual_start(tag_info, MANUAL_UNITS);
|
||
|
if (doc == NULL) {
|
||
|
if (doc == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
utype_name_translation(putype->obsoleted_by));
|
||
|
fprintf(doc, "%s", tag_info->subitem_end);
|
||
|
fprintf(doc, tag_info->subitem_begin, "helptext");
|
||
|
helptext_unit(buf, sizeof(buf), NULL, "", putype, FALSE);
|
||
|
helptext_unit(buf, sizeof(buf), nullptr, "", putype, FALSE);
|
||
|
fprintf(doc, "%s", buf);
|
||
|
fprintf(doc, "%s", tag_info->subitem_end);
|
||
|
fprintf(doc, "%s", tag_info->item_end);
|
||