diff --git a/c/src/sbp.c b/c/src/sbp.c index 2c3aca63cd..2b545d434d 100644 --- a/c/src/sbp.c +++ b/c/src/sbp.c @@ -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; @@ -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; @@ -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 diff --git a/test_data/benchmark.sh b/test_data/benchmark.sh index 4d4aa4e374..4d28e5a5f0 100755 --- a/test_data/benchmark.sh +++ b/test_data/benchmark.sh @@ -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