Add const, fix warnings.

SVN revision: 26976
This commit is contained in:
Kim Woelders 2006-11-05 16:49:55 +00:00
parent 91e6ee5f66
commit 7c4d58dbdf
5 changed files with 21 additions and 4 deletions

View File

@ -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);

View File

@ -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))
{

View File

@ -28,6 +28,7 @@
*/
#include "Ecore.h"
#include "ecore_private.h"
#include "ecore_con_private.h"
#include <ctype.h>
#include <netinet/in.h>
@ -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;

View File

@ -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

View File

@ -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
}