Servers: cleanup of some gcc -W warnings

This commit is contained in:
David van Moolenbroek 2011-12-11 22:32:26 +01:00
parent c6459e8ec1
commit 9701e9dfd2
9 changed files with 22 additions and 25 deletions

View file

@ -597,9 +597,9 @@ PUBLIC int tty_opcl(
*===========================================================================*/
PUBLIC int ctty_opcl(
int op, /* operation, DEV_OPEN or DEV_CLOSE */
dev_t dev, /* device to open or close */
endpoint_t proc_e, /* process to open/close for */
int flags /* mode bits and flags */
dev_t UNUSED(dev), /* device to open or close */
endpoint_t UNUSED(proc_e), /* process to open/close for */
int UNUSED(flags) /* mode bits and flags */
)
{
/* This procedure is called from the dmap struct on opening or closing
@ -747,9 +747,10 @@ message *mess_ptr; /* pointer to message for task */
/*===========================================================================*
* ctty_io *
*===========================================================================*/
PUBLIC int ctty_io(task_nr, mess_ptr)
int task_nr; /* not used - for compatibility with dmap_t */
message *mess_ptr; /* pointer to message for task */
PUBLIC int ctty_io(
endpoint_t UNUSED(task_nr), /* not used - for compatibility with dmap_t */
message *mess_ptr /* pointer to message for task */
)
{
/* This routine is only called for one device, namely /dev/tty. Its job
* is to change the message to use the controlling terminal, instead of the
@ -800,7 +801,7 @@ PUBLIC int no_dev(
/*===========================================================================*
* no_dev_io *
*===========================================================================*/
PUBLIC int no_dev_io(int proc, message *m)
PUBLIC int no_dev_io(endpoint_t UNUSED(proc), message *UNUSED(m))
{
/* Called when doing i/o on a nonexistent device. */
printf("VFS: I/O on unmapped device number\n");

View file

@ -32,10 +32,6 @@ PRIVATE struct {
PRIVATE int depth = 0; /* current globals stack level */
#if ENABLE_SYSCALL_STATS
EXTERN unsigned long calls_stats[NCALLS];
#endif
FORWARD _PROTOTYPE( int push_globals, (void) );
FORWARD _PROTOTYPE( void pop_globals, (void) );
FORWARD _PROTOTYPE( void set_globals, (message *m) );

View file

@ -475,7 +475,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info)
{
/* Initialize the virtual file server. */
int s, i;

View file

@ -398,7 +398,8 @@ PRIVATE int select_request_async(struct filp *f, int *ops, int block)
/*===========================================================================*
* select_request_file *
*===========================================================================*/
PRIVATE int select_request_file(struct filp *f, int *ops, int block)
PRIVATE int select_request_file(struct filp *UNUSED(f), int *UNUSED(ops),
int UNUSED(block))
{
/* Files are always ready, so output *ops is input *ops */
return(SEL_OK);

View file

@ -252,7 +252,7 @@ PRIVATE int map_service(const struct rprocpub *rpub)
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PUBLIC int sef_cb_init_fresh(int type, sef_init_info_t *info)
PUBLIC int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info)
{
/* Initialize the data store server. */
int i, r;

View file

@ -106,8 +106,10 @@ PUBLIC int nice_to_priority(int nice, unsigned* new_q)
*new_q = MAX_USER_Q + (nice-PRIO_MIN) * (MIN_USER_Q-MAX_USER_Q+1) /
(PRIO_MAX-PRIO_MIN+1);
if (*new_q < MAX_USER_Q) *new_q = MAX_USER_Q; /* shouldn't happen */
if (*new_q > MIN_USER_Q) *new_q = MIN_USER_Q; /* shouldn't happen */
/* Neither of these should ever happen. */
if ((signed) *new_q < MAX_USER_Q) *new_q = MAX_USER_Q;
if (*new_q > MIN_USER_Q) *new_q = MIN_USER_Q;
return (OK);
}

View file

@ -69,7 +69,7 @@ PRIVATE void init_hook(void)
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(int argc, char *argv[])
PUBLIC int main(void)
{
/* ProcFS entry point.
*/

View file

@ -371,7 +371,7 @@ PRIVATE void pid_read(struct inode *node)
/*===========================================================================*
* pid_link *
*===========================================================================*/
PRIVATE int pid_link(struct inode *node, char *ptr, int max)
PRIVATE int pid_link(struct inode *UNUSED(node), char *ptr, int UNUSED(max))
{
/* The contents of a symbolic link in a PID directory are requested.
* This function is a placeholder for future use.
@ -386,7 +386,8 @@ PRIVATE int pid_link(struct inode *node, char *ptr, int max)
/*===========================================================================*
* lookup_hook *
*===========================================================================*/
PUBLIC int lookup_hook(struct inode *parent, char *name, cbdata_t cbdata)
PUBLIC int lookup_hook(struct inode *parent, char *name,
cbdata_t UNUSED(cbdata))
{
/* Path name resolution hook, for a specific parent and name pair.
* If needed, update our own view of the system first; after that,
@ -432,7 +433,7 @@ PUBLIC int lookup_hook(struct inode *parent, char *name, cbdata_t cbdata)
/*===========================================================================*
* getdents_hook *
*===========================================================================*/
PUBLIC int getdents_hook(struct inode *node, cbdata_t cbdata)
PUBLIC int getdents_hook(struct inode *node, cbdata_t UNUSED(cbdata))
{
/* Directory entry retrieval hook, for potentially all files in a
* directory. Make sure that all files that are supposed to be
@ -478,7 +479,7 @@ PUBLIC int read_hook(struct inode *node, off_t off, char **ptr,
* rdlink_hook *
*===========================================================================*/
PUBLIC int rdlink_hook(struct inode *node, char *ptr, size_t max,
cbdata_t cbdata)
cbdata_t UNUSED(cbdata))
{
/* Symbolic link resolution hook. Not used yet.
*/

View file

@ -32,10 +32,6 @@ PRIVATE struct {
PRIVATE int depth = 0; /* current globals stack level */
#if ENABLE_SYSCALL_STATS
EXTERN unsigned long calls_stats[NCALLS];
#endif
FORWARD _PROTOTYPE( int push_globals, (void) );
FORWARD _PROTOTYPE( void pop_globals, (void) );
FORWARD _PROTOTYPE( void set_globals, (message *m) );