DragonFly BSD
DragonFly submit List (threaded) for 2005-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

fts_open parameter constify


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Sun, 23 Oct 2005 12:19:39 +0200

hey,

i'd like something like this, yet i am aware that all consumers which pass a char ** will then in turn get compile warnings. Anybody have an opinion on that?

cheers
  simon

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low $$$ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Index: include/fts.h
===================================================================
RCS file: /space/cvs/dragonfly/src/include/fts.h,v
retrieving revision 1.3
diff -u -r1.3 fts.h
--- include/fts.h	14 Nov 2003 01:01:43 -0000	1.3
+++ include/fts.h	23 Oct 2005 10:11:51 -0000
@@ -122,7 +122,7 @@
 __BEGIN_DECLS
 FTSENT	*fts_children (FTS *, int);
 int	 fts_close (FTS *);
-FTS	*fts_open (char * const *, int,
+FTS	*fts_open (const char * const *, int,
 	    int (*)(const FTSENT **, const FTSENT **));
 FTSENT	*fts_read (FTS *);
 int	 fts_set (FTS *, FTSENT *, int);
Index: lib/libc/gen/fts.c
===================================================================
RCS file: /space/cvs/dragonfly/src/lib/libc/gen/fts.c,v
retrieving revision 1.6
diff -u -r1.6 fts.c
--- lib/libc/gen/fts.c	27 Apr 2005 11:37:50 -0000	1.6
+++ lib/libc/gen/fts.c	23 Oct 2005 10:11:21 -0000
@@ -56,7 +56,7 @@
 static FTSENT	*fts_build(FTS *, int);
 static void	 fts_lfree(FTSENT *);
 static void	 fts_load(FTS *, FTSENT *);
-static size_t	 fts_maxarglen(char * const *);
+static size_t	 fts_maxarglen(const char * const *);
 static void	 fts_padjust(FTS *, FTSENT *);
 static int	 fts_palloc(FTS *, size_t);
 static FTSENT	*fts_sort(FTS *, FTSENT *, int);
@@ -77,7 +77,7 @@
 #define	BREAD		3		/* fts_read */
 
 FTS *
-fts_open(char * const *argv, int options,
+fts_open(const char * const *argv, int options,
 	 int (*compar)(const FTSENT **, const FTSENT **))
 {
 	FTS *sp;
@@ -1022,7 +1022,7 @@
 }
 
 static size_t
-fts_maxarglen(char * const *argv)
+fts_maxarglen(const char * const *argv)
 {
 	size_t len, max;
 


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