Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[codacy] Reduce scope for variables.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 8 Apr 2019 20:16:31 +0000 (22:16 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 9 Apr 2019 16:11:07 +0000 (18:11 +0200)
teshsuite/smpi/privatization/privatization.c
teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c

index 25668c8..df6b5f5 100644 (file)
@@ -7,14 +7,12 @@
 static int myvalue = 0;
 static void test_opts(int* argc, char **argv[]){
   int found = 0;
 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) {
   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;
 
     if(ret==-1)
       break;
 
index 84217e9..00de44c 100644 (file)
@@ -13,15 +13,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(dsend,"the dsend test");
 
 static void test_opts(int* argc, char **argv[]){
   int found = 0;
 
 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) {
   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;
 
     if(ret==-1)
       break;