Feature #1504 ยป 0091-vision.-ch-Replace-NULL-with-nullptr.patch
common/vision.c | ||
---|---|---|
****************************************************************************/
|
||
void vision_site_destroy(struct vision_site *psite)
|
||
{
|
||
if (psite->name != NULL) {
|
||
if (psite->name != nullptr) {
|
||
free(psite->name);
|
||
}
|
||
... | ... | |
psite->identity = identity;
|
||
psite->location = location;
|
||
psite->owner = owner;
|
||
psite->original = NULL;
|
||
psite->original = nullptr;
|
||
return psite;
|
||
}
|
||
... | ... | |
if (watcher == pcity->original) {
|
||
psite->original = pcity->original;
|
||
} else {
|
||
psite->original = NULL;
|
||
psite->original = nullptr;
|
||
}
|
||
return psite;
|
||
... | ... | |
if (watcher == pcity->original) {
|
||
psite->original = pcity->original;
|
||
} else {
|
||
psite->original = NULL;
|
||
psite->original = nullptr;
|
||
}
|
||
vision_site_size_set(psite, city_size_get(pcity));
|
||
if (psite->name != NULL) {
|
||
if (psite->name != nullptr) {
|
||
free(psite->name);
|
||
}
|
||
psite->name = fc_strdup(city_name_get(pcity));
|
||
... | ... | |
*copy = *psite;
|
||
/* Then allocate things that aren't shared */
|
||
if (psite->name != NULL) {
|
||
if (psite->name != nullptr) {
|
||
copy->name = fc_strdup(psite->name);
|
||
}
|
||
... | ... | |
****************************************************************************/
|
||
citizens vision_site_size_get(const struct vision_site *psite)
|
||
{
|
||
fc_assert_ret_val(psite != NULL, 0);
|
||
fc_assert_ret_val(psite != nullptr, 0);
|
||
return psite->size;
|
||
}
|
||
... | ... | |
****************************************************************************/
|
||
void vision_site_size_set(struct vision_site *psite, citizens size)
|
||
{
|
||
fc_assert_ret(psite != NULL);
|
||
fc_assert_ret(psite != nullptr);
|
||
psite->size = size;
|
||
}
|
common/vision.h | ||
---|---|---|
struct vision_site {
|
||
char *name;
|
||
struct tile *location; /* Cannot be NULL */
|
||
struct player *owner; /* May be NULL, always check! */
|
||
struct player *original; /* Can be NULL, even in case of a city */
|
||
struct tile *location; /* Cannot be nullptr */
|
||
struct player *owner; /* May be nullptr, always check! */
|
||
struct player *original; /* Can be nullptr, even in case of a city */
|
||
int identity; /* city > IDENTITY_NUMBER_ZERO */
|
||
citizens size; /* city size (0 <= size <= MAX_CITY_SIZE) */
|
||
... | ... | |
}
|
||
#endif /* __cplusplus */
|
||
#endif /* FC__VISION_H */
|
||
#endif /* FC__VISION_H */
|