2014-05-15 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/c.nanorc: Improve the magic regex, plus tweaks.
* src/color.c (color_update): Adjust comment, and be clear.
+ * src/nano.h: Improve two comments, and elide one macro.
2014-05-14 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (edit_draw): Poke a non-breaking space into the last
/* Suppress warnings for __attribute__((warn_unused_result)). */
#define IGNORE_CALL_RESULT(call) do { if (call) {} } while(0)
-/* Macros for flags. */
-#define FLAGOFF(flag) ((flag) / (sizeof(unsigned) * 8))
+/* Macros for flags, indexing each bit in a small array. */
+#define FLAGS(flag) flags[((flag) / (sizeof(unsigned) * 8))]
#define FLAGMASK(flag) (1 << ((flag) % (sizeof(unsigned) * 8)))
-#define FLAGS(flag) flags[FLAGOFF(flag)]
#define SET(flag) FLAGS(flag) |= FLAGMASK(flag)
#define UNSET(flag) FLAGS(flag) &= ~FLAGMASK(flag)
#define ISSET(flag) ((FLAGS(flag) & FLAGMASK(flag)) != 0)
NUMBER_OF_ELEMENTS
};
-/* Enumeration to be used in flags table. See FLAGBIT and FLAGOFF
- * definitions. */
+/* Enumeration used in the flags array. See the definition of FLAGMASK. */
enum
{
DONTUSE,