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

@ -19,13 +19,13 @@
#include <logging/log.h>
LOG_MODULE_REGISTER(ADT7420, CONFIG_SENSOR_LOG_LEVEL);
static int adt7420_temp_reg_read(struct device *dev, u8_t reg, s16_t *val)
static int adt7420_temp_reg_read(struct device *dev, uint8_t reg, int16_t *val)
{
struct adt7420_data *drv_data = dev->driver_data;
const struct adt7420_dev_config *cfg = dev->config_info;
if (i2c_burst_read(drv_data->i2c, cfg->i2c_addr,
reg, (u8_t *) val, 2) < 0) {
reg, (uint8_t *) val, 2) < 0) {
return -EIO;
}
@ -34,11 +34,11 @@ static int adt7420_temp_reg_read(struct device *dev, u8_t reg, s16_t *val)
return 0;
}
static int adt7420_temp_reg_write(struct device *dev, u8_t reg, s16_t val)
static int adt7420_temp_reg_write(struct device *dev, uint8_t reg, int16_t val)
{
struct adt7420_data *drv_data = dev->driver_data;
const struct adt7420_dev_config *cfg = dev->config_info;
u8_t buf[3] = {reg, val >> 8, val & 0xFF};
uint8_t buf[3] = {reg, val >> 8, val & 0xFF};
return i2c_write(drv_data->i2c, buf, sizeof(buf), cfg->i2c_addr);
}
@ -50,9 +50,9 @@ static int adt7420_attr_set(struct device *dev,
{
struct adt7420_data *drv_data = dev->driver_data;
const struct adt7420_dev_config *cfg = dev->config_info;
u8_t val8, reg = 0U;
u16_t rate;
s64_t value;
uint8_t val8, reg = 0U;
uint16_t rate;
int64_t value;
if (chan != SENSOR_CHAN_AMBIENT_TEMP) {
return -ENOTSUP;
@ -94,7 +94,7 @@ static int adt7420_attr_set(struct device *dev,
return -EINVAL;
}
value = (s64_t)val->val1 * 1000000 + val->val2;
value = (int64_t)val->val1 * 1000000 + val->val2;
value = (value / ADT7420_TEMP_SCALE) << 1;
if (adt7420_temp_reg_write(dev, reg, value) < 0) {
@ -113,7 +113,7 @@ static int adt7420_attr_set(struct device *dev,
static int adt7420_sample_fetch(struct device *dev, enum sensor_channel chan)
{
struct adt7420_data *drv_data = dev->driver_data;
s16_t value;
int16_t value;
__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL ||
chan == SENSOR_CHAN_AMBIENT_TEMP);
@ -132,13 +132,13 @@ static int adt7420_channel_get(struct device *dev,
struct sensor_value *val)
{
struct adt7420_data *drv_data = dev->driver_data;
s32_t value;
int32_t value;
if (chan != SENSOR_CHAN_AMBIENT_TEMP) {
return -ENOTSUP;
}
value = (s32_t)drv_data->sample * ADT7420_TEMP_SCALE;
value = (int32_t)drv_data->sample * ADT7420_TEMP_SCALE;
val->val1 = value / 1000000;
val->val2 = value % 1000000;
@ -158,7 +158,7 @@ static int adt7420_probe(struct device *dev)
{
struct adt7420_data *drv_data = dev->driver_data;
const struct adt7420_dev_config *cfg = dev->config_info;
u8_t value;
uint8_t value;
int ret;
ret = i2c_reg_read_byte(drv_data->i2c, cfg->i2c_addr,

View file

@ -60,7 +60,7 @@
struct adt7420_data {
struct device *i2c;
s16_t sample;
int16_t sample;
#ifdef CONFIG_ADT7420_TRIGGER
struct device *gpio;
struct gpio_callback gpio_cb;
@ -83,7 +83,7 @@ struct adt7420_data {
struct adt7420_dev_config {
const char *i2c_port;
u16_t i2c_addr;
uint16_t i2c_addr;
#ifdef CONFIG_ADT7420_TRIGGER
gpio_pin_t int_pin;
gpio_flags_t int_flags;

View file

@ -45,7 +45,7 @@ static void process_int(struct device *dev)
{
struct adt7420_data *drv_data = dev->driver_data;
const struct adt7420_dev_config *cfg = dev->config_info;
u8_t status;
uint8_t status;
/* Clear the status */
if (i2c_reg_read_byte(drv_data->i2c, cfg->i2c_addr,
@ -68,7 +68,7 @@ static void process_int(struct device *dev)
}
static void adt7420_gpio_callback(struct device *dev,
struct gpio_callback *cb, u32_t pins)
struct gpio_callback *cb, uint32_t pins)
{
struct adt7420_data *drv_data =
CONTAINER_OF(cb, struct adt7420_data, gpio_cb);