]> arthur.barton.de Git - netatalk.git/commitdiff
stupid stuff, replace
authordidg <didg>
Sun, 12 Jan 2003 14:39:57 +0000 (14:39 +0000)
committerdidg <didg>
Sun, 12 Jan 2003 14:39:57 +0000 (14:39 +0000)
if ((a = b) == c)
with
if (c == (a = b))
for '==' and '!=' operators. the form ((a = b) == c) is confusing for some, not
smart enough, data-flow analyser.

13 files changed:
etc/afpd/afp_options.c
etc/afpd/appl.c
etc/afpd/desktop.c
etc/afpd/directory.c
etc/afpd/enumerate.c
etc/afpd/file.c
etc/afpd/filedir.c
etc/afpd/fork.c
etc/afpd/mangle.c
etc/afpd/unix.c
etc/afpd/volume.c
libatalk/adouble/ad_open.c
libatalk/dsi/dsi_stream.c

index eba6c660e97dbabb0e459b016c5cf7c473605bd9..2e75bcc05f42a22df45b33f78285c834ee7526c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_options.c,v 1.28 2002-12-07 02:39:57 rlewczuk Exp $
+ * $Id: afp_options.c,v 1.29 2003-01-12 14:39:57 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -428,17 +428,17 @@ int afp_options_parse(int ac, char **av, struct afp_options *options)
         perror( "gethostname" );
         return 0;
     }
-    if (( p = strchr(options->hostname, '.' )) != 0 ) {
+    if (NULL != ( p = strchr(options->hostname, '.' )) ) {
         *p = '\0';
     }
 
-    if (( p = strrchr( av[ 0 ], '/' )) == NULL ) {
+    if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) {
         p = av[ 0 ];
     } else {
         p++;
     }
 
-    while (( c = getopt( ac, av, OPTIONS )) != EOF ) {
+    while (EOF != ( c = getopt( ac, av, OPTIONS )) ) {
         switch ( c ) {
         case 'd' :
             options->flags |= OPTION_DEBUG;
index f6bd37ac63040cb88055911fdda57176eb4edc30..8173469166bbb8e41f60aef0e3e81621e330e33e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: appl.c,v 1.9 2003-01-08 15:01:33 didg Exp $
+ * $Id: appl.c,v 1.10 2003-01-12 14:39:58 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -181,7 +181,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid ))) {
         return( AFPERR_PARAM );
     }
 
@@ -267,7 +267,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid ))) {
         return( AFPERR_PARAM );
     }
 
@@ -335,7 +335,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         *rbuflen = 0;
         return( AFPERR_PARAM );
     }
index e26993bb4fb972e3e2fefb181a7ca39c2183a44b..b92318fca07998c5380ac5aa158756d17070ee4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: desktop.c,v 1.20 2003-01-08 15:01:33 didg Exp $
+ * $Id: desktop.c,v 1.21 2003-01-12 14:39:58 didg Exp $
  *
  * See COPYRIGHT.
  *
@@ -60,7 +60,7 @@ int           ibuflen, *rbuflen;
     ibuf += 2;
 
     memcpy( &vid, ibuf, sizeof(vid));
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         *rbuflen = 0;
         return( AFPERR_PARAM );
     }
@@ -768,17 +768,17 @@ int               ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( did );
-    if (( dir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, did )) ) {
        return afp_errno;
     }
 
-    if (( path = cname( vol, dir, &ibuf )) == NULL ) {
+    if (NULL == ( path = cname( vol, dir, &ibuf )) ) {
        return afp_errno;
     }
 
@@ -843,17 +843,17 @@ int               ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( did );
-    if (( dir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, did )) ) {
        return afp_errno;
     }
 
-    if (( s_path = cname( vol, dir, &ibuf )) == NULL ) {
+    if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) {
        return afp_errno;
     }
 
@@ -909,17 +909,17 @@ int               ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( did );
-    if (( dir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, did )) ) {
        return afp_errno;
     }
 
