Feature #2006 ยป 0033-common-headers-Replace-NULL-with-nullptr.patch
| common/name_translation.h | ||
|---|---|---|
|
};
|
||
|
/* Initialization macro. */
|
||
|
#define NAME_INIT { NULL, "\0", "\0" }
|
||
|
#define NAME_INIT { nullptr, "\0", "\0" }
|
||
|
/************************************************************************//**
|
||
|
Initializes a name translation structure.
|
||
| ... | ... | |
|
static inline void name_init(struct name_translation *ptrans)
|
||
|
{
|
||
|
ptrans->vernacular[0] = ptrans->rulename[0] = '\0';
|
||
|
ptrans->translated = NULL;
|
||
|
ptrans->translated = nullptr;
|
||
|
}
|
||
|
/************************************************************************//**
|
||
|
Set the untranslated and rule names of the name translation structure.
|
||
|
If rule_name is NULL, use vernacular_name for it (after removing any i18n
|
||
|
If rule_name is nullptr, use vernacular_name for it (after removing any i18n
|
||
|
qualifier).
|
||
|
****************************************************************************/
|
||
|
static inline void names_set(struct name_translation *ptrans,
|
||
| ... | ... | |
|
if (ptrans->vernacular[0] != '\0') {
|
||
|
/* Translate now. */
|
||
|
if (domain == NULL) {
|
||
|
if (domain == nullptr) {
|
||
|
ptrans->translated = Q_(ptrans->vernacular);
|
||
|
} else {
|
||
|
ptrans->translated = skip_intl_qualifier_prefix(DG_(domain, ptrans->vernacular));
|
||
| ... | ... | |
|
const char *domain,
|
||
|
const char *vernacular_name)
|
||
|
{
|
||
|
names_set(ptrans, domain, vernacular_name, NULL);
|
||
|
names_set(ptrans, domain, vernacular_name, nullptr);
|
||
|
}
|
||
|
/************************************************************************//**
|
||
| common/terrain.h | ||
|---|---|---|
|
bool is_terrain_flag_card_near(const struct civ_map *nmap,
|
||
|
const struct tile *ptile,
|
||
|
enum terrain_flag_id flag);
|
||
|
enum terrain_flag_id flag);
|
||
|
bool is_terrain_flag_near_tile(const struct civ_map *nmap,
|
||
|
const struct tile *ptile,
|
||
|
enum terrain_flag_id flag);
|
||
|
enum terrain_flag_id flag);
|
||
|
int count_terrain_flag_near_tile(const struct civ_map *nmap,
|
||
|
const struct tile *ptile,
|
||
|
bool cardinal_only, bool percentage,
|
||
|
enum terrain_flag_id flag);
|
||
|
bool cardinal_only, bool percentage,
|
||
|
enum terrain_flag_id flag);
|
||
|
void user_terrain_flags_init(void);
|
||
|
void user_terrain_flags_free(void);
|
||
|
void set_user_terrain_flag_name(enum terrain_flag_id id, const char *name, const char *helptxt);
|
||
| ... | ... | |
|
/* Functions to operate on a general terrain type. */
|
||
|
bool is_terrain_card_near(const struct civ_map *nmap,
|
||
|
const struct tile *ptile,
|
||
|
const struct terrain *pterrain,
|
||
|
const struct terrain *pterrain,
|
||
|
bool check_self);
|
||
|
bool is_terrain_near_tile(const struct civ_map *nmap,
|
||
|
const struct tile *ptile,
|
||
|
const struct terrain *pterrain,
|
||
|
const struct terrain *pterrain,
|
||
|
bool check_self);
|
||
|
int count_terrain_property_near_tile(const struct civ_map *nmap,
|
||
|
const struct tile *ptile,
|
||
| ... | ... | |
|
} \
|
||
|
}
|
||
|
#define terrain_animals_iterate(pterrain, _animal) \
|
||
|
if (NULL != pterrain && pterrain->num_animals > 0) { \
|
||
|
int _animal##_index; \
|
||
|
for (_animal##_index = 0; \
|
||
|
_animal##_index < pterrain->num_animals; \
|
||
|
_animal##_index++) { \
|
||
|
const struct unit_type *_animal = pterrain->animals[_animal##_index]; \
|
||
|
#define terrain_animals_iterate(pterrain, _animal) \
|
||
|
if (pterrain != nullptr && pterrain->num_animals > 0) { \
|
||
|
int _animal##_index; \
|
||
|
for (_animal##_index = 0; \
|
||
|
_animal##_index < pterrain->num_animals; \
|
||
|
_animal##_index++) { \
|
||
|
const struct unit_type *_animal = pterrain->animals[_animal##_index];
|
||
|
#define terrain_animals_iterate_end \
|
||
|
} \
|
||
|
#define terrain_animals_iterate_end \
|
||
|
} \
|
||
|
}
|
||
|
#ifdef __cplusplus
|
||