msg_process_t process = MSG_process_from_PID(pid);
if (not process) {
- jxbt_throw_process_not_found(env, bprintf("PID = %d",static_cast<int>(pid)));
+ jxbt_throw_process_not_found(env, std::string("PID = ") + std::to_string(static_cast<int>(pid)));
return nullptr;
}
/* try to suspend the process */
msg_error_t rv = MSG_process_suspend(process);
- jxbt_check_res("MSG_process_suspend()", rv, MSG_OK, bprintf("unexpected error , please report this bug"));
+ jxbt_check_res("MSG_process_suspend()", rv, MSG_OK, "unexpected error , please report this bug");
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume(JNIEnv * env, jobject jprocess)
/* try to resume the process */
msg_error_t res = MSG_process_resume(process);
- jxbt_check_res("MSG_process_resume()", res, MSG_OK, bprintf("unexpected error , please report this bug"));
+ jxbt_check_res("MSG_process_resume()", res, MSG_OK, "unexpected error , please report this bug");
}
JNIEXPORT void
msg_error_t rv = MSG_task_cancel(ptask);
- jxbt_check_res("MSG_task_cancel()", rv, MSG_OK, bprintf("unexpected error , please report this bug"));
+ jxbt_check_res("MSG_task_cancel()", rv, MSG_OK, "unexpected error , please report this bug");
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute(JNIEnv * env, jobject jtask)
void ClusterZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int /*rank*/, int position)
{
- char* link_id = bprintf("%s_link_%d", cluster->id, id);
+ std::string link_id = std::string(cluster->id) + "_link_" + std::to_string(id);
LinkCreationArgs link;
link.id = link_id;
if (link.policy == SURF_LINK_FULLDUPLEX) {
std::string tmp_link = std::string(link_id) + "_UP";
linkUp = surf::LinkImpl::byName(tmp_link);
- tmp_link = bprintf("%s_DOWN", link_id);
+ tmp_link = std::string(link_id) + "_DOWN";
linkDown = surf::LinkImpl::byName(tmp_link);
} else {
linkUp = surf::LinkImpl::byName(link_id);
linkDown = linkUp;
}
- xbt_free(link_id);
privateLinks_.insert({position, {linkUp, linkDown}});
}
}