correct endianness for cell_simple_p()

pull/1181/head
nick black 4 years ago committed by Nick Black
parent 8db3f77f5c
commit 11bbf3c4ff

@ -252,13 +252,13 @@ egcpool_dump(egcpool* pool){
// unsafe results if called on a simple cell.
static inline uint32_t
cell_egc_idx(const cell* c){
return htole(c->gcluster) & 0x00fffffflu;
return (htole(c->gcluster) & 0xffffff00lu) >> 8u;
}
// Is the cell simple (a UTF8-encoded EGC of four bytes or fewer)?
static inline bool
cell_simple_p(const cell* c){
return (htole(c->gcluster) & 0xff000000ul) != 0x01000000ul;
return (htole(c->gcluster) & 0xffu) != 0x01u;
}
// only applies to complex cells, do not use on simple cells

Loading…
Cancel
Save