Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libsa ANSI, De-__P(), and some cosmetic changes incl...



details:   https://anonhg.NetBSD.org/src/rev/adf090b99678
branches:  trunk
changeset: 582004:adf090b99678
user:      junyoung <junyoung%NetBSD.org@localhost>
date:      Mon Jun 13 12:03:01 2005 +0000

description:
ANSI, De-__P(), and some cosmetic changes including
bcmp -> memcmp, bzero -> memset, bcopy -> memcpy.

diffstat:

 sys/lib/libsa/cd9660.c |  51 +++++++++++++++----------------------------------
 1 files changed, 16 insertions(+), 35 deletions(-)

diffs (144 lines):

diff -r adc93afbb5a1 -r adf090b99678 sys/lib/libsa/cd9660.c
--- a/sys/lib/libsa/cd9660.c    Mon Jun 13 11:34:11 2005 +0000
+++ b/sys/lib/libsa/cd9660.c    Mon Jun 13 12:03:01 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660.c,v 1.16 2005/02/26 22:58:56 perry Exp $        */
+/*     $NetBSD: cd9660.c,v 1.17 2005/06/13 12:03:01 junyoung Exp $     */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -73,13 +73,11 @@
 
 #define        cdb2devb(bno)   ((bno) * ISO_DEFAULT_BLOCK_SIZE / DEV_BSIZE)
 
-static int     pnmatch __P((const char *, struct ptable_ent *));
-static int     dirmatch __P((const char *, struct iso_directory_record *));
+static int     pnmatch(const char *, struct ptable_ent *);
+static int     dirmatch(const char *, struct iso_directory_record *);
 
 static int
-pnmatch(path, pp)
-       const char *path;
-       struct ptable_ent *pp;
+pnmatch(const char *path, struct ptable_ent *pp)
 {
        char *cp;
        int i;
@@ -96,9 +94,7 @@
 }
 
 static int
-dirmatch(path, dp)
-       const char *path;
-       struct iso_directory_record *dp;
+dirmatch(const char *path, struct iso_directory_record *dp)
 {
        char *cp;
        int i;
@@ -134,9 +130,7 @@
 }
 
 int
-cd9660_open(path, f)
-       const char *path;
-       struct open_file *f;
+cd9660_open(const char *path, struct open_file *f)
 {
        struct file *fp = 0;
        void *buf;
@@ -149,7 +143,8 @@
        int rc;
 
        /* First find the volume descriptor */
-       buf = alloc(buf_size = ISO_DEFAULT_BLOCK_SIZE);
+       buf_size = ISO_DEFAULT_BLOCK_SIZE
+       buf = alloc(buf_size);
        vd = buf;
        for (bno = 16;; bno++) {
 #if !defined(LIBSA_NO_TWIDDLE)
@@ -164,7 +159,7 @@
                        goto out;
                }
                rc = EINVAL;
-               if (bcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0)
+               if (memcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0)
                        goto out;
                if (isonum_711(vd->type) == ISO_VD_END)
                        goto out;
@@ -271,7 +266,7 @@
 
        /* allocate file system specific data structure */
        fp = alloc(sizeof(struct file));
-       bzero(fp, sizeof(struct file));
+       memset(fp, 0, sizeof(struct file));
        f->f_fsdata = (void *)fp;
 
        fp->off = 0;
@@ -291,8 +286,7 @@
 
 #if !defined(LIBSA_NO_FS_CLOSE)
 int
-cd9660_close(f)
-       struct open_file *f;
+cd9660_close(struct open_file *f)
 {
        struct file *fp = (struct file *)f->f_fsdata;
 
@@ -304,11 +298,7 @@
 #endif /* !defined(LIBSA_NO_FS_CLOSE) */
 
 int
-cd9660_read(f, start, size, resid)
-       struct open_file *f;
-       void *start;
-       size_t size;
-       size_t *resid;
+cd9660_read(struct open_file *f, void *start, size_t size, size_t *resid)
 {
        struct file *fp = (struct file *)f->f_fsdata;
        int rc = 0;
@@ -340,7 +330,7 @@
                        if (nread > off + size)
                                nread = off + size;
                        nread -= off;
-                       bcopy(buf + off, start, nread);
+                       memcpy(start, buf + off, nread);
                        start = (caddr_t)start + nread;
                        fp->off += nread;
                        size -= nread;
@@ -357,11 +347,7 @@
 
 #if !defined(LIBSA_NO_FS_WRITE)
 int
-cd9660_write(f, start, size, resid)
-       struct open_file *f;
-       void *start;
-       size_t size;
-       size_t *resid;
+cd9660_write(struct open_file *f, void *start, size_t size, size_t *resid)
 {
        return EROFS;
 }
@@ -369,10 +355,7 @@
 
 #if !defined(LIBSA_NO_FS_SEEK)
 off_t
-cd9660_seek(f, offset, where)
-       struct open_file *f;
-       off_t offset;
-       int where;
+cd9660_seek(struct open_file *f, off_t offset, int where)
 {
        struct file *fp = (struct file *)f->f_fsdata;
 
@@ -394,9 +377,7 @@
 #endif /* !defined(LIBSA_NO_FS_SEEK) */
 
 int
-cd9660_stat(f, sb)
-       struct open_file *f;
-       struct stat *sb;
+cd9660_stat(struct open_file *f, struct stat *sb)
 {
        struct file *fp = (struct file *)f->f_fsdata;
 



Home | Main Index | Thread Index | Old Index