]> granicus.if.org Git - neomutt/commitdiff
Update a confusing and obsolete comment.
authorDavid Champion <dgc@bikeshed.us>
Tue, 30 Aug 2016 23:11:45 +0000 (16:11 -0700)
committerRichard Russon <rich@flatcap.org>
Tue, 13 Sep 2016 15:15:01 +0000 (16:15 +0100)
This 2004 comment in sort.h predicted what has recently come to pass, so
I'm reframing it just to document for future devs what's going on with
this oddball flag.

sort.h

diff --git a/sort.h b/sort.h
index c969c097209e8069fbe820967dad1e694d2390a6..4242e9dce21ff48e2b8e966b134148e9cc2a646b 100644 (file)
--- a/sort.h
+++ b/sort.h
 #define SORT_DESC      19
 #define SORT_LABEL     20
 
-/* dgc: Sort & SortAux are shorts, so I'm bumping these bitflags up from
- * bits 4 & 5 to bits 8 & 9 to make room for more sort keys in the future. */
-#define SORT_MASK      0xff
+/* Sort and sort_aux are shorts, and are a composite of a
+ * constant sort operation number and a set of compounded
+ * bitflags.
+ *
+ * Everything below SORT_MASK is a constant. There's room for
+ * SORT_MASK constant SORT_ values.
+ *
+ * Everything above is a bitflag. It's OK to move SORT_MASK
+ * down by powers of 2 if we need more, so long as we don't
+ * collide with the constants above. (Or we can just expand
+ * sort and sort_aux to uint32_t.)
+ */
+#define SORT_MASK      ((1<<8) - 1)
 #define SORT_REVERSE   (1<<8)
 #define SORT_LAST      (1<<9)