aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-15 16:58:11 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-15 16:58:11 -0500
commit648c2f77afd1dadce1c01de3f1dc42b54da656d0 (patch)
tree637f1437a771c79e97efe5afcc113cb4f422b841 /src
parent1b5a2116bc558ebef5d59c2c37c02c7375bf8712 (diff)
Preserve compatibility with C89 mode.
Diffstat (limited to 'src')
-rw-r--r--src/obd2/obd2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/obd2/obd2.c b/src/obd2/obd2.c
index 513c7d71..5b282f16 100644
--- a/src/obd2/obd2.c
+++ b/src/obd2/obd2.c
@@ -31,7 +31,8 @@ DiagnosticShims diagnostic_init_shims(LogShim log,
static void setup_receive_handle(DiagnosticRequestHandle* handle) {
if(handle->request.arbitration_id == OBD2_FUNCTIONAL_BROADCAST_ID) {
- for(uint16_t response_id = 0;
+ uint16_t response_id;
+ for(response_id = 0;
response_id < OBD2_FUNCTIONAL_RESPONSE_COUNT; ++response_id) {
handle->isotp_receive_handles[response_id] = isotp_receive(
&handle->isotp_shims, OBD2_FUNCTIONAL_RESPONSE_START + response_id,
@@ -197,7 +198,8 @@ DiagnosticResponse diagnostic_receive_can_frame(DiagnosticShims* shims,
isotp_continue_send(&handle->isotp_shims,
&handle->isotp_send_handle, arbitration_id, data, size);
} else {
- for(uint8_t i = 0; i < handle->isotp_receive_handle_count; ++i) {
+ uint8_t i;
+ for(i = 0; i < handle->isotp_receive_handle_count; ++i) {
IsoTpMessage message = isotp_continue_receive(&handle->isotp_shims,
&handle->isotp_receive_handles[i], arbitration_id, data, size);