tighter scope, more const
authorRoker <roker@pep-project.org>
Thu, 14 Jul 2016 11:57:01 +0200
changeset 880c9c9de1e8e27
parent 879 6460821c3170
child 881 bbc6c48ce146
tighter scope, more const
(transplanted from 33ede5ddef27e4820ba1106b2bcbdba51a3dfc64)
src/pEpEngine.c
src/pgp_gpg.c
     1.1 --- a/src/pEpEngine.c	Thu Jul 14 11:32:56 2016 +0200
     1.2 +++ b/src/pEpEngine.c	Thu Jul 14 11:57:01 2016 +0200
     1.3 @@ -564,7 +564,6 @@
     1.4          )
     1.5  {
     1.6      PEP_STATUS status = PEP_STATUS_OK;
     1.7 -    int result;
     1.8  
     1.9      assert(session);
    1.10      assert(word);
    1.11 @@ -589,7 +588,7 @@
    1.12      sqlite3_bind_text(session->trustword, 1, lang, -1, SQLITE_STATIC);
    1.13      sqlite3_bind_int(session->trustword, 2, value);
    1.14  
    1.15 -    result = sqlite3_step(session->trustword);
    1.16 +    const int result = sqlite3_step(session->trustword);
    1.17      if (result == SQLITE_ROW) {
    1.18          *word = strdup((const char *) sqlite3_column_text(session->trustword,
    1.19                      1));
     2.1 --- a/src/pgp_gpg.c	Thu Jul 14 11:32:56 2016 +0200
     2.2 +++ b/src/pgp_gpg.c	Thu Jul 14 11:57:01 2016 +0200
     2.3 @@ -1313,8 +1313,6 @@
     2.4  {
     2.5      gpgme_error_t gpgme_error;
     2.6      gpgme_key_t key;
     2.7 -    stringlist_t *_keylist;
     2.8 -    char *fpr;
     2.9  
    2.10      assert(session);
    2.11      assert(pattern);
    2.12 @@ -1335,7 +1333,7 @@
    2.13          return PEP_GET_KEY_FAILED;
    2.14      };
    2.15  
    2.16 -    _keylist = new_stringlist(NULL);
    2.17 +    stringlist_t *_keylist = new_stringlist(NULL);
    2.18      stringlist_t *_k = _keylist;
    2.19  
    2.20      do {
    2.21 @@ -1348,7 +1346,7 @@
    2.22          case GPG_ERR_NO_ERROR:
    2.23              assert(key);
    2.24              assert(key->subkeys);
    2.25 -            fpr = key->subkeys->fpr;
    2.26 +            char *fpr = key->subkeys->fpr;
    2.27              assert(fpr);
    2.28              _k = stringlist_add(_k, fpr);
    2.29              assert(_k);