summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Guggemos <jimg@google.com>2015-12-03 15:13:18 -0700
committerJim Guggemos <jimg@google.com>2015-12-03 15:52:10 -0700
commit6f55211dcb7a6df03ddc24447b7a932126860825 (patch)
tree8796cc498fdfc306c2709041cf68d5846d591f55
parent9a13a5ea03f17f73f556f3ed13c9469e60aa9c46 (diff)
downloadcommon-6f55211dcb7a6df03ddc24447b7a932126860825.tar.gz
Stop fatal warnings in i2c_service, gpio_playground
Replace GNU old-style field designators (clang didn't like em) Made unused param warnings not fatal in gpio_playground Change-Id: I758a7651b139d782608fa133150af6a0a024ab01 TEST: compiled shamu-userdebug, edison-eng
-rw-r--r--brillo_gpios/src/gpio_playground/Android.mk2
-rw-r--r--brillo_i2c/src/i2c_service/i2c_device.cpp28
2 files changed, 15 insertions, 15 deletions
diff --git a/brillo_gpios/src/gpio_playground/Android.mk b/brillo_gpios/src/gpio_playground/Android.mk
index 72c995e..cf4ca71 100644
--- a/brillo_gpios/src/gpio_playground/Android.mk
+++ b/brillo_gpios/src/gpio_playground/Android.mk
@@ -20,5 +20,5 @@ LOCAL_MODULE := gpio_playground
LOCAL_SRC_FILES := gpio_playground.cpp
LOCAL_SHARED_LIBRARIES := libchrome libbrillo libbrillo-stream
LOCAL_C_INCLUDES := external/gtest/include
-LOCAL_CFLAGS := -Wall -Werror
+LOCAL_CFLAGS := -Wall -Werror -Wno-error=unused-parameter
include $(BUILD_EXECUTABLE)
diff --git a/brillo_i2c/src/i2c_service/i2c_device.cpp b/brillo_i2c/src/i2c_service/i2c_device.cpp
index 90e1b1a..35089b6 100644
--- a/brillo_i2c/src/i2c_service/i2c_device.cpp
+++ b/brillo_i2c/src/i2c_service/i2c_device.cpp
@@ -77,8 +77,8 @@ int I2CDevice::Send(struct i2c_msg messages[],
// Sending messages requires them to be wrapped in the i2c_rdwr_ioctl_data
// struct and sending them using the I2C_RDWR ioctl.
struct i2c_rdwr_ioctl_data data = {
- msgs: messages,
- nmsgs: count
+ .msgs = messages,
+ .nmsgs = count
};
int rc = ioctl(fd_, I2C_RDWR, &data);
if (rc < 0) {
@@ -95,10 +95,10 @@ int I2CDevice::SetRegister(const uint8_t register_address,
uint8_t outbuf[] = {register_address, value};
struct i2c_msg messages[1];
messages[0] = {
- addr: address_,
- flags: 0,
- len: sizeof(outbuf),
- buf: outbuf
+ .addr = address_,
+ .flags = 0,
+ .len = sizeof(outbuf),
+ .buf = outbuf
};
return Send(messages, 1);
}
@@ -113,17 +113,17 @@ int I2CDevice::GetRegister(const uint8_t register_address,
uint8_t outbuf = register_address;
// Both messages need the addr value set.
messages[0] = {
- addr: address_,
- flags: 0,
- len: 1,
- buf: &outbuf
+ .addr = address_,
+ .flags = 0,
+ .len = 1,
+ .buf = &outbuf
};
// Needs to pass the I2C_M_RD flag in order to get the value.
messages[1] = {
- addr: address_,
- flags: I2C_M_RD,
- len: 1,
- buf: &value,
+ .addr = address_,
+ .flags = I2C_M_RD,
+ .len = 1,
+ .buf = &value,
};
// Will contain the register value.
int rc = Send(messages, 2);