CVS update: /ccvs/windows-NT/

[email protected] 26 May 2005 16:07:14 -0000
Newsgroups gmane.comp.version-control.cvs.cvs
Message-ID <[email protected]>
User: dprice  
Date: 05/05/26 09:07:14

Modified:
 /ccvs/windows-NT/
  ChangeLog, ndir.c, ndir.h

Log:
 * ndir.h, ndir.c: Reformatting to CVS conventions.

File Changes:

Directory: /ccvs/windows-NT/
============================

File [changed]: ChangeLog
Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/ChangeLog?r1=1.305&r2=1.306
Delta lines:  +4 -0
-------------------
--- ChangeLog	26 May 2005 09:40:40 -0000	1.305
+++ ChangeLog	26 May 2005 16:07:12 -0000	1.306
@@ -1,3 +1,7 @@
+2005-05-26  Derek Price  <[email protected]>
+
+	* ndir.h, ndir.c: Reformatting to CVS conventions.
+
 2005-05-26  Conrad T. Pino  <[email protected]>
 
 	* filesubr.c: Remove "wnt_lstat" function.  Collapse static function

File [changed]: ndir.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/ndir.c?r1=1.7&r2=1.8
Delta lines:  +13 -15
---------------------
--- ndir.c	15 May 2004 17:32:22 -0000	1.7
+++ ndir.c	26 May 2005 16:07:12 -0000	1.8
@@ -60,34 +60,33 @@
 
   strcat (strcat (strcpy (name_buf, name), slash), "*.*");
 
-  dirp = (DIR *) xmalloc (sizeof (DIR));
-  if (dirp == (DIR *)0)
-    return (DIR *)0;
+  dirp = xmalloc (sizeof (DIR));
+  if (!dirp) return NULL;
 
   dirp->dd_loc = 0;
-  dirp->dd_contents = dirp->dd_cp = (struct _dircontents *) 0;
+  dirp->dd_contents = dirp->dd_cp = NULL;
 
   if ((hFile = _findfirst (name_buf, &find_buf)) < 0)
     {
       free (dirp);
-      return (DIR *)0;
+      return NULL;
     }
 
   do
     {
-      dp = (struct _dircontents *) xmalloc (sizeof (struct _dircontents));
-      if (dp == (struct _dircontents *)0)
+      dp = xmalloc (sizeof (struct _dircontents));
+      if (!dp)
 	{
 	  free_dircontents (dirp->dd_contents);
-	  return (DIR *)0;
+	  return NULL;
 	}
 
       dp->_d_entry = xmalloc (strlen (find_buf.name) + 1);
-      if (dp->_d_entry == (char *)0)
+      if (!dp->_d_entry)
 	{
 	  free (dp);
 	  free_dircontents (dirp->dd_contents);
-	  return (DIR *)0;
+	  return NULL;
 	}
 
       if (dirp->dd_contents)
@@ -97,7 +96,7 @@
 
       strcpy (dp->_d_entry, find_buf.name);
 
-      dp->_d_next = (struct _dircontents *)0;
+      dp->_d_next = NULL;
 
     } while (!_findnext (hFile, &find_buf));
 
@@ -113,7 +112,7 @@
 closedir (DIR *dirp)
 {
   free_dircontents (dirp->dd_contents);
-  free ((char *) dirp);
+  free (dirp);
 }
 
 
@@ -122,8 +121,7 @@
 {
   static struct direct dp;
 
-  if (dirp->dd_cp == (struct _dircontents *)0)
-    return (struct direct *)0;
+  if (!dirp->dd_cp) return NULL;
   dp.d_namlen = dp.d_reclen =
     strlen (strcpy (dp.d_name, dirp->dd_cp->_d_entry));
 #if 0 /* JB */
@@ -184,7 +182,7 @@
 main (int argc, char *argv[])
 {
   static DIR *directory;
-  struct direct *entry = (struct direct *)0;
+  struct direct *entry = NULL;
 
   char *name = "";
 

File [changed]: ndir.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/windows-NT/ndir.h?r1=1.6&r2=1.7
Delta lines:  +5 -5
-------------------
--- ndir.h	11 Aug 1997 01:09:32 -0000	1.6
+++ ndir.h	26 May 2005 16:07:12 -0000	1.7
@@ -47,11 +47,11 @@
   struct _dircontents *dd_cp;	/* pointer to current position */
 } DIR;
 
-extern void seekdir (DIR *, long);
-extern long telldir (DIR *);
-extern DIR *opendir (const char *);
-extern void closedir (DIR *);
-extern struct direct *readdir (DIR *);
+void seekdir (DIR *, long);
+long telldir (DIR *);
+DIR *opendir (const char *);
+void closedir (DIR *);
+struct direct *readdir (DIR *);
 
 /* 
  * Local Variables: