Fixing -Wstrict-prototypes warnings.

Bug: webrtc:8984
Change-Id: I9a7ffb0038f341bfec055f021fc203c7d45d72fa
Reviewed-on: https://webrtc-review.googlesource.com/60903
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22501}
This commit is contained in:
Mirko Bonadei 2018-03-19 16:23:48 +01:00 committed by Commit Bot
parent def1ef5603
commit d7573563a4
9 changed files with 29 additions and 13 deletions

View File

@ -171,7 +171,9 @@ config("common_inherited_config") {
config("common_config") {
cflags = []
cflags_c = []
cflags_cc = []
cflags_objc = []
defines = []
if (rtc_enable_protobuf) {
@ -221,6 +223,20 @@ config("common_config") {
"-Wno-missing-field-initializers",
"-Wno-strict-overflow",
]
cflags_c += [
# TODO(bugs.webrtc.org/9029): enable commented compiler flags.
# Some of these flags should also be added to cflags_objc.
# "-Wextra", (used when building C++ but not when building C)
# "-Wmissing-prototypes", (C/Obj-C only)
# "-Wmissing-declarations", (ensure this is always used C/C++, etc..)
"-Wstrict-prototypes",
# "-Wpointer-arith", (ensure this is always used C/C++, etc..)
# "-Wbad-function-cast", (C/Obj-C only)
# "-Wnested-externs", (C/Obj-C only)
]
cflags_objc += [ "-Wstrict-prototypes" ]
cflags_cc = [
"-Wnon-virtual-dtor",

View File

@ -110,7 +110,7 @@ extern "C" {
// C code will be assigned.
// Note that this function MUST be called in any application that uses SPL
// functions.
void WebRtcSpl_Init();
void WebRtcSpl_Init(void);
int16_t WebRtcSpl_GetScalingSquare(int16_t* in_vector,
size_t in_vector_length,

View File

@ -30,7 +30,7 @@ ScaleAndAddVectorsWithRound WebRtcSpl_ScaleAndAddVectorsWithRound;
#if (!defined(WEBRTC_HAS_NEON)) && !defined(MIPS32_LE)
/* Initialize function pointers to the generic C version. */
static void InitPointersToC() {
static void InitPointersToC(void) {
WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16C;
WebRtcSpl_MaxAbsValueW32 = WebRtcSpl_MaxAbsValueW32C;
WebRtcSpl_MaxValueW16 = WebRtcSpl_MaxValueW16C;
@ -46,7 +46,7 @@ static void InitPointersToC() {
#if defined(WEBRTC_HAS_NEON)
/* Initialize function pointers to the Neon version. */
static void InitPointersToNeon() {
static void InitPointersToNeon(void) {
WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16Neon;
WebRtcSpl_MaxAbsValueW32 = WebRtcSpl_MaxAbsValueW32Neon;
WebRtcSpl_MaxValueW16 = WebRtcSpl_MaxValueW16Neon;
@ -62,7 +62,7 @@ static void InitPointersToNeon() {
#if defined(MIPS32_LE)
/* Initialize function pointers to the MIPS version. */
static void InitPointersToMIPS() {
static void InitPointersToMIPS(void) {
WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16_mips;
WebRtcSpl_MaxValueW16 = WebRtcSpl_MaxValueW16_mips;
WebRtcSpl_MaxValueW32 = WebRtcSpl_MaxValueW32_mips;
@ -128,6 +128,6 @@ static void once(void (*func)(void)) {
*/
#endif /* WEBRTC_POSIX */
void WebRtcSpl_Init() {
void WebRtcSpl_Init(void) {
once(InitFunctionPointers);
}

View File

@ -27,7 +27,7 @@ extern "C" {
#endif
// Creates an instance to the VAD structure.
VadInst* WebRtcVad_Create();
VadInst* WebRtcVad_Create(void);
// Frees the dynamic memory of a specified VAD instance.
//

View File

@ -34,5 +34,5 @@
@end
NSInteger ARDGetCpuUsagePercentage();
NSInteger ARDGetCpuUsagePercentage(void);

View File

@ -67,7 +67,7 @@ void WebRtcIsacfix_InitPlc(PLCstr* State);
/* transform functions */
void WebRtcIsacfix_InitTransform();
void WebRtcIsacfix_InitTransform(void);
typedef void (*Time2Spec)(int16_t* inre1Q9,
int16_t* inre2Q9,

View File

@ -208,7 +208,7 @@ int WebRtcAgc_get_config(void* agcInst, WebRtcAgcConfig* config);
* This function creates and returns an AGC instance, which will contain the
* state information for one (duplex) channel.
*/
void* WebRtcAgc_Create();
void* WebRtcAgc_Create(void);
/*
* This function frees the AGC instance created at the beginning.

View File

@ -24,7 +24,7 @@ extern "C" {
/*
* This function creates an instance of the floating point Noise Suppression.
*/
NsHandle* WebRtcNs_Create();
NsHandle* WebRtcNs_Create(void);
/*
* This function frees the dynamic memory of a specified noise suppression
@ -126,7 +126,7 @@ const float* WebRtcNs_noise_estimate(const NsHandle* handle);
*
* Return value : Number of frequency bins.
*/
size_t WebRtcNs_num_freq();
size_t WebRtcNs_num_freq(void);
#ifdef __cplusplus
}

View File

@ -24,7 +24,7 @@ extern "C" {
/*
* This function creates an instance of the fixed point Noise Suppression.
*/
NsxHandle* WebRtcNsx_Create();
NsxHandle* WebRtcNsx_Create(void);
/*
* This function frees the dynamic memory of a specified Noise Suppression
@ -104,7 +104,7 @@ const uint32_t* WebRtcNsx_noise_estimate(const NsxHandle* nsxInst,
*
* Return value : Number of frequency bins.
*/
size_t WebRtcNsx_num_freq();
size_t WebRtcNsx_num_freq(void);
#ifdef __cplusplus
}