]> diplodocus.org Git - nmh/commitdiff
sbr/vector.c: Change bvector_bits() to return first word.
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 26 Apr 2017 12:41:27 +0000 (13:41 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 26 Apr 2017 12:41:27 +0000 (13:41 +0100)
Rename it to bvector_first_bits() to represent its new behaviour.  It
has only one caller that uses it to produce debug.  Tighten the API so
other callers don't get access to the location of the bvector's bits.

h/mh.h
sbr/vector.c
uip/mark.c

diff --git a/h/mh.h b/h/mh.h
index 774d336..1edf482 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
@@ -199,7 +199,7 @@ void bvector_clear (bvector_t, size_t);
 void bvector_clear_all (bvector_t);
 void bvector_set (bvector_t, size_t);
 unsigned int bvector_at (bvector_t, size_t);
-const unsigned long *bvector_bits (bvector_t);
+unsigned long bvector_first_bits (bvector_t);
 
 typedef struct svector *svector_t;
 
index e975e27..1167fa2 100644 (file)
@@ -141,9 +141,9 @@ bvector_resize (bvector_t vec, size_t maxsize) {
         bvector_clear (vec, i);
 }
 
-const unsigned long *
-bvector_bits (bvector_t vec) {
-    return vec->bits;
+unsigned long
+bvector_first_bits (bvector_t vec) {
+    return *vec->bits;
 }
 
 
index c882a17..3972508 100644 (file)
@@ -259,7 +259,7 @@ seq_printdebug (struct msgs *mp)
        if (is_selected (mp, msgnum))
            printf ("%*d: %s\n", DMAXFOLDER, msgnum,
                    snprintb (buf, sizeof buf,
-                             (unsigned) *bvector_bits (msgstat (mp, msgnum)),
+                             (unsigned) bvector_first_bits (msgstat (mp, msgnum)),
                              seq_bits (mp)));
     }
 }