Support building with -Werror=strict-prototypes / -Werror=old-style-definition

Unfortunately "-std=c99" is not sufficient to make gcc ignore cold that
uses constructs of earlier C standards, which were abandoned in C99.

See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for
some related discussion.

Change-Id: Ic92aa70d569778a776f4c5d24c455f71fd50b61b
This commit is contained in:
Harald Welte 2022-11-03 11:50:48 +01:00 committed by laforge
parent 2986ee497b
commit 6c8ca97546
24 changed files with 41 additions and 40 deletions

View File

@ -40,7 +40,7 @@ enum assignment_fsm_event {
ASSIGNMENT_EV_CONN_RELEASING,
};
void assignment_fsm_init();
void assignment_fsm_init(void);
int reassignment_request_to_lchan(enum assign_for assign_for, struct gsm_lchan *lchan, struct gsm_lchan *to_lchan,
int tsc_set, int tsc);

View File

@ -113,4 +113,4 @@ extern const struct osmo_stat_item_group_desc bsc_statg_desc;
void bsc_update_connection_stats(struct gsm_network *net);
void all_allocated_update_bts(struct gsm_bts *bts);
void all_allocated_update_bsc();
void all_allocated_update_bsc(void);

View File

@ -57,7 +57,7 @@ struct osmo_mgcpc_ep_ci;
struct assignment_request;
struct gsm_lchan;
void bsc_subscr_conn_fsm_init();
void bsc_subscr_conn_fsm_init(void);
/* Allocate a subscriber connection and its associated FSM */
struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net);

View File

@ -6,11 +6,11 @@ struct gsm_bts_trx;
struct gsm_bts_trx_ts;
struct gsm_lchan;
void chan_counts_sig_init();
void chan_counts_sig_init(void);
void chan_counts_ts_update(struct gsm_bts_trx_ts *ts);
void chan_counts_ts_clear(struct gsm_bts_trx_ts *ts);
void chan_counts_trx_update(struct gsm_bts_trx *trx);
void chan_counts_bsc_verify();
void chan_counts_bsc_verify(void);
/* First array index to chan_counts.val. */
enum chan_counts_dim1 {

View File

@ -55,7 +55,7 @@ struct handover_rr_detect_data {
const uint8_t *access_delay;
};
void handover_fsm_init();
void handover_fsm_init(void);
int handover_request(struct handover_out_req *req);
void handover_start(struct handover_out_req *req);

View File

@ -3,6 +3,6 @@
#include <osmocom/vty/vty.h>
#include <osmocom/bsc/handover_cfg.h>
void ho_vty_init();
void ho_vty_init(void);
void ho_vty_write_net(struct vty *vty, struct gsm_network *net);
void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts);

View File

