Răsfoiți Sursa

totem*: add "const" to avoid 1 more warning

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1935 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 ani în urmă
părinte
comite
f7152d349a
3 a modificat fișierele cu 7 adăugiri și 8 ștergeri
  1. 2 2
      exec/totemconfig.c
  2. 2 4
      exec/totemip.c
  3. 3 2
      include/corosync/totem/totemip.h

+ 2 - 2
exec/totemconfig.c

@@ -91,7 +91,7 @@ static void add_totem_config_notification(
 static inline int objdb_get_string (
 static inline int objdb_get_string (
 	struct objdb_iface_ver0 *objdb,
 	struct objdb_iface_ver0 *objdb,
 	hdb_handle_t object_service_handle,
 	hdb_handle_t object_service_handle,
-	const char *key, char **value)
+	const char *key, const char **value)
 {
 {
 	int res;
 	int res;
 
 
@@ -226,7 +226,7 @@ extern int totem_config_read (
 	int res = 0;
 	int res = 0;
 	hdb_handle_t object_totem_handle;
 	hdb_handle_t object_totem_handle;
 	hdb_handle_t object_interface_handle;
 	hdb_handle_t object_interface_handle;
-	char *str;
+	const char *str;
 	unsigned int ringnumber = 0;
 	unsigned int ringnumber = 0;
 	hdb_handle_t object_find_interface_handle;
 	hdb_handle_t object_find_interface_handle;
 
 

+ 2 - 4
exec/totemip.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2005-2007 Red Hat, Inc.
+ * Copyright (c) 2005-2007, 2009 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -256,7 +256,7 @@ int totemip_totemip_to_sockaddr_convert(struct totem_ip_address *ip_addr,
 /* Converts an address string string into a totem_ip_address.
 /* Converts an address string string into a totem_ip_address.
    family can be AF_INET, AF_INET6 or 0 ("for "don't care")
    family can be AF_INET, AF_INET6 or 0 ("for "don't care")
 */
 */
-int totemip_parse(struct totem_ip_address *totemip, char *addr, int family)
+int totemip_parse(struct totem_ip_address *totemip, const char *addr, int family)
 {
 {
 	struct addrinfo *ainfo;
 	struct addrinfo *ainfo;
 	struct addrinfo ahints;
 	struct addrinfo ahints;
@@ -536,5 +536,3 @@ finished:
 	return 0;
 	return 0;
 }
 }
 #endif /* COROSYNC_LINUX */
 #endif /* COROSYNC_LINUX */
-
-

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

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2005-2007 Red Hat, Inc.
+ * Copyright (c) 2005-2007, 2009 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -71,7 +71,8 @@ extern const char *totemip_print(struct totem_ip_address *addr);
 extern int totemip_sockaddr_to_totemip_convert(struct sockaddr_storage *saddr, struct totem_ip_address *ip_addr);
 extern int totemip_sockaddr_to_totemip_convert(struct sockaddr_storage *saddr, struct totem_ip_address *ip_addr);
 extern int totemip_totemip_to_sockaddr_convert(struct totem_ip_address *ip_addr,
 extern int totemip_totemip_to_sockaddr_convert(struct totem_ip_address *ip_addr,
 					       uint16_t port, struct sockaddr_storage *saddr, int *addrlen);
 					       uint16_t port, struct sockaddr_storage *saddr, int *addrlen);
-extern int totemip_parse(struct totem_ip_address *totemip, char *addr, int family);
+extern int totemip_parse(struct totem_ip_address *totemip, const char *addr,
+			 int family);
 extern int totemip_iface_check(struct totem_ip_address *bindnet, struct totem_ip_address *boundto, int *interface_up, int *interface_num, int mask_high_bit);
 extern int totemip_iface_check(struct totem_ip_address *bindnet, struct totem_ip_address *boundto, int *interface_up, int *interface_num, int mask_high_bit);
 
 
 /* These two simulate a zero in_addr by clearing the family field */
 /* These two simulate a zero in_addr by clearing the family field */