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

@ -13,10 +13,10 @@
#include "string.h"
#include <errno.h>
u8_t
uint8_t
fcb_get_align(const struct fcb *fcb)
{
u8_t align;
uint8_t align;
if (fcb->fap == NULL) {
return 0;
@ -95,7 +95,7 @@ fcb_init(int f_area_id, struct fcb *fcb)
struct flash_sector *sector;
int rc;
int i;
u8_t align;
uint8_t align;
int oldest = -1, newest = -1;
struct flash_sector *oldest_sector = NULL, *newest_sector = NULL;
struct fcb_disk_area fda;
@ -196,7 +196,7 @@ fcb_is_empty(struct fcb *fcb)
* 1 byte for lengths < 128 bytes, and 2 bytes for < 16384.
*/
int
fcb_put_len(u8_t *buf, u16_t len)
fcb_put_len(uint8_t *buf, uint16_t len)
{
if (len < 0x80) {
buf[0] = len;
@ -211,7 +211,7 @@ fcb_put_len(u8_t *buf, u16_t len)
}
int
fcb_get_len(u8_t *buf, u16_t *len)
fcb_get_len(uint8_t *buf, uint16_t *len)
{
int rc;
@ -232,7 +232,7 @@ fcb_get_len(u8_t *buf, u16_t *len)
* Initialize erased sector for use.
*/
int
fcb_sector_hdr_init(struct fcb *fcb, struct flash_sector *sector, u16_t id)
fcb_sector_hdr_init(struct fcb *fcb, struct flash_sector *sector, uint16_t id)
{
struct fcb_disk_area fda;
int rc;
@ -285,7 +285,7 @@ int fcb_sector_hdr_read(struct fcb *fcb, struct flash_sector *sector,
* @return 0 on there are any fcbs aviable; -ENOENT otherwise
*/
int
fcb_offset_last_n(struct fcb *fcb, u8_t entries,
fcb_offset_last_n(struct fcb *fcb, uint8_t entries,
struct fcb_entry *last_n_entry)
{
struct fcb_entry loc;

View file

@ -57,13 +57,13 @@ fcb_append_to_scratch(struct fcb *fcb)
}
int
fcb_append(struct fcb *fcb, u16_t len, struct fcb_entry *append_loc)
fcb_append(struct fcb *fcb, uint16_t len, struct fcb_entry *append_loc)
{
struct flash_sector *sector;
struct fcb_entry *active;
int cnt;
int rc;
u8_t tmp_str[8];
uint8_t tmp_str[8];
cnt = fcb_put_len(tmp_str, len);
if (cnt < 0) {
@ -118,7 +118,7 @@ int
fcb_append_finish(struct fcb *fcb, struct fcb_entry *loc)
{
int rc;
u8_t crc8[fcb->f_align];
uint8_t crc8[fcb->f_align];
off_t off;
(void)memset(crc8, 0xFF, sizeof(crc8));

View file

@ -15,15 +15,15 @@
* the data.
*/
int
fcb_elem_crc8(struct fcb *fcb, struct fcb_entry *loc, u8_t *c8p)
fcb_elem_crc8(struct fcb *fcb, struct fcb_entry *loc, uint8_t *c8p)
{
u8_t tmp_str[FCB_TMP_BUF_SZ];
uint8_t tmp_str[FCB_TMP_BUF_SZ];
int cnt;
int blk_sz;
u8_t crc8;
u16_t len;
u32_t off;
u32_t end;
uint8_t crc8;
uint16_t len;
uint32_t off;
uint32_t end;
int rc;
if (loc->fe_elem_off + 2 > loc->fe_sector->fs_size) {
@ -66,8 +66,8 @@ fcb_elem_crc8(struct fcb *fcb, struct fcb_entry *loc, u8_t *c8p)
int fcb_elem_info(struct fcb *fcb, struct fcb_entry *loc)
{
int rc;
u8_t crc8;
u8_t fl_crc8;
uint8_t crc8;
uint8_t fl_crc8;
off_t off;
rc = fcb_elem_crc8(fcb, loc, &crc8);

View file

@ -12,22 +12,22 @@
extern "C" {
#endif
#define FCB_CRC_SZ sizeof(u8_t)
#define FCB_CRC_SZ sizeof(uint8_t)
#define FCB_TMP_BUF_SZ 32
#define FCB_ID_GT(a, b) (((int16_t)(a) - (int16_t)(b)) > 0)
struct fcb_disk_area {
u32_t fd_magic;
u8_t fd_ver;
u8_t _pad;
u16_t fd_id;
uint32_t fd_magic;
uint8_t fd_ver;
uint8_t _pad;
uint16_t fd_id;
};
int fcb_put_len(u8_t *buf, u16_t len);
int fcb_get_len(u8_t *buf, u16_t *len);
int fcb_put_len(uint8_t *buf, uint16_t len);
int fcb_get_len(uint8_t *buf, uint16_t *len);
static inline int fcb_len_in_flash(struct fcb *fcb, u16_t len)
static inline int fcb_len_in_flash(struct fcb *fcb, uint16_t len)
{
if (fcb->f_align <= 1U) {
return len;
@ -36,7 +36,7 @@ static inline int fcb_len_in_flash(struct fcb *fcb, u16_t len)
}
const struct flash_area *fcb_open_flash(const struct fcb *fcb);
u8_t fcb_get_align(const struct fcb *fcb);
uint8_t fcb_get_align(const struct fcb *fcb);
int fcb_erase_sector(const struct fcb *fcb, const struct flash_sector *sector);
int fcb_getnext_in_sector(struct fcb *fcb, struct fcb_entry *loc);
@ -45,9 +45,9 @@ struct flash_sector *fcb_getnext_sector(struct fcb *fcb,
int fcb_getnext_nolock(struct fcb *fcb, struct fcb_entry *loc);
int fcb_elem_info(struct fcb *fcb, struct fcb_entry *loc);
int fcb_elem_crc8(struct fcb *fcb, struct fcb_entry *loc, u8_t *crc8p);
int fcb_elem_crc8(struct fcb *fcb, struct fcb_entry *loc, uint8_t *crc8p);
int fcb_sector_hdr_init(struct fcb *fcb, struct flash_sector *sector, u16_t id);
int fcb_sector_hdr_init(struct fcb *fcb, struct flash_sector *sector, uint16_t id);
int fcb_sector_hdr_read(struct fcb *fcb, struct flash_sector *sector,
struct fcb_disk_area *fdap);