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: I84fd99442d0cc400fa562fa33623c142649230e2
This commit is contained in:
Harald Welte 2022-11-03 11:05:58 +01:00
parent 0d9b6b0e31
commit b4dc159212
55 changed files with 214 additions and 214 deletions

View File

@ -52,7 +52,7 @@ void osmo_counter_free(struct osmo_counter *ctr)
int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data);
int osmo_counters_count(); int osmo_counters_count(void);
struct osmo_counter *osmo_counter_get_by_name(const char *name); struct osmo_counter *osmo_counter_get_by_name(const char *name);

View File

@ -105,8 +105,8 @@ struct osmo_signalfd {
struct osmo_signalfd * struct osmo_signalfd *
osmo_signalfd_setup(void *ctx, sigset_t set, osmo_signalfd_cb *cb, void *data); osmo_signalfd_setup(void *ctx, sigset_t set, osmo_signalfd_cb *cb, void *data);
void osmo_select_shutdown_request(); void osmo_select_shutdown_request(void);
int osmo_select_shutdown_requested(); int osmo_select_shutdown_requested(void);
bool osmo_select_shutdown_done(); bool osmo_select_shutdown_done(void);
/*! @} */ /*! @} */

View File

@ -235,7 +235,7 @@ int bssgp_fc_in(struct bssgp_flow_control *fc, struct msgb *msg,
int bssgp_fc_ms_init(struct bssgp_flow_control *fc_ms, uint16_t bvci, int bssgp_fc_ms_init(struct bssgp_flow_control *fc_ms, uint16_t bvci,
uint16_t nsei, uint32_t max_queue_depth); uint16_t nsei, uint32_t max_queue_depth);
void bssgp_flush_all_queues(); void bssgp_flush_all_queues(void);
void bssgp_fc_flush_queue(struct bssgp_flow_control *fc); void bssgp_fc_flush_queue(struct bssgp_flow_control *fc);
/* gprs_bssgp_vty.c */ /* gprs_bssgp_vty.c */

View File

@ -73,7 +73,7 @@ struct msgb *gsm0808_create_cipher2(const struct gsm0808_cipher_mode_command *cm
struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id); struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id);
struct msgb *gsm0808_create_cipher_reject(enum gsm0808_cause cause); struct msgb *gsm0808_create_cipher_reject(enum gsm0808_cause cause);
struct msgb *gsm0808_create_cipher_reject_ext(enum gsm0808_cause_class class, uint8_t ext); struct msgb *gsm0808_create_cipher_reject_ext(enum gsm0808_cause_class class, uint8_t ext);
struct msgb *gsm0808_create_classmark_request(); struct msgb *gsm0808_create_classmark_request(void);
struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len,
const uint8_t *cm3, uint8_t cm3_len); const uint8_t *cm3, uint8_t cm3_len);
struct msgb *gsm0808_create_sapi_reject_cause(uint8_t link_id, uint16_t cause); struct msgb *gsm0808_create_sapi_reject_cause(uint8_t link_id, uint16_t cause);
@ -269,8 +269,8 @@ struct gsm0808_handover_command {
}; };
struct msgb *gsm0808_create_handover_command(const struct gsm0808_handover_command *params); struct msgb *gsm0808_create_handover_command(const struct gsm0808_handover_command *params);
struct msgb *gsm0808_create_handover_detect(); struct msgb *gsm0808_create_handover_detect(void);
struct msgb *gsm0808_create_handover_succeeded(); struct msgb *gsm0808_create_handover_succeeded(void);
struct gsm0808_handover_complete { struct gsm0808_handover_complete {
bool rr_cause_present; bool rr_cause_present;

View File

@ -442,8 +442,8 @@ char *argv_concat(const char **argv, int argc, int shift);
vector cmd_make_strvec(const char *); vector cmd_make_strvec(const char *);
int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p); int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p);
void cmd_free_strvec(vector); void cmd_free_strvec(vector);
vector cmd_describe_command(); vector cmd_describe_command(vector vline, struct vty * vty, int *status);
char **cmd_complete_command(); char **cmd_complete_command(vector vline, struct vty *vty, int *status);
const char *cmd_prompt(enum node_type); const char *cmd_prompt(enum node_type);
int config_from_file(struct vty *, FILE *); int config_from_file(struct vty *, FILE *);
enum node_type node_parent(enum node_type); enum node_type node_parent(enum node_type);

View File

@ -6,7 +6,7 @@
#define FILTER_STR "Filter log messages\n" #define FILTER_STR "Filter log messages\n"
struct log_info; struct log_info;
void logging_vty_add_cmds(); void logging_vty_add_cmds(void);
void logging_vty_add_deprecated_subsys(void *ctx, const char *name); void logging_vty_add_deprecated_subsys(void *ctx, const char *name);
struct vty; struct vty;
struct log_target *osmo_log_vty2tgt(struct vty *vty); struct log_target *osmo_log_vty2tgt(struct vty *vty);

View File

@ -75,7 +75,7 @@ int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *),
/*! Counts the registered counter /*! Counts the registered counter
* \returns amount of counters */ * \returns amount of counters */
int osmo_counters_count() int osmo_counters_count(void)
{ {
return llist_count(&counters); return llist_count(&counters);
} }

View File