@ -57,7 +57,7 @@ struct smlc_config {
extern const struct rate_ctr_desc smlc_ctr_description[];
extern const struct rate_ctr_group_desc smlc_ctrg_desc;
int lb_init();
int lb_start_or_stop();
int lb_init(void);
int lb_start_or_stop(void);
int lb_send(struct gsm_subscriber_connection *conn, const struct bssap_le_pdu *bssap_le);
void lb_close_conn(struct gsm_subscriber_connection *conn);

View File

@ -56,7 +56,7 @@ enum lchan_fsm_event {
LCHAN_EV_REQUEST_MODE_MODIFY,
};
void lchan_fsm_init();
void lchan_fsm_init(void);
void lchan_fsm_alloc(struct gsm_lchan *lchan);
void lchan_release(struct gsm_lchan *lchan, bool do_rr_release,

View File

@ -73,7 +73,7 @@ void bts_cell_ab(struct cell_ab *arfcn_bsic, const struct gsm_bts *bts);
int resolve_neighbors(struct gsm_bts **local_neighbor_p, struct gsm0808_cell_id_list2 *remote_neighbors,
struct gsm_bts *from_bts, const struct cell_ab *target_ab, bool log_errors);
void neighbor_ident_vty_init();
void neighbor_ident_vty_init(void);
void neighbor_ident_vty_write_bts(struct vty *vty, const char *indent, struct gsm_bts *bts);
void neighbor_ident_vty_write_network(struct vty *vty, const char *indent);
@ -81,7 +81,7 @@ int neighbor_ident_add_neighbor(struct vty *vty, struct gsm_bts *bts, struct nei
int neighbor_ident_del_neighbor(struct vty *vty, struct gsm_bts *bts, struct neighbor *n);
int neighbor_ident_ctrl_init(void);
int neighbors_check_cfg();
int neighbors_check_cfg(void);
#define CELL_AB_VTY_PARAMS "arfcn <0-1023> bsic (<0-63>|any)"
#define CELL_AB_VTY_DOC \

View File

@ -17,7 +17,7 @@ struct gsm_audio_support;
struct gsm_subscriber_connection;
struct gsm_bts;
struct bsc_api *osmo_bsc_api();
struct bsc_api *osmo_bsc_api(void);
int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
@ -25,7 +25,8 @@ int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
int bsc_handle_udt(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length);
int bsc_handle_dt(struct gsm_subscriber_connection *conn, struct msgb *msg, unsigned int len);
int bsc_ctrl_cmds_install();
struct gsm_network;
int bsc_ctrl_cmds_install(struct gsm_network *net);
void bsc_gen_location_state_trap(struct gsm_bts *bts);

View File

@ -53,7 +53,7 @@ static struct {
.format_json = false,
};
static void print_help()
static void print_help(void)
{
printf("\n");
printf("Usage: abisip-find [-l] [<interface-name>]\n");
@ -265,7 +265,7 @@ LLIST_HEAD(base_stations);
void *ctx = NULL;
void print_timestamp()
void print_timestamp(void)
{
time_t now = time(NULL);
printf("\n\n----- %s\n", ctime(&now));
@ -304,7 +304,7 @@ bool base_stations_add(struct base_station *new_bs)
return true;
}
bool base_stations_timeout()
bool base_stations_timeout(void)
{
struct base_station *bs, *next_bs;
time_t now = time(NULL);
@ -323,7 +323,7 @@ bool base_stations_timeout()
return changed;
}
void base_stations_print()
void base_stations_print(void)
{
struct base_station *bs;
int count = 0;

View File

@ -364,7 +364,7 @@ static bool lchan_type_compat_with_mode(enum gsm_chan_t type, const struct chann
}
}
void assignment_fsm_init()
void assignment_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&assignment_fsm) == 0);
}

View File

@ -229,7 +229,7 @@ void all_allocated_update_bts(struct gsm_bts *bts)
all_allocated_update(&bts->all_allocated, &bts->chan_counts);
}
void all_allocated_update_bsc()
void all_allocated_update_bsc(void)
{
struct gsm_network *net = bsc_gsmnet;
all_allocated_update(&net->all_allocated, &net->chan_counts);

View File

@ -1202,7 +1202,7 @@ static struct osmo_fsm gscon_fsm = {
.event_names = gscon_fsm_event_names,
};
void bsc_subscr_conn_fsm_init()
void bsc_subscr_conn_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&gscon_fsm) == 0);
OSMO_ASSERT(osmo_fsm_register(&lcls_fsm) == 0);

View File

@ -251,7 +251,7 @@ void bssmap_reset_resend_reset(struct bssmap_reset *bssmap_reset)
osmo_fsm_inst_state_chg_ms(bssmap_reset->fi, BSSMAP_RESET_ST_DISC, 1, 0);
}
static __attribute__((constructor)) void bssmap_reset_fsm_init()
static __attribute__((constructor)) void bssmap_reset_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&bssmap_reset_fsm) == 0);
}

View File

@ -248,7 +248,7 @@ void chan_counts_sig_init(void)
osmo_signal_register_handler(SS_NM, chan_counts_sig_cb, NULL);
}
void chan_counts_bsc_verify()
void chan_counts_bsc_verify(void)
{
struct gsm_bts *bts;
struct chan_counts bsc_counts = {0};

View File

@ -293,7 +293,7 @@ static void handover_reset(struct gsm_subscriber_connection *conn)
};
}
void handover_fsm_init()
void handover_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&ho_fsm) == 0);
}

View File

