Feature #1830 ยป 0046-style.c-Replace-parameter-checking-fc_asserts-with-n.patch
| common/style.c | ||
|---|---|---|
|
**************************************************************************/
|
||
|
int style_number(const struct nation_style *pstyle)
|
||
|
{
|
||
|
fc_assert_ret_val(pstyle != nullptr, -1);
|
||
|
return pstyle->id;
|
||
|
}
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
int style_index(const struct nation_style *pstyle)
|
||
|
{
|
||
|
fc_assert_ret_val(pstyle != nullptr, -1);
|
||
|
return pstyle - styles;
|
||
|
}
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
int music_style_number(const struct music_style *pms)
|
||
|
{
|
||
|
fc_assert_ret_val(pms != nullptr, -1);
|
||
|
return pms->id;
|
||
|
}
|
||
| common/style.h | ||
|---|---|---|
|
void styles_alloc(int count);
|
||
|
void styles_free(void);
|
||
|
int style_count(void);
|
||
|
int style_number(const struct nation_style *pstyle);
|
||
|
int style_index(const struct nation_style *pstyle);
|
||
|
int style_number(const struct nation_style *pstyle)
|
||
|
fc__attribute((nonnull(1)));
|
||
|
int style_index(const struct nation_style *pstyle)
|
||
|
fc__attribute((nonnull(1)));
|
||
|
struct nation_style *style_by_number(int id);
|
||
|
const char *style_name_translation(const struct nation_style *pstyle);
|
||
|
const char *style_rule_name(const struct nation_style *pstyle);
|
||
| ... | ... | |
|
void music_styles_alloc(int count);
|
||
|
void music_styles_free(void);
|
||
|
int music_style_number(const struct music_style *pms);
|
||
|
int music_style_number(const struct music_style *pms)
|
||
|
fc__attribute((nonnull(1)));
|
||
|
struct music_style *music_style_by_number(int id);
|
||
|
struct music_style *player_music_style(struct player *plr);
|
||