zephyr: replace zephyr integer types with C99 types

git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-05-27 11:26:57 -05:00 committed by Kumar Gala
commit a1b77fd589
2364 changed files with 32505 additions and 32505 deletions

View file

@ -16,40 +16,40 @@
LOG_MODULE_REGISTER(opt3001, CONFIG_SENSOR_LOG_LEVEL);
static int opt3001_reg_read(struct opt3001_data *drv_data, u8_t reg,
u16_t *val)
static int opt3001_reg_read(struct opt3001_data *drv_data, uint8_t reg,
uint16_t *val)
{
u8_t value[2];
uint8_t value[2];
if (i2c_burst_read(drv_data->i2c, DT_INST_REG_ADDR(0),
reg, value, 2) != 0) {
return -EIO;
}
*val = ((u16_t)value[0] << 8) + value[1];
*val = ((uint16_t)value[0] << 8) + value[1];
return 0;
}
static int opt3001_reg_write(struct opt3001_data *drv_data, u8_t reg,
u16_t val)
static int opt3001_reg_write(struct opt3001_data *drv_data, uint8_t reg,
uint16_t val)
{
u8_t new_value[2];
uint8_t new_value[2];
new_value[0] = val >> 8;
new_value[1] = val & 0xff;
u8_t tx_buf[3] = { reg, new_value[0], new_value[1] };
uint8_t tx_buf[3] = { reg, new_value[0], new_value[1] };
return i2c_write(drv_data->i2c, tx_buf, sizeof(tx_buf),
DT_INST_REG_ADDR(0));
}
static int opt3001_reg_update(struct opt3001_data *drv_data, u8_t reg,
u16_t mask, u16_t val)
static int opt3001_reg_update(struct opt3001_data *drv_data, uint8_t reg,
uint16_t mask, uint16_t val)
{
u16_t old_val;
u16_t new_val;
uint16_t old_val;
uint16_t new_val;
if (opt3001_reg_read(drv_data, reg, &old_val) != 0) {
return -EIO;
@ -64,7 +64,7 @@ static int opt3001_reg_update(struct opt3001_data *drv_data, u8_t reg,
static int opt3001_sample_fetch(struct device *dev, enum sensor_channel chan)
{
struct opt3001_data *drv_data = dev->driver_data;
u16_t value;
uint16_t value;
__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL || chan == SENSOR_CHAN_LIGHT);
@ -83,7 +83,7 @@ static int opt3001_channel_get(struct device *dev, enum sensor_channel chan,
struct sensor_value *val)
{
struct opt3001_data *drv_data = dev->driver_data;
s32_t uval;
int32_t uval;
if (chan != SENSOR_CHAN_LIGHT) {
return -ENOTSUP;
@ -113,7 +113,7 @@ static const struct sensor_driver_api opt3001_driver_api = {
static int opt3001_chip_init(struct device *dev)
{
struct opt3001_data *drv_data = dev->driver_data;
u16_t value;
uint16_t value;
drv_data->i2c = device_get_binding(DT_INST_BUS_LABEL(0));
if (drv_data->i2c == NULL) {

View file

@ -25,7 +25,7 @@
struct opt3001_data {
struct device *i2c;
u16_t sample;
uint16_t sample;
};
#endif /* _SENSOR_OPT3001_ */