Skip to content

Commit 72edca8

Browse files
authored
Merge pull request #205 from open-watt/minor_fixes
Minor bug fixes
2 parents dc9450b + 6a0defa commit 72edca8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/main.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ int main(string[] args)
113113
Duration frame_time = getTime() - start;
114114

115115
// work out how long to sleep
116-
int sleep_usecs = 1000_000 / g_app.update_rate_hz;
116+
long sleep_usecs = 1000_000 / g_app.update_rate_hz;
117117
sleep_usecs -= frame_time.as!"usecs";
118118
// only sleep if we need to sleep >20us or so...
119119
if (sleep_usecs > 20)

src/manager/console/argument.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,10 @@ const(char[]) convertVariant(T)(ref const Variant v, out T r) nothrow @nogc
318318
}
319319
else if (v.isString)
320320
{
321+
const(char)[] s;
321322
static if (__traits(compiles, { r.fromString(s); }))
322323
{
323-
const(char)[] s = v.asString;
324+
s = v.asString;
324325
return r.fromString(s) == s.length ? null : tconcat("Couldn't parse `" ~ Type.stringof ~ "` from string: ", v);
325326
}
326327
else

src/router/iface/can.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ nothrow @nogc:
172172
const ubyte[] ebyteFrame = buffer[offset .. offset + EbyteFrameSize];
173173

174174
frame.control = ebyteFrame[0];
175+
assert((frame.control & 0xF) <= 8, "TODO: bad CAN frame; did we fall off the rails? bad data? skip this message? how do we resync?");
175176

176177
frame.id = ebyteFrame[1 .. 5].bigEndianToNative!uint;
177178
frame.id &= (frame.extended ? 0x1FFFFFFF : 0x7FF);

0 commit comments

Comments
 (0)