Browse Source

Cleaning up: fixing compiler warnings.

* set NULL to variables not used in child processes in dixon.
* set exit_code to success at initalization; may happen that no question is registered;
* commenting unused variables for splitting jobs
Michele Orrù 10 years ago
parent
commit
d11a354b96
4 changed files with 13 additions and 9 deletions
  1. 1 1
      src/indiana.c
  2. 6 6
      src/qa.c
  3. 4 0
      src/questions/allquestions.c
  4. 2 2
      src/questions/dixon.c

+ 1 - 1
src/indiana.c

@@ -52,7 +52,7 @@ int main(int argc, char **argv)
 
     rsa = pkey->pkey.rsa;
     printf("%-10s: %s\n", SITE, site);
-    run_question(&MetadataQuestion, crt, NULL);
+    run_question(&MetadataQuestion, crt, rsa);
     X509_free(crt);
   }
 

+ 6 - 6
src/qa.c

@@ -97,7 +97,6 @@ get_local_rsa(const char *src)
 int
 qa_init(const struct qa_conf* conf)
 {
-  int exitcode;
   X509 *crt = NULL;
   RSA *rsa = NULL;
 
@@ -119,20 +118,21 @@ qa_init(const struct qa_conf* conf)
   if (!crt && !rsa)
     error(EXIT_FAILURE, errno, "Unable to open source \"%s\" :", conf->src);
 
-  exitcode = qa_dispose(crt, rsa);
+  int ret = qa_dispose(crt, rsa);
   X509_free(crt);
-  return exitcode;
+  return ret;
 }
 
 static int
 qa_dispose(X509 *crt, RSA *rsa)
 {
-  int exit_code;
+  int exit_code = EXIT_SUCCESS;
   RSA *pub;
   qa_question_t *q;
   EVP_PKEY *pkey;
 #ifdef HAVE_OPENMPI
-  int proc, procs, i;
+  int proc, procs;
+  /* i; */
 #endif
 
   if (!rsa && crt)  {
@@ -149,7 +149,7 @@ qa_dispose(X509 *crt, RSA *rsa)
 #ifdef HAVE_OPENMPI
   MPI_Comm_rank(MPI_COMM_WORLD, &proc);
   MPI_Comm_size(MPI_COMM_WORLD, &procs);
-  i = 0;
+  /* i = 0; */
 #endif
 
   LIST_FOREACH(q, &questions, qs) {

+ 4 - 0
src/questions/allquestions.c

@@ -16,6 +16,10 @@
 #include <openssl/rsa.h>
 #include <openssl/ssl.h>
 
+#ifdef HAVE_OPENMPI
+#include <mpi.h>
+#endif
+
 #include "qa/questions/questions.h"
 
 void QA_library_init(void)

+ 2 - 2
src/questions/dixon.c

@@ -179,8 +179,8 @@ dixon_question_ask_rsa(const RSA *rsa)
   struct bnpair {
     BIGNUM *x;
     BIGNUM *y;
-  } *R;
-  matrix_t *m;
+  } *R = NULL;
+  matrix_t *m = NULL;
   matrix_t *h;