<BlaXpirit>
might need something different for big endian, i dont know at this point..
<jokke>
BlaXpirit: do you think revoked is the msb or lsb?
<BlaXpirit>
i think it depends on endianness but the code i wrote is meant to get revoked as get_bit(0)
<jokke>
yeah i was just thinking if i could map it to an enum
<BlaXpirit>
my guess is the bit order is the opposite of what enum uses
<jokke>
yeah mine too
<jokke>
C99 §6.7.2.1, paragraph 10 says: "The order of allocation of bit-fields within a unit (high-order to low-order or low-order to high-order) is implementation-defined."
<jokke>
great...
<jokke>
so i'll need to write some c code to access the fields
<RX14>
BlaXpirit, there's already a .bit call on Number
<jokke>
RX14: but since i can't know in what order the fields are i need to write accessors in c...
<RX14>
i'm pretty sure thats just a spec detail you can ignore
<jokke>
RX14: hm?
<RX14>
treat it as if they're in order and it'll work
<jokke>
hmm
<RX14>
it'll be ABI-specific
<jokke>
ok
<RX14>
so anything thyat works on x86 linux will work on x86 linux
<RX14>
at least
<RX14>
so you don't really have to think about it
<jokke>
so if i were to map the bits to an enum with @[Flags] how would i do that?
<RX14>
it's an optimization opportunity in the spec which I don't think compilers take advantage of
<RX14>
@[Flags] enum Foo : Int32
<RX14>
list the fields with the correct names in order
<RX14>
then write a test for it
<RX14>
well test it at least
<RX14>
because I could be wrong, although i'm 99% sure
<jokke>
kk
<jokke>
isn't enum Int32 by default?
<RX14>
best to specify
<jokke>
k
<RX14>
just in case
vikaton has joined #crystal-lang
<jokke>
works!
DeBot has quit [Remote host closed the connection]
DeBot has joined #crystal-lang
soveran has quit [Remote host closed the connection]
sz0 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
danielpclark has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
bjz has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cosepinyari has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
cosepinyari has quit [Quit: -a- IRC for Android 2.1.22]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]