-    if (( s_path = cname( vol, dir, &ibuf )) == NULL ) {
+    if (NULL == ( s_path = cname( vol, dir, &ibuf ))) {
        return afp_errno;
     }
 
index 32c73ba1d590fd906e8e9e84cce8d4a2f9fd34cd..8464aad3b49abed72a595e2c49b97d4154639d49 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.55 2003-01-08 15:01:33 didg Exp $
+ * $Id: directory.c,v 1.56 2003-01-12 14:39:58 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -147,7 +147,7 @@ u_int32_t   did;
         return ret;
 
     id = did;
-    if ((upath = cnid_resolve(vol->v_db, &id, buffer, buflen)) == NULL) {
+    if (NULL == (upath = cnid_resolve(vol->v_db, &id, buffer, buflen)) ) {
         afp_errno = AFPERR_NOOBJ;
         return NULL;
     }
@@ -1273,7 +1273,7 @@ int               ibuflen, *rbuflen;
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -1645,7 +1645,7 @@ int               ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -1654,11 +1654,11 @@ int             ibuflen, *rbuflen;
 
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( did );
-    if (( dir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, did )) ) {
         return( AFPERR_NOOBJ );
     }
 
-    if (( s_path = cname( vol, dir, &ibuf )) == NULL ) {
+    if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) {
         return afp_errno;
     }
     /* FIXME check done elswhere? cname was able to move curdir to it! */
@@ -2153,18 +2153,18 @@ int             ibuflen, *rbuflen;
     memcpy(&vid, ibuf, sizeof(vid));
     ibuf += sizeof( vid );
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
     memcpy(&did, ibuf, sizeof(did));
     ibuf += sizeof(did);
 
-    if (( parentdir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( parentdir = dirlookup( vol, did )) ) {
         return afp_errno;
     }
 
-    if (( path = cname( vol, parentdir, &ibuf )) == NULL ) {
+    if (NULL == ( path = cname( vol, parentdir, &ibuf )) ) {
         return afp_errno;
     }
 
index 3e6eb96edc5ea9e19ddb7d95c015e5e37d390d18..cc3473fabcf631988b5d27b5d4767c9b36c533c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: enumerate.c,v 1.29 2003-01-07 22:13:39 didg Exp $
+ * $Id: enumerate.c,v 1.30 2003-01-12 14:39:59 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -244,7 +244,7 @@ int     ext;
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         *rbuflen = 0;
         return( AFPERR_PARAM );
     }
@@ -252,7 +252,7 @@ int     ext;
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( did );
 
-    if (( dir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, did )) ) {
         *rbuflen = 0;
         return( AFPERR_NODIR );
     }
@@ -310,7 +310,7 @@ int     ext;
     
     maxsz = min(maxsz, *rbuflen);
 
-    if (( o_path = cname( vol, dir, &ibuf )) == NULL) {
+    if (NULL == ( o_path = cname( vol, dir, &ibuf )) ) {
         *rbuflen = 0;
         return( AFPERR_NODIR );
     }
index 32073ad87fcd1cfd0f39bcf13aba5a666e00eb43..4529f37043ac278f68712cf16c92b79534146eac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.71 2003-01-11 17:26:06 jmarcus Exp $
+ * $Id: file.c,v 1.72 2003-01-12 14:39:59 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -535,7 +535,7 @@ int         ibuflen, *rbuflen;
     memcpy(&vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -545,11 +545,11 @@ int               ibuflen, *rbuflen;
     memcpy(&did, ibuf, sizeof( did));
     ibuf += sizeof( did );
 
-    if (( dir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, did )) ) {
         return afp_errno;
     }
 
-    if (( s_path = cname( vol, dir, &ibuf )) == NULL ) {
+    if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) {
         return afp_errno;
     }
 
@@ -645,7 +645,7 @@ int         ibuflen, *rbuflen;
 
     memcpy(&vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -1033,13 +1033,13 @@ int             ibuflen, *rbuflen;
 
     memcpy(&svid, ibuf, sizeof( svid ));
     ibuf += sizeof( svid );
-    if (( vol = getvolbyvid( svid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( svid )) ) {
         return( AFPERR_PARAM );
     }
 
     memcpy(&sdid, ibuf, sizeof( sdid ));
     ibuf += sizeof( sdid );
-    if (( dir = dirlookup( vol, sdid )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, sdid )) ) {
         return afp_errno;
     }
 
@@ -1516,7 +1516,7 @@ int               ibuflen, *rbuflen;
     memcpy(&vid, ibuf, sizeof(vid));
     ibuf += sizeof(vid);
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM);
     }
 
@@ -1786,7 +1786,7 @@ int               ibuflen, *rbuflen;
     memcpy(&vid, ibuf, sizeof(vid));
     ibuf += sizeof(vid);
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM);
     }
 
index a34b6a6c1672d4fd4f93e89f8646956447d00d40..6ea49b2ba66605f27063fa1614f32da888cfb57e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filedir.c,v 1.37 2003-01-08 15:01:34 didg Exp $
+ * $Id: filedir.c,v 1.38 2003-01-12 14:40:01 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -159,14 +159,14 @@ int               ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( did );
 
-    if (( dir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, did )) ) {
         return afp_errno;
     }
 
@@ -177,7 +177,7 @@ int         ibuflen, *rbuflen;
     dbitmap = ntohs( dbitmap );
     ibuf += sizeof( dbitmap );
 
-    if (( s_path = cname( vol, dir, &ibuf )) == NULL) {
+    if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) {
         return afp_errno;
     }
 
