art & beauty sync
authorVolker Birk <vb@pep.foundation>
Sun, 21 Oct 2018 18:01:57 +0200
branchsync
changeset 30908adef1192b4e
parent 3089 95d63a8d69bf
child 3091 ee2e7d1e0601
art & beauty
src/mime.c
src/pEpEngine.c
     1.1 --- a/src/mime.c	Sun Oct 21 17:54:01 2018 +0200
     1.2 +++ b/src/mime.c	Sun Oct 21 18:01:57 2018 +0200
     1.3 @@ -1360,8 +1360,6 @@
     1.4      char *_longmsg;
     1.5      size_t length;
     1.6      size_t _size;
     1.7 -    int code;
     1.8 -    int r;
     1.9      size_t index;
    1.10      char *type = NULL;
    1.11      char *charset = NULL;
    1.12 @@ -1383,9 +1381,9 @@
    1.13      length = part->mm_body->dt_data.dt_text.dt_length;
    1.14  
    1.15      if (part->mm_body->dt_encoded) {
    1.16 -        code = part->mm_body->dt_encoding;
    1.17 +        int code = part->mm_body->dt_encoding;
    1.18          index = 0;
    1.19 -        r = mailmime_part_parse(text, length, &index, code, &_longmsg, &_size);
    1.20 +        int r = mailmime_part_parse(text, length, &index, code, &_longmsg, &_size);
    1.21          switch (r) {
    1.22              case MAILIMF_NO_ERROR:
    1.23                  break;
    1.24 @@ -1449,9 +1447,9 @@
    1.25          headerblock = strstr(headerblock, header_string);
    1.26          if (headerblock) {
    1.27              const char* subj_start = "Subject: ";
    1.28 -            size_t subj_len = strlen(subj_start);
    1.29              headerblock = strstr(headerblock, subj_start);
    1.30              if (headerblock) {
    1.31 +                size_t subj_len = strlen(subj_start);
    1.32                  headerblock += subj_len;
    1.33                  char* end_pt = strstr(headerblock, "\n");
    1.34                  if (end_pt) {
     2.1 --- a/src/pEpEngine.c	Sun Oct 21 17:54:01 2018 +0200
     2.2 +++ b/src/pEpEngine.c	Sun Oct 21 18:01:57 2018 +0200
     2.3 @@ -20,17 +20,16 @@
     2.4  
     2.5  // sql overloaded functions - modified from sqlite3.c
     2.6  static void _sql_lower(sqlite3_context* ctx, int argc, sqlite3_value** argv) {
     2.7 -    char *z1;
     2.8      const char *z2;
     2.9 -    int i, n;
    2.10 +    int n;
    2.11      z2 = (char*)sqlite3_value_text(argv[0]);
    2.12      n = sqlite3_value_bytes(argv[0]);
    2.13      /* Verify that the call to _bytes() does not invalidate the _text() pointer */
    2.14      assert( z2==(char*)sqlite3_value_text(argv[0]) );
    2.15      if( z2 ){
    2.16 -        z1 = (char*)sqlite3_malloc(n+1);
    2.17 +        char *z1 = (char*)sqlite3_malloc(n+1);
    2.18          if( z1 ){
    2.19 -            for(i=0; i<n; i++){
    2.20 +            for(int i=0; i<n; i++){
    2.21                  char c = z2[i];
    2.22                  char c_mod = c | 0x20;
    2.23                  if (c_mod < 0x61 || c_mod > 0x7a)
    2.24 @@ -2375,8 +2374,6 @@
    2.25          identity_list** id_list
    2.26      )
    2.27  {
    2.28 -    pEp_identity* ident;
    2.29 -
    2.30      assert(session);
    2.31      assert(address);
    2.32      assert(address[0]);
    2.33 @@ -2395,7 +2392,7 @@
    2.34      while ((result = sqlite3_step(session->get_identities_by_address)) == SQLITE_ROW) {
    2.35          //"select user_id, main_key_id, username, comm_type, lang,"
    2.36          //"   identity.flags, is_own"
    2.37 -        ident = new_identity(
    2.38 +        pEp_identity *ident = new_identity(
    2.39                  address,
    2.40                  (const char *) sqlite3_column_text(session->get_identities_by_address, 1),
    2.41                  (const char *) sqlite3_column_text(session->get_identities_by_address, 0),
    2.42 @@ -4437,7 +4434,6 @@
    2.43      )
    2.44  {
    2.45      PEP_STATUS status = PEP_STATUS_OK;
    2.46 -    int result;
    2.47  
    2.48      assert(session);
    2.49      assert(name && value);
    2.50 @@ -4452,7 +4448,7 @@
    2.51          status = _get_sequence_value(session, name, value);
    2.52  
    2.53      if (status == PEP_STATUS_OK) {
    2.54 -        result = sqlite3_exec(session->db, "COMMIT ;", NULL, NULL, NULL);
    2.55 +        int result = sqlite3_exec(session->db, "COMMIT ;", NULL, NULL, NULL);
    2.56          if (result == SQLITE_OK){
    2.57              assert(*value < INT32_MAX);
    2.58              if (*value == INT32_MAX){
    2.59 @@ -4640,8 +4636,6 @@
    2.60          identity_list** id_list
    2.61      )
    2.62  {
    2.63 -    pEp_identity* ident;
    2.64 -
    2.65      assert(session);
    2.66      assert(id_list);
    2.67  
    2.68 @@ -4655,7 +4649,7 @@
    2.69      int result;
    2.70  
    2.71      while ((result = sqlite3_step(session->get_last_contacted)) == SQLITE_ROW) {
    2.72 -        ident = new_identity(
    2.73 +        pEp_identity *ident = new_identity(
    2.74                  (const char *) sqlite3_column_text(session->get_last_contacted, 1),
    2.75                  NULL,
    2.76                  (const char *) sqlite3_column_text(session->get_last_contacted, 0),