From afae718917b81a3bda6e777507b91104921f6b43 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Wed, 27 Mar 2024 12:06:42 +0800 Subject: [PATCH] clang-format --- ext-src/swoole_server.cc | 8 +++----- src/server/master.cc | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ext-src/swoole_server.cc b/ext-src/swoole_server.cc index 879a6ac1793..0284303619a 100644 --- a/ext-src/swoole_server.cc +++ b/ext-src/swoole_server.cc @@ -716,7 +716,7 @@ static bool php_swoole_server_task_unpack(zval *zresult, EventData *task_result) PHP_VAR_UNSERIALIZE_DESTROY(var_hash); if (!unserialized) { swoole_warning("unserialize() failed, Error at offset " ZEND_LONG_FMT " of %zd bytes", - (zend_long)((char *) p - packet.data), + (zend_long) ((char *) p - packet.data), l); return false; } @@ -1768,15 +1768,13 @@ static int php_swoole_server_dispatch_func(Server *serv, Connection *conn, SendD *zserv = *((zval *) serv->private_data_2); ZVAL_LONG(zfd, conn ? conn->session_id : data->info.fd); - ZVAL_LONG(ztype, (zend_long)(data ? data->info.type : (int) SW_SERVER_EVENT_CLOSE)); + ZVAL_LONG(ztype, (zend_long) (data ? data->info.type : (int) SW_SERVER_EVENT_CLOSE)); if (data && sw_zend_function_max_num_args(fci_cache->function_handler) > 3) { // TODO: reduce memory copy zdata = &args[3]; ZVAL_STRINGL(zdata, data->data, data->info.len > SW_IPC_BUFFER_SIZE ? SW_IPC_BUFFER_SIZE : data->info.len); } - HOOK_PHP_CALL_STACK( - auto call_result = sw_zend_call_function_ex(nullptr, fci_cache, zdata ? 4 : 3, args, &retval); - ); + HOOK_PHP_CALL_STACK(auto call_result = sw_zend_call_function_ex(nullptr, fci_cache, zdata ? 4 : 3, args, &retval);); if (UNEXPECTED(call_result != SUCCESS)) { php_swoole_error(E_WARNING, "%s->onDispatch handler error", SW_Z_OBJCE_NAME_VAL_P(zserv)); } else if (!ZVAL_IS_NULL(&retval)) { diff --git a/src/server/master.cc b/src/server/master.cc index 6c38338fb13..138daf1a70c 100644 --- a/src/server/master.cc +++ b/src/server/master.cc @@ -978,7 +978,7 @@ void Server::destroy() { join_reactor_thread(); } - release_pipe_buffers(); + release_pipe_buffers(); for (auto port : ports) { port->close(); @@ -1515,7 +1515,7 @@ bool Server::sendfile(SessionId session_id, const char *file, uint32_t l_file, o "sendfile name[%.8s...] length %u is exceed the max name len %u", file, l_file, - (uint32_t)(SW_IPC_BUFFER_SIZE - sizeof(SendfileTask) - 1)); + (uint32_t) (SW_IPC_BUFFER_SIZE - sizeof(SendfileTask) - 1)); return false; } // string must be zero termination (for `state` system call) @@ -1769,7 +1769,7 @@ ListenPort *Server::add_port(SocketType type, const char *host, int port) { #ifdef SW_USE_OPENSSL if (type & SW_SOCK_SSL) { - type = (SocketType)(type & (~SW_SOCK_SSL)); + type = (SocketType) (type & (~SW_SOCK_SSL)); ls->type = type; ls->ssl = 1; ls->ssl_context = new SSLContext(); @@ -2016,7 +2016,7 @@ int Server::create_pipe_buffers() { } void Server::release_pipe_buffers() { - message_bus.free_buffer(); + message_bus.free_buffer(); } int Server::get_idle_worker_num() {