From 03514ba605e8e31a49cf0b58bba0c484f25cfb79 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 24 Feb 2014 14:00:17 +0100 Subject: [PATCH] Getting rid of "old-style-definition" Patch submitted by hoefnix. Ref. https://groups.google.com/d/msg/minix-dev/sHQDVJRyx1c/eJjrYOqk5bgJ Change-Id: I2fcdf4cf119ef252ccc7df06849baf37ffd08440 --- lib/libaudiodriver/audio_fw.c | 14 +++----- lib/libblockdriver/drvlib.c | 65 ++++++++++++++++++---------------- lib/libc/sys-minix/mount.c | 10 +++--- lib/libcompat_minix/mtab.c | 11 +++--- lib/libdevman/generic.c | 4 +-- lib/libhgfs/attr.c | 11 ++---- lib/libhgfs/channel.c | 30 +++++++++------- lib/libhgfs/dir.c | 15 +++----- lib/libhgfs/error.c | 3 +- lib/libhgfs/file.c | 44 ++++++++++++----------- lib/libhgfs/info.c | 5 +-- lib/libhgfs/link.c | 14 +++----- lib/libhgfs/path.c | 7 ++-- lib/libhgfs/rpc.c | 8 ++--- lib/liblwip/core/dns.c | 3 +- lib/libminixfs/cache.c | 36 ++++++++----------- lib/libminlib/itoa.c | 3 +- lib/libpuffs/link.c | 26 +++++++------- lib/libpuffs/misc.c | 4 +-- lib/libpuffs/mount.c | 6 ++-- lib/libpuffs/open.c | 10 +++--- lib/libpuffs/path.c | 45 ++++++++++++----------- lib/libpuffs/protect.c | 4 +-- lib/libpuffs/puffs.c | 7 ++-- lib/libpuffs/stadir.c | 4 +-- lib/libpuffs/time.c | 2 +- lib/libpuffs/utility.c | 4 +-- lib/libsffs/dentry.c | 21 ++++------- lib/libsffs/handle.c | 6 ++-- lib/libsffs/inode.c | 23 +++++------- lib/libsffs/link.c | 17 ++++----- lib/libsffs/lookup.c | 63 ++++++++++++++++++-------------- lib/libsffs/main.c | 10 +++--- lib/libsffs/misc.c | 2 +- lib/libsffs/mount.c | 4 +-- lib/libsffs/name.c | 8 ++--- lib/libsffs/path.c | 11 ++---- lib/libsffs/read.c | 4 +-- lib/libsffs/stat.c | 10 +++--- lib/libsffs/util.c | 13 +++---- lib/libsffs/verify.c | 27 +++++++------- lib/libsffs/write.c | 11 +++--- lib/libsys/arch/i386/profile.c | 10 +++--- lib/libsys/env_get_prm.c | 12 +++---- lib/libsys/optset.c | 12 ++----- lib/libsys/sef_liveupdate.c | 2 +- lib/libvassert/vassert.c | 24 +++++-------- 47 files changed, 312 insertions(+), 373 deletions(-) diff --git a/lib/libaudiodriver/audio_fw.c b/lib/libaudiodriver/audio_fw.c index 491fb54a6..ab45e5bb0 100644 --- a/lib/libaudiodriver/audio_fw.c +++ b/lib/libaudiodriver/audio_fw.c @@ -47,8 +47,8 @@ static int init_buffers(sub_dev_t *sub_dev_ptr); static int get_started(sub_dev_t *sub_dev_ptr); static int io_ctl_length(int io_request); static special_file_t* get_special_file(int minor_dev_nr); -static void tell_dev(vir_bytes buf, size_t size, int pci_bus, int - pci_dev, int pci_func); +static void tell_dev(vir_bytes buf, size_t size, int pci_bus, + int pci_dev, int pci_func); static char io_ctl_buf[IOCPARM_MASK]; static int irq_hook_id = 0; /* id of irq hook at the kernel */ @@ -90,7 +90,7 @@ int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -static void sef_local_startup() +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -832,12 +832,8 @@ static special_file_t* get_special_file(int minor_dev_nr) { return NULL; } -static void tell_dev(buf, size, pci_bus, pci_dev, pci_func) -vir_bytes buf; -size_t size; -int pci_bus; -int pci_dev; -int pci_func; +static void tell_dev(vir_bytes buf, size_t size, int pci_bus, + int pci_dev, int pci_func) { int r; endpoint_t dev_e; diff --git a/lib/libblockdriver/drvlib.c b/lib/libblockdriver/drvlib.c index c2e57089f..15d618ae3 100644 --- a/lib/libblockdriver/drvlib.c +++ b/lib/libblockdriver/drvlib.c @@ -11,22 +11,26 @@ /* Extended partition? */ #define ext_part(s) ((s) == 0x05 || (s) == 0x0F) -static void parse_part_table(struct blockdriver *bdp, int device, int - style, int atapi, u8_t *tmp_buf); -static void extpartition(struct blockdriver *bdp, int extdev, unsigned - long extbase, u8_t *tmp_buf); -static int get_part_table(struct blockdriver *bdp, int device, unsigned - long offset, struct part_entry *table, u8_t *tmp_buf); +static void parse_part_table(struct blockdriver *bdp, int device, + int style, int atapi, u8_t *tmp_buf); + +static void extpartition(struct blockdriver *bdp, int extdev, + unsigned long extbase, u8_t *tmp_buf); + +static int get_part_table(struct blockdriver *bdp, int device, + unsigned long offset, struct part_entry *table, u8_t *tmp_buf); + static void sort(struct part_entry *table); /*============================================================================* * partition * *============================================================================*/ -void partition(bdp, device, style, atapi) -struct blockdriver *bdp; /* device dependent entry points */ -int device; /* device to partition */ -int style; /* partitioning style: floppy, primary, sub. */ -int atapi; /* atapi device */ +void partition( + struct blockdriver *bdp, /* device dependent entry points */ + int device, /* device to partition */ + int style, /* partitioning style: floppy, primary, sub. */ + int atapi /* atapi device */ +) { /* This routine is called on first open to initialize the partition tables * of a device. @@ -51,12 +55,13 @@ int atapi; /* atapi device */ /*============================================================================* * parse_part_table * *============================================================================*/ -static void parse_part_table(bdp, device, style, atapi, tmp_buf) -struct blockdriver *bdp; /* device dependent entry points */ -int device; /* device to partition */ -int style; /* partitioning style: floppy, primary, sub. */ -int atapi; /* atapi device */ -u8_t *tmp_buf; /* temporary buffer */ +static void parse_part_table( + struct blockdriver *bdp, /* device dependent entry points */ + int device, /* device to partition */ + int style, /* partitioning style: floppy, primary, sub. */ + int atapi, /* atapi device */ + u8_t *tmp_buf /* temporary buffer */ +) { /* This routine reads and parses a partition table. It may be called * recursively. It makes sure that each partition falls safely within the @@ -128,11 +133,12 @@ u8_t *tmp_buf; /* temporary buffer */ /*============================================================================* * extpartition * *============================================================================*/ -static void extpartition(bdp, extdev, extbase, tmp_buf) -struct blockdriver *bdp; /* device dependent entry points */ -int extdev; /* extended partition to scan */ -unsigned long extbase; /* sector offset of the base ext. partition */ -u8_t *tmp_buf; /* temporary buffer */ +static void extpartition( + struct blockdriver *bdp, /* device dependent entry points */ + int extdev, /* extended partition to scan */ + unsigned long extbase, /* sector offset of the base ext. partition */ + u8_t *tmp_buf /* temporary buffer */ +) { /* Extended partitions cannot be ignored alas, because people like to move * files to and from DOS partitions. Avoid reading this code, it's no fun. @@ -177,12 +183,12 @@ u8_t *tmp_buf; /* temporary buffer */ /*============================================================================* * get_part_table * *============================================================================*/ -static int get_part_table(bdp, device, offset, table, tmp_buf) -struct blockdriver *bdp; -int device; -unsigned long offset; /* sector offset to the table */ -struct part_entry *table; /* four entries */ -u8_t *tmp_buf; /* temporary buffer */ +static int get_part_table( + struct blockdriver *bdp, + int device, + unsigned long offset, /* sector offset to the table */ + struct part_entry *table, /* four entries */ + u8_t *tmp_buf) /* temporary buffer */ { /* Read the partition table for the device, return true iff there were no * errors. @@ -210,8 +216,7 @@ u8_t *tmp_buf; /* temporary buffer */ /*===========================================================================* * sort * *===========================================================================*/ -static void sort(table) -struct part_entry *table; +static void sort(struct part_entry *table) { /* Sort a partition table. */ struct part_entry *pe, tmp; diff --git a/lib/libc/sys-minix/mount.c b/lib/libc/sys-minix/mount.c index 0ef69cfe4..6ca0543a8 100644 --- a/lib/libc/sys-minix/mount.c +++ b/lib/libc/sys-minix/mount.c @@ -27,9 +27,9 @@ static int rs_down(char *label) } char *find_rslabel(char *args_line); -int mount(special, name, mountflags, srvflags, type, args) -char *name, *special, *type, *args; -int mountflags, srvflags; + +int mount(char *special, char *name, int mountflags, int srvflags, + char *type, char *args) { int r; message m; @@ -165,9 +165,7 @@ int mountflags, srvflags; return r; } -int umount(name, srvflags) -const char *name; -int srvflags; +int umount(const char *name, int srvflags) { char label[MNT_LABEL_LEN]; message m; diff --git a/lib/libcompat_minix/mtab.c b/lib/libcompat_minix/mtab.c index a38dde4df..88cd1869e 100644 --- a/lib/libcompat_minix/mtab.c +++ b/lib/libcompat_minix/mtab.c @@ -46,14 +46,13 @@ char *etc_mtab = "/etc/mtab"; /* name of the /etc/mtab file */ static char mtab_in[BUF_SIZE+1]; /* holds /etc/mtab when it is read in */ static char *iptr = mtab_in; /* pointer to next line to feed out. */ -int load_mtab(char *prog_name ); +int load_mtab(char *prog_name); int get_mtab_entry(char dev[PATH_MAX], char mount_point[PATH_MAX], char type[MNTNAMELEN], char flags[MNTFLAGLEN]); -static void err(char *prog_name, char *str ); +static void err(char *prog_name, const char *str); -int load_mtab(prog_name) -char *prog_name; +int load_mtab(char *prog_name) { /* Read in /etc/mtab and store it in /etc/mtab. */ @@ -114,9 +113,7 @@ int get_mtab_entry(char dev[PATH_MAX], char mount_point[PATH_MAX], } -static void -err(prog_name, str) -char *prog_name, *str; +static void err(char *prog_name, const char *str) { std_err(prog_name); std_err(str); diff --git a/lib/libdevman/generic.c b/lib/libdevman/generic.c index fbc099a71..9e404e814 100644 --- a/lib/libdevman/generic.c +++ b/lib/libdevman/generic.c @@ -182,7 +182,7 @@ int devman_del_device(struct devman_dev *dev) /**************************************************************************** * devman_get_ep * ***************************************************************************/ -endpoint_t devman_get_ep() +endpoint_t devman_get_ep(void) { return devman_ep; } @@ -190,7 +190,7 @@ endpoint_t devman_get_ep() /**************************************************************************** * devman_init * ***************************************************************************/ -int devman_init() +int devman_init(void) { int res; diff --git a/lib/libhgfs/attr.c b/lib/libhgfs/attr.c index 4814c7b40..d87fb6084 100644 --- a/lib/libhgfs/attr.c +++ b/lib/libhgfs/attr.c @@ -7,8 +7,7 @@ /*===========================================================================* * attr_get * *===========================================================================*/ -void attr_get(attr) -struct sffs_attr *attr; +void attr_get(struct sffs_attr *attr) { /* Get attribute information from the RPC buffer, storing the requested parts * in the given attr structure. @@ -35,9 +34,7 @@ struct sffs_attr *attr; /*===========================================================================* * hgfs_getattr * *===========================================================================*/ -int hgfs_getattr(path, attr) -char *path; -struct sffs_attr *attr; +int hgfs_getattr(char *path, struct sffs_attr *attr) { /* Get selected attributes of a file by path name. */ @@ -58,9 +55,7 @@ struct sffs_attr *attr; /*===========================================================================* * hgfs_setattr * *===========================================================================*/ -int hgfs_setattr(path, attr) -char *path; -struct sffs_attr *attr; +int hgfs_setattr(char *path, struct sffs_attr *attr) { /* Set selected attributes of a file by path name. */ diff --git a/lib/libhgfs/channel.c b/lib/libhgfs/channel.c index 3fca1beec..985e84293 100644 --- a/lib/libhgfs/channel.c +++ b/lib/libhgfs/channel.c @@ -19,9 +19,10 @@ enum { /*===========================================================================* * channel_open * *===========================================================================*/ -int channel_open(ch, type) -struct channel *ch; /* struct describing the new channel */ -u32_t type; /* channel type: CH_IN or CH_OUT */ +int channel_open( + struct channel *ch, /* struct describing the new channel */ + u32_t type /* channel type: CH_IN or CH_OUT */ +) { /* Open a new backdoor channel. Upon success, the given channel structure will * be filled with information and can be used in subsequent channel calls. @@ -46,8 +47,9 @@ u32_t type; /* channel type: CH_IN or CH_OUT */ /*===========================================================================* * channel_close * *===========================================================================*/ -void channel_close(ch) -struct channel *ch; /* backdoor channel to close */ +void channel_close( + struct channel *ch /* backdoor channel to close */ +) { /* Close a previously opened backdoor channel. */ @@ -64,10 +66,11 @@ struct channel *ch; /* backdoor channel to close */ /*===========================================================================* * channel_send * *===========================================================================*/ -int channel_send(ch, buf, len) -struct channel *ch; /* backdoor channel to send to */ -char *buf; /* buffer to send data from */ -int len; /* size of the data to send */ +int channel_send( + struct channel *ch, /* backdoor channel to send to */ + char *buf, /* buffer to send data from */ + int len /* size of the data to send */ +) { /* Receive data over a backdoor channel. Return OK on success, or a negative * error code on error. @@ -101,10 +104,11 @@ int len; /* size of the data to send */ /*===========================================================================* * channel_recv * *===========================================================================*/ -int channel_recv(ch, buf, max) -struct channel *ch; /* backdoor channel to receive from */ -char *buf; /* buffer to receive data into */ -int max; /* size of the buffer */ +int channel_recv( + struct channel *ch, /* backdoor channel to receive from */ + char *buf, /* buffer to receive data into */ + int max /* size of the buffer */ +) { /* Receive data on a backdoor channel. Return the number of bytes received, or * a negative error code on error. diff --git a/lib/libhgfs/dir.c b/lib/libhgfs/dir.c index 006a8f3c5..3782b920f 100644 --- a/lib/libhgfs/dir.c +++ b/lib/libhgfs/dir.c @@ -5,9 +5,7 @@ /*===========================================================================* * hgfs_opendir * *===========================================================================*/ -int hgfs_opendir(path, handle) -char *path; -sffs_dir_t *handle; +int hgfs_opendir(char *path, sffs_dir_t *handle) { /* Open a directory. Store a directory handle upon success. */ @@ -28,12 +26,8 @@ sffs_dir_t *handle; /*===========================================================================* * hgfs_readdir * *===========================================================================*/ -int hgfs_readdir(handle, index, buf, size, attr) -sffs_dir_t handle; -unsigned int index; -char *buf; -size_t size; -struct sffs_attr *attr; +int hgfs_readdir(sffs_dir_t handle, unsigned int index, char *buf, + size_t size, struct sffs_attr *attr) { /* Read a directory entry from an open directory, using a zero-based index * number. Upon success, the resulting path name is stored in the given buffer @@ -66,8 +60,7 @@ struct sffs_attr *attr; /*===========================================================================* * hgfs_closedir * *===========================================================================*/ -int hgfs_closedir(handle) -sffs_dir_t handle; +int hgfs_closedir(sffs_dir_t handle) { /* Close an open directory. */ diff --git a/lib/libhgfs/error.c b/lib/libhgfs/error.c index a926fc7bf..b5da000bb 100644 --- a/lib/libhgfs/error.c +++ b/lib/libhgfs/error.c @@ -28,8 +28,7 @@ static int error_map[NERRS] = { /*===========================================================================* * error_convert * *===========================================================================*/ -int error_convert(err) -int err; +int error_convert(int err) { /* Convert a HGFS error into an errno error code. */ diff --git a/lib/libhgfs/file.c b/lib/libhgfs/file.c index 12f21c692..2b158cb5b 100644 --- a/lib/libhgfs/file.c +++ b/lib/libhgfs/file.c @@ -8,11 +8,12 @@ /*===========================================================================* * hgfs_open * *===========================================================================*/ -int hgfs_open(path, flags, mode, handle) -char *path; /* path name to open */ -int flags; /* open flags to use */ -int mode; /* mode to create (user bits only) */ -sffs_file_t *handle; /* place to store resulting handle */ +int hgfs_open( + char *path, /* path name to open */ + int flags, /* open flags to use */ + int mode, /* mode to create (user bits only) */ + sffs_file_t *handle /* place to store resulting handle */ +) { /* Open a file. Store a file handle upon success. */ @@ -50,11 +51,12 @@ sffs_file_t *handle; /* place to store resulting handle */ /*===========================================================================* * hgfs_read * *===========================================================================*/ -ssize_t hgfs_read(handle, buf, size, off) -sffs_file_t handle; /* handle to open file */ -char *buf; /* data buffer or NULL */ -size_t size; /* maximum number of bytes to read */ -u64_t off; /* file offset */ +ssize_t hgfs_read( + sffs_file_t handle, /* handle to open file */ + char *buf, /* data buffer or NULL */ + size_t size, /* maximum number of bytes to read */ + u64_t off /* file offset */ +) { /* Read from an open file. Upon success, return the number of bytes read. */ @@ -84,11 +86,12 @@ u64_t off; /* file offset */ /*===========================================================================* * hgfs_write * *===========================================================================*/ -ssize_t hgfs_write(handle, buf, len, off) -sffs_file_t handle; /* handle to open file */ -char *buf; /* data buffer or NULL */ -size_t len; /* number of bytes to write */ -u64_t off; /* file offset */ +ssize_t hgfs_write( + sffs_file_t handle, /* handle to open file */ + char *buf, /* data buffer or NULL */ + size_t len, /* number of bytes to write */ + u64_t off /* file offset */ +) { /* Write to an open file. Upon success, return the number of bytes written. */ @@ -115,8 +118,9 @@ u64_t off; /* file offset */ /*===========================================================================* * hgfs_close * *===========================================================================*/ -int hgfs_close(handle) -sffs_file_t handle; /* handle to open file */ +int hgfs_close( + sffs_file_t handle /* handle to open file */ +) { /* Close an open file. */ @@ -130,8 +134,7 @@ sffs_file_t handle; /* handle to open file */ /*===========================================================================* * hgfs_readbuf * *===========================================================================*/ -size_t hgfs_readbuf(ptr) -char **ptr; +size_t hgfs_readbuf(char **ptr) { /* Return information about the read buffer, for zero-copy purposes. Store a * pointer to the first byte of the read buffer, and return the maximum data @@ -152,8 +155,7 @@ char **ptr; /*===========================================================================* * hgfs_writebuf * *===========================================================================*/ -size_t hgfs_writebuf(ptr) -char **ptr; +size_t hgfs_writebuf(char **ptr) { /* Return information about the write buffer, for zero-copy purposes. Store a * pointer to the first byte of the write buffer, and return the maximum data diff --git a/lib/libhgfs/info.c b/lib/libhgfs/info.c index f6d9258e2..006e6d72b 100644 --- a/lib/libhgfs/info.c +++ b/lib/libhgfs/info.c @@ -5,10 +5,7 @@ /*===========================================================================* * hgfs_queryvol * *===========================================================================*/ -int hgfs_queryvol(path, free, total) -char *path; -u64_t *free; -u64_t *total; +int hgfs_queryvol(char *path, u64_t *free, u64_t *total) { /* Retrieve information about available and total volume space associated with * a given path. diff --git a/lib/libhgfs/link.c b/lib/libhgfs/link.c index fc0c24f90..c3a568477 100644 --- a/lib/libhgfs/link.c +++ b/lib/libhgfs/link.c @@ -7,9 +7,7 @@ /*===========================================================================* * hgfs_mkdir * *===========================================================================*/ -int hgfs_mkdir(path, mode) -char *path; -int mode; +int hgfs_mkdir(char *path, int mode) { /* Create a new directory. */ @@ -25,8 +23,7 @@ int mode; /*===========================================================================* * hgfs_unlink * *===========================================================================*/ -int hgfs_unlink(path) -char *path; +int hgfs_unlink(char *path) { /* Delete a file. */ @@ -41,8 +38,7 @@ char *path; /*===========================================================================* * hgfs_rmdir * *===========================================================================*/ -int hgfs_rmdir(path) -char *path; +int hgfs_rmdir(char *path) { /* Remove an empty directory. */ @@ -57,9 +53,7 @@ char *path; /*===========================================================================* * hgfs_rename * *===========================================================================*/ -int hgfs_rename(opath, npath) -char *opath; -char *npath; +int hgfs_rename(char *opath, char *npath) { /* Rename a file or directory. */ diff --git a/lib/libhgfs/path.c b/lib/libhgfs/path.c index e10f817b7..40b4b9d70 100644 --- a/lib/libhgfs/path.c +++ b/lib/libhgfs/path.c @@ -7,8 +7,7 @@ /*===========================================================================* * path_put * *===========================================================================*/ -void path_put(path) -char *path; +void path_put(char *path) { /* Append the given path name in HGFS format to the RPC buffer. Truncate it * if it is longer than PATH_MAX bytes. @@ -42,9 +41,7 @@ char *path; /*===========================================================================* * path_get * *===========================================================================*/ -int path_get(path, max) -char *path; -int max; +int path_get(char *path, int max) { /* Retrieve a HGFS formatted path name from the RPC buffer. Returns EINVAL if * the path name is invalid. Returns ENAMETOOLONG if the path name is too diff --git a/lib/libhgfs/rpc.c b/lib/libhgfs/rpc.c index 479e8caf8..81183226a 100644 --- a/lib/libhgfs/rpc.c +++ b/lib/libhgfs/rpc.c @@ -10,7 +10,7 @@ static struct channel rpc_chan; /*===========================================================================* * rpc_open * *===========================================================================*/ -int rpc_open() +int rpc_open(void) { /* Open a HGFS RPC backdoor channel to the VMware host, and make sure that it * is working. Return OK upon success, or a negative error code otherwise; in @@ -32,7 +32,7 @@ int rpc_open() /*===========================================================================* * rpc_query * *===========================================================================*/ -int rpc_query() +int rpc_query(void) { /* Send a HGFS RPC query over the backdoor channel. Return OK upon success, or * a negative error code otherwise; EAGAIN is returned if shared folders are @@ -70,7 +70,7 @@ int rpc_query() /*===========================================================================* * rpc_test * *===========================================================================*/ -int rpc_test() +int rpc_test(void) { /* Test whether HGFS communication is working. Return OK on success, EAGAIN if * shared folders are disabled, or another negative error code upon error. @@ -86,7 +86,7 @@ int rpc_test() /*===========================================================================* * rpc_close * *===========================================================================*/ -void rpc_close() +void rpc_close(void) { /* Close the HGFS RPC backdoor channel. */ diff --git a/lib/liblwip/core/dns.c b/lib/liblwip/core/dns.c index 788df7155..d2d061ef0 100644 --- a/lib/liblwip/core/dns.c +++ b/lib/liblwip/core/dns.c @@ -228,8 +228,7 @@ static u8_t* dns_payload; * Initialize the resolver: set up the UDP pcb and configure the default server * (DNS_SERVER_ADDRESS). */ -void -dns_init() +void dns_init(void) { ip_addr_t dnsserver; diff --git a/lib/libminixfs/cache.c b/lib/libminixfs/cache.c index 7d9bbe6f2..bcef04592 100644 --- a/lib/libminixfs/cache.c +++ b/lib/libminixfs/cache.c @@ -46,8 +46,7 @@ static int rdwt_err; static int quiet = 0; -void -lmfs_setquiet(int q) { quiet = q; } +void lmfs_setquiet(int q) { quiet = q; } static u32_t fs_bufs_heuristic(int minbufs, u32_t btotal, u64_t bfree, int blocksize, dev_t majordev) @@ -115,26 +114,22 @@ void lmfs_blockschange(dev_t dev, int delta) } } -void -lmfs_markdirty(struct buf *bp) +void lmfs_markdirty(struct buf *bp) { bp->lmfs_flags |= VMMC_DIRTY; } -void -lmfs_markclean(struct buf *bp) +void lmfs_markclean(struct buf *bp) { bp->lmfs_flags &= ~VMMC_DIRTY; } -int -lmfs_isclean(struct buf *bp) +int lmfs_isclean(struct buf *bp) { return !(bp->lmfs_flags & VMMC_DIRTY); } -dev_t -lmfs_dev(struct buf *bp) +dev_t lmfs_dev(struct buf *bp) { return bp->lmfs_dev; } @@ -144,8 +139,7 @@ int lmfs_bytes(struct buf *bp) return bp->lmfs_bytes; } -static void -free_unused_blocks(void) +static void free_unused_blocks(void) { struct buf *bp; @@ -161,8 +155,7 @@ free_unused_blocks(void) printf("libminixfs: freeing; %d blocks, %d bytes\n", freed, bytes); } -static void -lmfs_alloc_block(struct buf *bp) +static void lmfs_alloc_block(struct buf *bp) { int len; ASSERT(!bp->data); @@ -418,9 +411,10 @@ struct buf *lmfs_get_block_ino(dev_t dev, block_t block, int only_search, /*===========================================================================* * lmfs_put_block * *===========================================================================*/ -void lmfs_put_block(bp, block_type) -register struct buf *bp; /* pointer to the buffer to be released */ -int block_type; /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */ +void lmfs_put_block( + struct buf *bp, /* pointer to the buffer to be released */ + int block_type /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */ +) { /* Return a block to the list of available blocks. Depending on 'block_type' * it may be put on the front or rear of the LRU chain. Blocks that are @@ -501,8 +495,9 @@ void lmfs_cache_reevaluate(dev_t dev) /*===========================================================================* * read_block * *===========================================================================*/ -static void read_block(bp) -register struct buf *bp; /* buffer pointer */ +static void read_block( + struct buf *bp /* buffer pointer */ +) { /* Read or write a disk block. This is the only routine in which actual disk * I/O is invoked. If an error occurs, a message is printed here, but the error @@ -770,8 +765,7 @@ void lmfs_rw_scattered( /*===========================================================================* * rm_lru * *===========================================================================*/ -static void rm_lru(bp) -struct buf *bp; +static void rm_lru(struct buf *bp) { /* Remove a block from its LRU chain. */ struct buf *next_ptr, *prev_ptr; diff --git a/lib/libminlib/itoa.c b/lib/libminlib/itoa.c index 81181b458..ac5a84910 100644 --- a/lib/libminlib/itoa.c +++ b/lib/libminlib/itoa.c @@ -6,8 +6,7 @@ static char qbuf[8]; char *itoa(int n); -char *itoa(n) -int n; +char *itoa(int n) { register int r, k; int flag = 0; diff --git a/lib/libpuffs/link.c b/lib/libpuffs/link.c index b3a41ae54..931f78c26 100644 --- a/lib/libpuffs/link.c +++ b/lib/libpuffs/link.c @@ -68,7 +68,7 @@ int fs_ftrunc(void) /*===========================================================================* * fs_link * *===========================================================================*/ -int fs_link() +int fs_link(void) { /* Perform the link(name1, name2) system call. */ @@ -152,7 +152,7 @@ int fs_link() /*===========================================================================* * fs_rdlink * *===========================================================================*/ -int fs_rdlink() +int fs_rdlink(void) { register int r; /* return value */ size_t copylen; @@ -193,7 +193,7 @@ int fs_rdlink() /*===========================================================================* * fs_rename * *===========================================================================*/ -int fs_rename() +int fs_rename(void) { /* Perform the rename(name1, name2) system call. */ struct puffs_node *old_dirp, *old_ip; /* ptrs to old dir, file pnodes */ @@ -393,7 +393,7 @@ static int unlink_file(struct puffs_node *dirp, struct puffs_node *pn, /*===========================================================================* * fs_unlink * *===========================================================================*/ -int fs_unlink() +int fs_unlink(void) { /* Perform the unlink(name) or rmdir(name) system call. The code for these two * is almost the same. They differ only in some condition testing. Unlink() @@ -467,10 +467,11 @@ int fs_unlink() /*===========================================================================* * remove_dir * *===========================================================================*/ -static int remove_dir(pn_dir, pn, pcn) -struct puffs_node *pn_dir; /* parent directory */ -struct puffs_node *pn; /* directory to be removed */ -struct puffs_cn *pcn; /* Name, creads of directory */ +static int remove_dir( + struct puffs_node *pn_dir, /* parent directory */ + struct puffs_node *pn, /* directory to be removed */ + struct puffs_cn *pcn /* Name, creads of directory */ +) { /* A directory file has to be removed. Five conditions have to met: * - The file must be a directory @@ -525,10 +526,11 @@ struct puffs_cn *pcn; /* Name, creads of directory */ /*===========================================================================* * unlink_file * *===========================================================================*/ -static int unlink_file(dirp, pn, pcn) -struct puffs_node *dirp; /* parent directory of file */ -struct puffs_node *pn; /* pnode of file, may be NULL too. */ -struct puffs_cn *pcn; /* Name, creads of file */ +static int unlink_file( + struct puffs_node *dirp, /* parent directory of file */ + struct puffs_node *pn, /* pnode of file, may be NULL too. */ + struct puffs_cn *pcn /* Name, creads of file */ +) { /* Unlink 'file_name'; pn must be the pnode of 'file_name' */ int r; diff --git a/lib/libpuffs/misc.c b/lib/libpuffs/misc.c index e5886ebcb..b07b937f6 100644 --- a/lib/libpuffs/misc.c +++ b/lib/libpuffs/misc.c @@ -12,7 +12,7 @@ /*===========================================================================* * fs_sync * *===========================================================================*/ -int fs_sync() +int fs_sync(void) { /* Perform the sync() system call. Flush all the tables. * The order in which the various tables are flushed is critical. @@ -35,7 +35,7 @@ int fs_sync() /*===========================================================================* * fs_flush * *===========================================================================*/ -int fs_flush() +int fs_flush(void) { /* Flush the blocks of a device from the cache after writing any dirty blocks * to disk. diff --git a/lib/libpuffs/mount.c b/lib/libpuffs/mount.c index 88b1133dc..5218b8b4f 100644 --- a/lib/libpuffs/mount.c +++ b/lib/libpuffs/mount.c @@ -15,7 +15,7 @@ /*===========================================================================* * fs_readsuper * *===========================================================================*/ -int fs_readsuper() +int fs_readsuper(void) { struct vattr *root_va; @@ -42,7 +42,7 @@ int fs_readsuper() /*===========================================================================* * fs_mountpoint * *===========================================================================*/ -int fs_mountpoint() +int fs_mountpoint(void) { /* This function looks up the mount point, it checks the condition whether * the partition can be mounted on the pnode or not. @@ -75,7 +75,7 @@ int fs_mountpoint() /*===========================================================================* * fs_unmount * *===========================================================================*/ -int fs_unmount() +int fs_unmount(void) { int error; diff --git a/lib/libpuffs/open.c b/lib/libpuffs/open.c index 8888259f4..2d6b4305d 100644 --- a/lib/libpuffs/open.c +++ b/lib/libpuffs/open.c @@ -16,7 +16,7 @@ /*===========================================================================* * fs_create * *===========================================================================*/ -int fs_create() +int fs_create(void) { int r; struct puffs_node *pn_dir; @@ -114,7 +114,7 @@ int fs_create() /*===========================================================================* * fs_mknod * *===========================================================================*/ -int fs_mknod() +int fs_mknod(void) { int r; struct puffs_node *pn_dir; @@ -197,7 +197,7 @@ int fs_mknod() /*===========================================================================* * fs_mkdir * *===========================================================================*/ -int fs_mkdir() +int fs_mkdir(void) { int r; struct puffs_node *pn_dir; @@ -280,7 +280,7 @@ int fs_mkdir() /*===========================================================================* * fs_slink * *===========================================================================*/ -int fs_slink() +int fs_slink(void) { int r; struct pnode *pn; /* pnode containing symbolic link */ @@ -372,7 +372,7 @@ int fs_slink() /*===========================================================================* * fs_inhibread * *===========================================================================*/ -int fs_inhibread() +int fs_inhibread(void) { return(OK); } diff --git a/lib/libpuffs/path.c b/lib/libpuffs/path.c index 4c4b7ac5a..c749289f2 100644 --- a/lib/libpuffs/path.c +++ b/lib/libpuffs/path.c @@ -35,7 +35,7 @@ static int parse_path(pino_t dir_ino, pino_t root_ino, int flags, struct /*===========================================================================* * fs_lookup * *===========================================================================*/ -int fs_lookup() +int fs_lookup(void) { cp_grant_id_t grant; int r, r1, flags, symlinks; @@ -129,13 +129,14 @@ int fs_lookup() * parse_path * *===========================================================================*/ static int parse_path( -pino_t dir_ino, -pino_t root_ino, -int flags, -struct puffs_node **res_inop, -size_t *offsetp, -int *symlinkp -) { + pino_t dir_ino, + pino_t root_ino, + int flags, + struct puffs_node **res_inop, + size_t *offsetp, + int *symlinkp +) +{ /* Parse the path in user_path, starting at dir_ino. If the path is the empty * string, just return dir_ino. It is upto the caller to treat an empty * path in a special way. Otherwise, if the path consists of just one or @@ -279,11 +280,12 @@ int *symlinkp /*===========================================================================* * ltraverse * *===========================================================================*/ -static int ltraverse(pn, suffix) -register struct puffs_node *pn;/* symbolic link */ -char *suffix; /* current remaining path. Has to point in the +static int ltraverse( + struct puffs_node *pn, /* symbolic link */ + char *suffix /* current remaining path. Has to point in the * user_path buffer */ +) { /* Traverse a symbolic link. Copy the link text from the pnode and insert * the text into the path. Return error code or report success. Base @@ -292,8 +294,8 @@ char *suffix; /* current remaining path. Has to point in the */ int r; char sp[PATH_MAX]; - size_t llen = PATH_MAX;/* length of link */ - size_t slen; /* length of suffix */ + size_t llen = PATH_MAX; /* length of link */ + size_t slen; /* length of suffix */ PUFFS_MAKECRED(pcr, &global_kcred); @@ -355,10 +357,12 @@ char *suffix; /* current remaining path. Has to point in the /*===========================================================================* * advance * *===========================================================================*/ -struct puffs_node *advance(pn_dir, string, chk_perm) -struct puffs_node *pn_dir; /* pnode for directory to be searched */ -char string[NAME_MAX + 1]; /* component name to look for */ -int chk_perm; /* check permissions when string is looked up*/ +struct puffs_node *advance( + struct puffs_node *pn_dir, /* pnode for directory to be searched */ + char string[NAME_MAX + 1], /* component name to look for */ + int chk_perm /* check permissions when string is + * looked up*/ +) { /* Given a directory and a component of a path, look up the component in * the directory, find the pnode, open it, and return a pointer to its pnode @@ -501,9 +505,10 @@ int chk_perm; /* check permissions when string is looked up*/ /*===========================================================================* * get_name * *===========================================================================*/ -static char *get_name(path_name, string) -char *path_name; /* path name to parse */ -char string[NAME_MAX+1]; /* component extracted from 'old_name' */ +static char *get_name( + char *path_name, /* path name to parse */ + char string[NAME_MAX+1] /* component extracted from 'old_name' */ +) { /* Given a pointer to a path name in fs space, 'path_name', copy the first * component to 'string' (truncated if necessary, always nul terminated). diff --git a/lib/libpuffs/protect.c b/lib/libpuffs/protect.c index 0c46dc74d..6cf79360f 100644 --- a/lib/libpuffs/protect.c +++ b/lib/libpuffs/protect.c @@ -14,7 +14,7 @@ static int in_group(gid_t grp); /*===========================================================================* * fs_chmod * *===========================================================================*/ -int fs_chmod() +int fs_chmod(void) { /* Perform the chmod(name, mode) system call. */ struct puffs_node *pn; @@ -48,7 +48,7 @@ int fs_chmod() /*===========================================================================* * fs_chown * *===========================================================================*/ -int fs_chown() +int fs_chown(void) { struct puffs_node *pn; struct vattr va; diff --git a/lib/libpuffs/puffs.c b/lib/libpuffs/puffs.c index 2df7e7ce6..1d5bfe32c 100644 --- a/lib/libpuffs/puffs.c +++ b/lib/libpuffs/puffs.c @@ -683,7 +683,7 @@ puffs_mainloop(struct puffs_usermount *pu) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -static void sef_local_startup() +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -735,8 +735,9 @@ static void sef_cb_signal_handler(int signo) /*===========================================================================* * get_work * *===========================================================================*/ -static void get_work(m_in) -message *m_in; /* pointer to message */ +static void get_work( + message *m_in /* pointer to message */ +) { int r, srcok = 0; endpoint_t src; diff --git a/lib/libpuffs/stadir.c b/lib/libpuffs/stadir.c index 5e7f2fd17..7b41174b6 100644 --- a/lib/libpuffs/stadir.c +++ b/lib/libpuffs/stadir.c @@ -14,7 +14,7 @@ /*===========================================================================* * fs_stat * *===========================================================================*/ -int fs_stat() +int fs_stat(void) { register int r; /* return value */ register struct puffs_node *pn; /* target pnode */ @@ -78,7 +78,7 @@ int fs_stat() /*===========================================================================* * fs_statvfs * *===========================================================================*/ -int fs_statvfs() +int fs_statvfs(void) { int r; struct statvfs st; diff --git a/lib/libpuffs/time.c b/lib/libpuffs/time.c index b6e11fcb5..412bbe11c 100644 --- a/lib/libpuffs/time.c +++ b/lib/libpuffs/time.c @@ -14,7 +14,7 @@ /*===========================================================================* * fs_utime * *===========================================================================*/ -int fs_utime() +int fs_utime(void) { struct puffs_node *pn; struct vattr va; diff --git a/lib/libpuffs/utility.c b/lib/libpuffs/utility.c index 03667561a..2f41cb76a 100644 --- a/lib/libpuffs/utility.c +++ b/lib/libpuffs/utility.c @@ -14,7 +14,7 @@ /*===========================================================================* * no_sys * *===========================================================================*/ -int no_sys() +int no_sys(void) { /* Somebody has used an illegal system call number */ lpuffs_debug("no_sys: invalid call %d\n", req_nr); @@ -38,7 +38,7 @@ void mfs_nul_f(const char *file, int line, char *str, unsigned int len, /*===========================================================================* * clock_timespec * *===========================================================================*/ -struct timespec clock_timespec() +struct timespec clock_timespec(void) { /* This routine returns the time in seconds since 1.1.1970. MINIX is an * astrophysically naive system that assumes the earth rotates at a constant diff --git a/lib/libsffs/dentry.c b/lib/libsffs/dentry.c index 53f097312..45b0d7c5d 100644 --- a/lib/libsffs/dentry.c +++ b/lib/libsffs/dentry.c @@ -20,7 +20,7 @@ static unsigned int hash_dentry(struct inode *parent, char *name); /*===========================================================================* * init_dentry * *===========================================================================*/ -void init_dentry() +void init_dentry(void) { /* Initialize the names hashtable. */ @@ -33,9 +33,7 @@ void init_dentry() /*===========================================================================* * lookup_dentry * *===========================================================================*/ -struct inode *lookup_dentry(parent, name) -struct inode *parent; -char *name; +struct inode *lookup_dentry(struct inode *parent, char *name) { /* Given a directory inode and a component name, look up the inode associated * with that directory entry. Return the inode (with increased reference @@ -64,10 +62,7 @@ char *name; /*===========================================================================* * add_dentry * *===========================================================================*/ -void add_dentry(parent, name, ino) -struct inode *parent; -char *name; -struct inode *ino; +void add_dentry(struct inode *parent, char *name, struct inode *ino) { /* Add an entry to a parent inode, in the form of a new inode, with the given * name. An entry with this name must not already exist. @@ -92,8 +87,7 @@ struct inode *ino; /*===========================================================================* * del_one_dentry * *===========================================================================*/ -static void del_one_dentry(ino) -struct inode *ino; +static void del_one_dentry(struct inode *ino) { /* This inode has become inaccessible by name. Disassociate it from its parent * and remove it from the names hash table. @@ -123,8 +117,7 @@ struct inode *ino; /*===========================================================================* * del_dentry * *===========================================================================*/ -void del_dentry(ino) -struct inode *ino; +void del_dentry(struct inode *ino) { /* Disassociate an inode from its parent, effectively deleting it. Recursively * delete all its children as well, fragmenting the deleted branch into single @@ -167,9 +160,7 @@ struct inode *ino; /*===========================================================================* * hash_dentry * *===========================================================================*/ -static unsigned int hash_dentry(parent, name) -struct inode *parent; -char *name; +static unsigned int hash_dentry(struct inode *parent, char *name) { /* Generate a hash value for a given name. Normalize the name first, so that * different variations of the name will result in the same hash value. diff --git a/lib/libsffs/handle.c b/lib/libsffs/handle.c index d4663580f..ed416c134 100644 --- a/lib/libsffs/handle.c +++ b/lib/libsffs/handle.c @@ -15,8 +15,7 @@ /*===========================================================================* * get_handle * *===========================================================================*/ -int get_handle(ino) -struct inode *ino; +int get_handle(struct inode *ino) { /* Get an open file or directory handle for an inode. */ @@ -55,8 +54,7 @@ struct inode *ino; /*===========================================================================* * put_handle * *===========================================================================*/ -void put_handle(ino) -struct inode *ino; +void put_handle(struct inode *ino) { /* Close an open file or directory handle associated with an inode. */ diff --git a/lib/libsffs/inode.c b/lib/libsffs/inode.c index a70b43603..aed2f09bc 100644 --- a/lib/libsffs/inode.c +++ b/lib/libsffs/inode.c @@ -25,7 +25,7 @@ static TAILQ_HEAD(free_head, inode) free_list; /*===========================================================================* * init_inode * *===========================================================================*/ -struct inode *init_inode() +struct inode *init_inode(void) { /* Initialize inode table. Return the root inode. */ @@ -101,8 +101,7 @@ struct inode *find_inode(pino_t ino_nr) /*===========================================================================* * get_inode * *===========================================================================*/ -void get_inode(ino) -struct inode *ino; +void get_inode(struct inode *ino) { /* Increase the given inode's reference count. If both reference and link * count were zero before, remove the inode from the free list. @@ -125,8 +124,7 @@ struct inode *ino; /*===========================================================================* * put_inode * *===========================================================================*/ -void put_inode(ino) -struct inode *ino; +void put_inode(struct inode *ino) { /* Decrease an inode's reference count. If this count has reached zero, close * the inode's file handle, if any. If both reference and link count have @@ -165,9 +163,7 @@ struct inode *ino; /*===========================================================================* * link_inode * *===========================================================================*/ -void link_inode(parent, ino) -struct inode *parent; -struct inode *ino; +void link_inode(struct inode *parent, struct inode *ino) { /* Link an inode to a parent. If both reference and link count were zero * before, remove the inode from the free list. This function should only be @@ -186,8 +182,7 @@ struct inode *ino; /*===========================================================================* * unlink_inode * *===========================================================================*/ -void unlink_inode(ino) -struct inode *ino; +void unlink_inode(struct inode *ino) { /* Unlink an inode from its parent. If both reference and link count have * reached zero, mark the inode as cached or free. This function should only @@ -212,7 +207,7 @@ struct inode *ino; /*===========================================================================* * get_free_inode * *===========================================================================*/ -struct inode *get_free_inode() +struct inode *get_free_inode(void) { /* Return a free inode object (with reference count 1), if available. */ @@ -249,7 +244,7 @@ struct inode *get_free_inode() /*===========================================================================* * have_free_inode * *===========================================================================*/ -int have_free_inode() +int have_free_inode(void) { /* Check whether there are any free inodes at the moment. Kind of lame, but * this allows for easier error recovery in some places. @@ -261,7 +256,7 @@ int have_free_inode() /*===========================================================================* * have_used_inode * *===========================================================================*/ -int have_used_inode() +int have_used_inode(void) { /* Check whether any inodes are still in use, that is, any of the inodes have * a reference count larger than zero. @@ -278,7 +273,7 @@ int have_used_inode() /*===========================================================================* * do_putnode * *===========================================================================*/ -int do_putnode() +int do_putnode(void) { /* Decrease an inode's reference count. */ diff --git a/lib/libsffs/link.c b/lib/libsffs/link.c index be877cc7f..67716958c 100644 --- a/lib/libsffs/link.c +++ b/lib/libsffs/link.c @@ -20,7 +20,7 @@ static int force_remove(char *path, int dir); /*===========================================================================* * do_create * *===========================================================================*/ -int do_create() +int do_create(void) { /* Create a new file. */ @@ -129,7 +129,7 @@ int do_create() /*===========================================================================* * do_mkdir * *===========================================================================*/ -int do_mkdir() +int do_mkdir(void) { /* Make a new directory. */ @@ -178,9 +178,10 @@ int do_mkdir() /*===========================================================================* * force_remove * *===========================================================================*/ -static int force_remove(path, dir) -char *path; /* path to file or directory */ -int dir; /* TRUE iff directory */ +static int force_remove( + char *path, /* path to file or directory */ + int dir /* TRUE iff directory */ +) { /* Remove a file or directory. Wrapper around unlink and rmdir that makes the * target temporarily writable if the operation fails with an access denied @@ -233,7 +234,7 @@ int dir; /* TRUE iff directory */ /*===========================================================================* * do_unlink * *===========================================================================*/ -int do_unlink() +int do_unlink(void) { /* Delete a file. */ @@ -280,7 +281,7 @@ int do_unlink() /*===========================================================================* * do_rmdir * *===========================================================================*/ -int do_rmdir() +int do_rmdir(void) { /* Remove an empty directory. */ @@ -328,7 +329,7 @@ int do_rmdir() /*===========================================================================* * do_rename * *===========================================================================*/ -int do_rename() +int do_rename(void) { /* Rename a file or directory. */ diff --git a/lib/libsffs/lookup.c b/lib/libsffs/lookup.c index 2b90d49ad..b3ef77f25 100644 --- a/lib/libsffs/lookup.c +++ b/lib/libsffs/lookup.c @@ -10,19 +10,24 @@ #include "inc.h" static int get_mask(vfs_ucred_t *ucred); -static int access_as_dir(struct inode *ino, struct sffs_attr *attr, int - uid, int mask); + +static int access_as_dir(struct inode *ino, struct sffs_attr *attr, + int uid, int mask); + static int next_name(char **ptr, char **start, char name[NAME_MAX+1]); -static int go_up(char path[PATH_MAX], struct inode *ino, struct inode - **res_ino, struct sffs_attr *attr); + +static int go_up(char path[PATH_MAX], struct inode *ino, + struct inode **res_ino, struct sffs_attr *attr); + static int go_down(char path[PATH_MAX], struct inode *ino, char *name, struct inode **res_ino, struct sffs_attr *attr); /*===========================================================================* * get_mask * *===========================================================================*/ -static int get_mask(ucred) -vfs_ucred_t *ucred; /* credentials of the caller */ +static int get_mask( + vfs_ucred_t *ucred /* credentials of the caller */ +) { /* Given the caller's credentials, precompute a search access mask to test * against directory modes. @@ -42,11 +47,12 @@ vfs_ucred_t *ucred; /* credentials of the caller */ /*===========================================================================* * access_as_dir * *===========================================================================*/ -static int access_as_dir(ino, attr, uid, mask) -struct inode *ino; /* the inode to test */ -struct sffs_attr *attr; /* attributes of the inode */ -int uid; /* UID of the caller */ -int mask; /* search access mask of the caller */ +static int access_as_dir( + struct inode *ino, /* the inode to test */ + struct sffs_attr *attr, /* attributes of the inode */ + int uid, /* UID of the caller */ + int mask /* search access mask of the caller */ +) { /* Check whether the given inode may be accessed as directory. * Return OK or an appropriate error code. @@ -69,10 +75,11 @@ int mask; /* search access mask of the caller */ /*===========================================================================* * next_name * *===========================================================================*/ -static int next_name(ptr, start, name) -char **ptr; /* cursor pointer into path (in, out) */ -char **start; /* place to store start of name */ -char name[NAME_MAX+1]; /* place to store name */ +static int next_name( + char **ptr, /* cursor pointer into path (in, out) */ + char **start, /* place to store start of name */ + char name[NAME_MAX+1] /* place to store name */ +) { /* Get the next path component from a path. */ @@ -102,11 +109,12 @@ char name[NAME_MAX+1]; /* place to store name */ /*===========================================================================* * go_up * *===========================================================================*/ -static int go_up(path, ino, res_ino, attr) -char path[PATH_MAX]; /* path to take the last part from */ -struct inode *ino; /* inode of the current directory */ -struct inode **res_ino; /* place to store resulting inode */ -struct sffs_attr *attr; /* place to store inode attributes */ +static int go_up( + char path[PATH_MAX], /* path to take the last part from */ + struct inode *ino, /* inode of the current directory */ + struct inode **res_ino, /* place to store resulting inode */ + struct sffs_attr *attr /* place to store inode attributes */ +) { /* Given an inode, progress into the parent directory. */ @@ -131,12 +139,13 @@ struct sffs_attr *attr; /* place to store inode attributes */ /*===========================================================================* * go_down * *===========================================================================*/ -static int go_down(path, parent, name, res_ino, attr) -char path[PATH_MAX]; /* path to add the name to */ -struct inode *parent; /* inode of the current directory */ -char *name; /* name of the directory entry */ -struct inode **res_ino; /* place to store resulting inode */ -struct sffs_attr *attr; /* place to store inode attributes */ +static int go_down( + char path[PATH_MAX], /* path to add the name to */ + struct inode *parent, /* inode of the current directory */ + char *name, /* name of the directory entry */ + struct inode **res_ino, /* place to store resulting inode */ + struct sffs_attr *attr /* place to store inode attributes */ +) { /* Given a directory inode and a name, progress into a directory entry. */ @@ -190,7 +199,7 @@ struct sffs_attr *attr; /* place to store inode attributes */ /*===========================================================================* * do_lookup * *===========================================================================*/ -int do_lookup() +int do_lookup(void) { /* Resolve a path string to an inode. */ diff --git a/lib/libsffs/main.c b/lib/libsffs/main.c index fa3e24ad6..137e520b1 100644 --- a/lib/libsffs/main.c +++ b/lib/libsffs/main.c @@ -64,8 +64,7 @@ void sffs_signal(int signo) /*===========================================================================* * get_work * *===========================================================================*/ -static int get_work(who_e) -endpoint_t *who_e; +static int get_work(endpoint_t *who_e) { /* Receive a request message from VFS. Return TRUE if a new message is ready * to be processed, or FALSE if sef_stop() was called from the signal handler. @@ -86,9 +85,10 @@ endpoint_t *who_e; /*===========================================================================* * send_reply * *===========================================================================*/ -static void send_reply(err, transid) -int err; /* resulting error code */ -int transid; +static void send_reply( + int err, /* resulting error code */ + int transid +) { /* Send a reply message to the requesting party, with the given error code. */ diff --git a/lib/libsffs/misc.c b/lib/libsffs/misc.c index 17455dc5b..a14181db8 100644 --- a/lib/libsffs/misc.c +++ b/lib/libsffs/misc.c @@ -14,7 +14,7 @@ /*===========================================================================* * do_statvfs * *===========================================================================*/ -int do_statvfs() +int do_statvfs(void) { /* Retrieve file system statistics. */ diff --git a/lib/libsffs/mount.c b/lib/libsffs/mount.c index 2ed02d191..3e2d75338 100644 --- a/lib/libsffs/mount.c +++ b/lib/libsffs/mount.c @@ -13,7 +13,7 @@ /*===========================================================================* * do_readsuper * *===========================================================================*/ -int do_readsuper() +int do_readsuper(void) { /* Mount the file system. */ @@ -72,7 +72,7 @@ int do_readsuper() /*===========================================================================* * do_unmount * *===========================================================================*/ -int do_unmount() +int do_unmount(void) { /* Unmount the file system. */ diff --git a/lib/libsffs/name.c b/lib/libsffs/name.c index 8aeee562c..9627586bc 100644 --- a/lib/libsffs/name.c +++ b/lib/libsffs/name.c @@ -15,9 +15,7 @@ /*===========================================================================* * normalize_name * *===========================================================================*/ -void normalize_name(dst, src) -char dst[NAME_MAX+1]; -char *src; +void normalize_name(char dst[NAME_MAX+1], char *src) { /* Normalize the given path component name, storing the result in the given * buffer. @@ -38,9 +36,7 @@ char *src; /*===========================================================================* * compare_name * *===========================================================================*/ -int compare_name(name1, name2) -char *name1; -char *name2; +int compare_name(char *name1, char *name2) { /* Return TRUE if the given path component names are equivalent, FALSE * otherwise. diff --git a/lib/libsffs/path.c b/lib/libsffs/path.c index 8abe9b355..512230f68 100644 --- a/lib/libsffs/path.c +++ b/lib/libsffs/path.c @@ -14,9 +14,7 @@ /*===========================================================================* * make_path * *===========================================================================*/ -int make_path(path, ino) -char path[PATH_MAX]; -struct inode *ino; +int make_path(char path[PATH_MAX], struct inode *ino) { /* Given an inode, construct the path identifying that inode. */ @@ -69,9 +67,7 @@ struct inode *ino; /*===========================================================================* * push_path * *===========================================================================*/ -int push_path(path, name) -char path[PATH_MAX]; -char *name; +int push_path(char path[PATH_MAX], char *name) { /* Add a component to the end of a path. */ @@ -93,8 +89,7 @@ char *name; /*===========================================================================* * pop_path * *===========================================================================*/ -void pop_path(path) -char path[PATH_MAX]; +void pop_path(char path[PATH_MAX]) { /* Remove the last component from a path. */ diff --git a/lib/libsffs/read.c b/lib/libsffs/read.c index 5a968dc39..aaec41e46 100644 --- a/lib/libsffs/read.c +++ b/lib/libsffs/read.c @@ -17,7 +17,7 @@ /*===========================================================================* * do_read * *===========================================================================*/ -int do_read() +int do_read(void) { /* Read data from a file. */ @@ -77,7 +77,7 @@ int do_read() /*===========================================================================* * do_getdents * *===========================================================================*/ -int do_getdents() +int do_getdents(void) { /* Retrieve directory entries. */ diff --git a/lib/libsffs/stat.c b/lib/libsffs/stat.c index 7ac386926..0d01e6c42 100644 --- a/lib/libsffs/stat.c +++ b/lib/libsffs/stat.c @@ -15,9 +15,7 @@ /*===========================================================================* * get_mode * *===========================================================================*/ -pmode_t get_mode(ino, mode) -struct inode *ino; -int mode; +pmode_t get_mode(struct inode *ino, int mode) { /* Return the mode for an inode, given the inode and the retrieved mode. */ @@ -39,7 +37,7 @@ int mode; /*===========================================================================* * do_stat * *===========================================================================*/ -int do_stat() +int do_stat(void) { /* Retrieve inode status. */ @@ -103,7 +101,7 @@ int do_stat() /*===========================================================================* * do_chmod * *===========================================================================*/ -int do_chmod() +int do_chmod(void) { /* Change file mode. */ @@ -140,7 +138,7 @@ int do_chmod() /*===========================================================================* * do_utime * *===========================================================================*/ -int do_utime() +int do_utime(void) { /* Set file times. */ diff --git a/lib/libsffs/util.c b/lib/libsffs/util.c index 653741691..562e97575 100644 --- a/lib/libsffs/util.c +++ b/lib/libsffs/util.c @@ -14,10 +14,11 @@ /*===========================================================================* * get_name * *===========================================================================*/ -int get_name(grant, len, name) -cp_grant_id_t grant; /* memory grant for the path component */ -size_t len; /* length of the name, including '\0' */ -char name[NAME_MAX+1]; /* buffer in which store the result */ +int get_name( + cp_grant_id_t grant, /* memory grant for the path component */ + size_t len, /* length of the name, including '\0' */ + char name[NAME_MAX+1] /* buffer in which store the result */ +) { /* Retrieve a path component from the caller, using a given grant. */ @@ -43,7 +44,7 @@ char name[NAME_MAX+1]; /* buffer in which store the result */ /*===========================================================================* * do_noop * *===========================================================================*/ -int do_noop() +int do_noop(void) { /* Generic handler for no-op system calls. */ @@ -54,7 +55,7 @@ int do_noop() /*===========================================================================* * no_sys * *===========================================================================*/ -int no_sys() +int no_sys(void) { /* Generic handler for unimplemented system calls. */ diff --git a/lib/libsffs/verify.c b/lib/libsffs/verify.c index 1d4eab9c9..d335ebd93 100644 --- a/lib/libsffs/verify.c +++ b/lib/libsffs/verify.c @@ -14,11 +14,8 @@ /*===========================================================================* * verify_path * *===========================================================================*/ -int verify_path(path, ino, attr, stale) -char path[PATH_MAX]; -struct inode *ino; -struct sffs_attr *attr; -int *stale; +int verify_path(char path[PATH_MAX], struct inode *ino, + struct sffs_attr *attr, int *stale) { /* Given a path, and the inode associated with that path, verify if the inode * still matches the real world. Obtain the attributes of the file identified @@ -61,10 +58,11 @@ int *stale; /*===========================================================================* * verify_inode * *===========================================================================*/ -int verify_inode(ino, path, attr) -struct inode *ino; /* inode to verify */ -char path[PATH_MAX]; /* buffer in which to store the path */ -struct sffs_attr *attr; /* buffer for attributes, or NULL */ +int verify_inode( + struct inode *ino, /* inode to verify */ + char path[PATH_MAX], /* buffer in which to store the path */ + struct sffs_attr *attr /* buffer for attributes, or NULL */ +) { /* Given an inode, construct a path identifying the inode, and check whether * that path is still valid for that inode (as far as we can tell). As a side @@ -88,11 +86,12 @@ struct sffs_attr *attr; /* buffer for attributes, or NULL */ /*===========================================================================* * verify_dentry * *===========================================================================*/ -int verify_dentry(parent, name, path, res_ino) -struct inode *parent; /* parent inode: the inode to verify */ -char name[NAME_MAX+1]; /* the given directory entry path component */ -char path[PATH_MAX]; /* buffer to store the resulting path in */ -struct inode **res_ino; /* pointer for addressed inode (or NULL) */ +int verify_dentry( + struct inode *parent, /* parent inode: the inode to verify */ + char name[NAME_MAX+1], /* the given directory entry path component */ + char path[PATH_MAX], /* buffer to store the resulting path in */ + struct inode **res_ino /* pointer for addressed inode (or NULL) */ +) { /* Given a directory inode and a name, construct a path identifying that * directory entry, check whether the path to the parent is still valid, and diff --git a/lib/libsffs/write.c b/lib/libsffs/write.c index 3bdc209c3..7f403455e 100644 --- a/lib/libsffs/write.c +++ b/lib/libsffs/write.c @@ -16,11 +16,8 @@ static int write_file(struct inode *ino, u64_t *posp, size_t *countp, /*===========================================================================* * write_file * *===========================================================================*/ -static int write_file(ino, posp, countp, grantp) -struct inode *ino; -u64_t *posp; -size_t *countp; -cp_grant_id_t *grantp; +static int write_file(struct inode *ino, u64_t *posp, size_t *countp, + cp_grant_id_t *grantp) { /* Write data or zeroes to a file, depending on whether a valid pointer to * a data grant was provided. @@ -79,7 +76,7 @@ cp_grant_id_t *grantp; /*===========================================================================* * do_write * *===========================================================================*/ -int do_write() +int do_write(void) { /* Write data to a file. */ @@ -116,7 +113,7 @@ int do_write() /*===========================================================================* * do_ftrunc * *===========================================================================*/ -int do_ftrunc() +int do_ftrunc(void) { /* Change file size or create file holes. */ diff --git a/lib/libsys/arch/i386/profile.c b/lib/libsys/arch/i386/profile.c index 667733977..8b8098b05 100644 --- a/lib/libsys/arch/i386/profile.c +++ b/lib/libsys/arch/i386/profile.c @@ -45,7 +45,7 @@ static void reset(void); static void clear_tbl(void); -void procentry (char *name) +void procentry(char *name) { static int init = 0; unsigned hash = 0, x = 0; @@ -168,7 +168,7 @@ void procentry (char *name) } -void procexit (char *UNUSED(name)) +void procexit(char *UNUSED(name)) { u64_t stop, spent; u32_t tsc_lo, tsc_hi; @@ -224,7 +224,7 @@ void procexit (char *UNUSED(name)) } -static void cprof_init() +static void cprof_init(void) { int i; @@ -247,14 +247,14 @@ static void cprof_init() } -static void reset() +static void reset(void) { clear_tbl(); control.reset = 0; } -static void clear_tbl() +static void clear_tbl(void) { int i; diff --git a/lib/libsys/env_get_prm.c b/lib/libsys/env_get_prm.c index 2ebf426a3..d56313a0e 100644 --- a/lib/libsys/env_get_prm.c +++ b/lib/libsys/env_get_prm.c @@ -9,9 +9,7 @@ static char *find_key(const char *params, const char *key); /*===========================================================================* * env_setargs * *===========================================================================*/ -void env_setargs(arg_c, arg_v) -int arg_c; -char *arg_v[]; +void env_setargs(int arg_c, char *arg_v[]) { env_argc= arg_c; env_argv= arg_v; @@ -77,12 +75,10 @@ int env_get_param(const char *key, char *value, int max_len) /*==========================================================================* * find_key * *==========================================================================*/ -static char *find_key(params,name) -const char *params; -const char *name; +static char *find_key(const char *params, const char *name) { - register const char *namep; - register char *envp; + const char *namep; + char *envp; for (envp = (char *) params; *envp != 0;) { for (namep = name; *namep != 0 && *namep == *envp; namep++, envp++) diff --git a/lib/libsys/optset.c b/lib/libsys/optset.c index be65cfa9e..9a4ec61e2 100644 --- a/lib/libsys/optset.c +++ b/lib/libsys/optset.c @@ -18,16 +18,12 @@ #include #include -static void optset_parse_entry(struct optset *entry, char *ptr, int - len); +static void optset_parse_entry(struct optset *entry, char *ptr, int len); /*===========================================================================* * optset_parse_entry * *===========================================================================*/ -static void optset_parse_entry(entry, ptr, len) -struct optset *entry; -char *ptr; -int len; +static void optset_parse_entry(struct optset *entry, char *ptr, int len) { /* Parse and store the value of a single option. */ @@ -67,9 +63,7 @@ int len; /*===========================================================================* * optset_parse * *===========================================================================*/ -void optset_parse(table, string) -struct optset *table; -char *string; +void optset_parse(struct optset *table, char *string) { /* Parse a string of options, using the provided table of optset entries. */ diff --git a/lib/libsys/sef_liveupdate.c b/lib/libsys/sef_liveupdate.c index 10ed20a71..691a6c936 100644 --- a/lib/libsys/sef_liveupdate.c +++ b/lib/libsys/sef_liveupdate.c @@ -40,7 +40,7 @@ EXTERN int sef_self_first_receive_done; /*===========================================================================* * do_sef_lu_before_receive * *===========================================================================*/ -void do_sef_lu_before_receive() +void do_sef_lu_before_receive(void) { /* Handle SEF Live update before receive events. */ int r; diff --git a/lib/libvassert/vassert.c b/lib/libvassert/vassert.c index 31f789609..d3d05a8b6 100644 --- a/lib/libvassert/vassert.c +++ b/lib/libvassert/vassert.c @@ -61,8 +61,7 @@ void libvassert_process_backdoor(uint32, uint32, uint32, reg_t *, reg_t *, *--------------------------------------------------------------------- */ -static void -sig_segv(int sig_no) +static void sig_segv(int sig_no) { /* jumping to error handling in VAssert_IsInVM. */ siglongjmp(segv_jmp, 1); @@ -86,8 +85,7 @@ sig_segv(int sig_no) *--------------------------------------------------------------------- */ -static Bool -VAssert_IsInVM(void) +static Bool VAssert_IsInVM(void) { uint32 eax, ebx, ecx, edx; static Bool inVM = FALSE; @@ -128,8 +126,7 @@ VAssert_IsInVM(void) *--------------------------------------------------------------------- */ -char -VAssert_Init(void) +char VAssert_Init(void) { uint32 eax, ebx, ecx, edx; VA page_address = (VA) &vassert_state.inReplay; @@ -168,8 +165,7 @@ VAssert_Init(void) *--------------------------------------------------------------------- */ -char -VAssert_Uninit(void) +char VAssert_Uninit(void) { unsigned int eax, ebx, ecx, edx; if (!VAssert_IsInVM()) { @@ -197,8 +193,7 @@ VAssert_Uninit(void) *--------------------------------------------------------------------- */ -void -VAssert_LogMain(const char *format, ...) +void VAssert_LogMain(const char *format, ...) { unsigned int eax, ebx, ecx, edx; char buf[LOG_MAX]; @@ -231,8 +226,7 @@ VAssert_LogMain(const char *format, ...) *--------------------------------------------------------------------- */ -void -VAssert_GoLiveMain() +void VAssert_GoLiveMain(void) { unsigned int eax, ebx, ecx, edx; vassert_state.inReplay = 0; @@ -256,8 +250,7 @@ VAssert_GoLiveMain() *--------------------------------------------------------------------- */ -void -VAssert_ReturnToReplayMain() +void VAssert_ReturnToReplayMain(void) { unsigned int eax, ebx, ecx, edx; libvassert_process_backdoor(CMD_RETURN_REPLAY, 0, MAGIC_PORT, &eax, &ebx, &ecx, &edx); @@ -281,8 +274,7 @@ VAssert_ReturnToReplayMain() *--------------------------------------------------------------------- */ -char -VAssert_SetRecordingMain(char start) +char VAssert_SetRecordingMain(char start) { uint32 eax, ebx, ecx, edx; if (!VAssert_IsInVM()) { -- 2.44.0