summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Guggemos <jimg@google.com>2015-12-03 23:26:27 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-12-03 23:26:27 +0000
commit60e0251cc3c7037349d369d23af659a576c6b68f (patch)
tree77cb5cd7349db0bd09759e395f7bbed455e25fbd
parent485f161d875f1d7f7b3e87591c3f797410577990 (diff)
parent6f55211dcb7a6df03ddc24447b7a932126860825 (diff)
downloadcommon-60e0251cc3c7037349d369d23af659a576c6b68f.tar.gz
Merge "Stop fatal warnings in i2c_service, gpio_playground"
-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);