summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
da7234e)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5153
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
#include "xbt/module.h"
#include <math.h>
#include "xbt/module.h"
#include <math.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
"Messages specific for surf example");
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
"Messages specific for surf example");
tmp_name = (char **) calloc(31, sizeof(char *));
tmp_name = (char **) calloc(31, sizeof(char *));
- for (i = 0; i < 31; i++) {
- tmp_name[i] = (char *) calloc(10, sizeof(char));
- }
/*
* Creates the constraints
*/
tmp_cnst = calloc(15, sizeof(lmm_constraint_t));
for (i = 0; i < 15; i++) {
/*
* Creates the constraints
*/
tmp_cnst = calloc(15, sizeof(lmm_constraint_t));
for (i = 0; i < 15; i++) {
- sprintf(tmp_name[i], "C_%03d", i);
+ tmp_name[i] = bprintf("C_%03d", i);
tmp_cnst[i] = lmm_constraint_new(Sys, (void *) tmp_name[i], B[i]);
}
tmp_cnst[i] = lmm_constraint_new(Sys, (void *) tmp_name[i], B[i]);
}
*/
tmp_var = calloc(16, sizeof(lmm_variable_t));
for (j = 0; j < 16; j++) {
*/
tmp_var = calloc(16, sizeof(lmm_variable_t));
for (j = 0; j < 16; j++) {
- sprintf(tmp_name[i + j], "X_%03d", j);
+ tmp_name[i + j] = bprintf("X_%03d", j);
tmp_var[j] =
lmm_variable_new(Sys, (void *) tmp_name[i + j], 1.0, -1.0, 15);
lmm_update_variable_latency(Sys, tmp_var[j], 1.0);
tmp_var[j] =
lmm_variable_new(Sys, (void *) tmp_name[i + j], 1.0, -1.0, 15);
lmm_update_variable_latency(Sys, tmp_var[j], 1.0);