src: use more condensed style for short comments

This commit is contained in:
Bert Belder 2018-05-03 14:21:11 +02:00
parent 7c52fee8be
commit 0fbf0e2b0e
No known key found for this signature in database
GPG Key ID: 7A77887B2E2ED461
6 changed files with 14 additions and 23 deletions

View File

@ -37,8 +37,7 @@ static const GUID _AFD_PROVIDER_GUID_LIST[] = {
/* This protocol info record is used by afd_create_driver_socket() to create /* This protocol info record is used by afd_create_driver_socket() to create
* sockets that can be used as the first argument to afd_poll(). It is * sockets that can be used as the first argument to afd_poll(). It is
* populated on startup by afd_global_init(). * populated on startup by afd_global_init(). */
*/
static WSAPROTOCOL_INFOW _afd_driver_socket_template; static WSAPROTOCOL_INFOW _afd_driver_socket_template;
static const WSAPROTOCOL_INFOW* _afd_find_protocol_info( static const WSAPROTOCOL_INFOW* _afd_find_protocol_info(
@ -76,8 +75,7 @@ int afd_global_init(void) {
/* Find a WSAPROTOCOL_INFOW structure that we can use to create an MSAFD /* Find a WSAPROTOCOL_INFOW structure that we can use to create an MSAFD
* socket. Preferentially we pick a UDP socket, otherwise try TCP or any * socket. Preferentially we pick a UDP socket, otherwise try TCP or any
* other type. * other type. */
*/
for (;;) { for (;;) {
afd_info = _afd_find_protocol_info(infos, infos_count, IPPROTO_UDP); afd_info = _afd_find_protocol_info(infos, infos_count, IPPROTO_UDP);
if (afd_info != NULL) if (afd_info != NULL)
@ -174,9 +172,8 @@ int afd_poll(SOCKET driver_socket,
sizeof *poll_info); sizeof *poll_info);
if (overlapped == NULL) { if (overlapped == NULL) {
/* If this is a blocking operation, wait for the event to become /* If this is a blocking operation, wait for the event to become signaled,
* signaled, and then grab the real status from the io status block. * and then grab the real status from the io status block. */
*/
if (status == STATUS_PENDING) { if (status == STATUS_PENDING) {
DWORD r = WaitForSingleObject(event, INFINITE); DWORD r = WaitForSingleObject(event, INFINITE);

View File

@ -214,8 +214,7 @@ int ep_port_wait(ep_port_t* port_info,
} }
/* Compute the timeout for GetQueuedCompletionStatus, and the wait end /* Compute the timeout for GetQueuedCompletionStatus, and the wait end
* time, if the user specified a timeout other than zero or infinite. * time, if the user specified a timeout other than zero or infinite. */
*/
if (timeout > 0) { if (timeout > 0) {
due = GetTickCount64() + timeout; due = GetTickCount64() + timeout;
gqcs_timeout = (DWORD) timeout; gqcs_timeout = (DWORD) timeout;
@ -228,8 +227,7 @@ int ep_port_wait(ep_port_t* port_info,
EnterCriticalSection(&port_info->lock); EnterCriticalSection(&port_info->lock);
/* Dequeue completion packets until either at least one interesting event /* Dequeue completion packets until either at least one interesting event
* has been discovered, or the timeout is reached. * has been discovered, or the timeout is reached. */
*/
for (;;) { for (;;) {
ULONGLONG now; ULONGLONG now;

View File

@ -7,10 +7,9 @@
#include "internal.h" #include "internal.h"
#include "util.h" #include "util.h"
/* NB: the tree functions do not set errno or LastError when they fail. Each of /* N.b.: the tree functions do not set errno or LastError when they fail. Each
* the API functions has at most one failure mode. It is up to the caller to * of the API functions has at most one failure mode. It is up to the caller to
* set an appropriate error code when necessary. * set an appropriate error code when necessary. */
*/
typedef struct tree tree_t; typedef struct tree tree_t;
typedef struct tree_node tree_node_t; typedef struct tree_node tree_node_t;

View File

@ -42,8 +42,7 @@ SOCKET ws_get_base_socket(SOCKET socket) {
} }
/* Retrieves a copy of the winsock catalog. /* Retrieves a copy of the winsock catalog.
* The infos pointer must be released by the caller with free(). * The infos pointer must be released by the caller with free(). */
*/
ssize_t ws_get_protocol_catalog(WSAPROTOCOL_INFOW** infos_out) { ssize_t ws_get_protocol_catalog(WSAPROTOCOL_INFOW** infos_out) {
DWORD buffer_size = _WS_INITIAL_CATALOG_BUFFER_SIZE; DWORD buffer_size = _WS_INITIAL_CATALOG_BUFFER_SIZE;
int count; int count;

View File

@ -200,10 +200,9 @@ int main(void) {
} }
{ {
/* Add the *write* socket to the epoll set. The event mask is empty, /* Add the *write* socket to the epoll set. The event mask is empty, but
* but since EPOLLHUP and EPOLLERR are always reportable, the next call to * since EPOLLHUP and EPOLLERR are always reportable, the next call to
* epoll_wait() should be able to detect that the connection is now closed. * epoll_wait() should detect that the connection has been closed. */
*/
struct epoll_event ev; struct epoll_event ev;
int r; int r;

View File

@ -53,8 +53,7 @@ int main(void) {
r = connect(sock, (struct sockaddr*) &address, sizeof address); r = connect(sock, (struct sockaddr*) &address, sizeof address);
/* Unlike unix, windows sets the error to EWOULDBLOCK when the connection /* Unlike unix, windows sets the error to EWOULDBLOCK when the connection
* is being established in the background. * is being established in the background. */
*/
check(r == 0 || WSAGetLastError() == WSAEWOULDBLOCK); check(r == 0 || WSAGetLastError() == WSAEWOULDBLOCK);
ev.events = EPOLLOUT | EPOLLERR | EPOLLONESHOT; ev.events = EPOLLOUT | EPOLLERR | EPOLLONESHOT;