@ -1428,7 +1428,7 @@ void bssgp_fc_flush_queue(struct bssgp_flow_control *fc)
/*! /*!
* \brief Flush the queues of all BSSGP contexts. * \brief Flush the queues of all BSSGP contexts.
*/ */
void bssgp_flush_all_queues() void bssgp_flush_all_queues(void)
{ {
struct bssgp_bvc_ctx *bctx; struct bssgp_bvc_ctx *bctx;

View File

@ -418,7 +418,7 @@ struct msgb *gsm0808_create_lcls_notification(enum gsm0808_lcls_status status, b
/*! Create BSSMAP Classmark Request message /*! Create BSSMAP Classmark Request message
* \returns callee-allocated msgb with BSSMAP Classmark Request message */ * \returns callee-allocated msgb with BSSMAP Classmark Request message */
struct msgb *gsm0808_create_classmark_request() struct msgb *gsm0808_create_classmark_request(void)
{ {
struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
"classmark-request"); "classmark-request");
@ -1110,7 +1110,7 @@ struct msgb *gsm0808_create_handover_command(const struct gsm0808_handover_comma
/*! Create BSSMAP HANDOVER DETECT message, 3GPP TS 48.008 3.2.1.40. /*! Create BSSMAP HANDOVER DETECT message, 3GPP TS 48.008 3.2.1.40.
* Sent from the MT BSC back to the MSC when the MS has sent a handover RACH request and the MT BSC has * Sent from the MT BSC back to the MSC when the MS has sent a handover RACH request and the MT BSC has
* received the Handover Detect message. */ * received the Handover Detect message. */
struct msgb *gsm0808_create_handover_detect() struct msgb *gsm0808_create_handover_detect(void)
{ {
struct msgb *msg; struct msgb *msg;
@ -1129,7 +1129,7 @@ struct msgb *gsm0808_create_handover_detect()
/*! Create BSSMAP HANDOVER SUCCEEDED message, 3GPP TS 48.008 3.2.1.13. /*! Create BSSMAP HANDOVER SUCCEEDED message, 3GPP TS 48.008 3.2.1.13.
* Sent from the MSC back to the old BSS to notify that the MS has successfully accessed the new BSS. */ * Sent from the MSC back to the old BSS to notify that the MS has successfully accessed the new BSS. */
struct msgb *gsm0808_create_handover_succeeded() struct msgb *gsm0808_create_handover_succeeded(void)
{ {
struct msgb *msg; struct msgb *msg;

View File

@ -653,20 +653,20 @@ osmo_signalfd_setup(void *ctx, sigset_t set, osmo_signalfd_cb *cb, void *data)
* } * }
* } * }
*/ */
void osmo_select_shutdown_request() void osmo_select_shutdown_request(void)
{ {
_osmo_select_shutdown_requested++; _osmo_select_shutdown_requested++;
}; };
/*! Return the number of times osmo_select_shutdown_request() was called before. */ /*! Return the number of times osmo_select_shutdown_request() was called before. */
int osmo_select_shutdown_requested() int osmo_select_shutdown_requested(void)
{ {
return _osmo_select_shutdown_requested; return _osmo_select_shutdown_requested;
}; };
/*! Return true after osmo_select_shutdown_requested() was called, and after an osmo_select poll loop found no more /*! Return true after osmo_select_shutdown_requested() was called, and after an osmo_select poll loop found no more
* pending OSMO_FD_WRITE on any registered socket. */ * pending OSMO_FD_WRITE on any registered socket. */
bool osmo_select_shutdown_done() { bool osmo_select_shutdown_done(void) {
return _osmo_select_shutdown_done; return _osmo_select_shutdown_done;
}; };

View File

@ -49,7 +49,7 @@
OSMO_MIN((TIME_CC)->cfg.round_threshold_usec, GRAN_USEC(TIME_CC)) \ OSMO_MIN((TIME_CC)->cfg.round_threshold_usec, GRAN_USEC(TIME_CC)) \
: (GRAN_USEC(TIME_CC) / 2)) : (GRAN_USEC(TIME_CC) / 2))
static uint64_t time_now_usec() static uint64_t time_now_usec(void)
{ {
struct timespec tp; struct timespec tp;
if (osmo_clock_gettime(CLOCK_MONOTONIC, &tp)) if (osmo_clock_gettime(CLOCK_MONOTONIC, &tp))

View File

@ -89,7 +89,7 @@ static struct cmd_node sched_node = {
}; };
/* returns number of configured CPUs in the system, or negative otherwise */ /* returns number of configured CPUs in the system, or negative otherwise */
static int get_num_cpus() { static int get_num_cpus(void) {
static unsigned int num_cpus = 0; static unsigned int num_cpus = 0;
long ln; long ln;

View File

@ -1196,7 +1196,7 @@ static void gen_vty_logp_cmd_strs(struct cmd_element *cmd)
/*! Register logging related commands to the VTY. Call this once from /*! Register logging related commands to the VTY. Call this once from
* your application if you want to support those commands. */ * your application if you want to support those commands. */
void logging_vty_add_cmds() void logging_vty_add_cmds(void)
{ {
install_lib_element_ve(&enable_logging_cmd); install_lib_element_ve(&enable_logging_cmd);
install_lib_element_ve(&disable_logging_cmd); install_lib_element_ve(&disable_logging_cmd);

View File

@ -742,7 +742,7 @@ static int config_write_stats(struct vty *vty)
* Call this once during your application initialization if you would * Call this once during your application initialization if you would
* like to have stats VTY commands enabled. * like to have stats VTY commands enabled.
*/ */
void osmo_stats_vty_add_cmds() void osmo_stats_vty_add_cmds(void)
{ {
install_lib_element_ve(&show_stats_cmd); install_lib_element_ve(&show_stats_cmd);
install_lib_element_ve(&show_stats_level_cmd); install_lib_element_ve(&show_stats_level_cmd);

View File

@ -167,7 +167,7 @@ static inline void chk_descr(struct msgb *msg, const char *f_id, const char *f_v
} }
} }
static void test_sw_descr() static void test_sw_descr(void)
{ {
const char *f_id = "TEST.L0L", *f_ver = "0.1.666~deadbeeffacefeed-dirty"; const char *f_id = "TEST.L0L", *f_ver = "0.1.666~deadbeeffacefeed-dirty";
uint8_t chain[] = { 0x42, 0x12, 0x00, 0x03, 0x01, 0x02, 0x03, 0x13, 0x00, 0x03, 0x03, 0x04, 0x05, 0x42, 0x12, uint8_t chain[] = { 0x42, 0x12, 0x00, 0x03, 0x01, 0x02, 0x03, 0x13, 0x00, 0x03, 0x03, 0x04, 0x05, 0x42, 0x12,
@ -194,7 +194,7 @@ static void test_sw_descr()
} }
/* Test decode IPAC_DLCX_IND obtained from SYS#5915 */ /* Test decode IPAC_DLCX_IND obtained from SYS#5915 */
static void test_dec_ipac_dlc_indx() static void test_dec_ipac_dlc_indx(void)
{ {
/* Radio Signalling Link (RSL) /* Radio Signalling Link (RSL)
0111 111. = Message discriminator: ip.access Vendor Specific messages (63) 0111 111. = Message discriminator: ip.access Vendor Specific messages (63)

View File

@ -69,7 +69,7 @@ static inline void test_set(struct bitvec *bv, enum bit_value bit)
printf(" %s [%d]\n\n", lol, bv->cur_bit); printf(" %s [%d]\n\n", lol, bv->cur_bit);
} }
static void test_byte_ops() static void test_byte_ops(void)
{ {
struct bitvec bv; struct bitvec bv;
const uint8_t *in = (const uint8_t *)"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const uint8_t *in = (const uint8_t *)"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@ -162,7 +162,7 @@ static inline void test_bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits
OSMO_ASSERT(num == result); OSMO_ASSERT(num == result);
} }
static void test_array() static void test_array(void)
{ {
struct bitvec b; struct bitvec b;
uint8_t d[4096]; uint8_t d[4096];
@ -181,7 +181,7 @@ static void test_array()
test_array_item(17, &b, n, array, n * 3); test_array_item(17, &b, n, array, n * 3);
} }
static void test_used_bytes() static void test_used_bytes(void)
{ {
struct bitvec b; struct bitvec b;
uint8_t d[32]; uint8_t d[32];
@ -204,7 +204,7 @@ static void test_used_bytes()
} }
} }
static void test_tailroom() static void test_tailroom(void)
{ {
struct bitvec b; struct bitvec b;
uint8_t d[32]; uint8_t d[32];

View File

@ -48,7 +48,7 @@ struct bsslap_pdu bsslap_test_pdus[] = {
}, },
}; };
void test_bsslap_enc_dec() void test_bsslap_enc_dec(void)
{ {
struct bsslap_pdu *pdu; struct bsslap_pdu *pdu;
printf("--- %s\n", __func__); printf("--- %s\n", __func__);
@ -96,7 +96,7 @@ loop_end:
} }
} }
int main() int main(int argc, char **argv)
{ {
test_bsslap_enc_dec(); test_bsslap_enc_dec();
return 0; return 0;

View File

@ -150,7 +150,7 @@ struct bssmap_le_pdu bssmap_le_test_pdus[] = {
}, },
}; };
void test_bssmap_le_enc_dec() void test_bssmap_le_enc_dec(void)
{ {
struct bssmap_le_pdu *pdu; struct bssmap_le_pdu *pdu;
printf("--- %s\n", __func__); printf("--- %s\n", __func__);
@ -200,7 +200,7 @@ loop_end:
} }
} }
int main() int main(int argc, char **argv)
{ {
test_bssmap_le_enc_dec(); test_bssmap_le_enc_dec();
return 0; return 0;

View File

@ -183,7 +183,7 @@ void test_fr_concealment_core(void)
} }
/* Simulate a real life situation: voice frames with a few dropouts */ /* Simulate a real life situation: voice frames with a few dropouts */
void test_fr_concealment_realistic() void test_fr_concealment_realistic(void)
{ {
struct osmo_ecu_fr_state state; struct osmo_ecu_fr_state state;
uint8_t frame[GSM_FR_BYTES]; uint8_t frame[GSM_FR_BYTES];
@ -219,7 +219,7 @@ void test_fr_concealment_realistic()
} }
/* Simulate a real life situation: voice frames with a few dropouts, using generic core */ /* Simulate a real life situation: voice frames with a few dropouts, using generic core */
void test_fr_concealment_realistic_core() void test_fr_concealment_realistic_core(void)
{ {
struct osmo_ecu_state *state = osmo_ecu_init(NULL, OSMO_ECU_CODEC_FR); struct osmo_ecu_state *state = osmo_ecu_init(NULL, OSMO_ECU_CODEC_FR);
uint8_t frame[GSM_FR_BYTES]; uint8_t frame[GSM_FR_BYTES];

View File

@ -334,7 +334,7 @@ static const struct one_test test_messages_list[] = {
}, },
}; };
static void test_messages() static void test_messages(void)
{ {
struct ctrl_handle *ctrl; struct ctrl_handle *ctrl;
struct ctrl_connection *ccon; struct ctrl_connection *ccon;
@ -390,7 +390,7 @@ static int verify_test_defer(struct ctrl_cmd *cmd, const char *value, void *data
return 0; return 0;
} }
static void test_deferred_cmd() static void test_deferred_cmd(void)
{ {
struct ctrl_handle *ctrl; struct ctrl_handle *ctrl;
struct ctrl_connection *ccon; struct ctrl_connection *ccon;

View File

@ -52,7 +52,7 @@ int socket(int domain, int type, int protocol)
return fd; return fd;
} }
void bssgp_prim_cb() void bssgp_prim_cb(void)
{ {
} }

View File

@ -290,7 +290,7 @@ void obj_set_other(struct obj *a, struct obj *b)
obj_add_other(b, a); obj_add_other(b, a);
} }
static struct scene *scene_alloc() static struct scene *scene_alloc(void)
{ {
struct scene *s = talloc_zero(ctx, struct scene); struct scene *s = talloc_zero(ctx, struct scene);
s->use_count.talloc_object = s; s->use_count.talloc_object = s;
@ -419,7 +419,7 @@ static void trigger_tests(void *loop_ctx)
} }
} }
void test_osmo_fsm_term_safely() void test_osmo_fsm_term_safely(void)
{ {
fprintf(stderr, "\n\n%s()\n", __func__); fprintf(stderr, "\n\n%s()\n", __func__);
osmo_fsm_term_safely(true); osmo_fsm_term_safely(true);
@ -428,7 +428,7 @@ void test_osmo_fsm_term_safely()
fprintf(stderr, "\n\n%s() done\n", __func__); fprintf(stderr, "\n\n%s() done\n", __func__);
} }
void test_osmo_fsm_set_dealloc_ctx() void test_osmo_fsm_set_dealloc_ctx(void)
{ {
fprintf(stderr, "\n\n%s()\n", __func__); fprintf(stderr, "\n\n%s()\n", __func__);
void *dealloc_ctx = talloc_named_const(ctx, 0, "fsm_dealloc"); void *dealloc_ctx = talloc_named_const(ctx, 0, "fsm_dealloc");

View File

@ -172,7 +172,7 @@ static struct osmo_fsm_inst *foo(void)
return fi; return fi;
} }
static void test_id_api() static void test_id_api(void)
{ {
struct osmo_fsm_inst *fi; struct osmo_fsm_inst *fi;
@ -280,7 +280,7 @@ const struct timeval fake_time_start_time = { 123, 456 };
osmo_timers_update(); \ osmo_timers_update(); \
} while (0) } while (0)
void fake_time_start() void fake_time_start(void)
{ {
struct timespec *clock_override; struct timespec *clock_override;
@ -301,7 +301,7 @@ static int timer_cb(struct osmo_fsm_inst *fi)
return 0; return 0;
} }
static void test_state_chg_keep_timer() static void test_state_chg_keep_timer(void)
{ {
struct osmo_fsm_inst *fi; struct osmo_fsm_inst *fi;
@ -349,7 +349,7 @@ static void test_state_chg_keep_timer()
fprintf(stderr, "--- %s() done\n", __func__); fprintf(stderr, "--- %s() done\n", __func__);
} }
static void test_state_chg_T() static void test_state_chg_T(void)
{ {
struct osmo_fsm_inst *fi; struct osmo_fsm_inst *fi;

View File

@ -4,7 +4,7 @@
#include <osmocom/core/msgb.h> #include <osmocom/core/msgb.h>
#include <osmocom/gsm/gad.h> #include <osmocom/gsm/gad.h>
void test_gad_lat_lon_dec_enc_stability() void test_gad_lat_lon_dec_enc_stability(void)
{ {
uint32_t lat_enc; uint32_t lat_enc;
uint32_t lon_enc; uint32_t lon_enc;
@ -49,7 +49,7 @@ struct osmo_gad gad_test_values[] = {
}, },
}; };
void test_gad_enc_dec() void test_gad_enc_dec(void)
{ {
int i; int i;
printf("--- %s\n", __func__); printf("--- %s\n", __func__);
@ -115,7 +115,7 @@ loop_end:
} }
} }
void test_gad_to_str() void test_gad_to_str(void)
{ {
int i; int i;
printf("--- %s\n", __func__); printf("--- %s\n", __func__);
@ -134,7 +134,7 @@ void test_gad_to_str()
} }
} }
int main() int main(int argc, char **argv)
{ {
test_gad_lat_lon_dec_enc_stability(); test_gad_lat_lon_dec_enc_stability();
test_gad_enc_dec(); test_gad_enc_dec();

View File

@ -60,7 +60,7 @@ void dump_rim_ri(struct bssgp_rim_routing_info *ri)
} }
} }
static void test_bssgp_parse_rim_ri() static void test_bssgp_parse_rim_ri(void)
{ {
int rc; int rc;
struct bssgp_rim_routing_info result; struct bssgp_rim_routing_info result;
@ -94,7 +94,7 @@ static void test_bssgp_parse_rim_ri()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_create_rim_ri() static void test_bssgp_create_rim_ri(void)
{ {
int rc; int rc;
struct bssgp_rim_routing_info ri; struct bssgp_rim_routing_info ri;
@ -194,7 +194,7 @@ void dump_bssgp_ran_inf_req_rim_cont(struct bssgp_ran_inf_req_rim_cont *rim_cont
} }
} }
static void test_bssgp_dec_ran_inf_req_rim_cont_nacc() static void test_bssgp_dec_ran_inf_req_rim_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_req_rim_cont rim_cont_dec; struct bssgp_ran_inf_req_rim_cont rim_cont_dec;
@ -212,7 +212,7 @@ static void test_bssgp_dec_ran_inf_req_rim_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_ran_inf_req_rim_cont_nacc() static void test_bssgp_enc_ran_inf_req_rim_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_req_rim_cont rim_cont = { }; struct bssgp_ran_inf_req_rim_cont rim_cont = { };
@ -321,7 +321,7 @@ static void dump_bssgp_ran_inf_rim_cont(struct bssgp_ran_inf_rim_cont *rim_cont)
} }
} }
static void test_bssgp_dec_ran_inf_rim_cont_nacc() static void test_bssgp_dec_ran_inf_rim_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_rim_cont rim_cont_dec; struct bssgp_ran_inf_rim_cont rim_cont_dec;
@ -346,7 +346,7 @@ static void test_bssgp_dec_ran_inf_rim_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_dec_ran_inf_rim_cont_err_nacc() static void test_bssgp_dec_ran_inf_rim_cont_err_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_rim_cont rim_cont_dec; struct bssgp_ran_inf_rim_cont rim_cont_dec;
@ -364,7 +364,7 @@ static void test_bssgp_dec_ran_inf_rim_cont_err_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_ran_inf_rim_cont_nacc() static void test_bssgp_enc_ran_inf_rim_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_rim_cont rim_cont = { }; struct bssgp_ran_inf_rim_cont rim_cont = { };
@ -415,7 +415,7 @@ static void test_bssgp_enc_ran_inf_rim_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_ran_inf_rim_cont_err_nacc() static void test_bssgp_enc_ran_inf_rim_cont_err_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_rim_cont rim_cont = { }; struct bssgp_ran_inf_rim_cont rim_cont = { };
@ -458,7 +458,7 @@ static void dump_bssgp_ran_inf_ack_rim_cont(struct bssgp_ran_inf_ack_rim_cont *r
} }
} }
static void test_bssgp_dec_ran_inf_ack_rim_cont() static void test_bssgp_dec_ran_inf_ack_rim_cont(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_ack_rim_cont rim_cont_dec; struct bssgp_ran_inf_ack_rim_cont rim_cont_dec;
@ -474,7 +474,7 @@ static void test_bssgp_dec_ran_inf_ack_rim_cont()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_ran_inf_ack_rim_cont() static void test_bssgp_enc_ran_inf_ack_rim_cont(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_ack_rim_cont rim_cont = { }; struct bssgp_ran_inf_ack_rim_cont rim_cont = { };
@ -513,7 +513,7 @@ void dump_bssgp_ran_inf_err_rim_cont(struct bssgp_ran_inf_err_rim_cont *rim_cont
} }
} }
static void test_bssgp_dec_ran_inf_err_rim_cont() static void test_bssgp_dec_ran_inf_err_rim_cont(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_err_rim_cont rim_cont_dec; struct bssgp_ran_inf_err_rim_cont rim_cont_dec;
@ -530,7 +530,7 @@ static void test_bssgp_dec_ran_inf_err_rim_cont()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_ran_inf_err_rim_cont() static void test_bssgp_enc_ran_inf_err_rim_cont(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_err_rim_cont rim_cont = { }; struct bssgp_ran_inf_err_rim_cont rim_cont = { };
@ -578,7 +578,7 @@ void dump_bssgp_ran_inf_app_err_rim_cont(struct bssgp_ran_inf_app_err_rim_cont *
} }
} }
static void test_bssgp_dec_ran_inf_app_err_rim_cont_nacc() static void test_bssgp_dec_ran_inf_app_err_rim_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_app_err_rim_cont rim_cont_dec; struct bssgp_ran_inf_app_err_rim_cont rim_cont_dec;
@ -597,7 +597,7 @@ static void test_bssgp_dec_ran_inf_app_err_rim_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_ran_inf_app_err_rim_cont_nacc() static void test_bssgp_enc_ran_inf_app_err_rim_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_app_err_rim_cont rim_cont = { }; struct bssgp_ran_inf_app_err_rim_cont rim_cont = { };
@ -623,7 +623,7 @@ static void test_bssgp_enc_ran_inf_app_err_rim_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_dec_ran_inf_req_app_cont_nacc() static void test_bssgp_dec_ran_inf_req_app_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_req_app_cont_nacc app_cont_dec; struct bssgp_ran_inf_req_app_cont_nacc app_cont_dec;
@ -639,7 +639,7 @@ static void test_bssgp_dec_ran_inf_req_app_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_ran_inf_req_app_cont_nacc() static void test_bssgp_enc_ran_inf_req_app_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_req_app_cont_nacc app_cont = { }; struct bssgp_ran_inf_req_app_cont_nacc app_cont = { };
@ -662,7 +662,7 @@ static void test_bssgp_enc_ran_inf_req_app_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_dec_ran_inf_app_cont_nacc() static void test_bssgp_dec_ran_inf_app_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_app_cont_nacc app_cont_dec; struct bssgp_ran_inf_app_cont_nacc app_cont_dec;
@ -682,7 +682,7 @@ static void test_bssgp_dec_ran_inf_app_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_ran_inf_app_cont_nacc() static void test_bssgp_enc_ran_inf_app_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_ran_inf_app_cont_nacc app_cont = { }; struct bssgp_ran_inf_app_cont_nacc app_cont = { };
@ -721,7 +721,7 @@ static void test_bssgp_enc_ran_inf_app_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_dec_app_err_cont_nacc() static void test_bssgp_dec_app_err_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_app_err_cont_nacc app_cont_dec; struct bssgp_app_err_cont_nacc app_cont_dec;
@ -737,7 +737,7 @@ static void test_bssgp_dec_app_err_cont_nacc()
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_enc_app_err_cont_nacc() static void test_bssgp_enc_app_err_cont_nacc(void)
{ {
int rc; int rc;
struct bssgp_app_err_cont_nacc app_cont = { }; struct bssgp_app_err_cont_nacc app_cont = { };

View File

@ -173,7 +173,7 @@ static void test_bssgp_status(void)
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_bad_reset() static void test_bssgp_bad_reset(void)
{ {
struct msgb *msg; struct msgb *msg;
uint16_t bvci_be = htons(2); uint16_t bvci_be = htons(2);
@ -256,7 +256,7 @@ static void test_bssgp_flow_control_bvc(void)
printf("----- %s END\n", __func__); printf("----- %s END\n", __func__);
} }
static void test_bssgp_msgb_copy() static void test_bssgp_msgb_copy(void)
{ {
struct msgb *msg, *msg2; struct msgb *msg, *msg2;
uint16_t bvci_be = htons(2); uint16_t bvci_be = htons(2);

View File

@ -420,7 +420,7 @@ static int expire_nsvc_timer(struct gprs_nsvc *nsvc)
return rc; return rc;
} }
static void test_nsvc() static void test_nsvc(void)
{ {
struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
struct sockaddr_in peer[1] = {{0},}; struct sockaddr_in peer[1] = {{0},};
@ -459,7 +459,7 @@ static void test_nsvc()
alarm(0); alarm(0);
} }
static void test_ignored_messages() static void test_ignored_messages(void)
{ {
struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
struct sockaddr_in peer[1] = {{0},}; struct sockaddr_in peer[1] = {{0},};
@ -486,7 +486,7 @@ static void test_ignored_messages()
nsi = NULL; nsi = NULL;
} }
static void test_bss_port_changes() static void test_bss_port_changes(void)
{ {
struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
struct sockaddr_in peer[4] = {{0},}; struct sockaddr_in peer[4] = {{0},};
@ -540,7 +540,7 @@ static void test_bss_port_changes()
nsi = NULL; nsi = NULL;
} }
static void test_bss_reset_ack() static void test_bss_reset_ack(void)
{ {
struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
struct sockaddr_in peer[4] = {{0},}; struct sockaddr_in peer[4] = {{0},};
@ -687,7 +687,7 @@ static void test_bss_reset_ack()
} }
static void test_sgsn_reset() static void test_sgsn_reset(void)
{ {
struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
struct sockaddr_in sgsn_peer= {0}; struct sockaddr_in sgsn_peer= {0};
@ -765,7 +765,7 @@ static void test_sgsn_reset()
nsi = NULL; nsi = NULL;
} }
static void test_sgsn_reset_invalid_state() static void test_sgsn_reset_invalid_state(void)
{ {
struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
struct sockaddr_in sgsn_peer= {0}; struct sockaddr_in sgsn_peer= {0};
@ -833,7 +833,7 @@ static void test_sgsn_reset_invalid_state()
nsi = NULL; nsi = NULL;
} }
static void test_sgsn_output() static void test_sgsn_output(void)
{ {
struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
struct sockaddr_in sgsn_peer= {0}; struct sockaddr_in sgsn_peer= {0};

View File

@ -90,7 +90,7 @@ static const struct bcap_test bcap_tests[] = {
{ speech_no3a_lv, &bcap_speech_no3a, "Speech, without octet 3a" }, { speech_no3a_lv, &bcap_speech_no3a, "Speech, without octet 3a" },
}; };
static int test_bearer_cap() static int test_bearer_cap(void)
{ {
struct gsm_mncc_bearer_cap bc; struct gsm_mncc_bearer_cap bc;
int i, rc; int i, rc;
@ -1154,7 +1154,7 @@ struct mobile_identity_tc mobile_identity_tests[] = {
}, },
}; };
void test_struct_mobile_identity() void test_struct_mobile_identity(void)
{ {
struct mobile_identity_tc *t; struct mobile_identity_tc *t;
printf("%s()\n", __func__); printf("%s()\n", __func__);
@ -1316,7 +1316,7 @@ static const struct bcd_number_test {
}, },
}; };
static void test_bcd_number_encode_decode() static void test_bcd_number_encode_decode(void)
{ {
const struct bcd_number_test *test; const struct bcd_number_test *test;
uint8_t buf_enc[0xff] = { 0xff }; uint8_t buf_enc[0xff] = { 0xff };
@ -1550,7 +1550,7 @@ static void test_random_range_encoding(int range, int max_arfcn_num)
} }
} }
static void test_range_encoding() static void test_range_encoding(void)
{ {
int *arfcns; int *arfcns;
int arfcns_num = 0; int arfcns_num = 0;
@ -1611,7 +1611,7 @@ static int range512[] = {
__FILE__, __LINE__, (int) res, # cmp, (int) wanted); \ __FILE__, __LINE__, (int) res, # cmp, (int) wanted); \
} }
static void test_arfcn_filter() static void test_arfcn_filter(void)
{ {
int arfcns[50], i, res, f0_included; int arfcns[50], i, res, f0_included;
for (i = 0; i < ARRAY_SIZE(arfcns); ++i) for (i = 0; i < ARRAY_SIZE(arfcns); ++i)
@ -1644,7 +1644,7 @@ static void test_arfcn_filter()
VERIFY(arfcns[i], ==, ((i + 1) * 2) - 1); VERIFY(arfcns[i], ==, ((i + 1) * 2) - 1);
} }
static void test_print_encoding() static void test_print_encoding(void)
{ {
int rc; int rc;
int w[17]; int w[17];
@ -1669,7 +1669,7 @@ static void test_print_encoding()
printf("Range512: %s\n", osmo_hexdump(chan_list, ARRAY_SIZE(chan_list))); printf("Range512: %s\n", osmo_hexdump(chan_list, ARRAY_SIZE(chan_list)));
} }
static void test_si_range_helpers() static void test_si_range_helpers(void)
{ {
int ws[(sizeof(freqs1)/sizeof(freqs1[0]))]; int ws[(sizeof(freqs1)/sizeof(freqs1[0]))];
int i, f0 = 0xFFFFFF; int i, f0 = 0xFFFFFF;
@ -1708,7 +1708,7 @@ static void test_si_range_helpers()
VERIFY(f0, ==, 1); VERIFY(f0, ==, 1);
} }
static void test_power_ctrl() static void test_power_ctrl(void)
{ {
int8_t rc8; int8_t rc8;
int rc; int rc;
@ -1750,7 +1750,7 @@ static void test_power_ctrl()
VERIFY(rc, <, 0); VERIFY(rc, <, 0);
} }
static void test_rach_tx_integer_raw2val() static void test_rach_tx_integer_raw2val(void)
{ {
unsigned int raw; unsigned int raw;
for (raw = 0; raw <= 0x0f; raw++) { for (raw = 0; raw <= 0x0f; raw++) {

View File

@ -86,7 +86,7 @@ uint32_t facch_h1_fn_samples[] = { 500728, 500771, 500797, 500841, 500875, 50091
502782, 502825, 502869, 502903, 502955, 502999 502782, 502825, 502869, 502903, 502955, 502999
}; };
static void test_gsm0502_fn_remap() static void test_gsm0502_fn_remap(void)
{ {
unsigned int i; unsigned int i;
uint32_t fn_begin; uint32_t fn_begin;

View File

@ -111,7 +111,7 @@ static void test_create_layer3(void)
msgb_free(in_msg); msgb_free(in_msg);
} }
static void test_create_layer3_aoip() static void test_create_layer3_aoip(void)
{ {
static const uint8_t res[] = { static const uint8_t res[] = {
0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62, 0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62,
@ -148,7 +148,7 @@ static void test_create_layer3_aoip()
msgb_free(in_msg); msgb_free(in_msg);
} }
static void test_create_reset() static void test_create_reset(void)
{ {
static const uint8_t res[] = { 0x00, 0x04, 0x30, 0x04, 0x01, 0x20 }; static const uint8_t res[] = { 0x00, 0x04, 0x30, 0x04, 0x01, 0x20 };
struct msgb *msg; struct msgb *msg;
@ -159,7 +159,7 @@ static void test_create_reset()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_reset_ack() static void test_create_reset_ack(void)
{ {
static const uint8_t res[] = { 0x00, 0x01, 0x31 }; static const uint8_t res[] = { 0x00, 0x01, 0x31 };
struct msgb *msg; struct msgb *msg;
@ -171,7 +171,7 @@ static void test_create_reset_ack()
} }
static void test_create_clear_command() static void test_create_clear_command(void)
{ {
static const uint8_t res[] = { 0x20, 0x04, 0x01, 0x23 }; static const uint8_t res[] = { 0x20, 0x04, 0x01, 0x23 };
struct msgb *msg; struct msgb *msg;
@ -182,7 +182,7 @@ static void test_create_clear_command()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_clear_command2() static void test_create_clear_command2(void)
{ {
static const uint8_t res[] = { 0x00, 0x04, 0x20, 0x04, 0x01, 0x23 }; static const uint8_t res[] = { 0x00, 0x04, 0x20, 0x04, 0x01, 0x23 };
struct msgb *msg; struct msgb *msg;
@ -193,7 +193,7 @@ static void test_create_clear_command2()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_clear_command2_csfb() static void test_create_clear_command2_csfb(void)
{ {
static const uint8_t res[] = { 0x00, 0x05, 0x20, 0x04, 0x01, 0x23, 0x8F }; static const uint8_t res[] = { 0x00, 0x05, 0x20, 0x04, 0x01, 0x23, 0x8F };
struct msgb *msg; struct msgb *msg;
@ -204,7 +204,7 @@ static void test_create_clear_command2_csfb()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_clear_complete() static void test_create_clear_complete(void)
{ {
static const uint8_t res[] = { 0x00, 0x01, 0x21 }; static const uint8_t res[] = { 0x00, 0x01, 0x21 };
struct msgb *msg; struct msgb *msg;
@ -215,7 +215,7 @@ static void test_create_clear_complete()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_cipher() static void test_create_cipher(void)
{ {
static const uint8_t res[] = static const uint8_t res[] =
{ 0x00, 0x0c, 0x53, 0x0a, 0x09, 0x03, 0xaa, { 0x00, 0x0c, 0x53, 0x0a, 0x09, 0x03, 0xaa,
@ -255,7 +255,7 @@ static void test_create_cipher()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_cipher_complete() static void test_create_cipher_complete(void)
{ {
static const uint8_t res1[] = { static const uint8_t res1[] = {
0x00, 0x08, 0x55, 0x20, 0x03, 0x23, 0x42, 0x21, 0x2c, 0x04 }; 0x00, 0x08, 0x55, 0x20, 0x03, 0x23, 0x42, 0x21, 0x2c, 0x04 };
@ -312,7 +312,7 @@ static inline void parse_cipher_reject(struct msgb *msg, uint8_t exp)
rc, exp, OSMO_BIT_PRINT(exp), msgb_hexdump(msg)); rc, exp, OSMO_BIT_PRINT(exp), msgb_hexdump(msg));
} }
static void test_create_cipher_reject() static void test_create_cipher_reject(void)
{ {
static const uint8_t res[] = { 0x00, 0x04, 0x59, 0x04, 0x01, 0x23 }; static const uint8_t res[] = { 0x00, 0x04, 0x59, 0x04, 0x01, 0x23 };
enum gsm0808_cause cause = GSM0808_CAUSE_CCCH_OVERLOAD; enum gsm0808_cause cause = GSM0808_CAUSE_CCCH_OVERLOAD;
@ -327,7 +327,7 @@ static void test_create_cipher_reject()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_cipher_reject_ext() static void test_create_cipher_reject_ext(void)
{ {
static const uint8_t res[] = { 0x00, 0x05, 0x59, 0x04, 0x02, 0xd0, 0xFA }; static const uint8_t res[] = { 0x00, 0x05, 0x59, 0x04, 0x02, 0xd0, 0xFA };
uint8_t cause = 0xFA; uint8_t cause = 0xFA;
@ -342,7 +342,7 @@ static void test_create_cipher_reject_ext()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_cm_u() static void test_create_cm_u(void)
{ {
static const uint8_t res[] = { static const uint8_t res[] = {
0x00, 0x07, 0x54, 0x12, 0x01, 0x23, 0x13, 0x01, 0x42 }; 0x00, 0x07, 0x54, 0x12, 0x01, 0x23, 0x13, 0x01, 0x42 };
@ -364,7 +364,7 @@ static void test_create_cm_u()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_sapi_reject() static void test_create_sapi_reject(void)
{ {
static const uint8_t res[] = { 0x00, 0x06, 0x25, 0x18, 0x03, 0x04, 0x01, 0x25 }; static const uint8_t res[] = { 0x00, 0x06, 0x25, 0x18, 0x03, 0x04, 0x01, 0x25 };
struct msgb *msg; struct msgb *msg;
@ -375,7 +375,7 @@ static void test_create_sapi_reject()
msgb_free(msg); msgb_free(msg);
} }
static void test_dec_confusion() static void test_dec_confusion(void)
{ {
static const uint8_t hex[] = static const uint8_t hex[] =
{ 0x26, 0x04, 0x01, 0x52, 0x1f, 0x07, 0x00, 0xff, 0x00, 0x03, 0x25, 0x03, 0x25 }; { 0x26, 0x04, 0x01, 0x52, 0x1f, 0x07, 0x00, 0xff, 0x00, 0x03, 0x25, 0x03, 0x25 };
@ -425,7 +425,7 @@ static void test_dec_confusion()
} }
/* Test Perform Location Report SYS#5891 */ /* Test Perform Location Report SYS#5891 */
static void test_dec_perform_location_report_sys5891() static void test_dec_perform_location_report_sys5891(void)
{ {
/* Message Type Perform Location Request /* Message Type Perform Location Request
Location Type Location Type
@ -477,7 +477,7 @@ static void test_dec_perform_location_report_sys5891()
OSMO_ASSERT(rc == 5); OSMO_ASSERT(rc == 5);
} }
static void test_create_ass() static void test_create_ass(void)
{ {
static const uint8_t res1[] = static const uint8_t res1[] =
{ 0x00, 0x0a, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00, { 0x00, 0x0a, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00,
@ -527,7 +527,7 @@ static void test_create_ass()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_ass2() static void test_create_ass2(void)
{ {
static const uint8_t res[] = { static const uint8_t res[] = {
BSSAP_MSG_BSS_MANAGEMENT, BSSAP_MSG_BSS_MANAGEMENT,
@ -604,7 +604,7 @@ static void test_create_ass2()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_ass_compl() static void test_create_ass_compl(void)
{ {
static const uint8_t res1[] = { static const uint8_t res1[] = {
0x00, 0x09, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x00, 0x09, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c,
@ -623,7 +623,7 @@ static void test_create_ass_compl()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_ass_compl_aoip() static void test_create_ass_compl_aoip(void)
{ {
struct sockaddr_storage ss; struct sockaddr_storage ss;
struct sockaddr_in sin; struct sockaddr_in sin;
@ -660,7 +660,7 @@ static void test_create_ass_compl_aoip()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_ass_fail() static void test_create_ass_fail(void)
{ {
static const uint8_t res1[] = { 0x00, 0x04, 0x03, 0x04, 0x01, 0x23 }; static const uint8_t res1[] = { 0x00, 0x04, 0x03, 0x04, 0x01, 0x23 };
static const uint8_t res2[] = { static const uint8_t res2[] = {
@ -678,7 +678,7 @@ static void test_create_ass_fail()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_ass_fail_aoip() static void test_create_ass_fail_aoip(void)
{ {
static const uint8_t res1[] = static const uint8_t res1[] =
{ 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST, { 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST,
@ -704,7 +704,7 @@ static void test_create_ass_fail_aoip()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_clear_rqst() static void test_create_clear_rqst(void)
{ {
static const uint8_t res[] = { 0x00, 0x04, 0x22, 0x04, 0x01, 0x23 }; static const uint8_t res[] = { 0x00, 0x04, 0x22, 0x04, 0x01, 0x23 };
struct msgb *msg; struct msgb *msg;
@ -715,7 +715,7 @@ static void test_create_clear_rqst()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_paging() static void test_create_paging(void)
{ {
static const uint8_t res[] = static const uint8_t res[] =
{ 0x00, 0x10, 0x52, 0x08, 0x08, 0x09, 0x10, 0x10, 0x00, 0x00, 0x00, { 0x00, 0x10, 0x52, 0x08, 0x08, 0x09, 0x10, 0x10, 0x00, 0x00, 0x00,
@ -755,7 +755,7 @@ static void test_create_paging()
msgb_free(msg); msgb_free(msg);
} }
static void test_create_dtap() static void test_create_dtap(void)
{ {
static const uint8_t res[] = { 0x01, 0x03, 0x02, 0x23, 0x42 }; static const uint8_t res[] = { 0x01, 0x03, 0x02, 0x23, 0x42 };
struct msgb *msg, *l3; struct msgb *msg, *l3;
@ -772,7 +772,7 @@ static void test_create_dtap()
msgb_free(l3); msgb_free(l3);
} }
static void test_prepend_dtap() static void test_prepend_dtap(void)
{ {
static const uint8_t res[] = { 0x01, 0x03, 0x02, 0x23, 0x42 }; static const uint8_t res[] = { 0x01, 0x03, 0x02, 0x23, 0x42 };
struct msgb *in_msg; struct msgb *in_msg;
@ -789,7 +789,7 @@ static void test_prepend_dtap()
msgb_free(in_msg); msgb_free(in_msg);
} }
static void test_enc_dec_lcls() static void test_enc_dec_lcls(void)
{ {
static const uint8_t res[] = { static const uint8_t res[] = {
GSM0808_IE_GLOBAL_CALL_REF, GSM0808_IE_GLOBAL_CALL_REF,
@ -867,7 +867,7 @@ static void test_enc_dec_lcls()
msgb_free(msg); msgb_free(msg);
} }
static void test_enc_dec_aoip_trasp_addr_v4() static void test_enc_dec_aoip_trasp_addr_v4(void)
{ {
struct sockaddr_storage enc_addr; struct sockaddr_storage enc_addr;
struct sockaddr_storage dec_addr; struct sockaddr_storage dec_addr;
@ -895,7 +895,7 @@ static void test_enc_dec_aoip_trasp_addr_v4()
msgb_free(msg); msgb_free(msg);
} }
static void test_enc_dec_aoip_trasp_addr_v6() static void test_enc_dec_aoip_trasp_addr_v6(void)
{ {
struct sockaddr_storage enc_addr; struct sockaddr_storage enc_addr;
struct sockaddr_storage dec_addr; struct sockaddr_storage dec_addr;
@ -924,7 +924,7 @@ static void test_enc_dec_aoip_trasp_addr_v6()
msgb_free(msg); msgb_free(msg);
} }
static void test_enc_aoip_trasp_addr_msg_too_small() static void test_enc_aoip_trasp_addr_msg_too_small(void)
{ {
struct msgb *msg; struct msgb *msg;
struct sockaddr_storage enc_addr; struct sockaddr_storage enc_addr;
@ -946,7 +946,7 @@ static void test_enc_aoip_trasp_addr_msg_too_small()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_speech_codec() static void test_gsm0808_enc_dec_speech_codec(void)
{ {
struct gsm0808_speech_codec enc_sc = { struct gsm0808_speech_codec enc_sc = {
.pi = true, .pi = true,
@ -971,7 +971,7 @@ static void test_gsm0808_enc_dec_speech_codec()
} }
static void test_gsm0808_enc_dec_speech_codec_with_cfg() static void test_gsm0808_enc_dec_speech_codec_with_cfg(void)
{ {
struct gsm0808_speech_codec enc_sc = { struct gsm0808_speech_codec enc_sc = {
.pi = true, .pi = true,
@ -996,7 +996,7 @@ static void test_gsm0808_enc_dec_speech_codec_with_cfg()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg() static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg(void)
{ {
struct gsm0808_speech_codec enc_sc = { struct gsm0808_speech_codec enc_sc = {
.pi = true, .pi = true,
@ -1021,7 +1021,7 @@ static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_speech_codec_list() static void test_gsm0808_enc_dec_speech_codec_list(void)
{ {
struct gsm0808_speech_codec_list enc_scl = { struct gsm0808_speech_codec_list enc_scl = {
.codec = { .codec = {
@ -1064,7 +1064,7 @@ static void test_gsm0808_enc_dec_speech_codec_list()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_empty_speech_codec_list() static void test_gsm0808_enc_dec_empty_speech_codec_list(void)
{ {
struct gsm0808_speech_codec_list enc_scl = { struct gsm0808_speech_codec_list enc_scl = {
.len = 0, .len = 0,
@ -1086,7 +1086,7 @@ static void test_gsm0808_enc_dec_empty_speech_codec_list()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_channel_type() static void test_gsm0808_enc_dec_channel_type(void)
{ {
struct gsm0808_channel_type enc_ct = { struct gsm0808_channel_type enc_ct = {
.ch_indctr = GSM0808_CHAN_SPEECH, .ch_indctr = GSM0808_CHAN_SPEECH,
@ -1117,7 +1117,7 @@ static void test_gsm0808_enc_dec_channel_type()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_encrypt_info() static void test_gsm0808_enc_dec_encrypt_info(void)
{ {
struct gsm0808_encrypt_info enc_ei = { struct gsm0808_encrypt_info enc_ei = {
.perm_algo = { GSM0808_ALG_ID_A5_0, GSM0808_ALG_ID_A5_1 }, .perm_algo = { GSM0808_ALG_ID_A5_0, GSM0808_ALG_ID_A5_1 },
@ -1147,7 +1147,7 @@ static void test_gsm0808_enc_dec_encrypt_info()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_dec_cell_id_list_srvcc() static void test_gsm0808_dec_cell_id_list_srvcc(void)
{ {
/* taken from a pcap file of a real-world 3rd party MSC (SYS#5838) */ /* taken from a pcap file of a real-world 3rd party MSC (SYS#5838) */
const uint8_t enc_cil[] = { 0x0b, 0x2, 0xf2, 0x10, 0x4e, 0x20, 0x15, 0xbe}; const uint8_t enc_cil[] = { 0x0b, 0x2, 0xf2, 0x10, 0x4e, 0x20, 0x15, 0xbe};
@ -1160,7 +1160,7 @@ static void test_gsm0808_dec_cell_id_list_srvcc()
OSMO_ASSERT(dec_cil.id_list_len = 1); OSMO_ASSERT(dec_cil.id_list_len = 1);
} }
static void test_gsm0808_enc_dec_cell_id_list_lac() static void test_gsm0808_enc_dec_cell_id_list_lac(void)
{ {
struct gsm0808_cell_id_list2 enc_cil; struct gsm0808_cell_id_list2 enc_cil;
struct gsm0808_cell_id_list2 dec_cil; struct gsm0808_cell_id_list2 dec_cil;
@ -1187,7 +1187,7 @@ static void test_gsm0808_enc_dec_cell_id_list_lac()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_list_single_lac() static void test_gsm0808_enc_dec_cell_id_list_single_lac(void)
{ {
struct gsm0808_cell_id_list2 enc_cil; struct gsm0808_cell_id_list2 enc_cil;
struct gsm0808_cell_id_list2 dec_cil; struct gsm0808_cell_id_list2 dec_cil;
@ -1216,7 +1216,7 @@ static void test_gsm0808_enc_dec_cell_id_list_single_lac()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_list_multi_lac() static void test_gsm0808_enc_dec_cell_id_list_multi_lac(void)
{ {
struct gsm0808_cell_id_list2 enc_cil; struct gsm0808_cell_id_list2 enc_cil;
struct gsm0808_cell_id_list2 dec_cil; struct gsm0808_cell_id_list2 dec_cil;
@ -1252,7 +1252,7 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_lac()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_list_bss() static void test_gsm0808_enc_dec_cell_id_list_bss(void)
{ {
struct gsm0808_cell_id_list2 enc_cil; struct gsm0808_cell_id_list2 enc_cil;
struct gsm0808_cell_id_list2 dec_cil; struct gsm0808_cell_id_list2 dec_cil;
@ -1275,7 +1275,7 @@ static void test_gsm0808_enc_dec_cell_id_list_bss()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_list_multi_lai_and_lac() static void test_gsm0808_enc_dec_cell_id_list_multi_lai_and_lac(void)
{ {
struct gsm0808_cell_id_list2 enc_cil; struct gsm0808_cell_id_list2 enc_cil;
struct gsm0808_cell_id_list2 dec_cil; struct gsm0808_cell_id_list2 dec_cil;
@ -1331,7 +1331,7 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_lai_and_lac()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_list_multi_ci() static void test_gsm0808_enc_dec_cell_id_list_multi_ci(void)
{ {
struct gsm0808_cell_id_list2 enc_cil; struct gsm0808_cell_id_list2 enc_cil;
struct gsm0808_cell_id_list2 dec_cil; struct gsm0808_cell_id_list2 dec_cil;
@ -1365,7 +1365,7 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_ci()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_list_multi_lac_and_ci() static void test_gsm0808_enc_dec_cell_id_list_multi_lac_and_ci(void)
{ {
struct gsm0808_cell_id_list2 enc_cil; struct gsm0808_cell_id_list2 enc_cil;
struct gsm0808_cell_id_list2 dec_cil; struct gsm0808_cell_id_list2 dec_cil;
@ -1406,7 +1406,7 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_lac_and_ci()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_list_multi_global() static void test_gsm0808_enc_dec_cell_id_list_multi_global(void)
{ {
struct gsm0808_cell_id_list2 enc_cil; struct gsm0808_cell_id_list2 enc_cil;
struct gsm0808_cell_id_list2 dec_cil; struct gsm0808_cell_id_list2 dec_cil;
@ -1479,7 +1479,7 @@ static void print_cil(const struct gsm0808_cell_id_list2 *cil)
printf(" cell_id_list == %s\n", gsm0808_cell_id_list_name(cil)); printf(" cell_id_list == %s\n", gsm0808_cell_id_list_name(cil));
} }
void test_cell_id_list_add() { void test_cell_id_list_add(void) {
size_t zu; size_t zu;
const struct gsm0808_cell_id_list2 cgi1 = { const struct gsm0808_cell_id_list2 cgi1 = {
@ -1661,7 +1661,7 @@ void test_cell_id_list_add() {
printf("------- %s done\n", __func__); printf("------- %s done\n", __func__);
} }
static void test_gsm0808_enc_dec_cell_id_lac() static void test_gsm0808_enc_dec_cell_id_lac(void)
{ {
struct gsm0808_cell_id enc_ci = { struct gsm0808_cell_id enc_ci = {
.id_discr = CELL_IDENT_LAC, .id_discr = CELL_IDENT_LAC,
@ -1687,7 +1687,7 @@ static void test_gsm0808_enc_dec_cell_id_lac()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_bss() static void test_gsm0808_enc_dec_cell_id_bss(void)
{ {
struct gsm0808_cell_id enc_ci = { struct gsm0808_cell_id enc_ci = {
.id_discr = CELL_IDENT_BSS, .id_discr = CELL_IDENT_BSS,
@ -1709,7 +1709,7 @@ static void test_gsm0808_enc_dec_cell_id_bss()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_no_cell() static void test_gsm0808_enc_dec_cell_id_no_cell(void)
{ {
struct gsm0808_cell_id enc_ci = { struct gsm0808_cell_id enc_ci = {
.id_discr = CELL_IDENT_NO_CELL, .id_discr = CELL_IDENT_NO_CELL,
@ -1731,7 +1731,7 @@ static void test_gsm0808_enc_dec_cell_id_no_cell()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_lai_and_lac() static void test_gsm0808_enc_dec_cell_id_lai_and_lac(void)
{ {
struct gsm0808_cell_id enc_ci = { struct gsm0808_cell_id enc_ci = {
.id_discr = CELL_IDENT_LAI_AND_LAC, .id_discr = CELL_IDENT_LAI_AND_LAC,
@ -1762,7 +1762,7 @@ static void test_gsm0808_enc_dec_cell_id_lai_and_lac()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_ci() static void test_gsm0808_enc_dec_cell_id_ci(void)
{ {
struct gsm0808_cell_id enc_ci = { struct gsm0808_cell_id enc_ci = {
.id_discr = CELL_IDENT_CI, .id_discr = CELL_IDENT_CI,
@ -1785,7 +1785,7 @@ static void test_gsm0808_enc_dec_cell_id_ci()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_lac_and_ci() static void test_gsm0808_enc_dec_cell_id_lac_and_ci(void)
{ {
struct gsm0808_cell_id enc_ci = { struct gsm0808_cell_id enc_ci = {
.id_discr = CELL_IDENT_LAC_AND_CI, .id_discr = CELL_IDENT_LAC_AND_CI,
@ -1812,7 +1812,7 @@ static void test_gsm0808_enc_dec_cell_id_lac_and_ci()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_global() static void test_gsm0808_enc_dec_cell_id_global(void)
{ {
struct gsm0808_cell_id enc_ci = { struct gsm0808_cell_id enc_ci = {
.id_discr = CELL_IDENT_WHOLE_GLOBAL, .id_discr = CELL_IDENT_WHOLE_GLOBAL,
@ -1844,7 +1844,7 @@ static void test_gsm0808_enc_dec_cell_id_global()
msgb_free(msg); msgb_free(msg);
} }
static void test_gsm0808_enc_dec_cell_id_global_ps() static void test_gsm0808_enc_dec_cell_id_global_ps(void)
{ {
struct gsm0808_cell_id enc_cgi = { struct gsm0808_cell_id enc_cgi = {
.id_discr = CELL_IDENT_WHOLE_GLOBAL, .id_discr = CELL_IDENT_WHOLE_GLOBAL,
@ -2130,7 +2130,7 @@ static void test_gsm48_mr_cfg_from_gsm0808_sc_cfg_single(uint16_t s15_s0)
printf("\n"); printf("\n");
} }
void test_gsm48_mr_cfg_from_gsm0808_sc_cfg() void test_gsm48_mr_cfg_from_gsm0808_sc_cfg(void)
{ {
printf("Testing gsm48_mr_cfg_from_gsm0808_sc_cfg():\n"); printf("Testing gsm48_mr_cfg_from_gsm0808_sc_cfg():\n");
@ -2315,7 +2315,7 @@ static const struct test_cell_id_matching_data test_cell_id_matching_tests[] = {
{ .id = cgi_23_042_23_5, .match_id = cgi_23_99_23_5, .expect_match = false, .expect_exact_match = false }, { .id = cgi_23_042_23_5, .match_id = cgi_23_99_23_5, .expect_match = false, .expect_exact_match = false },
}; };
static void test_cell_id_matching() static void test_cell_id_matching(void)
{ {
int i; int i;
bool ok = true; bool ok = true;
@ -2478,7 +2478,7 @@ static const struct gsm0808_cell_id test_gsm0808_cell_id_to_from_cgi_data[] = {
{ .id_discr = 423 }, { .id_discr = 423 },
}; };
static void test_gsm0808_cell_id_to_from_cgi() static void test_gsm0808_cell_id_to_from_cgi(void)
{ {
int i; int i;
int j; int j;

View File

@ -54,7 +54,7 @@ static struct {
{ NULL, false }, { NULL, false },
}; };
bool test_valid_imsi() bool test_valid_imsi(void)
{ {
int i; int i;
bool pass = true; bool pass = true;
@ -97,7 +97,7 @@ static struct {
{ NULL, false }, { NULL, false },
}; };
bool test_valid_msisdn() bool test_valid_msisdn(void)
{ {
int i; int i;
bool pass = true; bool pass = true;
@ -138,7 +138,7 @@ static struct {
{ NULL, false, false }, { NULL, false, false },
}; };
bool test_valid_imei() bool test_valid_imei(void)
{ {
int i; int i;
bool pass = true; bool pass = true;
@ -185,7 +185,7 @@ static struct test_mnc_from_str test_mnc_from_strs[] = {
{ "023 ", { -EINVAL, 0, false } }, { "023 ", { -EINVAL, 0, false } },
}; };
static bool test_mnc_from_str() static bool test_mnc_from_str(void)
{ {
int i; int i;
bool pass = true; bool pass = true;
@ -209,7 +209,7 @@ static bool test_mnc_from_str()
return pass; return pass;
} }
static bool test_gummei_name() static bool test_gummei_name(void)
{ {
static const struct osmo_gummei gummei = { static const struct osmo_gummei gummei = {
.plmn = { .mcc = 901, .mnc = 70 }, .plmn = { .mcc = 901, .mnc = 70 },
@ -226,7 +226,7 @@ static bool test_gummei_name()
return pass; return pass;
} }
static bool test_domain_gen() static bool test_domain_gen(void)
{ {
static const struct osmo_gummei gummei = { static const struct osmo_gummei gummei = {
.plmn = { .mcc = 901, .mnc = 70 }, .plmn = { .mcc = 901, .mnc = 70 },
@ -252,7 +252,7 @@ static bool test_domain_gen()
} }
static bool test_domain_parse() static bool test_domain_parse(void)
{ {
static const char *mme_dom_valid = "mmec01.mmegiA001.mme.epc.mnc070.mcc901.3gppnetwork.org"; static const char *mme_dom_valid = "mmec01.mmegiA001.mme.epc.mnc070.mcc901.3gppnetwork.org";
static const char *home_dom_valid = "epc.mnc070.mcc901.3gppnetwork.org"; static const char *home_dom_valid = "epc.mnc070.mcc901.3gppnetwork.org";

View File

@ -138,7 +138,7 @@ struct nri_v_get_set_test nri_v_get_set_tests[] = {
}, },
}; };
void test_nri_v_get_set() void test_nri_v_get_set(void)
{ {
struct nri_v_get_set_test *t; struct nri_v_get_set_test *t;
@ -222,7 +222,7 @@ struct nri_validate_tc nri_validate_tests[] = {
{ .nri = INT16_MAX, .nri_bitlen = 0, .expect_rc = 1 }, { .nri = INT16_MAX, .nri_bitlen = 0, .expect_rc = 1 },
}; };
void test_nri_validate() void test_nri_validate(void)
{ {
struct nri_validate_tc *t; struct nri_validate_tc *t;
printf("\n%s()\n", __func__); printf("\n%s()\n", __func__);
@ -327,7 +327,7 @@ struct nri_range_validate_tc nri_range_validate_tests[] = {
}; };
void test_nri_range_validate() void test_nri_range_validate(void)
{ {
struct nri_range_validate_tc *t; struct nri_range_validate_tc *t;
printf("\n%s()\n", __func__); printf("\n%s()\n", __func__);
@ -357,7 +357,7 @@ void dump_list(const struct osmo_nri_ranges *nri_ranges)
printf("};\n"); printf("};\n");
} }
void test_nri_list() void test_nri_list(void)
{ {
struct osmo_nri_ranges *nri_ranges = osmo_nri_ranges_alloc(ctx); struct osmo_nri_ranges *nri_ranges = osmo_nri_ranges_alloc(ctx);
printf("\n%s()\n", __func__); printf("\n%s()\n", __func__);
@ -545,7 +545,7 @@ void test_nri_list()
DEL(100, 1); DEL(100, 1);
} }
void test_nri_limit_by_ranges() void test_nri_limit_by_ranges(void)
{ {
const uint8_t nri_bitlen = 8; const uint8_t nri_bitlen = 8;
const int16_t expect_nri_vals[] = { 10, 20, 21, 30, 31, 32 }; const int16_t expect_nri_vals[] = { 10, 20, 21, 30, 31, 32 };
@ -594,7 +594,7 @@ void test_nri_limit_by_ranges()
} }
} }
int main() int main(int argc, char **argv)
{ {
ctx = talloc_named_const(NULL, 0, "nri_test"); ctx = talloc_named_const(NULL, 0, "nri_test");

View File

@ -28,7 +28,7 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
static void test_gcr() static void test_gcr(void)
{ {
static const uint8_t res[] = { static const uint8_t res[] = {
0x03, /* .net_len */ 0x03, /* .net_len */

View File

@ -77,7 +77,7 @@ static const struct si13_test test_si13_arr[] = {
}, },
}; };
static void test_si13() static void test_si13(void)
{ {
int i, rc; int i, rc;
uint8_t data[GSM_MACBLOCK_LEN]; uint8_t data[GSM_MACBLOCK_LEN];

View File

@ -376,7 +376,7 @@ static int ms_to_bts_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *_ctx
return 0; return 0;
} }
static void test_lapdm_polling() static void test_lapdm_polling(void)
{ {
printf("I do some very simple LAPDm test.\n"); printf("I do some very simple LAPDm test.\n");
@ -470,7 +470,7 @@ static void test_lapdm_polling()
lapdm_channel_exit(&ms_to_bts_channel); lapdm_channel_exit(&ms_to_bts_channel);
} }
static void test_lapdm_contention_resolution() static void test_lapdm_contention_resolution(void)
{ {
printf("I test contention resultion by having two mobiles collide and " printf("I test contention resultion by having two mobiles collide and "
"first mobile repeating SABM.\n"); "first mobile repeating SABM.\n");
@ -523,7 +523,7 @@ static void test_lapdm_contention_resolution()
lapdm_channel_exit(&bts_to_ms_channel); lapdm_channel_exit(&bts_to_ms_channel);
} }
static void test_lapdm_early_release() static void test_lapdm_early_release(void)
{ {
printf("I test RF channel release of an unestablished channel.\n"); printf("I test RF channel release of an unestablished channel.\n");
@ -603,7 +603,7 @@ static void lapdm_establish(const uint8_t *est_req, size_t est_req_size)
msgb_free(msg); msgb_free(msg);
} }
static void test_lapdm_establishment() static void test_lapdm_establishment(void)
{ {
printf("I test RF channel establishment.\n"); printf("I test RF channel establishment.\n");
printf("Testing SAPI3/SDCCH\n"); printf("Testing SAPI3/SDCCH\n");
@ -677,7 +677,7 @@ static void dump_queue(struct llist_head *head)
printf("\n"); printf("\n");
} }
static void test_lapdm_desync() static void test_lapdm_desync(void)
{ {
printf("I test if desync problems exist in LAPDm\n"); printf("I test if desync problems exist in LAPDm\n");

View File

@ -78,7 +78,7 @@ DEFUN(log_sweep, log_sweep_cmd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void vty_commands_init() static void vty_commands_init(void)
{ {
install_element_ve(&log_sweep_cmd); install_element_ve(&log_sweep_cmd);
} }
@ -121,7 +121,7 @@ const struct log_info log_info = {
.num_cat = ARRAY_SIZE(default_categories), .num_cat = ARRAY_SIZE(default_categories),
}; };
static void print_help() static void print_help(void)
{ {
printf( "options:\n" printf( "options:\n"
" -h --help this text\n" " -h --help this text\n"

View File

@ -61,7 +61,7 @@ static int osmo_panic_try(volatile int *exception, int setjmp_result)
return *exception == 0; return *exception == 0;
} }
static void test_msgb_api() static void test_msgb_api(void)
{ {
struct msgb *msg = msgb_alloc_headroom(4096, 128, "data"); struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
unsigned char *cptr = NULL; unsigned char *cptr = NULL;
@ -117,7 +117,7 @@ static void test_msgb_api()
msgb_free(msg); msgb_free(msg);
} }
static void test_msgb_api_errors() static void test_msgb_api_errors(void)
{ {
struct msgb *msg = msgb_alloc_headroom(4096, 128, "data"); struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
volatile int e = 0; volatile int e = 0;
@ -138,7 +138,7 @@ static void test_msgb_api_errors()
osmo_set_panic_handler(NULL); osmo_set_panic_handler(NULL);
} }
static void test_msgb_copy() static void test_msgb_copy(void)
{ {
struct msgb *msg = msgb_alloc_headroom(4096, 128, "data"); struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
struct msgb *msg2; struct msgb *msg2;
@ -185,7 +185,7 @@ static void test_msgb_copy()
msgb_free(msg2); msgb_free(msg2);
} }
static void test_msgb_resize_area() static void test_msgb_resize_area(void)
{ {
struct msgb *msg = msgb_alloc_headroom(4096, 128, "data"); struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
int rc; int rc;
@ -285,7 +285,7 @@ static void test_msgb_resize_area()
osmo_set_panic_handler(NULL); osmo_set_panic_handler(NULL);
} }
static void test_msgb_printf() static void test_msgb_printf(void)
{ {
struct msgb *msg; struct msgb *msg;
struct msgb *msg_ref; struct msgb *msg_ref;

View File

@ -215,7 +215,7 @@ static const struct test_case test_decode[] =
}, },
}; };
static void test_octet_return() static void test_octet_return(void)
{ {
char out[256]; char out[256];
int oct, septets; int oct, septets;

View File

@ -81,7 +81,7 @@ static struct msgb *msgb_from_hex(unsigned int size, const char *hex)
return msg; return msg;
} }
static void test_decode() static void test_decode(void)
{ {
struct msgb *msg; struct msgb *msg;
struct osmo_cbsp_decoded *cbsp_dec; struct osmo_cbsp_decoded *cbsp_dec;

View File

@ -90,7 +90,7 @@ void dump_oip(const struct osmo_sockaddr_str *oip)
printf("{ .af = %s, .ip = %s, .port = %u }\n", af_name(oip->af), osmo_quote_str(oip->ip, -1), oip->port); printf("{ .af = %s, .ip = %s, .port = %u }\n", af_name(oip->af), osmo_quote_str(oip->ip, -1), oip->port);
} }
void sockaddr_str_test_conversions() void sockaddr_str_test_conversions(void)
{ {
int i; int i;
char buf[1024]; char buf[1024];
@ -235,7 +235,7 @@ void sockaddr_str_test_conversions()
} }
static void test_osmo_sockaddr_str_cmp() static void test_osmo_sockaddr_str_cmp(void)
{ {
int i; int i;
printf("\n\n%s\n", __func__); printf("\n\n%s\n", __func__);

View File

@ -150,7 +150,7 @@ static int test_sockinit2(void)
return 0; return 0;
} }
static int test_get_ip_and_port() static int test_get_ip_and_port(void)
{ {
int fd, rc; int fd, rc;
char ip[INET6_ADDRSTRLEN] = { }; char ip[INET6_ADDRSTRLEN] = { };

View File

@ -340,7 +340,7 @@ static void _do_report(int expect_counter_vals, int expect_stat_item_vals, int l
#define do_report(A, B) _do_report(A, B, __LINE__) #define do_report(A, B) _do_report(A, B, __LINE__)
static void test_reporting() static void test_reporting(void)
{ {
struct osmo_stats_reporter *srep1, *srep2, *srep; struct osmo_stats_reporter *srep1, *srep2, *srep;
struct osmo_stat_item_group *statg1, *statg2; struct osmo_stat_item_group *statg1, *statg2;

View File

@ -125,7 +125,7 @@ static void test_tdef_get(bool test_range)
} }
} }
static void test_tdef_get_nonexisting() static void test_tdef_get_nonexisting(void)
{ {
printf("\n%s()\n", __func__); printf("\n%s()\n", __func__);
@ -136,7 +136,7 @@ static void test_tdef_get_nonexisting()
print_tdef_get(tdefs, 5, OSMO_TDEF_US); print_tdef_get(tdefs, 5, OSMO_TDEF_US);
} }
static void test_tdef_set_and_get() static void test_tdef_set_and_get(void)
{ {
struct osmo_tdef *t; struct osmo_tdef *t;
printf("\n%s()\n", __func__); printf("\n%s()\n", __func__);
@ -317,7 +317,7 @@ const struct timeval fake_time_start_time = { 123, 456 };
osmo_timers_update(); \ osmo_timers_update(); \
} while (0) } while (0)
void fake_time_start() void fake_time_start(void)
{ {
struct timespec *clock_override; struct timespec *clock_override;

View File

@ -111,7 +111,7 @@ static int config_write_timer(struct vty *vty)
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void timer_init_vty() static void timer_init_vty(void)
{ {
/* Again, this is merely to get a vty write hook, see above. */ /* Again, this is merely to get a vty write hook, see above. */
install_node(&timer_node, config_write_timer); install_node(&timer_node, config_write_timer);
@ -123,7 +123,7 @@ static void timer_init_vty()
void *root_ctx = NULL; void *root_ctx = NULL;
static void print_help() static void print_help(void)
{ {
printf( "options:\n" printf( "options:\n"
" -h --help this text\n" " -h --help this text\n"

View File

@ -102,7 +102,7 @@ static int config_write_gsmnet(struct vty *vty)
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void gsmnet_init_vty() static void gsmnet_init_vty(void)
{ {
install_node(&gsmnet_node, config_write_gsmnet); install_node(&gsmnet_node, config_write_gsmnet);
install_element(CONFIG_NODE, &cfg_net_cmd); install_element(CONFIG_NODE, &cfg_net_cmd);
@ -116,7 +116,7 @@ static void gsmnet_init_vty()
void *root_ctx = NULL; void *root_ctx = NULL;
static void print_help() static void print_help(void)
{ {
printf( "options:\n" printf( "options:\n"
" -h --help this text\n" " -h --help this text\n"

View File

@ -179,7 +179,7 @@ static int config_write_member(struct vty *vty)
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void member_init_vty() static void member_init_vty(void)
{ {
install_node(&member_node, config_write_member); install_node(&member_node, config_write_member);
install_element(CONFIG_NODE, &cfg_member_cmd); install_element(CONFIG_NODE, &cfg_member_cmd);
@ -190,7 +190,7 @@ static void member_init_vty()
/* ------------------- THE REST is just boilerplate osmo main() ------------------- */ /* ------------------- THE REST is just boilerplate osmo main() ------------------- */
static void print_help() static void print_help(void)
{ {
printf( "options:\n" printf( "options:\n"
" -h --help this text\n" " -h --help this text\n"

View File

@ -125,7 +125,7 @@ static const struct log_info log_info = {
.num_cat = ARRAY_SIZE(log_categories), .num_cat = ARRAY_SIZE(log_categories),
}; };
int main() int main(int argc, char **argv)
{ {
void *ctx = talloc_named_const(NULL, 0, "time_cc_test"); void *ctx = talloc_named_const(NULL, 0, "time_cc_test");
struct timespec *now; struct timespec *now;

View File

@ -188,7 +188,7 @@ static void check_lv_shift_data_len(size_t data_len,
} }
} }
static void test_tlv_shift_functions() static void test_tlv_shift_functions(void)
{ {
uint8_t test_data[1024]; uint8_t test_data[1024];
uint8_t buf[1024]; uint8_t buf[1024];
@ -250,7 +250,7 @@ static void test_tlv_shift_functions()
/* Most GSM related protocols clearly indicate that in case of duplicate /* Most GSM related protocols clearly indicate that in case of duplicate
* IEs, only the first occurrence shall be used, while any further occurrences * IEs, only the first occurrence shall be used, while any further occurrences
* shall be ignored. See e.g. 3GPP TS 24.008 Section 8.6.3 */ * shall be ignored. See e.g. 3GPP TS 24.008 Section 8.6.3 */
static void test_tlv_repeated_ie() static void test_tlv_repeated_ie(void)
{ {
uint8_t test_data[768]; uint8_t test_data[768];
int i, rc; int i, rc;
@ -288,7 +288,7 @@ static void test_tlv_repeated_ie()
OSMO_ASSERT(dec3[2].lv[tag].val == &test_data[2 + 3 + 3]); OSMO_ASSERT(dec3[2].lv[tag].val == &test_data[2 + 3 + 3]);
} }
static void test_tlv_encoder() static void test_tlv_encoder(void)
{ {
const uint8_t enc_ies[] = { const uint8_t enc_ies[] = {
0x17, 0x14, 0x06, 0x2b, 0x12, 0x2b, 0x0b, 0x40, 0x2b, 0xb7, 0x05, 0xd0, 0x63, 0x82, 0x95, 0x03, 0x05, 0x40, 0x17, 0x14, 0x06, 0x2b, 0x12, 0x2b, 0x0b, 0x40, 0x2b, 0xb7, 0x05, 0xd0, 0x63, 0x82, 0x95, 0x03, 0x05, 0x40,
@ -332,7 +332,7 @@ static void test_tlv_encoder()
msgb_free(msg); msgb_free(msg);
} }
static void test_tlv_parser_bounds() static void test_tlv_parser_bounds(void)
{ {
struct tlv_definition tdef; struct tlv_definition tdef;
struct tlv_parsed dec; struct tlv_parsed dec;
@ -423,7 +423,7 @@ static void test_tlv_parser_bounds()
OSMO_ASSERT(TLVP_VAL(&dec, 0x23) == NULL); OSMO_ASSERT(TLVP_VAL(&dec, 0x23) == NULL);
} }
static void test_tlv_lens() static void test_tlv_lens(void)
{ {
uint16_t buf_len; uint16_t buf_len;
uint8_t buf[512]; uint8_t buf[512];

View File

@ -192,7 +192,7 @@ static struct foo *foo_alloc(const char *name, size_t static_entries)
return foo; return foo;
} }
void print_foos() void print_foos(void)
{ {
int count = 0; int count = 0;
struct foo *foo; struct foo *foo;
@ -204,7 +204,7 @@ void print_foos()
fprintf(stderr, "%d foos\n\n", count); fprintf(stderr, "%d foos\n\n", count);
} }
static void test_use_count_fsm() static void test_use_count_fsm(void)
{ {
struct foo *a, *b, *c; struct foo *a, *b, *c;
log("\n%s()\n", __func__); log("\n%s()\n", __func__);

View File

@ -342,7 +342,7 @@ static struct {
{ "DeafBeddedBabeAcceededFadedDecaff", 32, 32, false, false }, { "DeafBeddedBabeAcceededFadedDecaff", 32, 32, false, false },
}; };
bool test_is_hexstr() bool test_is_hexstr(void)
{ {
int i; int i;
bool pass = true; bool pass = true;
@ -1023,7 +1023,7 @@ struct osmo_str_tolowupper_test_data osmo_str_tolowupper_tests[] = {
}; };
static void osmo_str_tolowupper_test() static void osmo_str_tolowupper_test(void)
{ {
int i; int i;
char buf[128]; char buf[128];
@ -1197,7 +1197,7 @@ int strbuf_cascade(char *buf, size_t buflen)
return sb.chars_needed; return sb.chars_needed;
} }
void strbuf_test() void strbuf_test(void)
{ {
char buf[256]; char buf[256];
int rc; int rc;
@ -1230,7 +1230,7 @@ void strbuf_test()
printf("(need %d chars, had size=63) %s\n", rc, buf); printf("(need %d chars, had size=63) %s\n", rc, buf);
} }
void strbuf_test_nolen() void strbuf_test_nolen(void)
{ {
char buf[20]; char buf[20];
struct osmo_strbuf sb = { .buf = buf, .len = sizeof(buf) }; struct osmo_strbuf sb = { .buf = buf, .len = sizeof(buf) };
@ -1256,7 +1256,7 @@ static void startswith_test_str(const char *str, const char *startswith_str, boo
printf(" ERROR: EXPECTED %s\n", expect_rc ? "true" : "false"); printf(" ERROR: EXPECTED %s\n", expect_rc ? "true" : "false");
} }
static void startswith_test() static void startswith_test(void)
{ {
printf("\n%s()\n", __func__); printf("\n%s()\n", __func__);
startswith_test_str(NULL, NULL, true); startswith_test_str(NULL, NULL, true);
@ -1301,7 +1301,7 @@ static char *foo_name_c_zero_null(void *ctx, const char *arg)
OSMO_NAME_C_IMPL(ctx, 0, NULL, foo_name_buf, arg) OSMO_NAME_C_IMPL(ctx, 0, NULL, foo_name_buf, arg)
} }
static void name_c_impl_test() static void name_c_impl_test(void)
{ {
char *test_strs[] = { char *test_strs[] = {
"test", "test",
@ -1703,7 +1703,7 @@ const char *errno_str(int rc)
return ""; return "";
} }
} }
void test_float_str_to_int() void test_float_str_to_int(void)
{ {
const struct float_str_to_int_test *t; const struct float_str_to_int_test *t;
printf("--- %s\n", __func__); printf("--- %s\n", __func__);
@ -1865,7 +1865,7 @@ struct int_to_float_str_test int_to_float_str_tests[] = {
{ 23, -9223372036854775807, "-0.00009223372036854775807" }, { 23, -9223372036854775807, "-0.00009223372036854775807" },
{ 23, INT64_MIN, "-ERR" }, { 23, INT64_MIN, "-ERR" },
}; };
void test_int_to_float_str() void test_int_to_float_str(void)
{ {
const struct int_to_float_str_test *t; const struct int_to_float_str_test *t;
printf("--- %s\n", __func__); printf("--- %s\n", __func__);
@ -1956,7 +1956,7 @@ struct str_to_int_test str_to_int_tests[] = {
{ "123 ", 10, -1000, 1000, -E2BIG, 123 }, { "123 ", 10, -1000, 1000, -E2BIG, 123 },
{ "123.4", 10, -1000, 1000, -E2BIG, 123 }, { "123.4", 10, -1000, 1000, -E2BIG, 123 },
}; };
void test_str_to_int() void test_str_to_int(void)
{ {
const struct str_to_int_test *t; const struct str_to_int_test *t;
printf("--- %s\n", __func__); printf("--- %s\n", __func__);
@ -2053,7 +2053,7 @@ struct str_to_int64_test str_to_int64_tests[] = {
{ "-9223372036854775809", 10, -1000, 1000, -EOVERFLOW, INT64_MIN }, { "-9223372036854775809", 10, -1000, 1000, -EOVERFLOW, INT64_MIN },
{ "9223372036854775808", 10, -1000, 1000, -EOVERFLOW, INT64_MAX }, { "9223372036854775808", 10, -1000, 1000, -EOVERFLOW, INT64_MAX },
}; };
void test_str_to_int64() void test_str_to_int64(void)
{ {
const struct str_to_int64_test *t; const struct str_to_int64_test *t;
printf("--- %s\n", __func__); printf("--- %s\n", __func__);

View File

@ -476,7 +476,7 @@ DEFUN(cfg_range_baseboth, cfg_range_baseboth_cmd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
void test_vty_add_cmds() void test_vty_add_cmds(void)
{ {
install_element(CONFIG_NODE, &cfg_ret_warning_cmd); install_element(CONFIG_NODE, &cfg_ret_warning_cmd);
install_element(CONFIG_NODE, &cfg_ret_success_cmd); install_element(CONFIG_NODE, &cfg_ret_success_cmd);
@ -507,7 +507,7 @@ void test_vty_add_cmds()
install_element_ve(&cfg_range_baseboth_cmd); install_element_ve(&cfg_range_baseboth_cmd);
} }
void test_is_cmd_ambiguous() void test_is_cmd_ambiguous(void)
{ {
struct vty *vty; struct vty *vty;
struct vty_test test; struct vty_test test;
@ -526,7 +526,7 @@ void test_is_cmd_ambiguous()
destroy_test_vty(&test, vty); destroy_test_vty(&test, vty);
} }
void test_numeric_range() void test_numeric_range(void)
{ {
struct vty *vty; struct vty *vty;
struct vty_test test; struct vty_test test;
@ -541,7 +541,7 @@ void test_numeric_range()
destroy_test_vty(&test, vty); destroy_test_vty(&test, vty);
} }
void test_ranges() void test_ranges(void)
{ {
struct vty *vty; struct vty *vty;
struct vty_test test; struct vty_test test;

View File

@ -37,7 +37,7 @@
void *root_ctx = NULL; void *root_ctx = NULL;
static void print_help() static void print_help(void)
{ {
printf( "options:\n" printf( "options:\n"
" -h --help this text\n" " -h --help this text\n"
@ -315,7 +315,7 @@ DEFUN_ATTR_USRATTR(cfg_attr_hidden_app_attr_unbelievable,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void init_vty_cmds() static void init_vty_cmds(void)
{ {
install_element_ve(&single0_cmd); install_element_ve(&single0_cmd);
install_element_ve(&multi0_cmd); install_element_ve(&multi0_cmd);

View File

@ -88,7 +88,7 @@ static int milenage_check(const uint8_t *opc, const uint8_t *k, const uint8_t *s
} }
static void help() static void help(void)
{ {
printf( "Static SIM card parameters:\n" printf( "Static SIM card parameters:\n"
"-k --key\tSpecify Ki / K\n" "-k --key\tSpecify Ki / K\n"

View File

@ -85,7 +85,7 @@ static struct osmo_sub_auth_data test_aud = {
.algo = OSMO_AUTH_ALG_NONE, .algo = OSMO_AUTH_ALG_NONE,
}; };
static void help() static void help(void)
{ {
int alg; int alg;
printf( "-2 --2g\tUse 2G (GSM) authentication\n" printf( "-2 --2g\tUse 2G (GSM) authentication\n"

View File

@ -43,7 +43,7 @@ static struct vty_app_info vty_info = {
.copyright = vty_copyright, .copyright = vty_copyright,
}; };
static void print_help() static void print_help(void)
{ {
printf( "Some useful options:\n" printf( "Some useful options:\n"
" -h --help This text\n" " -h --help This text\n"