Overview
Comment: | comment out non-standard use of enums pending rewrite with #defines :( |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
04ed0094760ed6c7692f1abccff6033c |
User & Date: | lexi on 2019-08-25 04:15:40 |
Other Links: | manifest | tags |
Context
2019-08-26
| ||
19:49 | minor tweaks; update docs to explain error handling check-in: 55dc614190 user: lexi tags: trunk | |
2019-08-25
| ||
04:15 | comment out non-standard use of enums pending rewrite with #defines :( check-in: 04ed009476 user: lexi tags: trunk | |
03:55 | remove useless script, delete junk files, credit contributors, add documentation for typesize.c check-in: 312e446cfc user: lexi tags: trunk | |
Changes
Modified mod/kcore/type.h.m from [b30ab22689] to [efe9d86768].
88 88 define(“cat”, “$1$2”) 89 89 typedef enum kcendian { 90 90 kcendian_high, 91 91 kcendian_low, 92 92 kcendian_system = cat(kcendian_,prop_endian), 93 93 } kcendian; 94 94 95 -enum /* max-min values of each type */ { 96 - byte_bits = arch_byte_bits, 95 +define(“defval”,“#define $1 $2 96 +”) 97 + 98 +defval(byte_bits,arch_byte_bits) 99 + 100 + 101 +/* this section was originally defined with enums so 102 + * as to avoid creating extraneous macros; however, 103 + * enum in C is limited to values of type int, when 104 + * we need values that are considerably longer. the 105 + * section has been commented out until someone has 106 + * the energy to convert it to #defines. 97 107 108 +enum { 98 109 u8_min = 0, u8_max = ((u8)-1), 99 110 u16_min = 0, u16_max = ((u16)-1), 100 111 u32_min = 0, u32_max = ((u32)-1), 101 112 u64_min = 0, u64_max = ((u64)-1), 102 113 u128_min = 0, u128_max = ((u128)-1), 103 114 104 - /* assuming two's complement. TODO: check math */ 115 + // assuming two's complement. TODO: check math 105 116 define(“sspec”,“ 106 117 $1_min = 0 - ((1 << sizeof($1) * byte_bits) / 2), 107 118 $1_max = (1 << sizeof($1) * byte_bits) / 2 - 1”)dnl 108 119 109 120 sspec(s8), sspec(s16), sspec(s32), 110 121 sspec(s64), sspec(s128), 111 122 ................................................................................ 123 134 124 135 ubig_min = u128_min, ubig_max = u128_max, 125 136 sbig_min = s128_min, sbig_max = s128_max, 126 137 127 138 ubyte_min = kc_uchar_min, ubyte_max = kc_uchar_max, 128 139 sbyte_min = kc_schar_min, sbyte_max = kc_schar_max, 129 140 }; 141 +*/ 130 142 131 143 ifdef(“type_sz”,“ 132 144 typedef type_sz sz; 133 145 ”,“dnl 134 146 # ifdef __cplusplus 135 147 /* C++ gives us a clean, standardized way to do this */ 136 148 typedef decltype (sizeof(char)) sz;