X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/63282590b70f29e96c5f0f7d0db30ca48c9e0fa5..7aee0210f0feded0a8b2ac0b4d10ae894f5efe4b:/src/xbt/xbt_str.c diff --git a/src/xbt/xbt_str.c b/src/xbt/xbt_str.c index 7ff082793a..02ee5ab6b4 100644 --- a/src/xbt/xbt_str.c +++ b/src/xbt/xbt_str.c @@ -412,7 +412,8 @@ char *xbt_str_join(xbt_dynar_t dyn, const char*sep) { */ long getline(char **buf, size_t *n, FILE *stream) { - int i, ch; + size_t i; + int ch; if (!*buf) { *buf = xbt_malloc(512); @@ -452,7 +453,7 @@ long getline(char **buf, size_t *n, FILE *stream) { static xbt_matrix_t diff_build_LCS(xbt_dynar_t da, xbt_dynar_t db) { xbt_matrix_t C = xbt_matrix_new(xbt_dynar_length(da),xbt_dynar_length(db), sizeof(int),NULL); - int i,j; + unsigned long i,j; /* Compute the LCS */ /* @@ -469,8 +470,9 @@ static xbt_matrix_t diff_build_LCS(xbt_dynar_t da, xbt_dynar_t db) { C[i,j] := max(C[i,j-1], C[i-1,j]) return C[m,n] */ - for (i=0; i=0 && - (i<=0 || xbt_matrix_get_as(C,i,j-1,int) >= xbt_matrix_get_as(C,i-1,j,int))) { + (i<=0 ||j==0|| xbt_matrix_get_as(C,i,j-1,int) >= xbt_matrix_get_as(C,i-1,j,int))) { diff_build_diff(res,C,da,db,i,j-1); topush = bprintf("+ %s",xbt_dynar_get_as(db,j,char*)); xbt_dynar_push(res,&topush);