From 1d50b483a862893463417eeab602b80c1d2d7f91 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 8 Apr 2019 22:16:31 +0200 Subject: [PATCH] [codacy] Reduce scope for variables. --- teshsuite/smpi/privatization/privatization.c | 4 +--- teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/teshsuite/smpi/privatization/privatization.c b/teshsuite/smpi/privatization/privatization.c index 25668c8116..df6b5f5342 100644 --- a/teshsuite/smpi/privatization/privatization.c +++ b/teshsuite/smpi/privatization/privatization.c @@ -7,14 +7,12 @@ static int myvalue = 0; static void test_opts(int* argc, char **argv[]){ int found = 0; - int ret; static struct option long_options[] = { {"long", no_argument, 0, 0 }, {0, 0, 0, 0 } }; while (1) { - ret = getopt_long_only(*argc, *argv, "s", - long_options, NULL); + int ret = getopt_long_only(*argc, *argv, "s", long_options, NULL); if(ret==-1) break; diff --git a/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c b/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c index 84217e9ea9..00de44cb13 100644 --- a/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c +++ b/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c @@ -13,15 +13,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(dsend,"the dsend test"); static void test_opts(int* argc, char **argv[]){ int found = 0; - int ret; int option_index = 0; static struct option long_options[] = { {"long", no_argument, 0, 0 }, {0, 0, 0, 0 } }; while (1) { - ret = getopt_long(*argc, *argv, "s", - long_options, &option_index); + int ret = getopt_long(*argc, *argv, "s", long_options, &option_index); if(ret==-1) break; -- 2.20.1