Empty structure size is different between C and C++. To prevent clang warning when compiling this include file in C++ programs, remove empty structures.
Unified · Split
| @@ -1540,10 +1540,14 @@ struct lightbar_program { · 1539 unmodified lines | ||
| 1540 | 1540 | struct ec_params_lightbar { |
| 1541 | 1541 | uint8_t cmd; /* Command (see enum lightbar_command) */ |
| 1542 | 1542 | union { |
| 1543 | − struct { | |
| 1544 | − /* no args */ | |
| 1545 | − } dump, off, on, init, get_seq, get_params_v0, get_params_v1, | |
| 1546 | − version, get_brightness, get_demo, suspend, resume; | |
| 1543 | + /* | |
| 1544 | + * The following commands have no args: | |
| 1545 | + * | |
| 1546 | + * dump, off, on, init, get_seq, get_params_v0, get_params_v1, | |
| 1547 | + * version, get_brightness, get_demo, suspend, resume | |
| 1548 | + * | |
| 1549 | + * Don't use an empty struct, because C++ hates that. | |
| 1550 | + */ | |
| 1547 | 1551 | |
| 1548 | 1552 | struct __ec_todo_unpacked { |
| 1549 | 1553 | uint8_t num; |
| @@ -1597,11 +1601,13 @@ struct ec_response_lightbar { · 47 unmodified lines | ||
| 1597 | 1601 | uint8_t red, green, blue; |
| 1598 | 1602 | } get_rgb; |
| 1599 | 1603 | |
| 1600 | − struct { | |
| 1601 | − /* no return params */ | |
| 1602 | − } off, on, init, set_brightness, seq, reg, set_rgb, | |
| 1603 | − demo, set_params_v0, set_params_v1, | |
| 1604 | − set_program, manual_suspend_ctrl, suspend, resume; | |
| 1604 | + /* | |
| 1605 | + * The following commands have no response: | |
| 1606 | + * | |
| 1607 | + * off, on, init, set_brightness, seq, reg, set_rgb, | |
| 1608 | + * set_params_v0, set_params_v1, set_program, | |
| 1609 | + * manual_suspend_ctrl, suspend, resume | |
| 1610 | + */ | |
| 1605 | 1611 | }; |
| 1606 | 1612 | } __ec_todo_packed; |
| 1607 | 1613 | |
| @@ -3021,9 +3027,7 @@ enum charge_state_params { · 1413 unmodified lines | ||
| 3021 | 3027 | struct ec_params_charge_state { |
| 3022 | 3028 | uint8_t cmd; /* enum charge_state_command */ |
| 3023 | 3029 | union { |
| 3024 | − struct { | |
| 3025 | − /* no args */ | |
| 3026 | − } get_state; | |
| 3030 | + /* get_state has no args */ | |
| 3027 | 3031 | |
| 3028 | 3032 | struct __ec_todo_unpacked { |
| 3029 | 3033 | uint32_t param; /* enum charge_state_param */ |
| @@ -3049,9 +3053,8 @@ struct ec_response_charge_state { · 19 unmodified lines | ||
| 3049 | 3053 | struct __ec_align4 { |
| 3050 | 3054 | uint32_t value; |
| 3051 | 3055 | } get_param; |
| 3052 | − struct { | |
| 3053 | − /* no return values */ | |
| 3054 | − } set_param; | |
| 3056 | + | |
| 3057 | + /* set_param returns no args */ | |
| 3055 | 3058 | }; |
| 3056 | 3059 | } __ec_align4; |
| 3057 | 3060 | |