TT#50652 add -Wstrict-prototypes everywhere

Change-Id: Ic5b5fcb892a8f70196478f8622d956bdea373422
changes/66/27666/1
Richard Fuchs 6 years ago
parent 8f3c309c7f
commit e3ec97f858

@ -23,6 +23,7 @@ csh_lookup_str = csh_lookup_str.replace('!', '0')
flags = [
'-g',
'-Wall',
'-Wstrict-prototypes',
'-pthread',
'-fno-strict-aliasing',
'-I/usr/include/glib-2.0',

@ -51,7 +51,7 @@ endif
endif
endif
CFLAGS= -g -Wall -pthread -fno-strict-aliasing
CFLAGS= -g -Wall -Wstrict-prototypes -pthread -fno-strict-aliasing
CFLAGS+= -std=c99
CFLAGS+= $(shell pkg-config --cflags glib-2.0)
CFLAGS+= $(shell pkg-config --cflags gthread-2.0)

@ -114,7 +114,7 @@ int pcre_multi_match(pcre *re, pcre_extra *ree, const char *s, unsigned int num,
static void thread_join_me() {
static void thread_join_me(void) {
pthread_t *me;
me = g_slice_alloc(sizeof(*me));

@ -170,7 +170,7 @@ static void dump_cert(struct dtls_cert *cert) {
buf_dump_free(buf, len);
}
static int cert_init() {
static int cert_init(void) {
X509 *x509 = NULL;
EVP_PKEY *pkey = NULL;
BIGNUM *exponent = NULL, *serial_number = NULL;

@ -8,7 +8,7 @@
#include "ice.h"
#include "log.h"
INLINE void log_info_clear() {
INLINE void log_info_clear(void) {
switch (log_info.e) {
case LOG_INFO_NONE:
return;

@ -586,11 +586,11 @@ void fill_initial_rtpe_cfg(struct rtpengine_config* ini_rtpe_cfg) {
}
static void early_init() {
static void early_init(void) {
socket_init(); // needed for socktype_udp
}
static void init_everything() {
static void init_everything(void) {
log_init("rtpengine");
log_format(rtpe_config.log_format);
recording_fs_init(rtpe_config.spooldir, rtpe_config.rec_method, rtpe_config.rec_format);

@ -412,7 +412,7 @@ void redis_async_context_disconnect(const redisAsyncContext *redis_notify_async_
}
}
int redis_async_context_alloc() {
int redis_async_context_alloc(void) {
struct redis *r = 0;
if (!rtpe_redis_notify) {
@ -521,7 +521,7 @@ int redis_notify_subscribe_action(enum subscribe_action action, int keyspace) {
return 0;
}
static int redis_notify() {
static int redis_notify(void) {
struct redis *r = 0;
GList *l;

@ -3,7 +3,7 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
CFLAGS ?= -Wall -g
CFLAGS ?= -Wall -Wstrict-prototypes -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0

@ -14,6 +14,7 @@ compilation_database_folder = ''
flags = [
'-g',
'-Wall',
'-Wstrict-prototypes',
'-pthread',
'-fno-strict-aliasing',
'-I/usr/include/glib-2.0',

@ -184,7 +184,7 @@ INLINE int strmemcmp(const void *mem, int len, const char *str) {
return memcmp(mem, str, len);
}
INLINE long unsigned int ssl_random() {
INLINE long unsigned int ssl_random(void) {
long unsigned int ret;
random_string((void *) &ret, sizeof(ret));
return ret;

@ -103,7 +103,7 @@ extern const unsigned int num_crypto_suites;
void crypto_init_main();
void crypto_init_main(void);
const struct crypto_suite *crypto_find_suite(const str *);
int crypto_gen_session_key(struct crypto_context *, str *, unsigned char, int);

@ -7,7 +7,7 @@
void homer_sender_init(const endpoint_t *, int, int);
int homer_send(GString *, const str *, const endpoint_t *, const endpoint_t *,
const struct timeval *tv);
int has_homer();
int has_homer(void);
#endif

@ -34,7 +34,7 @@ int kernel_setup_table(unsigned int);
int kernel_add_stream(struct rtpengine_target_info *, int);
int kernel_del_stream(const struct re_address *);
GList *kernel_list();
GList *kernel_list(void);
unsigned int kernel_add_call(const char *id);
int kernel_del_call(unsigned int);

@ -33,6 +33,6 @@ void rtcp_list_free(GQueue *q);
rtcp_filter_func rtcp_avpf2avp_filter;
void rtcp_init();
void rtcp_init(void);
#endif

@ -1,5 +1,5 @@
CC?=gcc
CFLAGS = -O2 -Wall -shared -fPIC
CFLAGS = -O2 -Wall -Wstrict-prototypes -shared -fPIC
ifneq ($(RTPENGINE_VERSION),)
CFLAGS += -DRTPENGINE_VERSION="\"$(RTPENGINE_VERSION)\""
else

@ -14,6 +14,7 @@ compilation_database_folder = ''
flags = [
'-g',
'-Wall',
'-Wstrict-prototypes',
'-pthread',
'-fno-strict-aliasing',
'-I/usr/include/glib-2.0',

@ -920,7 +920,7 @@ seq_ok:
encoder_t *encoder_new() {
encoder_t *encoder_new(void) {
encoder_t *ret = g_slice_alloc0(sizeof(*ret));
format_init(&ret->requested_format);
format_init(&ret->actual_format);

@ -202,7 +202,7 @@ int decoder_input_data(decoder_t *dec, const str *data, unsigned long ts,
int (*callback)(decoder_t *, AVFrame *, void *u1, void *u2), void *u1, void *u2);
encoder_t *encoder_new();
encoder_t *encoder_new(void);
int encoder_config(encoder_t *enc, const codec_def_t *def, int bitrate, int ptime,
const format_t *requested_format, format_t *actual_format);
int encoder_config_fmtp(encoder_t *enc, const codec_def_t *def, int bitrate, int ptime,

@ -1,5 +1,5 @@
#include "fix_frame_channel_layout.h"
void test() {
void test(void) {
AVFrame *f = NULL;
fix_frame_channel_layout(f);
}

@ -18,7 +18,7 @@ typedef void write_log_t(int facility_priority, const char *format, ...) __attri
extern write_log_t *write_log;
int parse_log_facility(const char *name, int *dst);
void print_available_log_facilities ();
void print_available_log_facilities (void);
void log_to_stderr(int facility_priority, const char *format, ...) __attribute__ ((format (printf, 2, 3)));

@ -14,6 +14,7 @@ compilation_database_folder = ''
flags = [
'-g',
'-Wall',
'-Wstrict-prototypes',
'-pthread',
'-fno-strict-aliasing',
'-I/usr/include/glib-2.0',

@ -1,6 +1,6 @@
TARGET= rtpengine-recording
CFLAGS= -g -Wall -pthread -I. -I../lib/ -I../kernel-module/
CFLAGS= -g -Wall -Wstrict-prototypes -pthread -I. -I../lib/ -I../kernel-module/
CFLAGS+= -std=c99 -fno-strict-aliasing
CFLAGS+= -D_GNU_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE
CFLAGS+= $(shell pkg-config --cflags glib-2.0)

@ -69,7 +69,7 @@ static void my_stmt_close(MYSQL_STMT **st) {
}
static void reset_conn() {
static void reset_conn(void) {
my_stmt_close(&stm_insert_call);
my_stmt_close(&stm_close_call);
my_stmt_close(&stm_insert_stream);
@ -93,7 +93,7 @@ INLINE int prep(MYSQL_STMT **st, const char *str) {
}
static int check_conn() {
static int check_conn(void) {
if (mysql_conn)
return 0;
if (!c_mysql_host || !c_mysql_db)
@ -236,7 +236,7 @@ err:
}
static double now_double() {
static double now_double(void) {
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec + tv.tv_usec / 1000000.0;

@ -14,6 +14,7 @@ compilation_database_folder = ''
flags = [
'-g',
'-Wall',
'-Wstrict-prototypes',
'-pthread',
'-fno-strict-aliasing',
'-I/usr/include/glib-2.0',

@ -2,7 +2,7 @@ TARGET= all-tests
with_transcoding ?= yes
CFLAGS= -g -Wall -pthread -fno-strict-aliasing
CFLAGS= -g -Wall -Wstrict-prototypes -pthread -fno-strict-aliasing
CFLAGS+= -std=c99
CFLAGS+= $(shell pkg-config --cflags glib-2.0)
CFLAGS+= $(shell pkg-config --cflags gthread-2.0)

@ -178,7 +178,7 @@ void srtp_validate (struct crypto_context *c, struct crypto_context *c2, char* m
printf("%s RTCP decrypt: PASS\n", message);
}
extern void crypto_init_main();
extern void crypto_init_main(void);
void check_session_keys(struct crypto_context *c, int i) {
str s;

@ -79,7 +79,7 @@ static void do_test_amr_wb(const char *file, int line,
#define do_test_nb(in, out, fmt) \
do_test_amr_nb(__FILE__, __LINE__, fmt, in, sizeof(in)-1, out, sizeof(out)-1)
int main() {
int main(void) {
codeclib_init(0);
do_test_wb(

@ -118,7 +118,7 @@ static void do_test_amr_nb(const char *file, int line,
#define test_160_samples_16_bits \
"\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01\x00\x00\x01\x00\x01\x00\x01\x01"
int main() {
int main(void) {
codeclib_init(0);
do_test_wb(

@ -87,7 +87,7 @@ int do_test(const char *input, unsigned int input_len,
return argc;
}
int main() {
int main(void) {
test1("\x81", 8, "\x81", 0);
test2("\x81", 8, "\x81", 0, 1, "", -1);
test2("\x81", 8, "\x81", 0, 1, NULL, -1);

@ -26,7 +26,7 @@ static void test(char *p, int exp) {
}
}
int main() {
int main(void) {
test("one", 1);
test("two", 2);
test("dashed-string", 3);

@ -8,7 +8,7 @@ struct call;
struct stream_fd;
struct ice_agent;
INLINE void log_info_clear() {
INLINE void log_info_clear(void) {
}
INLINE void log_info_call(struct call *c) {
}

@ -31,7 +31,7 @@ static void most_cmp(struct payload_tracker *t, const char *cmp, const char *fil
#define cmp(s) most_cmp(&t, s, __FILE__, __LINE__)
#define add(p) payload_tracker_add(&t, p)
int main() {
int main(void) {
struct payload_tracker t;
payload_tracker_init(&t);

@ -103,7 +103,7 @@ static void __sdp_pt_fmt(int num, str codec, int clockrate, str full_codec, str
#define sdp_pt(num, codec, clockrate) sdp_pt_fmt(num, codec, clockrate, "")
static void offer() {
static void offer(void) {
printf("offer\n");
codec_rtp_payload_types(media_B, media_A, &rtp_types, &flags);
codec_handlers_update(media_B, media_A, &flags);
@ -111,7 +111,7 @@ static void offer() {
memset(&flags, 0, sizeof(flags));
}
static void answer() {
static void answer(void) {
printf("answer\n");
codec_rtp_payload_types(media_A, media_B, &rtp_types, &flags);
codec_handlers_update(media_A, media_B, &flags);
@ -282,7 +282,7 @@ static void __packet_seq_ts(const char *file, int line, struct call_media *media
#define packet_seq_nf(side, pt_in, pload, rtp_ts, rtp_seq, pt_out, pload_exp) \
packet_seq_ts(side, pt_in, pload, rtp_ts, rtp_seq, pt_out, pload_exp, -1, 0)
static void end() {
static void end(void) {
g_hash_table_destroy(rtp_ts_ht);
g_hash_table_destroy(rtp_seq_ht);
printf("\n");
@ -312,7 +312,7 @@ static void dtmf(const char *s) {
#define AMR_WB_payload "\xf0\x1c\xf3\x06\x08\x10\x77\x32\x23\x20\xd3\x50\x62\x12\xc7\x7c\xe2\xea\x84\x0e\x6e\xf4\x4d\xe4\x7f\xc9\x4c\xcc\x58\x5d\xed\xcc\x5d\x7c\x6c\x14\x7d\xc0" // octet aligned
#define AMR_WB_payload_noe "\xf1\xfc\xc1\x82\x04\x1d\xcc\x88\xc8\x34\xd4\x18\x84\xb1\xdf\x38\xba\xa1\x03\x9b\xbd\x13\x79\x1f\xf2\x53\x33\x16\x17\x7b\x73\x17\x5f\x1b\x05\x1f\x70" // bandwidth efficient
int main() {
int main(void) {
codeclib_init(0);
srandom(time(NULL));

Loading…
Cancel
Save