@ -170,7 +170,7 @@ HODEC1_CFG_ALL_MEMBERS
#undef HO_CFG_ONE_MEMBER
}
void ho_vty_init()
void ho_vty_init(void)
{
ho_vty_init_cmds(GSMNET_NODE);
install_element(GSMNET_NODE, &cfg_net_ho_congestion_check_interval_cmd);

View File

@ -46,7 +46,7 @@ static struct gsm_subscriber_connection *get_bsc_conn_by_lb_conn_id(int conn_id)
}
/* Send reset to SMLC */
int bssmap_le_tx_reset()
int bssmap_le_tx_reset(void)
{
struct osmo_ss7_instance *ss7;
struct msgb *msg;
@ -74,7 +74,7 @@ int bssmap_le_tx_reset()
}
/* Send reset-ack to SMLC */
int bssmap_le_tx_reset_ack()
int bssmap_le_tx_reset_ack(void)
{
struct osmo_ss7_instance *ss7;
struct msgb *msg;
@ -352,7 +352,7 @@ count_tx:
#define DEFAULT_ASP_LOCAL_IP "localhost"
#define DEFAULT_ASP_REMOTE_IP "localhost"
void lb_cancel_all()
void lb_cancel_all(void)
{
struct gsm_subscriber_connection *conn;
llist_for_each_entry(conn, &bsc_gsmnet->subscr_conns, entry)
@ -384,7 +384,7 @@ void lb_reset_tx_reset_ack(void *data)
bssmap_le_tx_reset_ack();
}
static void lb_start_reset_fsm()
static void lb_start_reset_fsm(void)
{
struct bssmap_reset_cfg cfg = {
.conn_cfm_failure_threshold = 3,
@ -404,13 +404,13 @@ static void lb_start_reset_fsm()
bsc_gsmnet->smlc->bssmap_reset = bssmap_reset_alloc(bsc_gsmnet, "Lb", &cfg);
}
static void lb_stop_reset_fsm()
static void lb_stop_reset_fsm(void)
{
bssmap_reset_term_and_free(bsc_gsmnet->smlc->bssmap_reset);
bsc_gsmnet->smlc->bssmap_reset = NULL;
}
static int lb_start()
static int lb_start(void)
{
uint32_t default_pc;
struct osmo_ss7_instance *cs7_inst = NULL;
@ -484,7 +484,7 @@ static int lb_start()
return 0;
}
static int lb_stop()
static int lb_stop(void)
{
/* Not set up? */
if (!bsc_gsmnet->smlc->sccp_user)
@ -499,7 +499,7 @@ static int lb_stop()
return 0;
}
int lb_start_or_stop()
int lb_start_or_stop(void)
{
int rc;
if (bsc_gsmnet->smlc->enable) {
@ -534,7 +534,7 @@ int lb_start_or_stop()
static void smlc_vty_init(void);
int lb_init()
int lb_init(void)
{
OSMO_ASSERT(!bsc_gsmnet->smlc);
bsc_gsmnet->smlc = talloc_zero(bsc_gsmnet, struct smlc_config);

View File

@ -463,7 +463,7 @@ void lchan_fsm_update_id(struct gsm_lchan *lchan)
extern void lchan_rtp_fsm_init();
void lchan_fsm_init()
void lchan_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&lchan_fsm) == 0);
lchan_rtp_fsm_init();

View File

@ -70,7 +70,7 @@ struct osmo_tdef_state_timeout lchan_rtp_fsm_timeouts[32] = {
} while (0)
/* Called from lchan_fsm_init(), does not need to be visible in lchan_rtp_fsm.h */
void lchan_rtp_fsm_init()
void lchan_rtp_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&lchan_rtp_fsm) == 0);
}

View File

@ -293,7 +293,7 @@ bool cell_ab_valid(const struct cell_ab *cell)
return true;
}
int neighbors_check_cfg()
int neighbors_check_cfg(void)
{
/* A local neighbor can be configured by BTS number, or by a cell ID. A local neighbor can omit the ARFCN+BSIC,
* in which case those are taken from that local BTS config. If a local neighbor has ARFCN+BSIC configured, it

View File

@ -628,7 +628,7 @@ DEFUN(show_bts_neighbor, show_bts_neighbor_cmd,
return CMD_SUCCESS;
}
void neighbor_ident_vty_init()
void neighbor_ident_vty_init(void)
{
install_element(GSMNET_NODE, &cfg_neighbor_bind_cmd);

View File

@ -91,12 +91,12 @@ static const char *config_file = "osmo-bsc.cfg";
static const char *rf_ctrl = NULL;
static int daemonize = 0;
static void print_usage()
static void print_usage(void)
{
printf("Usage: osmo-bsc\n");
}
static void print_help()
static void print_help(void)
{
printf("Some useful options:\n");
printf(" -h --help This text.\n");