]> granicus.if.org Git - mutt/commitdiff
Cleanup: avoid an ugly local preprocessor macro.
authorVincent Lefevre <vincent@vinc17.net>
Sat, 21 Jul 2018 23:35:32 +0000 (01:35 +0200)
committerVincent Lefevre <vincent@vinc17.net>
Sat, 21 Jul 2018 23:35:32 +0000 (01:35 +0200)
Note: This macro was also hiding the use of a variable, making the code
difficult to read.

curs_main.c
pattern.c

index 12a2eaf216e5342049533b96f2215110b095e0c1..1647a3861a1df574def11dd6995173e52450956f 100644 (file)
@@ -434,7 +434,6 @@ static void update_index_unthreaded (CONTEXT *ctx, int check, int oldcount)
    * they will be visible in the limited view */
   if (ctx->pattern)
   {
-#define THIS_BODY ctx->hdrs[j]->content
     for (j = (check == MUTT_REOPENED) ? 0 : oldcount; j < ctx->msgcount; j++)
     {
       if (!j)
@@ -444,15 +443,16 @@ static void update_index_unthreaded (CONTEXT *ctx, int check, int oldcount)
                             MUTT_MATCH_FULL_ADDRESS,
                             ctx, ctx->hdrs[j], NULL))
       {
+       BODY *this_body = ctx->hdrs[j]->content;
+
        assert (ctx->vcount < ctx->msgcount);
        ctx->hdrs[j]->virtual = ctx->vcount;
        ctx->v2r[ctx->vcount] = j;
        ctx->hdrs[j]->limited = 1;
        ctx->vcount++;
-       ctx->vsize += THIS_BODY->length + THIS_BODY->offset - THIS_BODY->hdr_offset;
+       ctx->vsize += this_body->length + this_body->offset - this_body->hdr_offset;
       }
     }
-#undef THIS_BODY
   }
 
   /* if the mailbox was reopened, need to rethread from scratch */
index 7ce968ab00c57a5451245e53ce3e6f5d81052acd..cfe4a700c946463e4470bd4efb610b45a1d99eba 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -1475,8 +1475,6 @@ int mutt_pattern_func (int op, char *prompt)
                      MUTT_PROGRESS_MSG, ReadInc,
                      (op == MUTT_LIMIT) ? Context->msgcount : Context->vcount);
 
-#define THIS_BODY Context->hdrs[i]->content
-
   if (op == MUTT_LIMIT)
   {
     Context->vcount    = 0;
@@ -1493,12 +1491,14 @@ int mutt_pattern_func (int op, char *prompt)
       Context->hdrs[i]->num_hidden = 0;
       if (mutt_pattern_exec (pat, MUTT_MATCH_FULL_ADDRESS, Context, Context->hdrs[i], NULL))
       {
+       BODY *this_body = Context->hdrs[i]->content;
+
        Context->hdrs[i]->virtual = Context->vcount;
        Context->hdrs[i]->limited = 1;
        Context->v2r[Context->vcount] = i;
        Context->vcount++;
-       Context->vsize+=THIS_BODY->length + THIS_BODY->offset -
-         THIS_BODY->hdr_offset;
+       Context->vsize += this_body->length + this_body->offset -
+         this_body->hdr_offset;
       }
     }
   }
@@ -1528,8 +1528,6 @@ int mutt_pattern_func (int op, char *prompt)
     }
   }
 
-#undef THIS_BODY
-
   mutt_clear_error ();
 
   if (op == MUTT_LIMIT)