From 7c4d58dbdfce7e3e98aebf110a8aeef68b2889c0 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sun, 5 Nov 2006 16:49:55 +0000 Subject: [PATCH] Add const, fix warnings. SVN revision: 26976 --- legacy/ecore/src/lib/ecore_con/Ecore_Con.h | 2 +- legacy/ecore/src/lib/ecore_con/ecore_con.c | 4 +++- legacy/ecore/src/lib/ecore_con/ecore_con_dns.c | 7 ++++++- legacy/ecore/src/lib/ecore_con/ecore_con_private.h | 1 + legacy/ecore/src/lib/ecore_con/ecore_con_url.c | 11 ++++++++++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h index 8b0857529e..186efa73b7 100644 --- a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h +++ b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h @@ -152,7 +152,7 @@ extern "C" { EAPI void *ecore_con_server_data_get(Ecore_Con_Server *svr); EAPI int ecore_con_server_connected_get(Ecore_Con_Server *svr); EAPI Ecore_List *ecore_con_server_clients_get(Ecore_Con_Server *svr); - EAPI int ecore_con_server_send(Ecore_Con_Server *svr, void *data, int size); + EAPI int ecore_con_server_send(Ecore_Con_Server *svr, const void *data, int size); EAPI void ecore_con_server_client_limit_set(Ecore_Con_Server *svr, int client_limit, char reject_excess_clients); EAPI char *ecore_con_server_ip_get(Ecore_Con_Server *svr); diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con.c b/legacy/ecore/src/lib/ecore_con/ecore_con.c index 6e6363a467..82f0d35848 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con.c @@ -50,7 +50,9 @@ EAPI int ECORE_CON_EVENT_SERVER_DATA = 0; static Ecore_List *servers = NULL; static int init_count = 0; +#if USE_OPENSSL static int ssl_init_count = 0; +#endif #define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path)) #define LENGTH_OF_ABSTRACT_SOCKADDR_UN(s, path) (strlen(path) + 1 + (size_t)(((struct sockaddr_un *)NULL)->sun_path)) @@ -647,7 +649,7 @@ ecore_con_server_clients_get(Ecore_Con_Server *svr) * @ingroup Ecore_Con_Server_Group */ EAPI int -ecore_con_server_send(Ecore_Con_Server *svr, void *data, int size) +ecore_con_server_send(Ecore_Con_Server *svr, const void *data, int size) { if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) { diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_dns.c b/legacy/ecore/src/lib/ecore_con/ecore_con_dns.c index 67da625f5e..7ebc32ad0b 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con_dns.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con_dns.c @@ -28,6 +28,7 @@ */ #include "Ecore.h" #include "ecore_private.h" +#include "ecore_con_private.h" #include #include @@ -72,6 +73,7 @@ struct _Ecore_Con_Dns_Cache { struct hostent *he; }; +#if 0 static void _ecore_con_dns_ghbn(Ecore_Con_Dns_Query *query, const char *hostname); static int _ecore_con_dns_timeout(void *data); static int _ecore_con_cb_fd_handler(void *data, Ecore_Fd_Handler *fd_handler); @@ -79,9 +81,11 @@ static void _ecore_con_dns_query_free(Ecore_Con_Dns_Query *query); static void _ecore_con_dns_cache_free(Ecore_Con_Dns_Cache *cache); static int _ecore_con_hostname_get(unsigned char *buf, char *hostname, int pos, int length); +#endif static int dns_init = 0; +#if 0 static struct in_addr servers[SERVERS]; static int server_count; @@ -93,6 +97,7 @@ static char *domain = NULL; static uint16_t dns_id = 0; static Ecore_Con_Dns_Cache *dns_cache = NULL; +#endif #define SET_16BIT(p, v) \ (((p)[0]) = ((v) >> 8) & 0xff), \ @@ -321,7 +326,7 @@ _ecore_con_dns_data_handler(void *data, Ecore_Fd_Handler *fd_handler) } static int -_ecore_con_dns_exit_handler(void *data, int type, void *event) +_ecore_con_dns_exit_handler(void *data, int type __UNUSED__, void *event) { CB_Data *cbdata; Ecore_Exe_Event_Del *ev; diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_private.h b/legacy/ecore/src/lib/ecore_con/ecore_con_private.h index cd17f10977..887d7e117d 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con_private.h +++ b/legacy/ecore/src/lib/ecore_con/ecore_con_private.h @@ -1,6 +1,7 @@ #ifndef _ECORE_CON_PRIVATE_H #define _ECORE_CON_PRIVATE_H +#include "Ecore_Con.h" #include "Ecore_Data.h" #define ECORE_MAGIC_CON_SERVER 0x77665544 diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_url.c b/legacy/ecore/src/lib/ecore_con/ecore_con_url.c index 592488bd20..fcb8503c57 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con_url.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con_url.c @@ -163,6 +163,7 @@ ecore_con_url_new(const char *url) return url_con; #else + url = NULL; return NULL; #endif } @@ -184,6 +185,8 @@ ecore_con_url_destroy(Ecore_Con_Url *url_con) curl_slist_free_all(url_con->headers); free(url_con->url); free(url_con); +#else + url_con = NULL; #endif } @@ -198,7 +201,9 @@ ecore_con_url_url_set(Ecore_Con_Url *url_con, const char *url) if (url) url_con->url = strdup(url); curl_easy_setopt(url_con->curl_easy, CURLOPT_URL, url_con->url); - +#else + url_con = NULL; + url = NULL; #endif return 1; } @@ -237,6 +242,10 @@ ecore_con_url_send(Ecore_Con_Url *url_con, void *data, size_t length, char *cont return _ecore_con_url_perform(url_con); #else + url_con = NULL; + data = NULL; + length = 0; + content_type = NULL; return 0; #endif }