Skip to content

Commit b200bfd

Browse files
committed
fix clang-tidy
Signed-off-by: zty98751 <zty98751@alibaba-inc.com>
1 parent 242765e commit b200bfd

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

src/wasm.cc

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class WasmBase::ShutdownHandle {
103103
std::shared_ptr<WasmBase> wasm_;
104104
};
105105

106+
// NOLINT(readability-function-size)
106107
void WasmBase::registerCallbacks() {
107108
#define _REGISTER(_fn) \
108109
wasm_vm_->registerCallback( \
@@ -378,54 +379,54 @@ ContextBase *WasmBase::getRootContext(const std::shared_ptr<PluginBase> &plugin,
378379
void WasmBase::startVm(ContextBase *root_context) {
379380
// wasi_snapshot_preview1.clock_time_get
380381
wasm_vm_->setRestrictedCallback(
381-
true, {// logging (Proxy-Wasm)
382-
"env.proxy_log",
383-
// logging (stdout/stderr)
384-
"wasi_unstable.fd_write", "wasi_snapshot_preview1.fd_write",
385-
// args
386-
"wasi_unstable.args_sizes_get", "wasi_snapshot_preview1.args_sizes_get",
387-
"wasi_unstable.args_get", "wasi_snapshot_preview1.args_get",
388-
// environment variables
389-
"wasi_unstable.environ_sizes_get", "wasi_snapshot_preview1.environ_sizes_get",
390-
"wasi_unstable.environ_get", "wasi_snapshot_preview1.environ_get",
391-
// preopened files/directories
392-
"wasi_unstable.fd_prestat_get", "wasi_snapshot_preview1.fd_prestat_get",
393-
"wasi_unstable.fd_prestat_dir_name", "wasi_snapshot_preview1.fd_prestat_dir_name",
394-
// time
395-
"wasi_unstable.clock_time_get", "wasi_snapshot_preview1.clock_time_get",
396-
"wasi_unstable.clock_res_get", "wasi_snapshot_preview1.clock_res_get",
397-
// random
398-
"wasi_unstable.random_get", "wasi_snapshot_preview1.random_get",
399-
// Go runtime initialization
400-
"wasi_unstable.fd_fdstat_get", "wasi_snapshot_preview1.fd_fdstat_get",
401-
"wasi_unstable.fd_fdstat_set_flags", "wasi_snapshot_preview1.fd_fdstat_set_flags",
402-
"wasi_unstable.fd_fdstat_set_rights", "wasi_snapshot_preview1.fd_fdstat_set_rights",
403-
"wasi_unstable.path_filestat_get", "wasi_snapshot_preview1.path_filestat_get",
404-
"wasi_unstable.fd_filestat_get", "wasi_snapshot_preview1.fd_filestat_get",
405-
"wasi_unstable.fd_filestat_set_size", "wasi_snapshot_preview1.fd_filestat_set_size",
406-
"wasi_unstable.fd_filestat_set_times", "wasi_snapshot_preview1.fd_filestat_set_times",
407-
"wasi_unstable.fd_advise", "wasi_snapshot_preview1.fd_advise",
408-
"wasi_unstable.fd_allocate", "wasi_snapshot_preview1.fd_allocate",
409-
"wasi_unstable.fd_datasync", "wasi_snapshot_preview1.fd_datasync",
410-
"wasi_unstable.fd_pread", "wasi_snapshot_preview1.fd_pread",
411-
"wasi_unstable.fd_pwrite", "wasi_snapshot_preview1.fd_pwrite",
412-
"wasi_unstable.fd_readdir", "wasi_snapshot_preview1.fd_readdir",
413-
"wasi_unstable.fd_renumber", "wasi_snapshot_preview1.fd_renumber",
414-
"wasi_unstable.fd_sync", "wasi_snapshot_preview1.fd_sync",
415-
"wasi_unstable.fd_tell", "wasi_snapshot_preview1.fd_tell",
416-
"wasi_unstable.path_create_directory", "wasi_snapshot_preview1.path_create_directory",
417-
"wasi_unstable.path_filestat_set_times", "wasi_snapshot_preview1.path_filestat_set_times",
418-
"wasi_unstable.path_link", "wasi_snapshot_preview1.path_link",
419-
"wasi_unstable.path_readlink", "wasi_snapshot_preview1.path_readlink",
420-
"wasi_unstable.path_remove_directory", "wasi_snapshot_preview1.path_remove_directory",
421-
"wasi_unstable.path_rename", "wasi_snapshot_preview1.path_rename",
422-
"wasi_unstable.path_symlink", "wasi_snapshot_preview1.path_symlink",
423-
"wasi_unstable.path_unlink_file", "wasi_snapshot_preview1.path_unlink_file",
424-
"wasi_unstable.poll_oneoff", "wasi_snapshot_preview1.poll_oneoff",
425-
"wasi_unstable.sock_accept", "wasi_snapshot_preview1.sock_accept",
426-
"wasi_unstable.sock_recv", "wasi_snapshot_preview1.sock_recv",
427-
"wasi_unstable.sock_send", "wasi_snapshot_preview1.sock_send",
428-
"wasi_unstable.sock_shutdown", "wasi_snapshot_preview1.sock_shutdown"});
382+
true,
383+
{// logging (Proxy-Wasm)
384+
"env.proxy_log",
385+
// logging (stdout/stderr)
386+
"wasi_unstable.fd_write", "wasi_snapshot_preview1.fd_write",
387+
// args
388+
"wasi_unstable.args_sizes_get", "wasi_snapshot_preview1.args_sizes_get",
389+
"wasi_unstable.args_get", "wasi_snapshot_preview1.args_get",
390+
// environment variables
391+
"wasi_unstable.environ_sizes_get", "wasi_snapshot_preview1.environ_sizes_get",
392+
"wasi_unstable.environ_get", "wasi_snapshot_preview1.environ_get",
393+
// preopened files/directories
394+
"wasi_unstable.fd_prestat_get", "wasi_snapshot_preview1.fd_prestat_get",
395+
"wasi_unstable.fd_prestat_dir_name", "wasi_snapshot_preview1.fd_prestat_dir_name",
396+
// time
397+
"wasi_unstable.clock_time_get", "wasi_snapshot_preview1.clock_time_get",
398+
"wasi_unstable.clock_res_get", "wasi_snapshot_preview1.clock_res_get",
399+
// random
400+
"wasi_unstable.random_get", "wasi_snapshot_preview1.random_get",
401+
// Go runtime initialization
402+
"wasi_unstable.fd_fdstat_get", "wasi_snapshot_preview1.fd_fdstat_get",
403+
"wasi_unstable.fd_fdstat_set_flags", "wasi_snapshot_preview1.fd_fdstat_set_flags",
404+
"wasi_unstable.fd_fdstat_set_rights", "wasi_snapshot_preview1.fd_fdstat_set_rights",
405+
"wasi_unstable.path_filestat_get", "wasi_snapshot_preview1.path_filestat_get",
406+
"wasi_unstable.fd_filestat_get", "wasi_snapshot_preview1.fd_filestat_get",
407+
"wasi_unstable.fd_filestat_set_size", "wasi_snapshot_preview1.fd_filestat_set_size",
408+
"wasi_unstable.fd_filestat_set_times", "wasi_snapshot_preview1.fd_filestat_set_times",
409+
"wasi_unstable.fd_advise", "wasi_snapshot_preview1.fd_advise", "wasi_unstable.fd_allocate",
410+
"wasi_snapshot_preview1.fd_allocate", "wasi_unstable.fd_datasync",
411+
"wasi_snapshot_preview1.fd_datasync", "wasi_unstable.fd_pread",
412+
"wasi_snapshot_preview1.fd_pread", "wasi_unstable.fd_pwrite",
413+
"wasi_snapshot_preview1.fd_pwrite", "wasi_unstable.fd_readdir",
414+
"wasi_snapshot_preview1.fd_readdir", "wasi_unstable.fd_renumber",
415+
"wasi_snapshot_preview1.fd_renumber", "wasi_unstable.fd_sync",
416+
"wasi_snapshot_preview1.fd_sync", "wasi_unstable.fd_tell", "wasi_snapshot_preview1.fd_tell",
417+
"wasi_unstable.path_create_directory", "wasi_snapshot_preview1.path_create_directory",
418+
"wasi_unstable.path_filestat_set_times", "wasi_snapshot_preview1.path_filestat_set_times",
419+
"wasi_unstable.path_link", "wasi_snapshot_preview1.path_link", "wasi_unstable.path_readlink",
420+
"wasi_snapshot_preview1.path_readlink", "wasi_unstable.path_remove_directory",
421+
"wasi_snapshot_preview1.path_remove_directory", "wasi_unstable.path_rename",
422+
"wasi_snapshot_preview1.path_rename", "wasi_unstable.path_symlink",
423+
"wasi_snapshot_preview1.path_symlink", "wasi_unstable.path_unlink_file",
424+
"wasi_snapshot_preview1.path_unlink_file", "wasi_unstable.poll_oneoff",
425+
"wasi_snapshot_preview1.poll_oneoff", "wasi_unstable.sock_accept",
426+
"wasi_snapshot_preview1.sock_accept", "wasi_unstable.sock_recv",
427+
"wasi_snapshot_preview1.sock_recv", "wasi_unstable.sock_send",
428+
"wasi_snapshot_preview1.sock_send", "wasi_unstable.sock_shutdown",
429+
"wasi_snapshot_preview1.sock_shutdown"});
429430
if (_initialize_) {
430431
// WASI reactor.
431432
_initialize_(root_context);

0 commit comments

Comments
 (0)