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
Port xbt_parmap to C++.
[simgrid.git]
/
src
/
xbt
/
xbt_str.cpp
diff --git
a/src/xbt/xbt_str.cpp
b/src/xbt/xbt_str.cpp
index
1146eef
..
ac5bc37
100644
(file)
--- a/
src/xbt/xbt_str.cpp
+++ b/
src/xbt/xbt_str.cpp
@@
-219,12
+219,11
@@
xbt_dynar_t xbt_str_split_str(const char *s, const char *sep)
while (not done) {
char *to_push;
while (not done) {
char *to_push;
- int v = 0;
// get the start of the first occurrence of the substring
q = strstr(p, sep);
//if substring was not found add the entire string
if (nullptr == q) {
// get the start of the first occurrence of the substring
q = strstr(p, sep);
//if substring was not found add the entire string
if (nullptr == q) {
-
v
= strlen(p);
+
int v
= strlen(p);
to_push = (char*) xbt_malloc(v + 1);
memcpy(to_push, p, v);
to_push[v] = '\0';
to_push = (char*) xbt_malloc(v + 1);
memcpy(to_push, p, v);
to_push[v] = '\0';
@@
-372,7
+371,8
@@
xbt_dynar_t xbt_str_split_quoted(const char *s)
/** @brief Join a set of strings as a single string */
char *xbt_str_join(xbt_dynar_t dyn, const char *sep)
{
/** @brief Join a set of strings as a single string */
char *xbt_str_join(xbt_dynar_t dyn, const char *sep)
{
- int len = 1, dyn_len = xbt_dynar_length(dyn);
+ int len = 1;
+ int dyn_len = xbt_dynar_length(dyn);
unsigned int cpt;
char* cursor;
unsigned int cpt;
char* cursor;