diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2019-11-05 19:33:29 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2020-01-08 00:17:29 +0100 |
commit | 64691cf96f9c4d7ff59dbd49e1fe01d26c1a00f6 (patch) | |
tree | 6e32fa6d9574223d5560508c76ce31d50bc42a14 /low-can-binding/utils/socketcan-j1939/socketcan-j1939-addressclaiming.cpp | |
parent | 3fb6ac3c3670499bee4ce02ff7813739017e8b8f (diff) |
all: Format one line 'if' or 'for' statement.
Bug-AGL: SPEC-2988
Change-Id: Ic3b9670a2ce9e982220c54f3632f690ee4eea686
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/utils/socketcan-j1939/socketcan-j1939-addressclaiming.cpp')
-rw-r--r-- | low-can-binding/utils/socketcan-j1939/socketcan-j1939-addressclaiming.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/low-can-binding/utils/socketcan-j1939/socketcan-j1939-addressclaiming.cpp b/low-can-binding/utils/socketcan-j1939/socketcan-j1939-addressclaiming.cpp index df994f59..83ba71a3 100644 --- a/low-can-binding/utils/socketcan-j1939/socketcan-j1939-addressclaiming.cpp +++ b/low-can-binding/utils/socketcan-j1939/socketcan-j1939-addressclaiming.cpp @@ -139,9 +139,8 @@ namespace utils } else { - for (int i = start_addr; i <= end_addr; i++) { + for (int i = start_addr; i <= end_addr; i++) table_j1939_address_[i] = std::make_pair(0,true); - } } } } @@ -187,9 +186,7 @@ namespace utils if(table_j1939_address_[i].second && i!=current_address_) { if( table_j1939_address_[i].first >= htole64(J1939_NAME_ECU) || table_j1939_address_[i].first == 0) - { return (uint8_t) i; - } } } return J1939_IDLE_ADDR; @@ -344,9 +341,8 @@ namespace utils int ret = sendto(socket_, dat, sizeof(dat), 0, (const struct sockaddr *)&peername, sizeof(peername)); if(ret < 0) - { AFB_ERROR("Error pgn_request()"); - } + return ret; } */ @@ -362,9 +358,7 @@ namespace utils for(int i = 0; i < J1939_IDLE_ADDR; i++) { if(table_j1939_address_[i].first == name) - { return (uint8_t) i; - } } return J1939_IDLE_ADDR; } @@ -411,4 +405,4 @@ namespace utils return claiming_state_; } -}
\ No newline at end of file +} |