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

@ -54,29 +54,29 @@ void __gcov_exit(void)
#define MASK_32BIT (0xffffffffUL)
static inline void buff_write_u64(void *buffer, size_t *off, uint64_t v)
{
*((u32_t *)((u8_t *)buffer + *off) + 0) = (u32_t)(v & MASK_32BIT);
*((u32_t *)((u8_t *)buffer + *off) + 1) = (u32_t)((v >> 32) &
*((uint32_t *)((uint8_t *)buffer + *off) + 0) = (uint32_t)(v & MASK_32BIT);
*((uint32_t *)((uint8_t *)buffer + *off) + 1) = (uint32_t)((v >> 32) &
MASK_32BIT);
*off = *off + sizeof(u64_t);
*off = *off + sizeof(uint64_t);
}
/**
* buff_write_u32 - Store 32 bit data on a buffer and return the size
*/
static inline void buff_write_u32(void *buffer, size_t *off, u32_t v)
static inline void buff_write_u32(void *buffer, size_t *off, uint32_t v)
{
*((u32_t *)((u8_t *)buffer + *off)) = v;
*off = *off + sizeof(u32_t);
*((uint32_t *)((uint8_t *)buffer + *off)) = v;
*off = *off + sizeof(uint32_t);
}
size_t calculate_buff_size(struct gcov_info *info)
{
u32_t iter;
u32_t iter_1;
u32_t iter_2;
uint32_t iter;
uint32_t iter_1;
uint32_t iter_2;
/* few Fixed values at the start version, stamp and magic number. */
u32_t size = sizeof(u32_t) * 3;
uint32_t size = sizeof(uint32_t) * 3;
for (iter = 0U; iter < info->n_functions; iter++) {
/* space for TAG_FUNCTION and FUNCTION_LENGTH
@ -84,7 +84,7 @@ size_t calculate_buff_size(struct gcov_info *info)
* lineno_checksum
* cfg_checksum
*/
size += (sizeof(u32_t) * 5);
size += (sizeof(uint32_t) * 5);
for (iter_1 = 0U; iter_1 < GCOV_COUNTERS; iter_1++) {
if (!info->merge[iter_1]) {
@ -92,14 +92,14 @@ size_t calculate_buff_size(struct gcov_info *info)
}
/* for function counter and number of values */
size += (sizeof(u32_t) * 2);
size += (sizeof(uint32_t) * 2);
for (iter_2 = 0U;
iter_2 < info->functions[iter]->ctrs->num;
iter_2++) {
/* Iter for values which is u64_t */
size += (sizeof(u64_t));
/* Iter for values which is uint64_t */
size += (sizeof(uint64_t));
}
}
@ -117,13 +117,13 @@ size_t calculate_buff_size(struct gcov_info *info)
* This buffer will now have info similar to a regular gcda
* format.
*/
size_t populate_buffer(u8_t *buffer, struct gcov_info *info)
size_t populate_buffer(uint8_t *buffer, struct gcov_info *info)
{
struct gcov_fn_info *functions;
struct gcov_ctr_info *counters_per_func;
u32_t iter_functions;
u32_t iter_counts;
u32_t iter_counter_values;
uint32_t iter_functions;
uint32_t iter_counts;
uint32_t iter_counter_values;
size_t buffer_write_position = 0;
/* File header. */
@ -202,7 +202,7 @@ size_t populate_buffer(u8_t *buffer, struct gcov_info *info)
void dump_on_console(const char *filename, char *ptr, size_t len)
{
u32_t iter;
uint32_t iter;
printk("\n%c", FILE_START_INDICATOR);
while (*filename != '\0') {
@ -213,7 +213,7 @@ void dump_on_console(const char *filename, char *ptr, size_t len)
/* Data dump */
for (iter = 0U; iter < len; iter++) {
printk(" %02x", (u8_t)*ptr++);
printk(" %02x", (uint8_t)*ptr++);
}
}
@ -222,7 +222,7 @@ void dump_on_console(const char *filename, char *ptr, size_t len)
*/
void gcov_coverage_dump(void)
{
u8_t *buffer;
uint8_t *buffer;
size_t size;
size_t written_size;
struct gcov_info *gcov_list = gcov_info_head;
@ -233,7 +233,7 @@ void gcov_coverage_dump(void)
size = calculate_buff_size(gcov_list);
buffer = (u8_t *) k_mem_pool_malloc(&gcov_heap_mem_pool, size);
buffer = (uint8_t *) k_mem_pool_malloc(&gcov_heap_mem_pool, size);
if (!buffer) {
printk("No Mem available to continue dump\n");
goto coverage_dump_end;
@ -260,9 +260,9 @@ coverage_dump_end:
/* Initialize the gcov by calling the required constructors */
void gcov_static_init(void)
{
extern u32_t __init_array_start, __init_array_end;
u32_t func_pointer_start = (u32_t) &__init_array_start;
u32_t func_pointer_end = (u32_t) &__init_array_end;
extern uint32_t __init_array_start, __init_array_end;
uint32_t func_pointer_start = (uint32_t) &__init_array_start;
uint32_t func_pointer_end = (uint32_t) &__init_array_end;
while (func_pointer_start < func_pointer_end) {
void (**p)(void);

View file

@ -36,14 +36,14 @@
#define GCOV_COUNTERS 10U
#endif
typedef u64_t gcov_type;
typedef uint64_t gcov_type;
#define GCOV_TAG_FUNCTION_LENGTH 3
#define GCOV_DATA_MAGIC (0x67636461)
#define GCOV_TAG_FUNCTION (0x01000000)
#define GCOV_TAG_COUNTER_BASE (0x01a10000)
#define GCOV_TAG_FOR_COUNTER(count) \
(GCOV_TAG_COUNTER_BASE + ((u32_t) (count) << 17))
(GCOV_TAG_COUNTER_BASE + ((uint32_t) (count) << 17))
#define FILE_START_INDICATOR '*'
#define GCOV_DUMP_SEPARATOR '<'

View file

@ -35,19 +35,19 @@
#include <tc_util.h>
#include <tinycrypt/constants.h>
static inline void show_str(const char *label, const u8_t *s, size_t len)
static inline void show_str(const char *label, const uint8_t *s, size_t len)
{
u32_t i;
uint32_t i;
TC_PRINT("%s = ", label);
for (i = 0U; i < (u32_t)len; ++i) {
for (i = 0U; i < (uint32_t)len; ++i) {
TC_PRINT("%02x", s[i]);
}
TC_PRINT("\n");
}
static inline
void fatal(u32_t testnum, const void *expected, size_t expectedlen,
void fatal(uint32_t testnum, const void *expected, size_t expectedlen,
const void *computed, size_t computedlen)
{
TC_ERROR("\tTest #%d Failed!\n", testnum);
@ -57,11 +57,11 @@ void fatal(u32_t testnum, const void *expected, size_t expectedlen,
}
static inline
u32_t check_result(u32_t testnum, const void *expected,
uint32_t check_result(uint32_t testnum, const void *expected,
size_t expectedlen, const void *computed,
size_t computedlen, u32_t verbose)
size_t computedlen, uint32_t verbose)
{
u32_t result = TC_PASS;
uint32_t result = TC_PASS;
ARG_UNUSED(verbose);

View file

@ -28,17 +28,17 @@
#define OS_GET_TIME() k_cycle_get_32()
/* time necessary to read the time */
extern u32_t tm_off;
extern uint32_t tm_off;
static inline u32_t TIME_STAMP_DELTA_GET(u32_t ts)
static inline uint32_t TIME_STAMP_DELTA_GET(uint32_t ts)
{
u32_t t;
uint32_t t;
/* serialize so OS_GET_TIME() is not reordered */
timestamp_serialize();
t = OS_GET_TIME();
u32_t res = (t >= ts) ? (t - ts) : (ULONG_MAX - ts + t);
uint32_t res = (t >= ts) ? (t - ts) : (ULONG_MAX - ts + t);
if (ts > 0) {
res -= tm_off;
@ -52,14 +52,14 @@ static inline u32_t TIME_STAMP_DELTA_GET(u32_t ts)
*/
static inline void bench_test_init(void)
{
u32_t t = OS_GET_TIME();
uint32_t t = OS_GET_TIME();
tm_off = OS_GET_TIME() - t;
}
/* timestamp for checks */
static s64_t tCheck;
static int64_t tCheck;
/*
* Routines are invoked before and after the benchmark and check

View file

@ -18,7 +18,7 @@ struct _thread_arch {
typedef struct _thread_arch _thread_arch_t;
/* Architecture functions */
static inline u32_t arch_k_cycle_get_32(void)
static inline uint32_t arch_k_cycle_get_32(void)
{
return 0;
}

View file

@ -134,7 +134,7 @@ void z_ztest_check_expected_value(const char *fn, const char *param,
void z_ztest_expect_data(const char *fn, const char *name, void *val);
void z_ztest_check_expected_data(const char *fn, const char *name, void *data,
u32_t length);
uint32_t length);
void z_ztest_returns_value(const char *fn, uintptr_t value);
uintptr_t z_ztest_get_return_value(const char *fn);

View file

@ -24,7 +24,7 @@ struct unit_test {
void (*test)(void);
void (*setup)(void);
void (*teardown)(void);
u32_t thread_options;
uint32_t thread_options;
};
void z_ztest_run_test_suite(const char *name, struct unit_test *suite);

View file

@ -108,7 +108,7 @@ static void cpu_hold(void *arg1, void *arg2, void *arg3)
ARG_UNUSED(arg2);
ARG_UNUSED(arg3);
unsigned int key = arch_irq_lock();
u32_t dt, start_ms = k_uptime_get_32();
uint32_t dt, start_ms = k_uptime_get_32();
k_sem_give(&cpuhold_sem);
@ -426,10 +426,10 @@ void main(void)
end_report();
if (IS_ENABLED(CONFIG_ZTEST_RETEST_IF_PASSED)) {
static __noinit struct {
u32_t magic;
u32_t boots;
uint32_t magic;
uint32_t boots;
} state;
const u32_t magic = 0x152ac523;
const uint32_t magic = 0x152ac523;
if (state.magic != magic) {
state.magic = magic;

View file

@ -207,7 +207,7 @@ void z_ztest_expect_data(const char *fn, const char *name, void *val)
}
void z_ztest_check_expected_data(const char *fn, const char *name, void *data,
u32_t length)
uint32_t length)
{
struct parameter *param;
void *expected;