Commit d5c088ac authored by Ghislain MARY's avatar Ghislain MARY

Fix strict-prototypes warnings.

parent e0ccb8c2
This diff is collapsed.
......@@ -37,7 +37,7 @@ typedef struct belle_sip_dict belle_sip_dict_t;
* @note The object is not owned by default.
* @note all belle_sip_dict_set_* functions will overwrite existing values.
*/
BELLESIP_EXPORT belle_sip_dict_t* belle_sip_dict_create();
BELLESIP_EXPORT belle_sip_dict_t* belle_sip_dict_create(void);
/**
* @brief belle_sip_dict_set_int stores an integer into the dictionary
......
......@@ -31,7 +31,7 @@ BELLE_SIP_BEGIN_DECLS
/**
*
*/
BELLESIP_EXPORT belle_generic_uri_t* belle_generic_uri_new();
BELLESIP_EXPORT belle_generic_uri_t* belle_generic_uri_new(void);
/**
*
......
This diff is collapsed.
......@@ -32,7 +32,7 @@ BELLE_SIP_BEGIN_DECLS
* @param ... optional list of belle_sip_header_t* to be included in the request, ending with NULL.
*/
BELLESIP_EXPORT belle_http_request_t *belle_http_request_create(const char *method, belle_generic_uri_t *uri, ...);
BELLESIP_EXPORT belle_http_request_t* belle_http_request_new();
BELLESIP_EXPORT belle_http_request_t* belle_http_request_new(void);
BELLESIP_EXPORT belle_http_request_t* belle_http_request_parse(const char* raw);
BELLESIP_EXPORT int belle_http_request_is_cancelled(const belle_http_request_t *req);
......
......@@ -39,7 +39,7 @@ BELLESIP_EXPORT belle_sip_message_t* belle_sip_message_parse_raw (const char* bu
BELLESIP_EXPORT int belle_sip_message_is_request(belle_sip_message_t *msg);
BELLESIP_EXPORT belle_sip_request_t* belle_sip_request_new();
BELLESIP_EXPORT belle_sip_request_t* belle_sip_request_new(void);
BELLESIP_EXPORT belle_sip_request_t* belle_sip_request_parse(const char* raw);
BELLESIP_EXPORT belle_sip_request_t* belle_sip_request_create(belle_sip_uri_t *requri, const char* method,
......
......@@ -439,7 +439,7 @@ BELLE_SIP_BEGIN_DECLS
**/
BELLESIP_EXPORT belle_sip_object_pool_t * belle_sip_object_pool_push(void);
belle_sip_object_pool_t * belle_sip_object_pool_get_current();
belle_sip_object_pool_t * belle_sip_object_pool_get_current(void);
int belle_sip_object_pool_cleanable(belle_sip_object_pool_t *pool);
void belle_sip_object_pool_clean(belle_sip_object_pool_t *obj);
......
......@@ -29,7 +29,7 @@ BELLE_SIP_BEGIN_DECLS
*
*/
belle_sip_parameters_t* belle_sip_parameters_new();
belle_sip_parameters_t* belle_sip_parameters_new(void);
/*
* remove all parameters */
BELLESIP_EXPORT void belle_sip_parameters_clean(belle_sip_parameters_t* params);
......
......@@ -29,7 +29,7 @@ BELLE_SIP_BEGIN_DECLS
/**
*
*/
BELLESIP_EXPORT belle_sip_uri_t* belle_sip_uri_new();
BELLESIP_EXPORT belle_sip_uri_t* belle_sip_uri_new(void);
/**
*
......
......@@ -153,7 +153,7 @@ static BELLESIP_INLINE void BELLE_SIP_CHECK_FORMAT_ARGS(1,2) belle_sip_fatal(con
BELLESIP_EXPORT void belle_sip_set_log_file(FILE *file);
BELLESIP_EXPORT void belle_sip_set_log_handler(belle_sip_log_function_t func);
BELLESIP_EXPORT belle_sip_log_function_t belle_sip_get_log_handler();
BELLESIP_EXPORT belle_sip_log_function_t belle_sip_get_log_handler(void);
BELLESIP_EXPORT char * BELLE_SIP_CHECK_FORMAT_ARGS(1,2) belle_sip_strdup_printf(const char *fmt,...);
BELLESIP_EXPORT char * belle_sip_strcat_vprintf(char* dst, const char *fmt, va_list ap);
......@@ -172,7 +172,7 @@ BELLESIP_EXPORT char * belle_sip_octets_to_text(const unsigned char *hash, size_
BELLESIP_EXPORT char * belle_sip_create_tag(char *ret, size_t size);
BELLESIP_EXPORT const char* belle_sip_version_to_string();
BELLESIP_EXPORT const char* belle_sip_version_to_string(void);
/**
* Returns string without surrounding quotes if any, else just call belle_sip_strdup().
......
......@@ -991,7 +991,7 @@ belle_sip_error_code belle_sip_headers_marshal(belle_sip_message_t *message, cha
******************************/
typedef struct _belle_sip_header_extension belle_sip_header_extension_t;
belle_sip_header_extension_t* belle_sip_header_extension_new();
belle_sip_header_extension_t* belle_sip_header_extension_new(void);
belle_sip_header_extension_t* belle_sip_header_extension_parse (const char* extension) ;
belle_sip_header_extension_t* belle_sip_header_extension_create (const char* name,const char* value);
......
......@@ -618,7 +618,6 @@ static int resolver_process_data_delayed(belle_sip_simple_resolver_context_t *ct
}
static int _resolver_start_query(belle_sip_simple_resolver_context_t *ctx) {
struct dns_hints *(*hints)() = &dns_hints_local;
struct dns_options opts;
int error;
struct dns_resolv_conf *conf;
......@@ -637,7 +636,7 @@ static int _resolver_start_query(belle_sip_simple_resolver_context_t *ctx) {
memset(&opts, 0, sizeof opts);
if (!(ctx->R = dns_res_open(ctx->resconf, ctx->hosts, dns_hints_mortal(hints(ctx->resconf, &error)), cache(ctx), &opts, &error))) {
if (!(ctx->R = dns_res_open(ctx->resconf, ctx->hosts, dns_hints_mortal(dns_hints_local(ctx->resconf, &error)), cache(ctx), &opts, &error))) {
belle_sip_error("%s dns_res_open error [%s]: %s", __FUNCTION__, ctx->name, dns_strerror(error));
return -1;
}
......
......@@ -598,7 +598,7 @@ char * belle_sip_strdup(const char *s){
#ifndef _WIN32
static int find_best_clock_id () {
static int find_best_clock_id (void) {
#if 0
struct timespec ts;
static int clock_id=-1;
......@@ -922,7 +922,7 @@ static void print_noescapes_map(char noescapes[BELLE_SIP_NO_ESCAPES_SIZE], const
}
*/
static const char *get_sip_uri_username_noescapes() {
static const char *get_sip_uri_username_noescapes(void) {
static char noescapes[BELLE_SIP_NO_ESCAPES_SIZE] = {0};
if (noescapes[BELLE_SIP_NO_ESCAPES_SIZE-1] == 0) {
// concurrent initialization should not be an issue
......@@ -948,7 +948,7 @@ static const char *get_sip_uri_username_noescapes() {
* password = *( unreserved / escaped /
"&" / "=" / "+" / "$" / "," )
* */
static const char *get_sip_uri_userpasswd_noescapes() {
static const char *get_sip_uri_userpasswd_noescapes(void) {
static char noescapes[BELLE_SIP_NO_ESCAPES_SIZE] = {0};
if (noescapes[BELLE_SIP_NO_ESCAPES_SIZE-1] == 0) {
// unreserved
......@@ -962,7 +962,7 @@ static const char *get_sip_uri_userpasswd_noescapes() {
return noescapes;
}
static const char *get_sip_uri_parameter_noescapes() {
static const char *get_sip_uri_parameter_noescapes(void) {
static char noescapes[BELLE_SIP_NO_ESCAPES_SIZE] = {0};
if (noescapes[BELLE_SIP_NO_ESCAPES_SIZE-1] == 0) {
/*
......@@ -994,7 +994,7 @@ static const char *get_sip_uri_parameter_noescapes() {
}
return noescapes;
}
static const char *get_sip_uri_header_noescapes() {
static const char *get_sip_uri_header_noescapes(void) {
static char noescapes[BELLE_SIP_NO_ESCAPES_SIZE] = {0};
if (noescapes[BELLE_SIP_NO_ESCAPES_SIZE-1] == 0) {
/*
......@@ -1065,7 +1065,7 @@ char* belle_sip_uri_to_escaped_header(const char* buff) {
/*uri (I.E RFC 2396)*/
static const char *get_generic_uri_query_noescapes() {
static const char *get_generic_uri_query_noescapes(void) {
static char noescapes[BELLE_SIP_NO_ESCAPES_SIZE] = {0};
if (noescapes[BELLE_SIP_NO_ESCAPES_SIZE-1] == 0) {
/*
......@@ -1092,7 +1092,7 @@ static const char *get_generic_uri_query_noescapes() {
return noescapes;
}
static const char *get_generic_uri_path_noescapes() {
static const char *get_generic_uri_path_noescapes(void) {
static char noescapes[BELLE_SIP_NO_ESCAPES_SIZE] = {0};
if (noescapes[BELLE_SIP_NO_ESCAPES_SIZE-1] == 0) {
/*
......
......@@ -3316,6 +3316,11 @@ size_t dns_txt_print(void *dst_, size_t lim, struct dns_txt *txt) {
} /* dns_txt_print() */
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#pragma GCC diagnostic push
#endif
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
static const struct {
enum dns_type type;
const char *name;
......@@ -3339,6 +3344,10 @@ static const struct {
{ DNS_T_SSHFP, "SSHFP", &dns_sshfp_parse, &dns_sshfp_push, &dns_sshfp_cmp, &dns_sshfp_print, 0 },
}; /* dns_rrtypes[] */
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#pragma GCC diagnostic pop
#endif
union dns_any *dns_any_init(union dns_any *any, size_t size) {
return (union dns_any *)dns_txt_init(&any->rdata, size);
......
......@@ -519,7 +519,7 @@ struct dns_rr_i {
int follow;
int (*sort)();
int (*sort)(struct dns_rr *, struct dns_rr *, struct dns_rr_i *, struct dns_packet *);
unsigned args[2];
struct {
......
......@@ -57,7 +57,7 @@ static unsigned int wait_for(belle_sip_stack_t *stack, int *current_value, int
else return TRUE;
}
static endpoint_t* create_endpoint() {
static endpoint_t* create_endpoint(void) {
endpoint_t* endpoint;
endpoint = belle_sip_new0(endpoint_t);
endpoint->stack = belle_sip_stack_new(NULL);
......
......@@ -49,8 +49,8 @@ const char * belle_sip_tester_get_root_ca_path(void);
void belle_sip_tester_set_root_ca_path(const char *root_ca_path);
void belle_sip_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args));
void belle_sip_tester_uninit(void);
void belle_sip_tester_before_each();
void belle_sip_tester_after_each();
void belle_sip_tester_before_each(void);
void belle_sip_tester_after_each(void);
int belle_sip_tester_set_log_file(const char *filename);
#ifdef __cplusplus
......
......@@ -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
......
......@@ -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, ...);
......
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