From c51657148120c98f52ee5063ad0225cc467b4681 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Wed, 25 May 2005 18:41:09 +0000 Subject: [PATCH] - Use NULL instead of 0 for all non-handle pointers. - Fix non-ANSI function declarations. - Make a function static. --- server/console.c | 2 +- server/fd.c | 2 +- server/file.c | 2 +- server/mailslot.c | 2 +- server/main.c | 2 +- server/named_pipe.c | 4 ++-- server/process.c | 2 +- server/queue.c | 6 +++--- server/region.c | 2 +- server/registry.c | 6 +++--- server/request.c | 2 +- server/signal.c | 8 ++++---- server/snapshot.c | 4 ++-- server/sock.c | 4 ++-- server/timer.c | 2 +- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/server/console.c b/server/console.c index a513538615c..cc574185a59 100644 --- a/server/console.c +++ b/server/console.c @@ -371,7 +371,7 @@ void inherit_console(struct thread *parent_thread, struct process *process, obj_ static struct console_input* console_input_get( obj_handle_t handle, unsigned access ) { - struct console_input* console = 0; + struct console_input* console = NULL; if (handle) console = (struct console_input *)get_handle_obj( current->process, handle, diff --git a/server/fd.c b/server/fd.c index 72c3d9faa7c..6d6b00855ea 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1042,7 +1042,7 @@ struct async *create_async(struct thread *thread, int* timeout, struct list *que { struct timeval when; - gettimeofday( &when, 0 ); + gettimeofday( &when, NULL ); add_timeout( &when, *timeout ); async->timeout = add_timeout_user( &when, async_callback, async ); } diff --git a/server/file.c b/server/file.c index 45f2bc0a8a6..8d237950d7a 100644 --- a/server/file.c +++ b/server/file.c @@ -297,7 +297,7 @@ static void file_queue_async( struct fd *fd, void *apc, void *user, void *iosb, return; } - if (!create_async( current, 0, queue, apc, user, iosb )) + if (!create_async( current, NULL, queue, apc, user, iosb )) return; /* Check if the new pending request can be served immediately */ diff --git a/server/mailslot.c b/server/mailslot.c index 09000e64c83..6f24126a475 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -365,7 +365,7 @@ static struct mail_writer *create_mail_writer( struct mailslot *mailslot, unsign !((sharing & FILE_SHARE_WRITE) && (writer->sharing & FILE_SHARE_WRITE))) { set_error( STATUS_SHARING_VIOLATION ); - return 0; + return NULL; } } diff --git a/server/main.c b/server/main.c index f1901cae6b8..3e258682114 100644 --- a/server/main.c +++ b/server/main.c @@ -111,7 +111,7 @@ static void parse_args( int argc, char *argv[] ) } } -static void sigterm_handler() +static void sigterm_handler( int signum ) { exit(1); /* make sure atexit functions get called */ } diff --git a/server/named_pipe.c b/server/named_pipe.c index 5dfc35990fd..c8358dca01a 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -364,7 +364,7 @@ static void check_flushed( void *arg ) { struct timeval tv; - gettimeofday( &tv, 0 ); + gettimeofday( &tv, NULL ); add_timeout( &tv, 100 ); server->flush_poll = add_timeout_user( &tv, check_flushed, server ); } @@ -402,7 +402,7 @@ static int pipe_server_flush( struct fd *fd, struct event **event ) server->event = create_event( NULL, 0, 0, 0 ); if( !server->event ) return 0; - gettimeofday( &tv, 0 ); + gettimeofday( &tv, NULL ); add_timeout( &tv, 100 ); server->flush_poll = add_timeout_user( &tv, check_flushed, server ); *event = server->event; diff --git a/server/process.c b/server/process.c index 24a34c87dad..eb869ec81df 100644 --- a/server/process.c +++ b/server/process.c @@ -1181,7 +1181,7 @@ DECL_HANDLER(get_dll_info) if (dll) { reply->size = dll->size; - reply->entry_point = 0; /* FIXME */ + reply->entry_point = NULL; /* FIXME */ if (dll->filename) { size_t len = min( dll->namelen, get_reply_max_size() ); diff --git a/server/queue.c b/server/queue.c index e0fef71da5a..38e5d6754d9 100644 --- a/server/queue.c +++ b/server/queue.c @@ -531,7 +531,7 @@ static struct message_result *alloc_message_result( struct msg_queue *send_queue if (timeout != -1) { struct timeval when; - gettimeofday( &when, 0 ); + gettimeofday( &when, NULL ); add_timeout( &when, timeout ); result->timeout = add_timeout_user( &when, result_timeout, result ); } @@ -960,7 +960,7 @@ static void restart_timer( struct msg_queue *queue, struct timer *timer ) struct timeval now; list_remove( &timer->entry ); - gettimeofday( &now, 0 ); + gettimeofday( &now, NULL ); while (!time_before( &now, &timer->when )) add_timeout( &timer->when, timer->rate ); link_timer( queue, timer ); set_next_timer( queue ); @@ -993,7 +993,7 @@ static struct timer *set_timer( struct msg_queue *queue, unsigned int rate ) if (timer) { timer->rate = max( rate, 1 ); - gettimeofday( &timer->when, 0 ); + gettimeofday( &timer->when, NULL ); add_timeout( &timer->when, rate ); link_timer( queue, timer ); /* check if we replaced the next timer */ diff --git a/server/region.c b/server/region.c index ea9cf695c28..9a3891aef25 100644 --- a/server/region.c +++ b/server/region.c @@ -111,7 +111,7 @@ static inline rectangle_t *add_rect( struct region *reg ) if (!new_rect) { set_error( STATUS_NO_MEMORY ); - return 0; + return NULL; } reg->rects = new_rect; reg->size *= 2; diff --git a/server/registry.c b/server/registry.c index 1c7a0d8b2a3..5d2d0b9ba34 100644 --- a/server/registry.c +++ b/server/registry.c @@ -452,7 +452,7 @@ static void make_clean( struct key *key ) } /* go through all the notifications and send them if necessary */ -void check_notify( struct key *key, unsigned int change, int not_subtree ) +static void check_notify( struct key *key, unsigned int change, int not_subtree ) { struct list *ptr, *next; @@ -1644,10 +1644,10 @@ static void set_periodic_save_timer(void) { struct timeval next; - gettimeofday( &next, 0 ); + gettimeofday( &next, NULL ); add_timeout( &next, save_period ); if (save_timeout_user) remove_timeout_user( save_timeout_user ); - save_timeout_user = add_timeout_user( &next, periodic_save, 0 ); + save_timeout_user = add_timeout_user( &next, periodic_save, NULL ); } /* save the modified registry branches to disk */ diff --git a/server/request.c b/server/request.c index 8d33660bf66..aa5c09de58d 100644 --- a/server/request.c +++ b/server/request.c @@ -813,7 +813,7 @@ void close_master_socket(void) if (master_socket_timeout) { - gettimeofday( &when, 0 ); + gettimeofday( &when, NULL ); add_timeout( &when, master_socket_timeout * 1000 ); master_socket->timeout = add_timeout_user( &when, close_socket_timeout, NULL ); } diff --git a/server/signal.c b/server/signal.c index 470a476de9d..f3b0f5f7dd8 100644 --- a/server/signal.c +++ b/server/signal.c @@ -181,25 +181,25 @@ static void sigint_callback(void) } /* SIGHUP handler */ -static void do_sighup() +static void do_sighup( int signum ) { do_signal( handler_sighup ); } /* SIGTERM handler */ -static void do_sigterm() +static void do_sigterm( int signum ) { do_signal( handler_sigterm ); } /* SIGINT handler */ -static void do_sigint() +static void do_sigint( int signum ) { do_signal( handler_sigint ); } /* SIGCHLD handler */ -static void do_sigchld() +static void do_sigchld( int signum ) { do_signal( handler_sigchld ); } diff --git a/server/snapshot.c b/server/snapshot.c index 61265badfe6..7f1670c6100 100644 --- a/server/snapshot.c +++ b/server/snapshot.c @@ -125,8 +125,8 @@ static int snapshot_next_process( struct snapshot *snapshot, struct next_process reply->count = ptr->count; reply->pid = get_process_id( ptr->process ); reply->ppid = ptr->process->parent ? get_process_id( ptr->process->parent ) : 0; - reply->heap = 0; /* FIXME */ - reply->module = 0; /* FIXME */ + reply->heap = NULL; /* FIXME */ + reply->module = NULL; /* FIXME */ reply->threads = ptr->threads; reply->priority = ptr->priority; reply->handles = ptr->handles; diff --git a/server/sock.c b/server/sock.c index 7fcb406f702..3fa3049b976 100644 --- a/server/sock.c +++ b/server/sock.c @@ -529,7 +529,7 @@ static void sock_queue_async( struct fd *fd, void *apc, void *user, void *iosb, } else { - if (!create_async( current, 0, queue, apc, user, iosb )) + if (!create_async( current, NULL, queue, apc, user, iosb )) return; } @@ -674,7 +674,7 @@ static struct sock *accept_socket( obj_handle_t handle ) acceptsock->wparam = 0; if (sock->event) acceptsock->event = (struct event *)grab_object( sock->event ); acceptsock->flags = sock->flags; - acceptsock->deferred = 0; + acceptsock->deferred = NULL; if (!(acceptsock->fd = create_anonymous_fd( &sock_fd_ops, acceptfd, &acceptsock->obj ))) { release_object( acceptsock ); diff --git a/server/timer.c b/server/timer.c index 720c6f328cc..2329c6c262e 100644 --- a/server/timer.c +++ b/server/timer.c @@ -147,7 +147,7 @@ static int set_timer( struct timer *timer, const abs_time_t *expire, int period, if (!expire->sec && !expire->usec) { /* special case: use now + period as first expiration */ - gettimeofday( &timer->when, 0 ); + gettimeofday( &timer->when, NULL ); add_timeout( &timer->when, period ); } else