From: Danny Al-Gaaf Date: Tue, 7 May 2013 15:17:49 +0000 (+0200) Subject: common/ceph_argparse.cc: remove scope of some variables X-Git-Tag: v0.63~46^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6256d3edee927e3959c6c43023dbfa730a5fb6f8;p=ceph.git common/ceph_argparse.cc: remove scope of some variables Signed-off-by: Danny Al-Gaaf --- diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 2ff520e45c92..2950a81f89d7 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -172,12 +172,11 @@ bool ceph_argparse_flag(std::vector &args, char tmp[strlen(first)+1]; dashes_to_underscores(first, tmp); first = tmp; - const char *a; va_list ap; va_start(ap, i); while (1) { - a = va_arg(ap, char*); + const char *a = va_arg(ap, char*); if (a == NULL) { va_end(ap); return false; @@ -200,15 +199,13 @@ static bool va_ceph_argparse_binary_flag(std::vector &args, char tmp[strlen(first)+1]; dashes_to_underscores(first, tmp); first = tmp; - const char *a; - int strlen_a; // does this argument match any of the possibilities? while (1) { - a = va_arg(ap, char*); + const char *a = va_arg(ap, char*); if (a == NULL) return false; - strlen_a = strlen(a); + int strlen_a = strlen(a); char a2[strlen_a+1]; dashes_to_underscores(a, a2); if (strncmp(a2, first, strlen(a2)) == 0) { @@ -259,15 +256,13 @@ static bool va_ceph_argparse_witharg(std::vector &args, char tmp[strlen(first)+1]; dashes_to_underscores(first, tmp); first = tmp; - const char *a; - int strlen_a; // does this argument match any of the possibilities? while (1) { - a = va_arg(ap, char*); + const char *a = va_arg(ap, char*); if (a == NULL) return false; - strlen_a = strlen(a); + int strlen_a = strlen(a); char a2[strlen_a+1]; dashes_to_underscores(a, a2); if (strncmp(a2, first, strlen(a2)) == 0) {