From: Martin Quinson Date: Thu, 16 Feb 2017 00:27:45 +0000 (+0100) Subject: please sonar and cosmetics X-Git-Tag: v3_15~362 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/939a250d95df492a4ae10048a3ef6744c80187bc?ds=sidebyside;hp=2c648b0307268182ff491d65f001920c5640e55c please sonar and cosmetics - Uppercase the literal suffix. - Remove the unused declaration of type "smx_host_priv_t". - Move this "namespace" out of the 'extern "C"' declaration. --- diff --git a/examples/msg/app-bittorrent/peer.c b/examples/msg/app-bittorrent/peer.c index 7921e8ad35..deccdd6e50 100644 --- a/examples/msg/app-bittorrent/peer.c +++ b/examples/msg/app-bittorrent/peer.c @@ -48,7 +48,7 @@ int peer_is_not_downloading_piece(peer_t peer, unsigned int piece){ void get_status(char **status, unsigned int bitfield){ for(int i=FILE_PIECES-1; i>=0; i--) - (*status)[i] = (bitfield&(1u<pieces_count[i]++; } } diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index 9ebbda1d4a..b412700ea8 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -50,9 +50,6 @@ typedef simgrid::surf::Cpu surf_Cpu; typedef simgrid::surf::Resource surf_Resource; typedef simgrid::trace_mgr::trace tmgr_Trace; -typedef simgrid::simix::Host *smx_host_priv_t; - - #else typedef struct simgrid_NetZone simgrid_NetZone; @@ -64,7 +61,6 @@ typedef struct surf_Resource surf_Resource; typedef struct Link Link; typedef struct Trace tmgr_Trace; -typedef struct simix_Host *smx_host_priv_t; #endif typedef simgrid_NetZone* NetZone_t; diff --git a/src/msg/msg_private.h b/src/msg/msg_private.h index 394ed86873..79a7c921c5 100644 --- a/src/msg/msg_private.h +++ b/src/msg/msg_private.h @@ -14,8 +14,6 @@ #include -SG_BEGIN_DECL() - /**************** datatypes **********************************/ /**************************** Host Extension *********************************/ namespace simgrid { @@ -110,10 +108,11 @@ typedef struct MSG_Global { void_f_pvoid_t process_data_cleanup; } s_MSG_Global_t, *MSG_Global_t; -/*extern MSG_Global_t msg_global;*/ XBT_PUBLIC_DATA(MSG_Global_t) msg_global; /*************************************************************/ +SG_BEGIN_DECL() + XBT_PRIVATE msg_host_t __MSG_host_create(sg_host_t host); XBT_PRIVATE msg_storage_t __MSG_storage_create(smx_storage_t storage); XBT_PRIVATE void __MSG_storage_destroy(msg_storage_priv_t host); diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 1e5791c847..557251a81b 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -75,7 +75,7 @@ namespace simgrid { /** @brief Stop the host if it is on */ void SIMIX_host_off(sg_host_t h, smx_actor_t issuer) { - smx_host_priv_t host = h->extension(); + simgrid::simix::Host* host = h->extension(); xbt_assert((host != nullptr), "Invalid parameters");