diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-01-19 23:12:37 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-01-19 23:12:37 +0000 |
commit | 6a50bef84ae6a0a67e03ac1356f8d85d15fe09d6 (patch) | |
tree | 01f78f04b22517899f603787f6005f70b359271e /src/bytecode | |
parent | 63c21aca7c77b1d37cb64ad2b1fa76d6b0b92f48 (diff) | |
download | libcss-6a50bef84ae6a0a67e03ac1356f8d85d15fe09d6.tar.gz libcss-6a50bef84ae6a0a67e03ac1356f8d85d15fe09d6.tar.bz2 |
Merge parser autogeneration and string handling refactor branch r=jmb,kinnison,vince
svn path=/trunk/libcss/; revision=11408
Diffstat (limited to 'src/bytecode')
-rw-r--r-- | src/bytecode/bytecode.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bytecode/bytecode.h b/src/bytecode/bytecode.h index f378585..4ac3dfb 100644 --- a/src/bytecode/bytecode.h +++ b/src/bytecode/bytecode.h @@ -14,6 +14,8 @@ #include <libcss/types.h> #include <libcss/properties.h> +typedef uint32_t css_code_t; + typedef enum css_properties_e opcode_t; enum flag { @@ -53,32 +55,32 @@ typedef enum shape { SHAPE_RECT = 0 } shape; -static inline uint32_t buildOPV(opcode_t opcode, uint8_t flags, uint16_t value) +static inline css_code_t buildOPV(opcode_t opcode, uint8_t flags, uint16_t value) { return (opcode & 0x3ff) | (flags << 10) | ((value & 0x3fff) << 18); } -static inline opcode_t getOpcode(uint32_t OPV) +static inline opcode_t getOpcode(css_code_t OPV) { return (OPV & 0x3ff); } -static inline uint8_t getFlags(uint32_t OPV) +static inline uint8_t getFlags(css_code_t OPV) { return ((OPV >> 10) & 0xff); } -static inline uint16_t getValue(uint32_t OPV) +static inline uint16_t getValue(css_code_t OPV) { return (OPV >> 18); } -static inline bool isImportant(uint32_t OPV) +static inline bool isImportant(css_code_t OPV) { return getFlags(OPV) & 0x1; } -static inline bool isInherit(uint32_t OPV) +static inline bool isInherit(css_code_t OPV) { return getFlags(OPV) & 0x2; } |