Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into MC_LTL
[simgrid.git] / src / instr / jedule / jedule_events.c
index d781b38..bab0e0c 100644 (file)
@@ -9,17 +9,19 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "jedule_events.h"
-#include "jedule_platform.h"
-
 #include "xbt/dict.h"
 #include "xbt/dynar.h"
 #include "xbt/asserts.h"
 
+#include "instr/jedule/jedule_events.h"
+#include "instr/jedule/jedule_platform.h"
+
+#ifdef HAVE_JEDULE
+
 void jed_event_add_resources(jed_event_t event, xbt_dynar_t host_selection) {
        xbt_dynar_t resource_subset_list;
        jed_res_subset_t res_set;
-       int i;
+       unsigned int i;
 
        resource_subset_list = xbt_dynar_new(sizeof(jed_res_subset_t), NULL);
 
@@ -49,17 +51,15 @@ void jed_event_add_info(jed_event_t event, char *key, char *value) {
 
 
 void create_jed_event(jed_event_t *event, char *name, double start_time,
-               double end_time, char *type) {
+               double end_time, const char *type) {
 
        *event = (jed_event_t) calloc(1, sizeof(s_jed_event_t));
-       (*event)->name = (char*) calloc(strlen(name) + 1, sizeof(char));
-       strcpy((*event)->name, name);
+       (*event)->name = xbt_strdup(name);
 
        (*event)->start_time = start_time;
        (*event)->end_time = end_time;
 
-       (*event)->type = (char*) calloc(strlen(type) + 1, sizeof(char));
-       strcpy((*event)->type, type);
+       (*event)->type = xbt_strdup(type);
 
        (*event)->resource_subsets = xbt_dynar_new(sizeof(jed_res_subset_t), NULL);
        (*event)->characteristics_list = xbt_dynar_new(sizeof(char*), NULL);
@@ -80,3 +80,5 @@ void jed_event_free(jed_event_t event) {
 
        free(event);
 }
+
+#endif