src: move variable declarations to top of block
This commit is contained in:
parent
2b57c726c8
commit
a2eeaa5f82
@ -107,8 +107,9 @@ static SOCKET _afd_get_base_socket(SOCKET socket) {
|
|||||||
|
|
||||||
static ssize_t _afd_get_protocol_info(SOCKET socket,
|
static ssize_t _afd_get_protocol_info(SOCKET socket,
|
||||||
WSAPROTOCOL_INFOW* protocol_info) {
|
WSAPROTOCOL_INFOW* protocol_info) {
|
||||||
ssize_t id;
|
|
||||||
int opt_len;
|
int opt_len;
|
||||||
|
ssize_t id;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
opt_len = sizeof *protocol_info;
|
opt_len = sizeof *protocol_info;
|
||||||
if (getsockopt(socket,
|
if (getsockopt(socket,
|
||||||
@ -119,7 +120,7 @@ static ssize_t _afd_get_protocol_info(SOCKET socket,
|
|||||||
return_error(-1);
|
return_error(-1);
|
||||||
|
|
||||||
id = -1;
|
id = -1;
|
||||||
for (size_t i = 0; i < array_count(AFD_PROVIDER_GUID_LIST); i++) {
|
for (i = 0; i < array_count(AFD_PROVIDER_GUID_LIST); i++) {
|
||||||
if (memcmp(&protocol_info->ProviderId,
|
if (memcmp(&protocol_info->ProviderId,
|
||||||
&AFD_PROVIDER_GUID_LIST[i],
|
&AFD_PROVIDER_GUID_LIST[i],
|
||||||
sizeof protocol_info->ProviderId) == 0) {
|
sizeof protocol_info->ProviderId) == 0) {
|
||||||
|
|||||||
@ -88,6 +88,7 @@ int ep_port_close(ep_port_t* port_info) {
|
|||||||
int ep_port_delete(ep_port_t* port_info) {
|
int ep_port_delete(ep_port_t* port_info) {
|
||||||
tree_node_t* tree_node;
|
tree_node_t* tree_node;
|
||||||
queue_node_t* queue_node;
|
queue_node_t* queue_node;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
EnterCriticalSection(&port_info->lock);
|
EnterCriticalSection(&port_info->lock);
|
||||||
|
|
||||||
@ -104,7 +105,7 @@ int ep_port_delete(ep_port_t* port_info) {
|
|||||||
ep_sock_force_delete(port_info, sock_info);
|
ep_sock_force_delete(port_info, sock_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < array_count(port_info->poll_group_allocators); i++) {
|
for (i = 0; i < array_count(port_info->poll_group_allocators); i++) {
|
||||||
poll_group_allocator_t* pga = port_info->poll_group_allocators[i];
|
poll_group_allocator_t* pga = port_info->poll_group_allocators[i];
|
||||||
if (pga != NULL)
|
if (pga != NULL)
|
||||||
poll_group_allocator_delete(pga);
|
poll_group_allocator_delete(pga);
|
||||||
@ -148,8 +149,9 @@ static int _ep_port_feed_events(ep_port_t* port_info,
|
|||||||
OVERLAPPED_ENTRY* iocp_events,
|
OVERLAPPED_ENTRY* iocp_events,
|
||||||
int iocp_event_count) {
|
int iocp_event_count) {
|
||||||
int epoll_event_count = 0;
|
int epoll_event_count = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
for (int i = 0; i < iocp_event_count; i++) {
|
for (i = 0; i < iocp_event_count; i++) {
|
||||||
OVERLAPPED* overlapped = iocp_events[i].lpOverlapped;
|
OVERLAPPED* overlapped = iocp_events[i].lpOverlapped;
|
||||||
struct epoll_event* ev = &epoll_events[epoll_event_count];
|
struct epoll_event* ev = &epoll_events[epoll_event_count];
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user