Quellcode durchsuchen

Remove const warnings from main.c.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1812 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake vor 17 Jahren
Ursprung
Commit
6895160788
6 geänderte Dateien mit 22 neuen und 20 gelöschten Zeilen
  1. 2 2
      exec/main.c
  2. 4 7
      exec/mainconfig.c
  3. 6 1
      exec/mainconfig.h
  4. 4 4
      exec/totemconfig.c
  5. 3 3
      exec/totemconfig.h
  6. 3 3
      include/corosync/engine/config.h

+ 2 - 2
exec/main.c

@@ -450,7 +450,7 @@ int main_mcast (
 
 int main (int argc, char **argv)
 {
-	char *error_string;
+	const char *error_string;
 	struct main_config main_config;
 	struct totem_config totem_config;
 	hdb_handle_t objdb_handle;
@@ -459,7 +459,7 @@ int main (int argc, char **argv)
 	void *objdb_p;
 	struct config_iface_ver0 *config;
 	void *config_p;
-	char *config_iface;
+	const char *config_iface;
 	char *iface;
 	int res, ch;
 	int background, setprio;

+ 4 - 7
exec/mainconfig.c

@@ -107,18 +107,15 @@ static struct logsys_config_struct {
 	unsigned int tags;
 } logsys_logger;
 
-
-
-
 int corosync_main_config_read_logging (
 	struct objdb_iface_ver0 *objdb,
-	char **error_string,
+	const char **error_string,
 	struct main_config *main_config)
 {
 	hdb_handle_t object_service_handle;
 	hdb_handle_t object_logger_subsys_handle;
 	char *value;
-	char *error_reason = error_string_response;
+	const char *error_reason = error_string_response;
 	hdb_handle_t object_find_handle;
 	hdb_handle_t object_find_logsys_handle;
 
@@ -312,7 +309,7 @@ static int gid_determine (char *req_group)
 
 int corosync_main_config_read (
 	struct objdb_iface_ver0 *objdb,
-	char **error_string,
+	const char **error_string,
 	struct main_config *main_config)
 {
 	hdb_handle_t object_service_handle;
@@ -376,7 +373,7 @@ static void main_objdb_reload_notify(objdb_reload_notify_type_t type, int flush,
 				     void *priv_data_pt)
 {
 	struct main_config *main_config = priv_data_pt;
-	char *error_string;
+	const char *error_string;
 
 	if (type == OBJDB_RELOAD_NOTIFY_END) {
 

+ 6 - 1
exec/mainconfig.h

@@ -65,9 +65,14 @@ struct main_config {
 	int gid;
 };
 
+int corosync_main_config_read_logging (
+	struct objdb_iface_ver0 *objdb,
+	const char **error_string,
+	struct main_config *main_config);
+
 extern int corosync_main_config_read (
 	struct objdb_iface_ver0 *objdb,
-	char **error_string,
+	const char **error_string,
 	struct main_config *main_config);
 
 #endif /* MAINCONFIG_H_DEFINED */

+ 4 - 4
exec/totemconfig.c

@@ -217,7 +217,7 @@ static void totem_volatile_config_read (
 extern int totem_config_read (
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
-	char **error_string)
+	const char **error_string)
 {
 	int res = 0;
 	hdb_handle_t object_totem_handle;
@@ -324,7 +324,7 @@ printf ("couldn't find totem handle\n");
 
 int totem_config_validate (
 	struct totem_config *totem_config,
-	char **error_string)
+	const char **error_string)
 {
 	static char local_error_reason[512];
 	char parse_error[512];
@@ -582,7 +582,7 @@ parse_error:
 static int read_keyfile (
 	char *key_location,
 	struct totem_config *totem_config,
-	char **error_string)
+	const char **error_string)
 {
 	int fd;
 	int res;
@@ -620,7 +620,7 @@ parse_error:
 int totem_config_keyread (
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
-	char **error_string)
+	const char **error_string)
 {
 	int got_key = 0;
 	char *key_location = NULL;

+ 3 - 3
exec/totemconfig.h

@@ -47,15 +47,15 @@
 extern int totem_config_read (
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
-	char **error_string);
+	const char **error_string);
 	
 extern int totem_config_validate (
 	struct totem_config *totem_config,
-	char **error_string);
+	const char **error_string);
 
 int totem_config_keyread (
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
-	char **error_string);
+	const char **error_string);
 
 #endif /* TOTEMCONFIG_H_DEFINED */

+ 3 - 3
include/corosync/engine/config.h

@@ -36,9 +36,9 @@
 #define CONFIG_H_DEFINED
 
 struct config_iface_ver0 {
-	int (*config_readconfig) (struct objdb_iface_ver0 *objdb, char **error_string);
-	int (*config_writeconfig) (struct objdb_iface_ver0 *objdb, char **error_string);
-	int (*config_reloadconfig) (struct objdb_iface_ver0 *objdb, int flush, char **error_string);
+	int (*config_readconfig) (struct objdb_iface_ver0 *objdb, const char **error_string);
+	int (*config_writeconfig) (struct objdb_iface_ver0 *objdb, const char **error_string);
+	int (*config_reloadconfig) (struct objdb_iface_ver0 *objdb, int flush, const char **error_string);
 };