Skip to content

Commit 9e2a28b

Browse files
committed
fix formatting issues
1 parent 58e7fd9 commit 9e2a28b

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

core/iwasm/common/wasm_application.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ wasm_application_execute_main(WASMModuleInstanceCommon *module_inst, int32 argc,
289289
exec_env = wasm_runtime_get_exec_env_singleton(module_inst);
290290
if (exec_env) {
291291
wasm_runtime_dump_mem_consumption(exec_env);
292-
(WASMModuleInstance *)module_inst->cur_exception
292+
(WASMModuleInstance *)module_inst->cur_exception
293293
}
294294
#endif
295295

@@ -716,7 +716,7 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name,
716716
// Explicit cast to double to avoid warning.
717717
// Float arguments are promoted to double in variadic
718718
// functions per section 6.5.2.2 of the C99 standard.
719-
os_printf("%.7g:f32", (double) *(float32 *)(argv1 + k));
719+
os_printf("%.7g:f32", (double)*(float32 *)(argv1 + k));
720720
k++;
721721
break;
722722
}

core/shared/platform/zephyr/platform_internal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
#endif
8888

8989
#ifndef STDIN_FILENO
90-
#define STDIN_FILENO 0
90+
#define STDIN_FILENO 0
9191
#endif
9292

9393
#ifndef STDOUT_FILENO
@@ -98,7 +98,6 @@
9898
#define STDERR_FILENO 2
9999
#endif
100100

101-
102101
/* Synchronization primitives for usermode.
103102
* The macros are prefixed with 'z' because when building
104103
* with WAMR_BUILD_LIBC_WASI the same functions are defined,
@@ -241,7 +240,7 @@ set_exec_mem_alloc_func(exec_mem_alloc_func_t alloc_func,
241240
typedef int os_dir_stream;
242241
typedef int os_raw_file_handle;
243242

244-
#define OS_DIR_STREAM_INVALID 0
243+
#define OS_DIR_STREAM_INVALID 0
245244

246245
// handle for file system descriptor
247246
typedef struct zephyr_fs_desc {
@@ -288,7 +287,8 @@ typedef struct timespec os_timespec;
288287

289288
#define CLOCK_MONOTONIC 4
290289

291-
static inline int os_sched_yield(void)
290+
static inline int
291+
os_sched_yield(void)
292292
{
293293
k_yield();
294294
return 0;

core/shared/platform/zephyr/zephyr_file.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ os_fstat(os_file_handle handle, struct __wasi_filestat_t *buf)
181181
buf->st_dev = 0; // Zephyr's fs_stat doesn't provide a device ID
182182
buf->st_ino = 0; // Zephyr's fs_stat doesn't provide an inode number
183183
buf->st_filetype = entry.type == FS_DIR_ENTRY_DIR
184-
? __WASI_FILETYPE_DIRECTORY
185-
: __WASI_FILETYPE_REGULAR_FILE;
184+
? __WASI_FILETYPE_DIRECTORY
185+
: __WASI_FILETYPE_REGULAR_FILE;
186186
buf->st_nlink = 1; // Zephyr's fs_stat doesn't provide a link count
187187
buf->st_size = entry.size;
188188
buf->st_atim = 0; // Zephyr's fs_stat doesn't provide timestamps
@@ -449,10 +449,11 @@ os_openat(os_file_handle handle, const char *path, __wasi_oflags_t oflags,
449449
// Is a directory
450450
fs_dir_t_init(&ptr->dir);
451451
rc = fs_opendir(&ptr->dir, abs_path);
452-
}
453-
else {
452+
}
453+
else {
454454
// Is a file
455-
int zmode = wasi_flags_to_zephyr(oflags, fd_flags, lookup_flags, access_mode);
455+
int zmode =
456+
wasi_flags_to_zephyr(oflags, fd_flags, lookup_flags, access_mode);
456457
fs_file_t_init(&ptr->file);
457458
rc = fs_open(&ptr->file, abs_path, zmode);
458459
}
@@ -481,7 +482,7 @@ os_file_get_access_mode(os_file_handle handle,
481482
*access_mode = WASI_LIBC_ACCESS_MODE_READ_WRITE;
482483
return __WASI_ESUCCESS;
483484
}
484-
485+
485486
GET_FILE_SYSTEM_DESCRIPTOR(handle->fd, ptr);
486487

487488
if (ptr->is_dir) {

0 commit comments

Comments
 (0)