From: cherierm Date: Fri, 21 Sep 2007 15:50:56 +0000 (+0000) Subject: declaration of the variables at the begining of the function X-Git-Tag: v3.3~1126 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e3f8483759ed01e7332f2cb243e8c42ea9ab23f6?hp=5319ffc7b1323889e1b8e2d88dd00e6a5f5b1372 declaration of the variables at the begining of the function git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4665 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index 964f92d580..8414788c99 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -426,17 +426,20 @@ static XBT_INLINE void * _xbt_dynar_insert_at_ptr(xbt_dynar_t const dynar, const int idx) { void *res; + unsigned long old_used; + unsigned long new_used; + unsigned long nb_shift; _sanity_check_dynar(dynar); _sanity_check_idx(idx); _check_sloppy_inbound_idx(dynar, idx); - const unsigned long old_used = dynar->used; - const unsigned long new_used = old_used + 1; + old_used = dynar->used; + new_used = old_used + 1; _xbt_dynar_expand(dynar, new_used); - const unsigned long nb_shift = old_used - idx; + nb_shift = old_used - idx; if (nb_shift) memmove(_xbt_dynar_elm(dynar, idx+1), @@ -520,6 +523,7 @@ xbt_dynar_search(xbt_dynar_t const dynar, _dynar_unlock(dynar); THROW2(not_found_error,0,"Element %p not part of dynar %p",elem,dynar); + return -1; } /** @brief Returns a boolean indicating whether the element is part of the dynar */