@@ -254,7 +254,7 @@ int         ibuflen, *rbuflen;
     memcpy( &vid, ibuf, sizeof(vid));
     ibuf += sizeof( vid );
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -465,7 +465,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -474,7 +474,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( did );
-    if (( sdir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( sdir = dirlookup( vol, did )) ) {
        return afp_errno;    
     }
 
@@ -545,7 +545,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -554,7 +554,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( int );
-    if (( dir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( dir = dirlookup( vol, did )) ) {
        return afp_errno;    
     }
 
@@ -567,7 +567,7 @@ int         ibuflen, *rbuflen;
         rc = deletecurdir( vol, obj->oldtmp, AFPOBJ_TMPSIZ);
     } else if (of_findname(s_path)) {
         rc = AFPERR_BUSY;
-    } else if ((rc = deletefile( upath, 1)) == AFP_OK) {
+    } else if (AFP_OK == (rc = deletefile( upath, 1))) {
 #ifdef CNID_DB /* get rid of entry */
         cnid_t id = cnid_get(vol->v_db, curdir->d_did, upath, strlen(upath));
         cnid_delete(vol->v_db, id);
@@ -650,7 +650,7 @@ int         ibuflen, *rbuflen;
 
     memcpy( &vid, ibuf, sizeof( vid ));
     ibuf += sizeof( vid );
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -660,7 +660,7 @@ int         ibuflen, *rbuflen;
     /* source did followed by dest did */
     memcpy( &did, ibuf, sizeof( did ));
     ibuf += sizeof( int );
-    if (( sdir = dirlookup( vol, did )) == NULL ) {
+    if (NULL == ( sdir = dirlookup( vol, did )) ) {
         return( AFPERR_PARAM );
     }
 
index c98c65013a9e4d60ac240a9d679e52389938f6cb..32008c1db55d02f16a899e7a4c224be9a82077f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: fork.c,v 1.42 2003-01-10 05:29:01 didg Exp $
+ * $Id: fork.c,v 1.43 2003-01-12 14:40:01 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -831,7 +831,7 @@ int is64;
     memcpy(&ofrefnum, ibuf, sizeof( ofrefnum ));
     ibuf += sizeof( u_short );
 
-    if (( ofork = of_find( ofrefnum )) == NULL ) {
+    if (NULL == ( ofork = of_find( ofrefnum )) ) {
         LOG(log_error, logtype_afpd, "afp_read: of_find");
         err = AFPERR_PARAM;
         goto afp_read_err;
@@ -1012,7 +1012,7 @@ int               ibuflen, *rbuflen;
     ibuf += 2;
 
     memcpy(&vid, ibuf, sizeof(vid));
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -1411,8 +1411,8 @@ int               ibuflen, *rbuflen;
         }
     }
 
-    if (( ret = getforkparams( ofork, bitmap,
-                               rbuf + sizeof( u_short ), &buflen, attrbits )) != AFP_OK ) {
+    if (AFP_OK != ( ret = getforkparams( ofork, bitmap,
+                               rbuf + sizeof( u_short ), &buflen, attrbits ))) {
         return( ret );
     }
 
index 812f9d5bdcfccb0daec0f5936c029a6048a88d69..dff7e36858fca268828b764731cd5afc1fb87ece 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: mangle.c,v 1.13 2002-12-18 00:17:03 jmarcus Exp $ 
+ * $Id: mangle.c,v 1.14 2003-01-12 14:40:02 didg Exp $ 
  *
  * Copyright (c) 2002. Joe Marcus Clarke (marcus@marcuscom.com)
  * All Rights Reserved.  See COPYRIGHT.
@@ -29,7 +29,7 @@ demangle(const struct vol *vol, char *mfilename) {
            return mfilename;
        }
 
-       if ((ext = strrchr(mfilename, '.')) != NULL) {
+       if (NULL != (ext = strrchr(mfilename, '.')) ) {
            ext_len = strlen(ext);
        }
        if (strlen(mangle) != strlen(MANGLE_CHAR) + MANGLE_LENGTH + ext_len) {
@@ -63,7 +63,7 @@ mangle(const struct vol *vol, char *filename) {
     }
 
     /* First, attmept to locate a file extension. */
-    if ((ext = strrchr(filename, '.')) != NULL) {
+    if (NULL != (ext = strrchr(filename, '.')) ) {
        ext_len = strlen(ext);
        if (ext_len > MAX_EXT_LENGTH) {
            /* Do some bounds checking to prevent an extension overflow. */
index fa0ee0a722f0a37abe731603cd03e25c486f27e6..a19f644dff392863b86584f4bf14c53fddb79bc7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.c,v 1.41 2003-01-08 15:01:36 didg Exp $
+ * $Id: unix.c,v 1.42 2003-01-12 14:40:03 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -651,7 +651,7 @@ static int recursive_chown(const char *path, uid_t uid, gid_t gid) {
            LOG(log_error, logtype_afpd, "cannot opendir() [%s] (uid = %d): %s\n", path, uid, strerror(errno));
            goto recursive_chown_end;
        }
-       while ((entry=readdir(odir)) != NULL) {
+       while (NULL != (entry=readdir(odir)) ) {
            name = entry->d_name;
            if (name[0] == '.' && name[1] == '\0')
                continue;
index 62d52267bcfc3f3443ca67556764af587e2467ed..f5ef2d5acd6547d0bdbc94015995cca2afc02ee5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.45 2003-01-08 15:01:37 didg Exp $
+ * $Id: volume.c,v 1.46 2003-01-12 14:40:04 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -539,7 +539,7 @@ FILE        *fp;
     int                c;
 
     p = buf;
-    while ((( c = getc( fp )) != EOF ) && ( size > 0 )) {
+    while ((EOF != ( c = getc( fp )) ) && ( size > 0 )) {
         if ( c == '\n' || c == '\r' ) {
             *p++ = '\n';
             break;
@@ -706,7 +706,7 @@ struct passwd *pwent;
         strcat( path, p2 );
     }
 
-    if (( fp = fopen( path, "r" )) == NULL ) {
+    if (NULL == ( fp = fopen( path, "r" )) ) {
         return( -1 );
     }
 
@@ -1298,7 +1298,7 @@ int               ibuflen, *rbuflen;
     *rbuflen = 0;
     ibuf += 2;
     memcpy(&vid, ibuf, sizeof( vid ));
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -1355,7 +1355,7 @@ struct extmap *getextmap(const char *path)
     char         *p;
     struct extmap *em;
 
-    if (( p = strrchr( path, '.' )) == NULL ) {
+    if (NULL == ( p = strrchr( path, '.' )) ) {
         return( defextmap );
     }
     p++;
@@ -1451,7 +1451,7 @@ int               ibuflen, *rbuflen;
     memcpy(&bitmap, ibuf, sizeof( bitmap ));
     bitmap = ntohs( bitmap );
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         *rbuflen = 0;
         return( AFPERR_PARAM );
     }
index 74ead26fb9f3c03a7a8257210382a444222e40ee..29eda2f088337201b8b6cd1c834d10cdffc51144 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_open.c,v 1.24 2002-11-26 18:48:23 didg Exp $
+ * $Id: ad_open.c,v 1.25 2003-01-12 14:40:04 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -483,7 +483,7 @@ ad_path( path, adflags )
        }
        slash = ".Parent";
     } else {
-       if (( slash = strrchr( buf, '/' )) != NULL ) {
+       if (NULL != ( slash = strrchr( buf, '/' )) ) {
            c = *++slash;
            *slash = '\0';
            strncpy( pathbuf, buf, MAXPATHLEN);
@@ -524,7 +524,7 @@ char
      * For a path which is just a filename, use "." instead.
      */
     strcpy( modebuf, path );
-    if (( slash = strrchr( modebuf, '/' )) != NULL ) {
+    if (NULL != ( slash = strrchr( modebuf, '/' )) ) {
        *slash = '\0';          /* remove pathname component */
     } else {
        modebuf[0] = '.';       /* use current directory */
@@ -672,7 +672,7 @@ int ad_open( path, adflags, oflags, mode, ad )
                 * mkdir it.
                 */
                if (errno == ENOENT && (adflags & ADFLAGS_NOADOUBLE) == 0) {
-                   if (( slash = strrchr( ad_p, '/' )) == NULL ) {
+                   if (NULL == ( slash = strrchr( ad_p, '/' )) ) {
                        ad_close( ad, adflags );
                        return( -1 );
                    }
index 54b6d456c78bb9e0dd204e0c9cebe48f4f794812..f2d76cd40b74365e8bd4b2d4a1adf355b21d59dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dsi_stream.c,v 1.9 2002-10-11 14:18:39 didg Exp $
+ * $Id: dsi_stream.c,v 1.10 2003-01-12 14:40:05 didg Exp $
  *
  * Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
@@ -46,8 +46,8 @@ size_t dsi_stream_write(DSI *dsi, void *data, const size_t length)
 
   written = 0;
   while (written < length) {
-    if (((len = write(dsi->socket, (u_int8_t *) data + written,
-                     length - written)) == -1 && errno == EINTR) ||
+    if ((-1 == (len = write(dsi->socket, (u_int8_t *) data + written,
+                     length - written)) && errno == EINTR) ||
        !len)
       continue;