From: Benno Schulenberg Date: Thu, 15 May 2014 13:11:55 +0000 (+0000) Subject: Improving two comments, and eliding a macro. X-Git-Tag: v2.3.3~39 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=eb91ad54efab00503698927bdd1758b12769d9c1;p=nano.git Improving two comments, and eliding a macro. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4891 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 5c344eb1..58db47e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2014-05-15 Benno Schulenberg * 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 * src/winio.c (edit_draw): Poke a non-breaking space into the last diff --git a/src/nano.h b/src/nano.h index db249eef..a1da639a 100644 --- a/src/nano.h +++ b/src/nano.h @@ -57,10 +57,9 @@ /* 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) @@ -497,8 +496,7 @@ enum 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,