Skip to content

Commit 31b65ca

Browse files
type safety on twist() and untwist()
1 parent 5f3a1b9 commit 31b65ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ulisp.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ enum stream { SERIALSTREAM, I2CSTREAM, SPISTREAM, SDSTREAM
144144

145145
typedef uint32_t symbol_t;
146146
typedef uint8_t minmax_t;
147-
typedef uint16_t builtin_t;
147+
typedef uint32_t builtin_t;
148148
typedef uint16_t flags_t;
149149

150150
typedef struct sobject {
@@ -268,11 +268,11 @@ void plispstr (symbol_t, pfun_t);
268268
void testescape ();
269269
bool is_macro_call (object*, object*);
270270

271-
inline uint32_t twist (uint32_t x) {
271+
inline symbol_t twist (builtin_t x) {
272272
return (x<<2) | ((x & 0xC0000000)>>30);
273273
}
274274

275-
inline uint32_t untwist (uint32_t x) {
275+
inline builtin_t untwist (symbol_t x) {
276276
return (x>>2 & 0x3FFFFFFF) | ((x & 0x03)<<30);
277277
}
278278

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy