- Uppercase the literal suffix.
- Remove the unused declaration of type "smx_host_priv_t".
- Move this "namespace" out of the 'extern "C"' declaration.
void get_status(char **status, unsigned int bitfield){
for(int i=FILE_PIECES-1; i>=0; i--)
- (*status)[i] = (bitfield&(1u<<i))? '1': '0';
+ (*status)[i] = (bitfield & (1U << i)) ? '1' : '0';
(*status)[FILE_PIECES] = '\0';
}
void update_pieces_count_from_bitfield(peer_t peer, unsigned int bitfield)
{
for (int i = 0; i < FILE_PIECES; i++) {
- if ((bitfield&(1u<<i))) {
+ if ((bitfield & (1U << i))) {
peer->pieces_count[i]++;
}
}
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;
typedef struct Link Link;
typedef struct Trace tmgr_Trace;
-typedef struct simix_Host *smx_host_priv_t;
#endif
typedef simgrid_NetZone* NetZone_t;
#include <xbt/Extendable.hpp>
-SG_BEGIN_DECL()
-
/**************** datatypes **********************************/
/**************************** Host Extension *********************************/
namespace simgrid {
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);
/** @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>();
+ simgrid::simix::Host* host = h->extension<simgrid::simix::Host>();
xbt_assert((host != nullptr), "Invalid parameters");