Просмотр исходного кода

Remove const/nonconst assignment warnings in totemnet.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1801 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 17 лет назад
Родитель
Сommit
3c3c11426e
3 измененных файлов с 14 добавлено и 11 удалено
  1. 10 7
      exec/totemnet.c
  2. 1 1
      exec/totemnet.h
  3. 3 3
      include/corosync/totem/totem.h

+ 10 - 7
exec/totemnet.c

@@ -139,8 +139,11 @@ struct totemnet_instance {
 
 	int totemnet_subsys_id;
 
-	void (*totemnet_log_printf) (int subsys, char *function, char *file,
-		int line, unsigned int level, char *format,
+	void (*totemnet_log_printf) (int subsys,
+		const char *function,
+		const char *file,
+		int line, unsigned int level,
+		const char *format,
 		...)__attribute__((format(printf, 6, 7)));
 
 	hdb_handle_t handle;
@@ -233,8 +236,8 @@ static void totemnet_instance_initialize (struct totemnet_instance *instance)
 #define log_printf(level, format, args...)				\
 do {									\
         instance->totemnet_log_printf (instance->totemnet_subsys_id,	\
-                (char *)__FUNCTION__, __FILE__, __LINE__, level,	\
-                format, ##args);					\
+                __FUNCTION__, __FILE__, __LINE__,			\
+		level, (const char *)format, ##args);			\
 } while (0);
 
 static int authenticate_and_decrypt (
@@ -1441,10 +1444,10 @@ extern void totemnet_net_mtu_adjust (struct totem_config *totem_config)
 	}
 }
 
-char *totemnet_iface_print (hdb_handle_t handle)  {
+const char *totemnet_iface_print (hdb_handle_t handle)  {
 	struct totemnet_instance *instance;
 	int res = 0;
-	char *ret_char;
+	const char *ret_char;
 
 	res = hdb_handle_get (&totemnet_instance_database, handle,
 		(void *)&instance);
@@ -1453,7 +1456,7 @@ char *totemnet_iface_print (hdb_handle_t handle)  {
 		goto error_exit;
 	}
 	
-	ret_char = (char *)totemip_print (&instance->my_id);
+	ret_char = totemip_print (&instance->my_id);
 
 	hdb_handle_put (&totemnet_instance_database, handle);
 error_exit:

+ 1 - 1
exec/totemnet.h

@@ -95,7 +95,7 @@ extern int totemnet_finalize (hdb_handle_t handle);
 
 extern void totemnet_net_mtu_adjust (struct totem_config *totem_config);
 
-extern char *totemnet_iface_print (hdb_handle_t handle);
+extern const char *totemnet_iface_print (hdb_handle_t handle);
 
 extern int totemnet_iface_get (
 	hdb_handle_t handle,

+ 3 - 3
include/corosync/totem/totem.h

@@ -60,11 +60,11 @@ struct totem_interface {
 struct totem_logging_configuration {
         void (*log_printf) (
                 int subsys,
-                char *function_name,
-                char *file_name,
+                const char *function_name,
+                const char *file_name,
                 int file_line,
                 unsigned int level,
-                char *format,
+                const char *format,
                 ...) __attribute__((format(printf, 6, 7)));
 
 	int log_level_security;