Commit 9bdec6f3 authored by Ghislain MARY's avatar Ghislain MARY

Fix strict-prototypes warnings.

parent ff7a2ce9
......@@ -31,7 +31,7 @@ typedef struct _MSEventQueue MSEventQueue;
* The application can then schedule the callbacks for the events
* received by the queue by calling ms_event_queue_pump()
**/
MS2_PUBLIC MSEventQueue *ms_event_queue_new();
MS2_PUBLIC MSEventQueue *ms_event_queue_new(void);
/**
* Install a global event queue.
......
......@@ -26,7 +26,7 @@ typedef struct _AlawEncData{
uint32_t ts;
} AlawEncData;
static AlawEncData * alaw_enc_data_new(){
static AlawEncData * alaw_enc_data_new(void){
AlawEncData *obj=(AlawEncData *)ms_new0(AlawEncData,1);
obj->bz=ms_bufferizer_new();
obj->ptime=0;
......
......@@ -41,7 +41,7 @@ typedef struct _ResampleData{
int cpuFeatures; /*store because there is no SPEEX_LIB_GET_CPU_FEATURES*/
} ResampleData;
static ResampleData * resample_data_new(){
static ResampleData * resample_data_new(void){
ResampleData *obj=ms_new0(ResampleData,1);
obj->bz=ms_bufferizer_new();
obj->ts=0;
......
......@@ -86,7 +86,7 @@ static bool_t wait_for_context_state(pa_context_state_t success_state, pa_contex
return state == success_state;
}
static void init_pulse_context(){
static void init_pulse_context(void){
if (context==NULL){
pa_loop=pa_threaded_mainloop_new();
context=pa_context_new(pa_threaded_mainloop_get_api(pa_loop),NULL);
......@@ -96,7 +96,7 @@ static void init_pulse_context(){
}
}
static void uninit_pulse_context(){
static void uninit_pulse_context(void){
pa_context_disconnect(context);
pa_context_unref(context);
pa_threaded_mainloop_stop(pa_loop);
......
......@@ -27,7 +27,7 @@ typedef struct _UlawEncData{
uint32_t ts;
} UlawEncData;
static UlawEncData * ulaw_enc_data_new(){
static UlawEncData * ulaw_enc_data_new(void){
UlawEncData *obj=(UlawEncData *)ms_new0(UlawEncData,1);
obj->bz=ms_bufferizer_new();
obj->ptime=0;
......
......@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static MSSndCardManager *scm=NULL;
static MSSndCardManager * create_manager(){
static MSSndCardManager * create_manager(void){
MSSndCardManager *obj=(MSSndCardManager *)ms_new0(MSSndCardManager,1);
obj->cards=NULL;
obj->descs=NULL;
......
......@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static MSWebCamManager *scm=NULL;
static MSWebCamManager * create_manager(){
static MSWebCamManager * create_manager(void){
MSWebCamManager *obj=(MSWebCamManager *)ms_new0(MSWebCamManager,1);
return obj;
}
......
......@@ -97,7 +97,7 @@ struct _MSDtlsSrtpContext{
/**************************/
/**** Helper functions ****/
static ORTP_INLINE uint64_t get_timeval_in_millis() {
static ORTP_INLINE uint64_t get_timeval_in_millis(void) {
struct timeval t;
ortp_gettimeofday(&t,NULL);
return (1000LL*t.tv_sec)+(t.tv_usec/1000LL);
......
......@@ -64,7 +64,7 @@ struct _MSSrtpCtx {
MSSrtpStreamContext recv_rtcp_context;
};
MSSrtpCtx* ms_srtp_context_new() {
MSSrtpCtx* ms_srtp_context_new(void) {
MSSrtpCtx* ctx = ms_new0(struct _MSSrtpCtx,1);
ctx->send_rtp_context.is_rtp=TRUE;
ms_mutex_init(&ctx->send_rtp_context.mutex, NULL);
......
......@@ -53,7 +53,7 @@ typedef enum {
/********************/
/* Helper functions */
static ORTP_INLINE uint64_t get_timeval_in_millis() {
static ORTP_INLINE uint64_t get_timeval_in_millis(void) {
struct timeval t;
ortp_gettimeofday(&t,NULL);
return (1000LL*t.tv_sec)+(t.tv_usec/1000LL);
......
......@@ -102,7 +102,7 @@ struct opengles_display {
float zoom_cy;
};
struct opengles_display* ogl_display_new() {
struct opengles_display* ogl_display_new(void) {
struct opengles_display* result =
(struct opengles_display*) malloc(sizeof(struct opengles_display));
if (result == 0) {
......
......@@ -29,7 +29,7 @@ struct opengles_display;
/**
* Create opaque structure to handle OpenGL display
*/
struct opengles_display* ogl_display_new();
struct opengles_display* ogl_display_new(void);
/**
* Release opaque struct memory
......
......@@ -66,7 +66,7 @@ static int x11error_handler(Display *d, XErrorEvent*ev) {
return 0;
}
static Display *init_display(){
static Display *init_display(void){
const char *display;
Display *ret;
display=getenv("DISPLAY");
......
......@@ -46,7 +46,7 @@ typedef struct _DecData{
bool_t avpf_enabled;
}DecData;
static void ffmpeg_init(){
static void ffmpeg_init(void){
static bool_t done=FALSE;
if (!done){
avcodec_register_all();
......
......@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "rfc2429.h"
extern void ms_ffmpeg_check_init();
extern void ms_ffmpeg_check_init(void);
typedef struct DecState{
......
......@@ -74,7 +74,7 @@ typedef struct X11Video
static Display *init_display(){
static Display *init_display(void){
const char *display;
Display *ret;
display=getenv("DISPLAY");
......
......@@ -41,7 +41,7 @@ extern "C"{
extern void __register_ffmpeg_encoders_if_possible(MSFactory *factory);
extern void __register_ffmpeg_h264_decoder_if_possible(MSFactory *factory);
extern void ms_ffmpeg_check_init();
extern void ms_ffmpeg_check_init(void);
extern bool_t libmsandroiddisplay_init(MSFactory *factory);
extern void libmsandroiddisplaybad_init(MSFactory *factory);
extern void libmsandroidopengldisplay_init(MSFactory *factory);
......
......@@ -109,7 +109,7 @@ MS2_PUBLIC void ms_zrtp_set_stream_sessions(MSZrtpContext *zrtp_context, MSMedia
bool_t ms_media_stream_sessions_secured(const MSMediaStreamSessions *sessions,MediaStreamDir dir);
MSSrtpCtx* ms_srtp_context_new();
MSSrtpCtx* ms_srtp_context_new(void);
void ms_srtp_context_delete(MSSrtpCtx *session);
......
......@@ -1310,7 +1310,7 @@ stunRand(void)
/* return a random number to use as a port */
static int
randomPort()
randomPort(void)
{
int min=0x4000;
int max=0x7FFF;
......
......@@ -26,10 +26,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <time.h>
#include <stdio.h>
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#pragma GCC diagnostic push
#endif
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#include "CUnit/Basic.h"
#include "CUnit/Automated.h"
#include "CUnit/MyMem.h"
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#pragma GCC diagnostic pop
#endif
#ifdef _WIN32
#if defined(__MINGW32__) || !defined(WINAPI_FAMILY_PARTITION) || !defined(WINAPI_PARTITION_DESKTOP)
#define BC_TESTER_WINDOWS_DESKTOP 1
......@@ -647,10 +656,10 @@ char* bc_sprintf(const char* format, ...) {
return res;
}
const char * bc_tester_current_suite_name() {
const char * bc_tester_current_suite_name(void) {
return bc_current_suite_name;
}
const char * bc_tester_current_test_name() {
const char * bc_tester_current_test_name(void) {
return bc_current_test_name;
}
......@@ -92,8 +92,8 @@ const char * bc_tester_test_name(const char *suite_name, int test_index);
int bc_tester_run_suite(test_suite_t *suite);
int bc_tester_run_tests(const char *suite_name, const char *test_name);
int bc_tester_suite_index(const char *suite_name);
const char * bc_tester_current_suite_name();
const char * bc_tester_current_test_name();
const char * bc_tester_current_suite_name(void);
const char * bc_tester_current_test_name(void);
char* bc_sprintfva(const char* format, va_list args);
char* bc_sprintf(const char* format, ...);
......
......@@ -318,7 +318,7 @@ static void event_queue_cb(MediaStream *ms, void *user_pointer) {
}
/********************************** Tests are starting now ********************/
static void packet_duplication() {
static void packet_duplication(void) {
const rtp_stats_t *stats;
double dup_ratio;
stream_manager_t * marielle, * margaux;
......@@ -345,7 +345,7 @@ static void packet_duplication() {
stop_adaptive_stream(marielle,margaux);
}
static void upload_bandwidth_computation() {
static void upload_bandwidth_computation(void) {
bool_t supported = ms_filter_codec_supported("pcma");
if( supported ) {
stream_manager_t * marielle, * margaux;
......@@ -364,7 +364,7 @@ static void upload_bandwidth_computation() {
}
}
static void loss_rate_estimation() {
static void loss_rate_estimation(void) {
bool_t supported = ms_filter_codec_supported("pcma");
if( supported ) {
LossRateEstimatorCtx ctx;
......@@ -408,26 +408,26 @@ void upload_bitrate(const char* codec, int payload, int target_bw, int expect_bw
}
}
static void upload_bitrate_pcma_3g() {
static void upload_bitrate_pcma_3g(void) {
// pcma codec bitrate is always 64 kbits, only ptime can change from 20ms to 100ms.
// ptime=20 ms -> network bitrate=80 kbits/s
// ptime=100 ms -> network bitrate=67 kbits/s
upload_bitrate("pcma", PCMA8_PAYLOAD_TYPE, THIRDGENERATION_BW, 80);
}
static void upload_bitrate_speex_low() {
static void upload_bitrate_speex_low(void) {
// speex codec bitrate can vary from 16 kbits/s to 42 kbits/s
// bitrate=42 kbits/s ptime=20 ms -> network bitrate=58 kbits/s
// bitrate=16 kbits/s ptime=100 ms -> network bitrate=19 kbits/s
upload_bitrate("speex", SPEEX_PAYLOAD_TYPE, 25, 25);
}
static void upload_bitrate_speex_3g() {
static void upload_bitrate_speex_3g(void) {
upload_bitrate("speex", SPEEX_PAYLOAD_TYPE, THIRDGENERATION_BW, 59);
}
static void upload_bitrate_opus_edge() {
static void upload_bitrate_opus_edge(void) {
// opus codec bitrate can vary from 6 kbits/s to 184 kbits/s
// bitrate=6 kbits/s and ptime=100 ms -> network bitrate= 9 kbits/s
// bitrate=184 kbits/s and ptime=20 ms -> network bitrate=200 kbits/s
......@@ -437,7 +437,7 @@ static void upload_bitrate_opus_edge() {
// is not sufficient to match the guidelines without adaptive algorithm.
}
static void upload_bitrate_opus_3g() {
static void upload_bitrate_opus_3g(void) {
upload_bitrate("opus", OPUS_PAYLOAD_TYPE, THIRDGENERATION_BW, 200);
}
......
......@@ -190,12 +190,12 @@ static void basic_audio_stream_base( const char* marielle_local_ip
rtp_profile_destroy(profile);
}
static void basic_audio_stream() {
static void basic_audio_stream(void) {
basic_audio_stream_base(MARIELLE_IP,MARIELLE_RTP_PORT,MARIELLE_RTCP_PORT
,MARGAUX_IP, MARGAUX_RTP_PORT, MARGAUX_RTCP_PORT);
}
static void multicast_audio_stream() {
static void multicast_audio_stream(void) {
basic_audio_stream_base("0.0.0.0",MARIELLE_RTP_PORT, 0
,MULTICAST_IP, MARGAUX_RTP_PORT, 0);
}
......
......@@ -135,7 +135,7 @@ static void dtmfgen_enc_dec_tonedet_pcmu(void) {
dtmfgen_enc_dec_tonedet("pcmu", 8000, 1);
}
static void dtmfgen_enc_dec_tonedet_isac() {
static void dtmfgen_enc_dec_tonedet_isac(void) {
bool_t supported = ms_filter_codec_supported("iSAC");
if( supported ) {
dtmfgen_enc_dec_tonedet("iSAC", 16000, 1);
......
......@@ -174,7 +174,7 @@ static void test_filterdesc_enable_disable_base(const char* mime, const char* fi
ms_filter_destroy(filter);
ms_exit();
}
static void test_filterdesc_enable_disable() {
static void test_filterdesc_enable_disable(void) {
test_filterdesc_enable_disable_base("pcmu", "MSUlawDec", FALSE);
test_filterdesc_enable_disable_base("pcma", "MSAlawEnc", TRUE);
}
......
......@@ -21,12 +21,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msmediaplayer.h"
#include "mediastreamer2/mediastream.h"
static int tester_before_all() {
static int tester_before_all(void) {
ms_init();
return 0;
}
static int tester_after_all() {
static int tester_after_all(void) {
ms_exit();
return 0;
}
......
......@@ -73,7 +73,7 @@ void text_stream_tester_set_local_ip(text_stream_tester_t* obj, const char* ip)
obj->local_ip = new_ip;
}
text_stream_tester_t* text_stream_tester_new() {
text_stream_tester_t* text_stream_tester_new(void) {
text_stream_tester_t* tst = ms_new0(text_stream_tester_t, 1);
text_stream_tester_set_local_ip(tst, "127.0.0.1");
tst->local_rtp = -1; /*random*/
......
......@@ -101,7 +101,7 @@ void video_stream_tester_set_local_ip(video_stream_tester_t* obj,const char*ip)
obj->local_ip=new_ip;
}
video_stream_tester_t* video_stream_tester_new() {
video_stream_tester_t* video_stream_tester_new(void) {
video_stream_tester_t* vst = ms_new0(video_stream_tester_t,1);
video_stream_tester_set_local_ip(vst,"127.0.0.1");
vst->cam = ms_web_cam_manager_get_cam(ms_web_cam_manager_get(), "StaticImage: Static picture");
......
......@@ -153,7 +153,7 @@ typedef struct _MediastreamDatas {
// MAIN METHODS
/* init default arguments */
MediastreamDatas* init_default_args();
MediastreamDatas* init_default_args(void);
/* parse args */
bool_t parse_args(int argc, char** argv, MediastreamDatas* out);
/* setup streams */
......@@ -279,7 +279,7 @@ int main(int argc, char * argv[])
#endif
MediastreamDatas* init_default_args() {
MediastreamDatas* init_default_args(void) {
MediastreamDatas* args = (MediastreamDatas*)ms_malloc0(sizeof(MediastreamDatas));
args->localport=0;
args->remoteport=0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment