avsm changed the topic of #mirage to: mirage 2 released! party on!
caw has quit [Ping timeout: 260 seconds]
caw has joined #mirage
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #mirage
syntiux has quit [Ping timeout: 250 seconds]
syntiux has joined #mirage
syntiux has quit [Ping timeout: 250 seconds]
syntiux has joined #mirage
syntiux has quit [Ping timeout: 240 seconds]
syntiux has joined #mirage
syntiux has quit [Ping timeout: 264 seconds]
syntiux has joined #mirage
syntiux has quit [Ping timeout: 260 seconds]
syntiux has joined #mirage
rgrinberg has quit [Ping timeout: 258 seconds]
rgrinberg has joined #mirage
agarwal1975 has quit [Ping timeout: 276 seconds]
rgrinberg has quit [Ping timeout: 250 seconds]
agarwal1975 has joined #mirage
copy` has quit [Quit: Connection closed for inactivity]
syntiux has quit [Ping timeout: 260 seconds]
syntiux has joined #mirage
jermar has joined #mirage
jermar has quit [Ping timeout: 244 seconds]
srenatus[m] has quit [Remote host closed the connection]
jermar has joined #mirage
srenatus[m] has joined #mirage
haesbaert has joined #mirage
jermar has quit [Ping timeout: 265 seconds]
yomimono has joined #mirage
yomimono has quit [Ping timeout: 250 seconds]
<haesbaert>
what's the recommended safe/nice way to compare int32 as unsigned ?
<haesbaert>
I'm working with Cstruct uint32 which uses an int32, very often I need to compare things as unsigned.
<haesbaert>
It's quite painfull to keep checking for underflow all the time
<haesbaert>
I'm sure someone came across this
<hannes>
haesbaert: is checking for equality sufficient?
<haesbaert>
no
<haesbaert>
I know equality is totally safe
<haesbaert>
I need to do additions/subtractions and sometimes check if it's lower/higher than something
<hannes>
I managed to avoid these comparisons so far... but several times I thought that a uint32 library should be written.. since OCaml doesn't seem to get it builtin soon
<haesbaert>
I'm trying to avoid them and I think so far it's being ok, there is one case so far I can't avoid, but I'm sure I'll make a mistake somewhere
<hannes>
had to write some C stubs (tested on clang so far) to get the overflow information...
<hannes>
since I expose (and use) type t = int32, there's no change needed for cstruct... you can just use those usane operations on something retrieved from Cstruct.BE.get_uint32!
dezzy_ is now known as dezzy
srenatus[m] has quit [Remote host closed the connection]