Change code style of form "if( x )" to "if (x)" for consistency.
This commit is contained in:
parent
2a19883857
commit
3795709344
|
@ -87,21 +87,21 @@ static void adjust_changes( int fd, unsigned int filter )
|
|||
return;
|
||||
|
||||
val = DN_MULTISHOT;
|
||||
if( filter & FILE_NOTIFY_CHANGE_FILE_NAME )
|
||||
if (filter & FILE_NOTIFY_CHANGE_FILE_NAME)
|
||||
val |= DN_RENAME | DN_DELETE | DN_CREATE;
|
||||
if( filter & FILE_NOTIFY_CHANGE_DIR_NAME )
|
||||
if (filter & FILE_NOTIFY_CHANGE_DIR_NAME)
|
||||
val |= DN_RENAME | DN_DELETE | DN_CREATE;
|
||||
if( filter & FILE_NOTIFY_CHANGE_ATTRIBUTES )
|
||||
if (filter & FILE_NOTIFY_CHANGE_ATTRIBUTES)
|
||||
val |= DN_ATTRIB;
|
||||
if( filter & FILE_NOTIFY_CHANGE_SIZE )
|
||||
if (filter & FILE_NOTIFY_CHANGE_SIZE)
|
||||
val |= DN_MODIFY;
|
||||
if( filter & FILE_NOTIFY_CHANGE_LAST_WRITE )
|
||||
if (filter & FILE_NOTIFY_CHANGE_LAST_WRITE)
|
||||
val |= DN_MODIFY;
|
||||
if( filter & FILE_NOTIFY_CHANGE_LAST_ACCESS )
|
||||
if (filter & FILE_NOTIFY_CHANGE_LAST_ACCESS)
|
||||
val |= DN_ACCESS;
|
||||
if( filter & FILE_NOTIFY_CHANGE_CREATION )
|
||||
if (filter & FILE_NOTIFY_CHANGE_CREATION)
|
||||
val |= DN_CREATE;
|
||||
if( filter & FILE_NOTIFY_CHANGE_SECURITY )
|
||||
if (filter & FILE_NOTIFY_CHANGE_SECURITY)
|
||||
val |= DN_ATTRIB;
|
||||
fcntl( fd, F_NOTIFY, val );
|
||||
#endif
|
||||
|
|
|
@ -1384,9 +1384,9 @@ int default_fd_get_poll_events( struct fd *fd )
|
|||
{
|
||||
int events = 0;
|
||||
|
||||
if( !list_empty( &fd->read_q ))
|
||||
if (!list_empty( &fd->read_q ))
|
||||
events |= POLLIN;
|
||||
if( !list_empty( &fd->write_q ))
|
||||
if (!list_empty( &fd->write_q ))
|
||||
events |= POLLOUT;
|
||||
|
||||
return events;
|
||||
|
|
|
@ -198,7 +198,7 @@ static int mailslot_get_poll_events( struct fd *fd )
|
|||
int events = 0;
|
||||
assert( mailslot->obj.ops == &mailslot_ops );
|
||||
|
||||
if( !list_empty( &mailslot->read_q ))
|
||||
if (!list_empty( &mailslot->read_q ))
|
||||
events |= POLLIN;
|
||||
|
||||
return events;
|
||||
|
@ -208,7 +208,7 @@ static void mailslot_poll_event( struct fd *fd, int event )
|
|||
{
|
||||
struct mailslot *mailslot = get_fd_user( fd );
|
||||
|
||||
if( !list_empty( &mailslot->read_q ) && (POLLIN & event) )
|
||||
if (!list_empty( &mailslot->read_q ) && (POLLIN & event))
|
||||
async_terminate_head( &mailslot->read_q, STATUS_ALERTED );
|
||||
|
||||
set_fd_events( fd, mailslot_get_poll_events(fd) );
|
||||
|
@ -222,13 +222,13 @@ static void mailslot_queue_async( struct fd *fd, void *apc, void *user,
|
|||
|
||||
assert(mailslot->obj.ops == &mailslot_ops);
|
||||
|
||||
if( type != ASYNC_TYPE_READ )
|
||||
if (type != ASYNC_TYPE_READ)
|
||||
{
|
||||
set_error(STATUS_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
if( list_empty( &mailslot->writers ) ||
|
||||
if (list_empty( &mailslot->writers ) ||
|
||||
!mailslot_message_count( mailslot ))
|
||||
{
|
||||
set_error(STATUS_IO_TIMEOUT);
|
||||
|
@ -267,18 +267,18 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
|
|||
int fds[2];
|
||||
static const WCHAR slot[] = {'m','a','i','l','s','l','o','t','\\',0};
|
||||
|
||||
if( ( len <= strlenW( slot ) ) || strncmpiW( slot, name, strlenW( slot ) ) )
|
||||
if (( len <= strlenW( slot )) || strncmpiW( slot, name, strlenW( slot ) ))
|
||||
{
|
||||
set_error( STATUS_OBJECT_NAME_INVALID );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mailslot = create_named_object( sync_namespace, &mailslot_ops, name, len );
|
||||
if( !mailslot )
|
||||
if (!mailslot)
|
||||
return NULL;
|
||||
|
||||
/* it already exists - there can only be one mailslot to read from */
|
||||
if( get_error() == STATUS_OBJECT_NAME_COLLISION )
|
||||
if (get_error() == STATUS_OBJECT_NAME_COLLISION)
|
||||
{
|
||||
release_object( mailslot );
|
||||
return NULL;
|
||||
|
@ -291,7 +291,7 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
|
|||
list_init( &mailslot->writers );
|
||||
list_init( &mailslot->read_q );
|
||||
|
||||
if( !socketpair( PF_UNIX, SOCK_DGRAM, 0, fds ) )
|
||||
if (!socketpair( PF_UNIX, SOCK_DGRAM, 0, fds ))
|
||||
{
|
||||
fcntl( fds[0], F_SETFL, O_NONBLOCK );
|
||||
fcntl( fds[1], F_SETFL, O_NONBLOCK );
|
||||
|
@ -299,7 +299,7 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
|
|||
fds[1], &mailslot->obj );
|
||||
mailslot->write_fd = create_anonymous_fd( &mail_writer_fd_ops,
|
||||
fds[0], &mailslot->obj );
|
||||
if( mailslot->fd && mailslot->write_fd ) return mailslot;
|
||||
if (mailslot->fd && mailslot->write_fd) return mailslot;
|
||||
}
|
||||
else file_set_error();
|
||||
|
||||
|
@ -402,7 +402,7 @@ DECL_HANDLER(create_mailslot)
|
|||
reply->handle = 0;
|
||||
mailslot = create_mailslot( get_req_data(), get_req_data_size(),
|
||||
req->max_msgsize, req->read_timeout );
|
||||
if( mailslot )
|
||||
if (mailslot)
|
||||
{
|
||||
reply->handle = alloc_handle( current->process, mailslot,
|
||||
GENERIC_READ, req->inherit );
|
||||
|
@ -418,19 +418,19 @@ DECL_HANDLER(open_mailslot)
|
|||
|
||||
reply->handle = 0;
|
||||
|
||||
if( ! ( req->sharing & FILE_SHARE_READ ) )
|
||||
if (!(req->sharing & FILE_SHARE_READ))
|
||||
{
|
||||
set_error( STATUS_SHARING_VIOLATION );
|
||||
return;
|
||||
}
|
||||
|
||||
mailslot = open_mailslot( get_req_data(), get_req_data_size() );
|
||||
if( mailslot )
|
||||
if (mailslot)
|
||||
{
|
||||
struct mail_writer *writer;
|
||||
|
||||
writer = create_mail_writer( mailslot, req->access, req->sharing );
|
||||
if( writer )
|
||||
if (writer)
|
||||
{
|
||||
reply->handle = alloc_handle( current->process, writer,
|
||||
req->access, req->inherit );
|
||||
|
@ -448,16 +448,16 @@ DECL_HANDLER(set_mailslot_info)
|
|||
{
|
||||
struct mailslot *mailslot = get_mailslot_obj( current->process, req->handle, 0 );
|
||||
|
||||
if( mailslot )
|
||||
if (mailslot)
|
||||
{
|
||||
if( req->flags & MAILSLOT_SET_READ_TIMEOUT )
|
||||
if (req->flags & MAILSLOT_SET_READ_TIMEOUT)
|
||||
mailslot->read_timeout = req->read_timeout;
|
||||
reply->max_msgsize = mailslot->max_msgsize;
|
||||
reply->read_timeout = mailslot->read_timeout;
|
||||
reply->msg_count = mailslot_message_count(mailslot);
|
||||
|
||||
/* get the size of the next message */
|
||||
if( reply->msg_count )
|
||||
if (reply->msg_count)
|
||||
reply->next_msgsize = mailslot_next_msg_size(mailslot);
|
||||
else
|
||||
reply->next_msgsize = MAILSLOT_NO_MESSAGE;
|
||||
|
|
|
@ -213,7 +213,7 @@ static void named_pipe_destroy( struct object *obj)
|
|||
static struct fd *pipe_client_get_fd( struct object *obj )
|
||||
{
|
||||
struct pipe_client *client = (struct pipe_client *) obj;
|
||||
if( client->fd )
|
||||
if (client->fd)
|
||||
return (struct fd *) grab_object( client->fd );
|
||||
set_error( STATUS_PIPE_DISCONNECTED );
|
||||
return NULL;
|
||||
|
@ -246,7 +246,7 @@ static struct fd *pipe_server_get_fd( struct object *obj )
|
|||
|
||||
static void notify_empty( struct pipe_server *server )
|
||||
{
|
||||
if( !server->flush_poll )
|
||||
if (!server->flush_poll)
|
||||
return;
|
||||
assert( server->state == ps_connected_server );
|
||||
assert( server->event );
|
||||
|
@ -260,7 +260,7 @@ static void notify_empty( struct pipe_server *server )
|
|||
static void do_disconnect( struct pipe_server *server )
|
||||
{
|
||||
/* we may only have a server fd, if the client disconnected */
|
||||
if( server->client )
|
||||
if (server->client)
|
||||
{
|
||||
assert( server->client->server == server );
|
||||
assert( server->client->fd );
|
||||
|
@ -278,13 +278,13 @@ static void pipe_server_destroy( struct object *obj)
|
|||
|
||||
assert( obj->ops == &pipe_server_ops );
|
||||
|
||||
if( server->fd )
|
||||
if (server->fd)
|
||||
{
|
||||
notify_empty( server );
|
||||
do_disconnect( server );
|
||||
}
|
||||
|
||||
if( server->client )
|
||||
if (server->client)
|
||||
{
|
||||
server->client->server = NULL;
|
||||
server->client = NULL;
|
||||
|
@ -306,11 +306,11 @@ static void pipe_client_destroy( struct object *obj)
|
|||
|
||||
assert( obj->ops == &pipe_client_ops );
|
||||
|
||||
if( server )
|
||||
if (server)
|
||||
{
|
||||
notify_empty( server );
|
||||
|
||||
switch( server->state )
|
||||
switch(server->state)
|
||||
{
|
||||
case ps_connected_server:
|
||||
/* Don't destroy the server's fd here as we can't
|
||||
|
@ -343,13 +343,13 @@ static int pipe_data_remaining( struct pipe_server *server )
|
|||
assert( server->client );
|
||||
|
||||
fd = get_unix_fd( server->client->fd );
|
||||
if( fd < 0 )
|
||||
if (fd < 0)
|
||||
return 0;
|
||||
pfd.fd = fd;
|
||||
pfd.events = POLLIN;
|
||||
pfd.revents = 0;
|
||||
|
||||
if( 0 > poll( &pfd, 1, 0 ) )
|
||||
if (0 > poll( &pfd, 1, 0 ))
|
||||
return 0;
|
||||
|
||||
return pfd.revents&POLLIN;
|
||||
|
@ -360,7 +360,7 @@ static void check_flushed( void *arg )
|
|||
struct pipe_server *server = (struct pipe_server*) arg;
|
||||
|
||||
assert( server->event );
|
||||
if( pipe_data_remaining( server ) )
|
||||
if (pipe_data_remaining( server ))
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
|
@ -382,25 +382,25 @@ static int pipe_server_flush( struct fd *fd, struct event **event )
|
|||
{
|
||||
struct pipe_server *server = get_fd_user( fd );
|
||||
|
||||
if( !server )
|
||||
if (!server)
|
||||
return 0;
|
||||
|
||||
if( server->state != ps_connected_server )
|
||||
if (server->state != ps_connected_server)
|
||||
return 0;
|
||||
|
||||
/* FIXME: if multiple threads flush the same pipe,
|
||||
maybe should create a list of processes to notify */
|
||||
if( server->flush_poll )
|
||||
if (server->flush_poll)
|
||||
return 0;
|
||||
|
||||
if( pipe_data_remaining( server ) )
|
||||
if (pipe_data_remaining( server ))
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
/* this kind of sux -
|
||||
there's no unix way to be alerted when a pipe becomes empty */
|
||||
server->event = create_event( NULL, 0, 0, 0 );
|
||||
if( !server->event )
|
||||
if (!server->event)
|
||||
return 0;
|
||||
gettimeofday( &tv, NULL );
|
||||
add_timeout( &tv, 100 );
|
||||
|
@ -447,9 +447,9 @@ static struct named_pipe *create_named_pipe( const WCHAR *name, size_t len )
|
|||
struct named_pipe *pipe;
|
||||
|
||||
pipe = create_named_object( sync_namespace, &named_pipe_ops, name, len );
|
||||
if( pipe )
|
||||
if (pipe)
|
||||
{
|
||||
if( get_error() != STATUS_OBJECT_NAME_COLLISION )
|
||||
if (get_error() != STATUS_OBJECT_NAME_COLLISION)
|
||||
{
|
||||
/* initialize it if it didn't already exist */
|
||||
pipe->instances = 0;
|
||||
|
@ -488,7 +488,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
|
|||
struct pipe_server *server;
|
||||
|
||||
server = alloc_object( &pipe_server_ops );
|
||||
if( !server )
|
||||
if (!server)
|
||||
return NULL;
|
||||
|
||||
server->fd = NULL;
|
||||
|
@ -510,7 +510,7 @@ static struct pipe_client *create_pipe_client( struct pipe_server *server, unsig
|
|||
struct pipe_client *client;
|
||||
|
||||
client = alloc_object( &pipe_client_ops );
|
||||
if( !client )
|
||||
if (!client)
|
||||
return NULL;
|
||||
|
||||
client->fd = NULL;
|
||||
|
@ -551,10 +551,10 @@ DECL_HANDLER(create_named_pipe)
|
|||
|
||||
reply->handle = 0;
|
||||
pipe = create_named_pipe( get_req_data(), get_req_data_size() );
|
||||
if( !pipe )
|
||||
if (!pipe)
|
||||
return;
|
||||
|
||||
if( get_error() != STATUS_OBJECT_NAME_COLLISION )
|
||||
if (get_error() != STATUS_OBJECT_NAME_COLLISION)
|
||||
{
|
||||
pipe->insize = req->insize;
|
||||
pipe->outsize = req->outsize;
|
||||
|
@ -565,15 +565,15 @@ DECL_HANDLER(create_named_pipe)
|
|||
else
|
||||
{
|
||||
set_error( 0 ); /* clear the name collision */
|
||||
if( pipe->maxinstances <= pipe->instances )
|
||||
if (pipe->maxinstances <= pipe->instances)
|
||||
{
|
||||
set_error( STATUS_PIPE_BUSY );
|
||||
release_object( pipe );
|
||||
return;
|
||||
}
|
||||
if( ( pipe->maxinstances != req->maxinstances ) ||
|
||||
( pipe->timeout != req->timeout ) ||
|
||||
( pipe->flags != req->flags ) )
|
||||
if ((pipe->maxinstances != req->maxinstances) ||
|
||||
(pipe->timeout != req->timeout) ||
|
||||
(pipe->flags != req->flags))
|
||||
{
|
||||
set_error( STATUS_ACCESS_DENIED );
|
||||
release_object( pipe );
|
||||
|
@ -582,7 +582,7 @@ DECL_HANDLER(create_named_pipe)
|
|||
}
|
||||
|
||||
server = create_pipe_server( pipe, req->options );
|
||||
if(server)
|
||||
if (server)
|
||||
{
|
||||
reply->handle = alloc_handle( current->process, server,
|
||||
GENERIC_READ|GENERIC_WRITE, req->inherit );
|
||||
|
@ -601,7 +601,7 @@ DECL_HANDLER(open_named_pipe)
|
|||
int fds[2];
|
||||
|
||||
pipe = open_named_pipe( get_req_data(), get_req_data_size() );
|
||||
if ( !pipe )
|
||||
if (!pipe)
|
||||
{
|
||||
set_error( STATUS_NO_SUCH_FILE );
|
||||
return;
|
||||
|
@ -610,14 +610,14 @@ DECL_HANDLER(open_named_pipe)
|
|||
server = find_server2( pipe, ps_idle_server, ps_wait_open );
|
||||
release_object( pipe );
|
||||
|
||||
if ( !server )
|
||||
if (!server)
|
||||
{
|
||||
set_error( STATUS_PIPE_NOT_AVAILABLE );
|
||||
return;
|
||||
}
|
||||
|
||||
client = create_pipe_client( server, req->flags );
|
||||
if( client )
|
||||
if (client)
|
||||
{
|
||||
if (!socketpair( PF_UNIX, SOCK_STREAM, 0, fds ))
|
||||
{
|
||||
|
@ -640,7 +640,7 @@ DECL_HANDLER(open_named_pipe)
|
|||
fds[0], &server->obj );
|
||||
if (client->fd && server->fd && res != 1)
|
||||
{
|
||||
if( server->state == ps_wait_open )
|
||||
if (server->state == ps_wait_open)
|
||||
async_terminate_head( &server->wait_q, STATUS_SUCCESS );
|
||||
assert( list_empty( &server->wait_q ) );
|
||||
server->state = ps_connected_server;
|
||||
|
@ -663,10 +663,10 @@ DECL_HANDLER(connect_named_pipe)
|
|||
struct pipe_server *server;
|
||||
|
||||
server = get_pipe_server_obj(current->process, req->handle, 0);
|
||||
if(!server)
|
||||
if (!server)
|
||||
return;
|
||||
|
||||
switch( server->state )
|
||||
switch(server->state)
|
||||
{
|
||||
case ps_idle_server:
|
||||
case ps_wait_connect:
|
||||
|
@ -705,7 +705,7 @@ DECL_HANDLER(wait_named_pipe)
|
|||
return;
|
||||
}
|
||||
server = find_server( pipe, ps_wait_open );
|
||||
if( server )
|
||||
if (server)
|
||||
{
|
||||
/* there's already a server waiting for a client to connect */
|
||||
thread_queue_apc( current, NULL, req->func, APC_ASYNC_IO,
|
||||
|
@ -737,9 +737,9 @@ DECL_HANDLER(disconnect_named_pipe)
|
|||
|
||||
reply->fd = -1;
|
||||
server = get_pipe_server_obj( current->process, req->handle, 0 );
|
||||
if( !server )
|
||||
if (!server)
|
||||
return;
|
||||
switch( server->state )
|
||||
switch(server->state)
|
||||
{
|
||||
case ps_connected_server:
|
||||
assert( server->fd );
|
||||
|
@ -778,7 +778,7 @@ DECL_HANDLER(get_named_pipe_info)
|
|||
struct pipe_server *server;
|
||||
|
||||
server = get_pipe_server_obj( current->process, req->handle, 0 );
|
||||
if(!server)
|
||||
if (!server)
|
||||
return;
|
||||
|
||||
reply->flags = server->pipe->flags;
|
||||
|
|
|
@ -271,7 +271,7 @@ static void key_dump( struct object *obj, int verbose )
|
|||
/* notify waiter and maybe delete the notification */
|
||||
static void do_notification( struct key *key, struct notify *notify, int del )
|
||||
{
|
||||
if( notify->event )
|
||||
if (notify->event)
|
||||
{
|
||||
set_event( notify->event );
|
||||
release_object( notify->event );
|
||||
|
@ -756,7 +756,7 @@ static int delete_key( struct key *key, int recurse )
|
|||
}
|
||||
|
||||
while (recurse && (key->last_subkey>=0))
|
||||
if(0>delete_key(key->subkeys[key->last_subkey], 1))
|
||||
if (0 > delete_key(key->subkeys[key->last_subkey], 1))
|
||||
return -1;
|
||||
|
||||
for (index = 0; index <= parent->last_subkey; index++)
|
||||
|
@ -1930,13 +1930,13 @@ DECL_HANDLER(set_registry_notification)
|
|||
struct notify *notify;
|
||||
|
||||
key = get_hkey_obj( req->hkey, KEY_NOTIFY );
|
||||
if( key )
|
||||
if (key)
|
||||
{
|
||||
event = get_event_obj( current->process, req->event, SYNCHRONIZE );
|
||||
if( event )
|
||||
if (event)
|
||||
{
|
||||
notify = find_notify( key, current->process, req->hkey );
|
||||
if( notify )
|
||||
if (notify)
|
||||
{
|
||||
release_object( notify->event );
|
||||
grab_object( event );
|
||||
|
@ -1945,7 +1945,7 @@ DECL_HANDLER(set_registry_notification)
|
|||
else
|
||||
{
|
||||
notify = mem_alloc( sizeof(*notify) );
|
||||
if( notify )
|
||||
if (notify)
|
||||
{
|
||||
grab_object( event );
|
||||
notify->event = event;
|
||||
|
|
|
@ -419,7 +419,7 @@ static int check_wait( struct thread *thread )
|
|||
struct wait_queue_entry *entry = wait->queues;
|
||||
|
||||
/* Suspended threads may not acquire locks */
|
||||
if( thread->process->suspend + thread->suspend > 0 ) return -1;
|
||||
if (thread->process->suspend + thread->suspend > 0) return -1;
|
||||
|
||||
assert( wait );
|
||||
if (wait->flags & SELECT_ALL)
|
||||
|
|
|
@ -764,7 +764,7 @@ static unsigned int token_access_check( struct token *token,
|
|||
/* open a security token */
|
||||
DECL_HANDLER(open_token)
|
||||
{
|
||||
if( req->flags & OPEN_TOKEN_THREAD )
|
||||
if (req->flags & OPEN_TOKEN_THREAD)
|
||||
{
|
||||
struct thread *thread = get_thread_from_handle( req->handle, 0 );
|
||||
if (thread)
|
||||
|
|
Loading…
Reference in New Issue