Feature #1660 ยป 0033-specialist.c-Replace-NULL-with-nullptr.patch
| common/specialist.c | ||
|---|---|---|
|
struct specialist *p = &specialists[i];
|
||
|
requirement_vector_free(&p->reqs);
|
||
|
if (NULL != p->helptext) {
|
||
|
if (p->helptext != nullptr) {
|
||
|
strvec_destroy(p->helptext);
|
||
|
p->helptext = NULL;
|
||
|
p->helptext = nullptr;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
Specialist_type_id specialist_index(const struct specialist *sp)
|
||
|
{
|
||
|
fc_assert_ret_val(NULL != sp, -1);
|
||
|
fc_assert_ret_val(sp != nullptr, -1);
|
||
|
return sp - specialists;
|
||
|
}
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
Specialist_type_id specialist_number(const struct specialist *sp)
|
||
|
{
|
||
|
fc_assert_ret_val(NULL != sp, -1);
|
||
|
fc_assert_ret_val(sp != nullptr, -1);
|
||
|
return sp->item_number;
|
||
|
}
|
||
| ... | ... | |
|
struct specialist *specialist_by_number(const Specialist_type_id id)
|
||
|
{
|
||
|
if (id < 0 || id >= game.control.num_specialist_types) {
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
return &specialists[id];
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
|
Return the specialist type with the given (untranslated!) rule name.
|
||
|
Returns NULL if none match.
|
||
|
Returns nullptr if none match.
|
||
|
**************************************************************************/
|
||
|
struct specialist *specialist_by_rule_name(const char *name)
|
||
|
{
|
||
| ... | ... | |
|
}
|
||
|
} specialist_type_iterate_end;
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
|
Return the specialist type with the given (translated, plural) name.
|
||
|
Returns NULL if none match.
|
||
|
Returns nullptr if none match.
|
||
|
**************************************************************************/
|
||
|
struct specialist *specialist_by_translated_name(const char *name)
|
||
|
{
|
||
| ... | ... | |
|
}
|
||
|
} specialist_type_iterate_end;
|
||
|
return NULL;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/**********************************************************************//**
|
||
| ... | ... | |
|
Return the output for the specialist type with this output type.
|
||
|
**************************************************************************/
|
||
|
int get_specialist_output(const struct city *pcity,
|
||
|
Specialist_type_id sp, Output_type_id otype)
|
||
|
Specialist_type_id sp, Output_type_id otype)
|
||
|
{
|
||
|
struct specialist *pspecialist = &specialists[sp];
|
||
|
struct output_type *poutput = get_output_type(otype);
|
||
|
return get_city_specialist_output_bonus(pcity, pspecialist, poutput,
|
||
|
EFT_SPECIALIST_OUTPUT);
|
||
|
EFT_SPECIALIST_OUTPUT);
|
||
|
}
|
||