From: quasar Date: Mon, 5 Nov 2007 10:49:00 +0000 (+0000) Subject: cleared warn: init discards pointer... X-Git-Tag: v3.3~855 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/647db997657e0682964d52235ddce9d20afc8832 cleared warn: init discards pointer... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4966 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/gras/properties/gras_prop.c b/examples/gras/properties/gras_prop.c index fa74db454e..6ad2d410e3 100644 --- a/examples/gras/properties/gras_prop.c +++ b/examples/gras/properties/gras_prop.c @@ -19,7 +19,7 @@ int client(int argc, char *argv[]) { } /* Try to get a property that does not exist */ - char *noexist="Nonexisent"; + char noexist[]="Nonexisent"; const char *value = gras_process_property_value(noexist); if ( value == NULL) INFO1("Process property: %s is undefined", noexist); @@ -28,7 +28,7 @@ int client(int argc, char *argv[]) { /* Modify an existing property. First check it exists */\ INFO0("Trying to modify a process property"); - char *exist="otherprop"; + char exist[]="otherprop"; value = gras_process_property_value(exist); if ( value == NULL) INFO1("\tProperty: %s is undefined", exist); @@ -62,7 +62,7 @@ int server(int argc, char *argv[]) { } /* Try to get a property that does not exist */ - char *noexist="Nonexisent"; + char noexist[]="Nonexisent"; const char *value = gras_os_host_property_value(noexist); if ( value == NULL) INFO1("Host property: %s is undefined", noexist); diff --git a/examples/msg/properties/msg_prop.c b/examples/msg/properties/msg_prop.c index 960aced84f..8547755249 100644 --- a/examples/msg/properties/msg_prop.c +++ b/examples/msg/properties/msg_prop.c @@ -79,16 +79,16 @@ int master(int argc, char *argv[]) } /* Try to get a property that does not exist */ - char *noexist="Unknown"; - const char*value = MSG_host_get_property_value(slaves[i-4],noexist); + char noexist[]="Unknown"; + const char*value = MSG_host_get_property_value(slaves[i-4], noexist); if ( value == NULL) INFO2("Property: %s for host %s is undefined", noexist, argv[i]); else - INFO3("Property: %s for host %s has value: %s", noexist, argv[i], value); + INFO3("Property: %s for host %s has value: %s",(char*) noexist, argv[i], value); /* Modify an existing property test. First check it exists */\ INFO0("Trying to modify a host property"); - char *exist="Hdd"; + char exist[]="Hdd"; value = MSG_host_get_property_value(slaves[i-4],exist); if ( value == NULL) INFO1("\tProperty: %s is undefined", exist); @@ -147,7 +147,7 @@ int slave(int argc, char *argv[]) } /* Try to get a property that does not exist */ - char *noexist="UnknownProcessProp"; + char noexist[]="UnknownProcessProp"; const char *value = MSG_process_get_property_value(MSG_process_self(),noexist); if ( value == NULL) INFO2("Property: %s for process %s is undefined", noexist, MSG_process_get_name(MSG_process_self())); diff --git a/examples/simdag/properties/sd_prop.c b/examples/simdag/properties/sd_prop.c index 5816cbf9a2..131d9f0fad 100755 --- a/examples/simdag/properties/sd_prop.c +++ b/examples/simdag/properties/sd_prop.c @@ -54,7 +54,7 @@ int main(int argc, char **argv) { } /* Try to get a property that does not exist */ - char *noexist="NoProp"; + char noexist[]="NoProp"; const char *value = SD_workstation_get_property_value(w1,noexist); if ( value == NULL) INFO1("\tProperty: %s is undefined", noexist); @@ -74,7 +74,7 @@ int main(int argc, char **argv) { /* Modify an existing property test. First check it exists */\ INFO0("Modify an host existing property"); - char *exist="Hdd"; + char exist[]="Hdd"; value = SD_workstation_get_property_value(w2,exist); if ( value == NULL) INFO1("\tProperty: %s is undefined", exist);