From: Navarrop Date: Wed, 26 Oct 2011 14:26:03 +0000 (+0200) Subject: Ensure windows combatibility. X-Git-Tag: exp_20120216~540^2~5^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/17984019babd9a2db099daebc0e46e8bc74909b9 Ensure windows combatibility. s_host is already an used variable. --- diff --git a/src/include/surf/surfxml_parse_values.h b/src/include/surf/surfxml_parse_values.h index 782c2d8847..1d9c5ebc3b 100644 --- a/src/include/surf/surfxml_parse_values.h +++ b/src/include/surf/surfxml_parse_values.h @@ -1,9 +1,8 @@ -/* - * surfxml_parse_values.h - * - * Created on: 24 oct. 2011 - * Author: navarrop - */ +/* Copyright (c) 2011. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ #ifndef SURFXML_PARSE_VALUES_H_ #define SURFXML_PARSE_VALUES_H_ @@ -56,8 +55,8 @@ typedef struct s_router { char* V_router_coord; } s_router_t; -typedef struct s_host *host_t; -typedef struct s_host { +typedef struct s_hostSG *hostSG_t; +typedef struct s_hostSG { char* V_host_id; //id double V_host_power_peak; //power int V_host_core; //core @@ -66,9 +65,9 @@ typedef struct s_host { e_surf_resource_state_t V_host_state_initial; //state tmgr_trace_t V_host_state_trace; //state file char* V_host_coord; -} s_host_t; +} s_hostSG_t; -extern host_t struct_host; +extern hostSG_t struct_host; extern router_t struct_router; extern cluster_t struct_cluster; extern peer_t struct_peer; diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c index 4371113acb..744d9041fd 100644 --- a/src/instr/instr_routing.c +++ b/src/instr/instr_routing.c @@ -190,19 +190,19 @@ static void instr_routing_parse_start_link () { container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1); - double bandwidth_value = lnk->V_link_bandwidth; - double latency_value = lnk->V_link_latency; + double bandwidth_value = struct_lnk->V_link_bandwidth; + double latency_value = struct_lnk->V_link_latency; xbt_dynar_t links_to_create = xbt_dynar_new (sizeof(char*), &xbt_free_ref); - if (lnk->V_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX){ - char *up = bprintf("%s_UP", lnk->V_link_id); - char *down = bprintf("%s_DOWN", lnk->V_link_id); + if (struct_lnk->V_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX){ + char *up = bprintf("%s_UP", struct_lnk->V_link_id); + char *down = bprintf("%s_DOWN", struct_lnk->V_link_id); xbt_dynar_push_as (links_to_create, char*, xbt_strdup(up)); xbt_dynar_push_as (links_to_create, char*, xbt_strdup(down)); free (up); free (down); }else{ - xbt_dynar_push_as (links_to_create, char*, strdup(lnk->V_link_id)); + xbt_dynar_push_as (links_to_create, char*, strdup(struct_lnk->V_link_id)); } char *link_name = NULL; @@ -232,11 +232,11 @@ static void instr_routing_parse_end_link () static void instr_routing_parse_start_host () { container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1); - container_t new = newContainer (host->V_host_id, INSTR_HOST, father); + container_t new = newContainer (struct_host->V_host_id, INSTR_HOST, father); if (TRACE_categorized() || TRACE_uncategorized()) { type_t power = getVariableType ("power", NULL, new->type); - new_pajeSetVariable (0, new, power, host->V_host_power_peak); + new_pajeSetVariable (0, new, power, struct_host->V_host_power_peak); } if (TRACE_uncategorized()){ getVariableType ("power_used", "0.5 0.5 0.5", new->type); @@ -277,7 +277,7 @@ static void instr_routing_parse_end_host () static void instr_routing_parse_start_router () { container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1); - newContainer (router->V_router_id, INSTR_ROUTER, father); + newContainer (struct_router->V_router_id, INSTR_ROUTER, father); } static void instr_routing_parse_end_router () diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index e6732d8c74..a6eb9abfa8 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -11,7 +11,7 @@ #include "surf/surfxml_parse_private.h" #include "surf/surf_private.h" -host_t struct_host; +hostSG_t struct_host; router_t struct_router; cluster_t struct_cluster; peer_t struct_peer; @@ -314,7 +314,7 @@ void STag_surfxml_platform(void) void STag_surfxml_host(void){ // XBT_INFO("STag_surfxml_host [%s]",A_surfxml_host_id); - struct_host = xbt_new0(s_host_t, 1); + struct_host = xbt_new0(s_hostSG_t, 1); struct_host->V_host_id = xbt_strdup(A_surfxml_host_id); struct_host->V_host_power_peak = get_cpu_power(A_surfxml_host_power); surf_parse_get_double(&(struct_host->V_host_power_scale), A_surfxml_host_availability);