A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'coverity_scan' of github.com:mquinson/simgrid
[simgrid.git]
/
examples
/
simdag
/
dot
/
dot_test2.c
diff --git
a/examples/simdag/dot/dot_test2.c
b/examples/simdag/dot/dot_test2.c
index
ece7797
..
38b7095
100644
(file)
--- a/
examples/simdag/dot/dot_test2.c
+++ b/
examples/simdag/dot/dot_test2.c
@@
-1,6
+1,6
@@
/* simple test trying to load a DOT file. */
/* simple test trying to load a DOT file. */
-/* Copyright (c) 2010-201
4
. The SimGrid Team.
+/* Copyright (c) 2010-201
6
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-13,8
+13,7
@@
#include "xbt/ex.h"
#include <string.h>
#include "xbt/ex.h"
#include <string.h>
-XBT_LOG_NEW_DEFAULT_CATEGORY(test,
- "Logging specific to this SimDag example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
@@
-22,31
+21,25
@@
int main(int argc, char **argv)
unsigned int cursor;
SD_task_t task, *dot_as_array=NULL;
unsigned int cursor;
SD_task_t task, *dot_as_array=NULL;
- /*
initialisation of SD
*/
+ /*
SD initialization
*/
SD_init(&argc, argv);
/* Check our arguments */
SD_init(&argc, argv);
/* Check our arguments */
- if (argc < 2) {
- XBT_INFO("Usage: %s dot_file", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 1, "Usage: %s dot_file", argv[0]);
/* load the DOT file */
dot = SD_dotload(argv[1]);
/* Display all the tasks */
/* load the DOT file */
dot = SD_dotload(argv[1]);
/* Display all the tasks */
- XBT_INFO
- ("------------------- Display all tasks of the loaded DAG ---------------------------");
+ XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
xbt_dynar_foreach(dot, cursor, task) {
SD_task_dump(task);
}
xbt_dynar_foreach(dot, cursor, task) {
SD_task_dump(task);
}
- XBT_INFO
- ("--------------------- Transform the dynar into an array ---------------------------");
+ XBT_INFO("--------------------- Transform the dynar into an array ---------------------------");
cursor=0;
dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
cursor=0;
dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
- XBT_INFO
- ("----------------------------- dump tasks again ------------------------------------");
+ XBT_INFO("----------------------------- dump tasks again ------------------------------------");
while ((task=dot_as_array[cursor++])){
SD_task_dump(task);
}
while ((task=dot_as_array[cursor++])){
SD_task_dump(task);
}