gordonb3 wrote:
> I read that somewhat different, because the values of xxx.expires are
> created elsewhere from jive_jiffies incremented with some
> max_process_time value. The sole purpose of those lines you mentioned is
> thus to identify timeouts.
I'm sorry. I don't see the point of what
gordonb3 wrote:
> (...) because lua_Number is not an `int` but a `double` (i.e. a floating
> point number). (...)
OMG, you're right. I forgot about that (I'm not a Lua programmer). And
the other assumption that Lua_Integer is unsigned is also wrong, it is a
ptrdiff_t, thus *signed*. I forgot
Maybe, maybe not. In my experience comparing notes often helps to
identify the actual problem a lot quicker.
gordonb3's Profile: http://forums.slimdevices.com/member.php?userid=71050
View this thread:
Steevee28 wrote:
> I would -not- recommend switching to an unsigned value type
> `lua_Integer`
>
The point being, I think, that, at least in C, checking that a signed
integer is negative is probably more readable, and possibly more
efficient, than checking that an unsigned integer is >= half
Steevee28 wrote:
> ... because as also @mrw pointed out, in order to fix the wrapping
> problems, we need to only deal with timer value _differences_. And when
> Lua behaves similar to C/C++, then, the difference between two unsigned
> values would in turn be unsigned, thus comparing the result
mrw wrote:
> The point being, I think, that, at least in C, checking that a signed
> integer is negative is probably more readable, and possibly more
> efficient, than checking that an unsigned integer is >= half MAX UINT +
> 1, or whatever.
>
That's actually one of the most efficient
gordonb3 wrote:
> (...) but obviously it did reset the timer so I'm back to waiting
> another 24 days to verify what it does.
Are you able to edit the jive_jiffies() function in src/common.h to
return a timer value right from the start that is - let's say - 1 minute
before wrapping
Oops! Sort of bricked my Radio by inserting an if clause on `framedue >
0x8000` which apparently LUA translated into `-1` and thus executed
instantly to trigger watchdog. Luckily I was able to recover from it,
but obviously it did reset the timer so I'm back to waiting another 24
days to