Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions c/src/sbp.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static s8 sbp_state_read_to_frame_buffer(sbp_state_t *s,
s32 (*read)(u8 *buff, u32 n, void *context),
u8 to_read)
{
u8 rd = (*read)(s->frame_buff + s->frame_len, to_read, s->io_context);
s32 rd = (*read)(s->frame_buff + s->frame_len, to_read, s->io_context);
if (0 > rd) return SBP_READ_ERROR;
s->frame_len += rd;
s->n_read += rd;
Expand All @@ -373,7 +373,7 @@ static s8 sbp_state_read_to_frame_buffer(sbp_state_t *s,
static void sbp_state_frame_buffer_clear(sbp_state_t *s)
{
/* Note, library functions are not used to avoid more dependencies. */
for (int i = 0; i < sizeof(s->frame_buff); i++) {
for (u32 i = 0; i < sizeof(s->frame_buff); i++) {
s->frame_buff[i] = 0;
}
s->frame_len = 0;
Expand Down Expand Up @@ -587,6 +587,7 @@ s8 sbp_process_frame(sbp_state_t *s, u16 sender_id, u16 msg_type,
node->context);
ret = SBP_OK_CALLBACK_EXECUTED;
} break;
case SBP_CALLBACK_TYPE_COUNT:
default:
{
// NOP
Expand Down
2 changes: 1 addition & 1 deletion test_data/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echo "Python" $time_py
time_hs=$(TIMEFORMAT="%R"; { time $1/sbp2json < $TESTDATA_ROOT/long.sbp > $TESTDATA_ROOT/long_hask.json; } 2>&1)
echo "Haskell" $time_hs

threshold=1.5
threshold=1.51
perf_diff=$(echo "$time_py / $time_hs" | bc -l)

if (( $(echo "$perf_diff > $threshold" | bc -l) )); then
Expand Down