chiark / gitweb /
Group counters into struct
[innduct.git] / statemc.c
index 5adecf95997cd79df2ea2dd3d4eb5746b7274547..8b588039b9e4f45e427f93a4e1da8a85dec9dda0 100644 (file)
--- a/statemc.c
+++ b/statemc.c
@@ -222,9 +222,9 @@ static void notice_processed(InputFile *ipf, int completed,
 
 #define RCI_NOTHING(x) /* nothing */
 #define RCI_TRIPLE_FMT(x) " " #x "=" RCI_TRIPLE_FMT_BASE
-#define RCI_TRIPLE_VALS(x) , RCI_TRIPLE_VALS_BASE(ipf->counts, [RC_##x])
+#define RCI_TRIPLE_VALS(x) , RCI_TRIPLE_VALS_BASE(ipf->counts.counts, [RC_##x])
 
-#define CNT(art,rc) (ipf->counts[art_##art][RC_##rc])
+#define CNT(art,rc) (ipf->counts.counts[art_##art][RC_##rc])
 
   char *inprog= completed
     ? xasprintf("%s","") /* GCC produces a stupid warning for printf("") ! */
@@ -238,8 +238,8 @@ static void notice_processed(InputFile *ipf, int completed,
        RESULT_COUNTS(RCI_NOTHING, RCI_TRIPLE_FMT)
        ,
        completed?"completed":"processed", what, spec,
-       ipf->readcount_ok, ipf->readcount_blank, ipf->readcount_err,
-       inprog, autodefer, ipf->count_nooffer_missing,
+       ipf->counts.read_ok, ipf->counts.read_blank, ipf->counts.read_err,
+       inprog, autodefer, ipf->counts.nooffer_missing,
        CNT(Unchecked,sent) + CNT(Unsolicited,sent)
        , CNT(Unchecked,sent), CNT(Unsolicited,sent),
        CNT(Wanted,accepted) + CNT(Unsolicited,accepted)
@@ -247,9 +247,7 @@ static void notice_processed(InputFile *ipf, int completed,
        RESULT_COUNTS(RCI_NOTHING,  RCI_TRIPLE_VALS)
        );
 
-  memset(ipf->counts, 0, sizeof(ipf->counts));
-  ipf->readcount_ok= ipf->readcount_blank=
-    ipf->readcount_err= ipf->count_nooffer_missing= 0;
+  memset(&ipf->counts, 0, sizeof(ipf->counts));
 
   free(inprog);
   free(autodefer);