]> granicus.if.org Git - graphviz/commitdiff
cgraph: [nfc] reflow bitarray.h
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 24 Feb 2022 05:05:21 +0000 (21:05 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 28 Feb 2022 00:09:55 +0000 (16:09 -0800)
Some non-compliant formatting crept in.

lib/cgraph/bitarray.h

index 6aa7fb7d7408bf8d0871751657f64ccb215251e3..54c3ef697fcbc99205ff6965b8a8d37b36130938 100644 (file)
@@ -38,7 +38,7 @@
 /// these to zero gives you a valid zero-length bit array.
 typedef struct {
   union {
-    uint8_t block[sizeof(uint8_t*)]; ///< inline storage for small arrays
+    uint8_t block[sizeof(uint8_t *)]; ///< inline storage for small arrays
     uint8_t *base; ///< start of the underlying allocated buffer
   };
   size_t size_bits; ///< extent in bits
@@ -53,7 +53,7 @@ static inline int bitarray_new(bitarray_t *self, size_t size_bits) {
   if (size_bits <= sizeof(self->block) * 8) {
     memset(self->block, 0, sizeof(self->block));
 
-  // otherwise we need to heap-allocate
+    // otherwise we need to heap-allocate
   } else {
     size_t capacity = size_bits / 8 + (size_bits % 8 == 0 ? 0 : 1);
     uint8_t *base = calloc(capacity, sizeof(self->base[0]));
@@ -113,7 +113,7 @@ static inline void bitarray_set(bitarray_t *self, size_t index, bool value) {
   if (value) {
     base[index / 8] |= (uint8_t)(UINT8_C(1) << (index % 8));
   } else {
-    base[index / 8] &= (uint8_t)~(UINT8_C(1) << (index % 8));
+    base[index / 8] &= (uint8_t) ~(UINT8_C(1) << (index % 8));
   }
 }