[hackers] [scc] [cc1] change enums to be declared with bitshifts || rain1_AT_openmailbox.org

From: <git_AT_suckless.org>
Date: Sun, 8 May 2016 20:30:13 +0200 (CEST)

commit c0b446c8b817e90d6d1d978d89bba51f80e56d3a
Author: rain1_AT_openmailbox.org <rain1_AT_openmailbox.org>
AuthorDate: Fri May 6 20:07:08 2016 +0100
Commit: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Sat May 7 18:31:55 2016 +0200

    [cc1] change enums to be declared with bitshifts

diff --git a/cc1/cc1.h b/cc1/cc1.h
index f1e1750..fcb65f7 100644
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
_AT_@ -162,29 +162,29 @@ enum {
 
 /* symbol flags */
 enum {
- SAUTO = 1,
- SREGISTER = 2,
- SDECLARED = 4,
- SFIELD = 8,
- SEXTERN = 16,
- SUSED = 32,
- SCONSTANT = 64,
- SGLOBAL = 128,
- SPRIVATE = 256,
- SLOCAL = 512,
- SEMITTED = 1024,
- SDEFINED = 2048,
- SSTRING = 4096,
- STYPEDEF = 8192,
- SINITLST = 16384,
- SHASINIT = 32768
+ SAUTO = 1 << 0,
+ SREGISTER = 1 << 1,
+ SDECLARED = 1 << 2,
+ SFIELD = 1 << 3,
+ SEXTERN = 1 << 4,
+ SUSED = 1 << 5,
+ SCONSTANT = 1 << 6,
+ SGLOBAL = 1 << 7,
+ SPRIVATE = 1 << 8,
+ SLOCAL = 1 << 9,
+ SEMITTED = 1 << 10,
+ SDEFINED = 1 << 11,
+ SSTRING = 1 << 12,
+ STYPEDEF = 1 << 13,
+ SINITLST = 1 << 14,
+ SHASINIT = 1 << 15
 };
 
 /* node flags */
 enum {
- NLVAL = 1,
- NCONST = 2,
- NEFFECT = 4
+ NLVAL = 1 << 0,
+ NCONST = 1 << 1,
+ NEFFECT = 1 << 2
 };
 
 /* lexer mode, compiler or preprocessor directive */
_AT_@ -195,11 +195,11 @@ enum {
 
 /* input tokens */
 enum tokens {
- CONST = 1, /* type qualifier tokens are used as flags */
- RESTRICT = 2,
- VOLATILE = 4,
- INLINE = 8,
- TQUALIFIER = 128,
+ CONST = 1 << 0, /* type qualifier tokens are used as flags */
+ RESTRICT = 1 << 1,
+ VOLATILE = 1 << 2,
+ INLINE = 1 << 3,
+ TQUALIFIER = 1 << 7, /* this value is picked outside of ASCII range */
         TYPE,
         IDEN,
         SCLASS,
Received on Sun May 08 2016 - 20:30:13 CEST

This archive was generated by hypermail 2.3.0 : Sun May 08 2016 - 20:36:22 CEST