[nas] [patch] RFC: remove _SvxConst ...

Stefan Huehner stefan at huehner.org
Wed Jul 12 08:42:14 MDT 2006


On Tue, Jul 11, 2006 at 08:54:28PM -0600, Jon Trulson wrote:
> On Tue, 11 Jul 2006, Stefan Huehner wrote:
> 
> >Hi,
> >
> >in the nas code there are several constructs such as:
> >
> >#ifndef _SvxConst
> >#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || 
> >(FUNCPROTO&4)
> >#define _SvxConst const
> >#else
> >#define _SvxConst                              /**/
> >#endif
> >#endif                                         /* _SvxConst
> >
> >where support for i.e. the ansi C 'const' modifier is conditionally 
> >included.
> >
> 
> >Please comment on the attached patch which removes the macro and
> >replaces all its uses directly with 'const'. Imho this makes the code
> >more readable. Additionally nearly all compilers should support the
> >const keyword, and there are lots of places in the code which use
> >uncoditional 'const'.
> 
> 
>         Yeah, by all means, kill them.  I really have no interest in
>         K&R C and 10-15 year old compilers :)  I don't think anyone
>         else here does either.  If so, speak up!
> 
>         BTW: I did not see a patch...?

Hi,
i've forgotten to attach the clarification patch. As the change is ok
for you i've attached the complete patch to this mail.

Please check and consider applying.

The patch not only removes the usage of i.e. _AUConst but also its
definition from the header file. As the headers are exposed to external
projects this is an incompatible change if someone externally uses these
defines. If backwartcompatibility should be preserved we could add
static defines to const for the removed names.

Regards,
Stefan
-------------- next part --------------
diff -ur ../../branches/upstream/nas-1.8/clients/audio/auctl/execute.c ./clients/audio/auctl/execute.c
--- ../../branches/upstream/nas-1.8/clients/audio/auctl/execute.c	2001-03-18 21:36:38.000000000 +0100
+++ ./clients/audio/auctl/execute.c	2006-07-12 15:54:31.000000000 +0200
@@ -77,7 +77,7 @@
 
 
 typedef struct _NameValue {
-    _AuConst char *name;
+    const char *name;
 #ifndef mips
     int (*proc) PROTO ((AuServer *, int, char **, AuPointer));
 #else
@@ -90,7 +90,7 @@
     AuServer *aud;
     int argc;
     char **argv;
-    _AuConst char *title;
+    const char *title;
     NameTable *tab;
     int ntab;
     AuPointer data;
@@ -328,7 +328,7 @@
     int argc;
     char **argv;
 {
-    static _AuConst char * _AuConst msg[] = {
+    static const char * const msg[] = {
 "The following commands are supported:",
 "",
 "    help                             print this message",
@@ -346,7 +346,7 @@
 "",
 	(char *) 0
     };
-    _AuConst char * _AuConst *cpp;
+    const char * const *cpp;
 
     for (cpp = msg; *cpp; cpp++) 
 	printf ("%s\n", *cpp);
diff -ur ../../branches/upstream/nas-1.8/clients/audio/audemo/audemo.c ./clients/audio/audemo/audemo.c
--- ../../branches/upstream/nas-1.8/clients/audio/audemo/audemo.c	2004-06-20 21:06:50.000000000 +0200
+++ ./clients/audio/audemo/audemo.c	2006-07-12 15:54:52.000000000 +0200
@@ -1835,11 +1835,11 @@
 
 static int
 sortRoutine(ap, bp)
-_AuConst void          *ap,
+const void          *ap,
                        *bp;
 {
-    _AuConst char **a = (_AuConst char **)ap;
-    _AuConst char **b = (_AuConst char **)bp;
+    const char **a = (const char **)ap;
+    const char **b = (const char **)bp;
 
     return strcmp(strrchr(*a, '/') + 1, strrchr(*b, '/') + 1);
 }
diff -ur ../../branches/upstream/nas-1.8/clients/audio/auinfo/Makefile ./clients/audio/auinfo/Makefile
diff -ur ../../branches/upstream/nas-1.8/clients/audio/auinfo/auinfo.c ./clients/audio/auinfo/auinfo.c
--- ../../branches/upstream/nas-1.8/clients/audio/auinfo/auinfo.c	2005-04-07 21:08:14.000000000 +0200
+++ ./clients/audio/auinfo/auinfo.c	2006-07-12 15:55:07.000000000 +0200
@@ -58,10 +58,10 @@
 
 static int maxwidth = 0;		/* reset later */
 #define TITLELEN 24
-static _AuConst char *TITLEFMT = "%-24s";
+static const char *TITLEFMT = "%-24s";
 #define INDENTPADSTR "    "
 #define INDENTPADLEN (sizeof(INDENTPADSTR) - 1)
-static _AuConst char *INDENTPAD = INDENTPADSTR;
+static const char *INDENTPAD = INDENTPADSTR;
 
 int
 main (argc, argv)
@@ -146,7 +146,7 @@
 
 typedef struct _nametable {
     int value;
-    _AuConst char *name;
+    const char *name;
     int len;
 } NameTable;
 
@@ -321,7 +321,7 @@
     AuServer *aud;
     NameTable *tab;
     int nents;
-    _AuConst char *title;
+    const char *title;
     int total;
     int (*getvaliter) PROTO((AuServer *, int, AuPointer));
     AuPointer p;
@@ -359,7 +359,7 @@
     for (i = 0; i < total; i++) {
 	int val = (*getvaliter) (aud, i, p);
 	NameTable *nt = _lookup_name (tab, nents, val, isbit);
-	_AuConst char *f = fmt;
+	const char *f = fmt;
 
 	if (!nt)
 	    continue;
diff -ur ../../branches/upstream/nas-1.8/clients/audio/auplay/auplay.c ./clients/audio/auplay/auplay.c
--- ../../branches/upstream/nas-1.8/clients/audio/auplay/auplay.c	2005-04-10 23:20:55.000000000 +0200
+++ ./clients/audio/auplay/auplay.c	2006-07-12 15:55:13.000000000 +0200
@@ -86,7 +86,7 @@
 static AuBool
 localAuSoundPlaySynchronousFromFile(aud, fname, volume)
 AuServer       *aud;
-_AuConst char  *fname;
+const char  *fname;
 int             volume;
 {
     AuStatus        ret;
diff -ur ../../branches/upstream/nas-1.8/clients/audio/auwave/auwave.c ./clients/audio/auwave/auwave.c
--- ../../branches/upstream/nas-1.8/clients/audio/auwave/auwave.c	2005-04-07 21:08:14.000000000 +0200
+++ ./clients/audio/auwave/auwave.c	2006-07-12 15:55:24.000000000 +0200
@@ -296,7 +296,7 @@
 {
     int             i;
     Widget          w;
-    _AuConst char  *s = NULL;
+    const char  *s = NULL;
 
     MakeWidget(g->form, g->top, formWidgetClass, "form");
 
@@ -307,7 +307,7 @@
 
     for (i = 0; i < AuServerNumWaveForms(g->aud); i++)
     {
-	_AuConst char  *p;
+	const char  *p;
 
 	p = AuWaveFormToString(AuServerWaveForm(g->aud, i));
 	MakeWidget(w, g->menu, smeBSBObjectClass, p);
diff -ur ../../branches/upstream/nas-1.8/lib/audio/8svx.c ./lib/audio/8svx.c
--- ../../branches/upstream/nas-1.8/lib/audio/8svx.c	2004-06-20 21:06:50.000000000 +0200
+++ ./lib/audio/8svx.c	2006-07-12 15:39:17.000000000 +0200
@@ -59,7 +59,7 @@
 }
 
 SvxInfo        *
-SvxOpenFileForReading(_SvxConst char *name)
+SvxOpenFileForReading(const char *name)
 {
     SvxInfo        *si;
     SvxChunk        ck;
@@ -143,7 +143,7 @@
 }
 
 SvxInfo *
-SvxOpenFileForWriting(_SvxConst char *name, SvxInfo *si)
+SvxOpenFileForWriting(const char *name, SvxInfo *si)
 {
     int             n;
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/8svx.h ./lib/audio/8svx.h
--- ../../branches/upstream/nas-1.8/lib/audio/8svx.h	2003-12-23 01:17:55.000000000 +0100
+++ ./lib/audio/8svx.h	2006-07-12 15:41:05.000000000 +0200
@@ -32,14 +32,6 @@
  * some ANSIfication definitions.
  */
 
-#ifndef _SvxConst
-#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
-#define _SvxConst const
-#else
-#define _SvxConst				/**/
-#endif
-#endif						/* _SvxConst */
-
 #ifndef _FUNCPROTOBEGIN
 #ifdef __cplusplus			/* for C++ V2.0 */
 #define _FUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
@@ -91,12 +83,12 @@
 
 extern SvxInfo *
 SvxOpenFileForReading(
-		      _SvxConst char *		/* file name */
+		      const char *		/* file name */
 );
 
 extern SvxInfo *
 SvxOpenFileForWriting(
-		      _SvxConst char *,		/* file name */
+		      const char *,		/* file name */
 		      SvxInfo *			/* info */
 );
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/Afuncproto.h ./lib/audio/Afuncproto.h
--- ../../branches/upstream/nas-1.8/lib/audio/Afuncproto.h	2003-12-23 01:17:55.000000000 +0100
+++ ./lib/audio/Afuncproto.h	2006-07-12 15:50:13.000000000 +0200
@@ -44,15 +44,6 @@
 #ifndef _AUFUNCPROTO_H_
 #define _AUFUNCPROTO_H_
 
-#ifndef _AuConst
-#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
-#define _AuConst const
-#else
-#define _AuConst /**/
-#endif
-#endif /* _AuConst */
-
-
 #ifndef _AUFUNCPROTOBEGIN
 #ifdef __cplusplus			/* for C++ V2.0 */
 #define _AUFUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
diff -ur ../../branches/upstream/nas-1.8/lib/audio/Alibint.h ./lib/audio/Alibint.h
--- ../../branches/upstream/nas-1.8/lib/audio/Alibint.h	2003-12-22 23:20:39.000000000 +0100
+++ ./lib/audio/Alibint.h	2006-07-12 15:46:46.000000000 +0200
@@ -706,7 +706,7 @@
 
 int
 _AuConnectServer(
-    _AuConst char *, 		/* server_name */
+    const char *, 		/* server_name */
     char **, 			/* fullnamep */
     int *, 			/* svrnump */
     char **, 			/* auth_namep */
diff -ur ../../branches/upstream/nas-1.8/lib/audio/AuErrDes.c ./lib/audio/AuErrDes.c
--- ../../branches/upstream/nas-1.8/lib/audio/AuErrDes.c	2003-12-22 23:39:07.000000000 +0100
+++ ./lib/audio/AuErrDes.c	2006-07-12 15:47:04.000000000 +0200
@@ -44,7 +44,7 @@
 typedef char   *XPointer;
 #endif
 
-static _AuConst char * _AuConst _AuErrorList[] = {
+static const char * const _AuErrorList[] = {
     /* No error	*/		"no error",
     /* AuBadRequest */		"BadRequest",
     /* AuBadValue */		"BadValue",
@@ -252,9 +252,9 @@
 /*ARGSUSED*/
 AuGetErrorDatabaseText(
     AuServer *aud,
-    register _AuConst char *name,
-    register _AuConst char *type,
-    _AuConst char *defaultp,
+    register const char *name,
+    register const char *type,
+    const char *defaultp,
     char *buffer,
     int nbytes)
 {
diff -ur ../../branches/upstream/nas-1.8/lib/audio/ConnSvr.c ./lib/audio/ConnSvr.c
--- ../../branches/upstream/nas-1.8/lib/audio/ConnSvr.c	2004-04-16 04:27:09.000000000 +0200
+++ ./lib/audio/ConnSvr.c	2006-07-12 15:47:21.000000000 +0200
@@ -149,7 +149,7 @@
                  int *auth_datalenp			/* RETURN */
                  );
 
-static char *copystring (register _AuConst char *src, int len)
+static char *copystring (register const char *src, int len)
 {
     char *dst = Aumalloc (len + 1);
 
@@ -306,7 +306,7 @@
  *     o  TCP to local host
  */
 int _AuConnectServer (
-    _AuConst char *server_name,
+    const char *server_name,
     char **fullnamep,			/* RETURN */
     int *svrnump,			/* RETURN */
     char **auth_namep,			/* RETURN */
@@ -318,7 +318,7 @@
     int family;
     int saddrlen;
     char *saddr;
-    _AuConst char *lastp, *p;		/* char pointers */
+    const char *lastp, *p;		/* char pointers */
     char *phostname = NULL;		/* start of host of server */
     char *psvrnum = NULL;		/* start of svrnum of server */
     char *realtrans;			/* real audio transport prefix */
@@ -350,7 +350,7 @@
       if (*p == '/') {
 	    int len = (p - server_name);
 	    char tmptransport[41];
-	    register _AuConst char *src;
+	    register const char *src;
 	    register char *dst;
 
 	    if (len >= sizeof tmptransport)    /* too AuInt32 */
diff -ur ../../branches/upstream/nas-1.8/lib/audio/OpenSvr.c ./lib/audio/OpenSvr.c
--- ../../branches/upstream/nas-1.8/lib/audio/OpenSvr.c	2003-12-23 00:08:51.000000000 +0100
+++ ./lib/audio/OpenSvr.c	2006-07-12 15:49:57.000000000 +0200
@@ -68,16 +68,16 @@
  * the newly created AuServer back to the caller.
  */
 AuServer *AuOpenServer (
-	register _AuConst char *server,
+	register const char *server,
 	int num_authproto,
-	_AuConst char *authproto,
+	const char *authproto,
 	int num_authdata,
-	_AuConst char *authdata,
+	const char *authdata,
 	char **ret_svrmsg)
 {
 	register AuServer *aud;		/* New AuServer object being created */
 	register int i;
-	_AuConst char *server_name;	/* pointer to server name */
+	const char *server_name;	/* pointer to server name */
 	int endian;			/* to determine which endian. */
 	auConnClientPrefix client;	/* client information */
 	auConnSetupPrefix prefix;	/* prefix information */
diff -ur ../../branches/upstream/nas-1.8/lib/audio/SvrName.c ./lib/audio/SvrName.c
--- ../../branches/upstream/nas-1.8/lib/audio/SvrName.c	2003-12-23 00:19:00.000000000 +0100
+++ ./lib/audio/SvrName.c	2006-07-12 15:47:42.000000000 +0200
@@ -28,20 +28,20 @@
 #define DEFAULT_AUSERVER ":0"
 
 #ifdef AU_NOT_STDC_ENV
-extern _AuConst char *getenv();
+extern const char *getenv();
 #endif
 
-_AuConst char *
-AuServerName (_AuConst char *name)
+const char *
+AuServerName (const char *name)
 {
     if (name && name[0])
 	return name;
 
-    name = (_AuConst char *) getenv ("AUDIOSERVER");
+    name = (const char *) getenv ("AUDIOSERVER");
     if (name)
 	return name;
 
-    name = (_AuConst char *) getenv ("DISPLAY");
+    name = (const char *) getenv ("DISPLAY");
     if (name)
 	return name;
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/Util.c ./lib/audio/Util.c
--- ../../branches/upstream/nas-1.8/lib/audio/Util.c	2003-12-23 00:20:06.000000000 +0100
+++ ./lib/audio/Util.c	2006-07-12 15:48:05.000000000 +0200
@@ -207,7 +207,7 @@
     "AuFormatLinearUnsigned16LSB",
   };
 
-_AuConst char  *
+const char  *
 AuFormatToString(unsigned int format)
 {
     int             i;
@@ -220,7 +220,7 @@
 }
 
 int
-AuStringToFormat(_AuConst char *s)
+AuStringToFormat(const char *s)
 {
     int             i;
 
@@ -231,7 +231,7 @@
     return -1;
 }
 
-_AuConst char  *
+const char  *
 AuFormatToDefine(unsigned int format)
 {
     int             i;
@@ -244,7 +244,7 @@
 }
 
 int
-AuDefineToFormat(_AuConst char *s)
+AuDefineToFormat(const char *s)
 {
     int             i;
 
@@ -267,7 +267,7 @@
     AuWaveFormConstant, "Constant",
   };
 
-_AuConst char  *
+const char  *
 AuWaveFormToString(unsigned int waveform)
 {
     int             i;
@@ -280,7 +280,7 @@
 }
 
 int
-AuStringToWaveForm(_AuConst char *s)
+AuStringToWaveForm(const char *s)
 {
     int             i;
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/aiff.c ./lib/audio/aiff.c
--- ../../branches/upstream/nas-1.8/lib/audio/aiff.c	2004-06-20 21:06:50.000000000 +0200
+++ ./lib/audio/aiff.c	2006-07-12 15:45:06.000000000 +0200
@@ -236,7 +236,7 @@
 }
 
 AiffInfo       *
-AiffOpenFileForReading(_AiffConst char *name)
+AiffOpenFileForReading(const char *name)
 {
     AiffInfo       *ai;
     AiffChunk       ck;
@@ -349,7 +349,7 @@
 
 AiffInfo       *
 AiffOpenFileForWriting(
-                       _AiffConst char *name,
+                       const char *name,
                        AiffInfo       *ai
 
                        )
diff -ur ../../branches/upstream/nas-1.8/lib/audio/aiff.h ./lib/audio/aiff.h
--- ../../branches/upstream/nas-1.8/lib/audio/aiff.h	2003-12-23 00:24:52.000000000 +0100
+++ ./lib/audio/aiff.h	2006-07-12 15:45:22.000000000 +0200
@@ -32,14 +32,6 @@
  * some ANSIfication definitions.
  */
 
-#ifndef _AiffConst
-#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
-#define _AiffConst const
-#else
-#define _AiffConst				/**/
-#endif
-#endif						/* _AiffConst */
-
 #ifndef _FUNCPROTOBEGIN
 #ifdef __cplusplus			/* for C++ V2.0 */
 #define _FUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
@@ -95,12 +87,12 @@
 
 extern AiffInfo *
 AiffOpenFileForReading(
-		       _AiffConst char *	/* file name */
+		       const char *		/* file name */
 );
 
 extern AiffInfo *
 AiffOpenFileForWriting(
-		       _AiffConst char *,	/* file name */
+		       const char *,		/* file name */
 		       AiffInfo *		/* info */
 );
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/audiolib.h ./lib/audio/audiolib.h
--- ../../branches/upstream/nas-1.8/lib/audio/audiolib.h	2003-12-23 02:01:36.000000000 +0100
+++ ./lib/audio/audiolib.h	2006-07-12 15:48:29.000000000 +0200
@@ -1013,9 +1013,9 @@
  * AuServerName - this routine returns the that the library will use to
  * locate the audio server.
  */
-extern _AuConst char * AUCDECL
+extern const char * AUCDECL
 AuServerName(
-	     _AuConst char *			/* servername */
+	     const char *			/* servername */
 );
 
 /*
@@ -1024,11 +1024,11 @@
  */
 extern AuServer * AUCDECL
 AuOpenServer(
-	     _AuConst char *,			/* servername */
+	     const char *,			/* servername */
 	     int,				/* num_authproto */
-	     _AuConst char *,			/* authproto */
+	     const char *,			/* authproto */
 	     int,				/* num_authdata */
-	     _AuConst char *,			/* authdata */
+	     const char *,			/* authdata */
 	     char **				/* server_message */
 );
 
@@ -1117,9 +1117,9 @@
 extern void AUCDECL
 AuGetErrorDatabaseText(
 		       AuServer *,		/* server */
-		       _AuConst char *,		/* name */
-		       _AuConst char *,		/* message */
-		       _AuConst char *,		/* default_string */
+		       const char *,		/* name */
+		       const char *,		/* message */
+		       const char *,		/* default_string */
 		       char *,			/* buffer_return */
 		       int			/* length */
 );
diff -ur ../../branches/upstream/nas-1.8/lib/audio/audioutil.h ./lib/audio/audioutil.h
--- ../../branches/upstream/nas-1.8/lib/audio/audioutil.h	2003-12-23 00:33:21.000000000 +0100
+++ ./lib/audio/audioutil.h	2006-07-12 15:48:48.000000000 +0200
@@ -127,34 +127,34 @@
  *			       STRING UTILITIES				     *
  *****************************************************************************/
 
-_AuConst char  * AUCDECL
+const char  * AUCDECL
 AuFormatToString(
 		 unsigned int			/* format */
 );
 
 int AUCDECL
 AuStringToFormat(
-		 _AuConst char *		/* string */
+		 const char *		/* string */
 );
 
-_AuConst char  * AUCDECL
+const char  * AUCDECL
 AuFormatToDefine(
 		 unsigned int			/* format */
 );
 
 int AUCDECL
 AuDefineToFormat(
-		 _AuConst char *		/* define */
+		 const char *		/* define */
 );
 
-_AuConst char  * AUCDECL
+const char  * AUCDECL
 AuWaveFormToString(
 		 unsigned int			/* waveform */
 );
 
 int AUCDECL
 AuStringToWaveForm(
-		 _AuConst char *		/* string */
+		 const char *		/* string */
 );
 
 /*****************************************************************************
diff -ur ../../branches/upstream/nas-1.8/lib/audio/fileutil.c ./lib/audio/fileutil.c
--- ../../branches/upstream/nas-1.8/lib/audio/fileutil.c	2004-06-20 21:06:50.000000000 +0200
+++ ./lib/audio/fileutil.c	2006-07-12 15:44:22.000000000 +0200
@@ -103,9 +103,9 @@
 }
 
 char       *
-FileCommentFromFilename(_FileConst char *fname)
+FileCommentFromFilename(const char *fname)
 {
-    _FileConst char *f;
+    const char *f;
     char       *t;
 
     /* ignore piped files */
diff -ur ../../branches/upstream/nas-1.8/lib/audio/fileutil.h ./lib/audio/fileutil.h
--- ../../branches/upstream/nas-1.8/lib/audio/fileutil.h	2003-12-23 01:17:55.000000000 +0100
+++ ./lib/audio/fileutil.h	2006-07-12 15:44:34.000000000 +0200
@@ -32,14 +32,6 @@
  * some ANSIfication definitions.
  */
 
-#ifndef _FileConst
-#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
-#define _FileConst const
-#else
-#define _FileConst		/**/
-#endif
-#endif				/* _FileConst */
-
 #ifndef _FUNCPROTOBEGIN
 #ifdef __cplusplus			/* for C++ V2.0 */
 #define _FUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
@@ -112,7 +104,7 @@
 
 extern char	*
 FileCommentFromFilename(
-                        _FileConst char	*		/* file name */
+                        const char	*		/* file name */
 );
 
 _FUNCPROTOEND
diff -ur ../../branches/upstream/nas-1.8/lib/audio/snd.c ./lib/audio/snd.c
--- ../../branches/upstream/nas-1.8/lib/audio/snd.c	2004-06-20 21:06:50.000000000 +0200
+++ ./lib/audio/snd.c	2006-07-12 15:43:50.000000000 +0200
@@ -126,7 +126,7 @@
 }
 
 SndInfo        *
-SndOpenFileForReading(_SndConst char *name)
+SndOpenFileForReading(const char *name)
 {
     SndInfo        *si;
     int             size;
@@ -192,7 +192,7 @@
 
 SndInfo        *
 SndOpenFileForWriting(
-                      _SndConst char *name,
+                      const char *name,
                       SndInfo        *si
                       )
 {
diff -ur ../../branches/upstream/nas-1.8/lib/audio/snd.h ./lib/audio/snd.h
--- ../../branches/upstream/nas-1.8/lib/audio/snd.h	2003-12-23 00:56:44.000000000 +0100
+++ ./lib/audio/snd.h	2006-07-12 15:44:02.000000000 +0200
@@ -33,14 +33,6 @@
 #include <stdio.h>
 #include <audio/audio.h>	/* for AuInt32 and AuUint32 */
 
-#ifndef _SndConst
-#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
-#define _SndConst const
-#else
-#define _SndConst				/**/
-#endif
-#endif						/* _SndConst */
-
 #ifndef _FUNCPROTOBEGIN
 #ifdef __cplusplus			/* for C++ V2.0 */
 #define _FUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
@@ -119,12 +111,12 @@
 
 extern SndInfo *
 SndOpenFileForReading(
-		      _SndConst char *		/* file name */
+		      const char *		/* file name */
 );
 
 extern SndInfo *
 SndOpenFileForWriting(
-		      _SndConst char *,		/* file name */
+		      const char *,		/* file name */
 		      SndInfo *			/* info */
 );
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/sound.c ./lib/audio/sound.c
--- ../../branches/upstream/nas-1.8/lib/audio/sound.c	2004-06-20 21:06:49.000000000 +0200
+++ ./lib/audio/sound.c	2006-07-12 15:42:44.000000000 +0200
@@ -70,7 +70,7 @@
 
 
 /* This order must match the _SoundFileFormatsID enum defined in sound.h */
-static _SoundConst SoundInfo _SoundFileInfo[] =
+static const SoundInfo _SoundFileInfo[] =
 {
     "Sun/NeXT", "snd", "snd au",
     (_oo(AuFormatULAW8) | _oo(AuFormatLinearUnsigned8) |
@@ -107,7 +107,7 @@
 #undef _oo
 #undef _VOIDP_
 
-_SoundConst int SoundNumFileFormats =
+const int SoundNumFileFormats =
 (sizeof(_SoundFileInfo) / sizeof(_SoundFileInfo[0]));
 
 char *SoundFileFormatString(Sound s)
@@ -375,7 +375,7 @@
 }
 
 Sound
-SoundOpenFileForReading(_SoundConst char *name)
+SoundOpenFileForReading(const char *name)
 {
     Sound           s;
     int             i;
@@ -407,7 +407,7 @@
 
 Sound
 SoundOpenFileForWriting(
-                        _SoundConst char *name,
+                        const char *name,
                         Sound           s
                         )
 {
@@ -501,7 +501,7 @@
             int numTracks,
             int sampleRate,
             int numSamples,
-            _SoundConst char *comment
+            const char *comment
             )
 {
     Sound           s;
@@ -561,7 +561,7 @@
 }
 
 int
-SoundStringToFileFormat(_SoundConst char *s)
+SoundStringToFileFormat(const char *s)
 {
     int             i;
 
@@ -573,7 +573,7 @@
 }
 
 int
-SoundAbbrevToFileFormat(_SoundConst char *s)
+SoundAbbrevToFileFormat(const char *s)
 {
     int             i;
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/sound.h ./lib/audio/sound.h
--- ../../branches/upstream/nas-1.8/lib/audio/sound.h	2003-12-23 00:58:05.000000000 +0100
+++ ./lib/audio/sound.h	2006-07-12 15:43:19.000000000 +0200
@@ -36,14 +36,6 @@
 #include	<audio/8svx.h>
 #include	<audio/audio.h>
 
-#ifndef _SoundConst
-#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
-#define _SoundConst const
-#else
-#define _SoundConst				/**/
-#endif
-#endif						/* _SoundConst */
-
 #ifndef _FUNCPROTOBEGIN
 #ifdef __cplusplus			/* for C++ V2.0 */
 #define _FUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
@@ -95,12 +87,12 @@
 
 extern          Sound
 SoundOpenFileForReading(
-			_SoundConst char *	/* file name */
+			const char *		/* file name */
 );
 
 extern          Sound
 SoundOpenFileForWriting(
-			_SoundConst char *,	/* file name */
+			const char *,		/* file name */
 			Sound			/* sound */
 );
 
@@ -132,17 +124,17 @@
 	    int,				/* num tracks */
 	    int,				/* sample rate */
 	    int,				/* num samples */
-	    _SoundConst char *			/* comment */
+	    const char *			/* comment */
 );
 
 extern int
 SoundStringToFileFormat(
-			_SoundConst char *	/* string */
+			const char *		/* string */
 );
 
 extern int
 SoundAbbrevToFileFormat(
-			_SoundConst char *	/* string */
+			const char *		/* string */
 );
 
 extern int
@@ -220,6 +212,6 @@
 
 extern SoundFileInfoProc SoundFileGetProc(int format, int proc);
 
-extern _SoundConst int SoundNumFileFormats;
+extern const int SoundNumFileFormats;
 
 #endif						/* _SOUND_H_ */
diff -ur ../../branches/upstream/nas-1.8/lib/audio/soundlib.c ./lib/audio/soundlib.c
--- ../../branches/upstream/nas-1.8/lib/audio/soundlib.c	2003-12-23 02:01:36.000000000 +0100
+++ ./lib/audio/soundlib.c	2006-07-12 15:51:41.000000000 +0200
@@ -42,7 +42,7 @@
 AuBucketID
 AuSoundCreateBucketFromFile(
                             AuServer       *aud,
-                            _SoundConst char *filename,
+                            const char *filename,
                             AuUint32   access,
                             AuBucketAttributes **ret_attr,
                             AuStatus       *ret_status
@@ -119,7 +119,7 @@
 AuBool
 AuSoundCreateFileFromBucket(
                             AuServer       *aud,
-                            _AuConst char  *filename,
+                            const char  *filename,
                             int             fileFormat,
                             AuBucketID      bucket,
                             AuStatus       *ret_status
@@ -694,7 +694,7 @@
 AuEventHandlerRec *
 AuSoundPlayFromFile(
                     AuServer       *aud,
-                    _AuConst char  *filename,
+                    const char  *filename,
                     AuDeviceID      device,
                     AuFixedPoint    volume,
                     AuSoundCallback callback,
@@ -751,7 +751,7 @@
 AuEventHandlerRec *
 AuSoundRecordToFile(
                     AuServer       *aud,
-                    _AuConst char  *filename,
+                    const char  *filename,
                     AuDeviceID      device,
                     AuFixedPoint    gain,
                     AuSoundCallback callback,
@@ -778,7 +778,7 @@
 AuEventHandlerRec *
 AuSoundRecordToFileN(
                      AuServer       *aud,
-                     _AuConst char  *filename,
+                     const char  *filename,
                      AuDeviceID      device,
                      AuFixedPoint    gain,
                      AuUint32 numSamples,
@@ -868,7 +868,7 @@
 AuBool
 AuSoundPlaySynchronousFromFile(
                                AuServer       *aud,
-                               _AuConst char  *fname,
+                               const char  *fname,
                                int             volume
                                )
 {
diff -ur ../../branches/upstream/nas-1.8/lib/audio/soundlib.h ./lib/audio/soundlib.h
--- ../../branches/upstream/nas-1.8/lib/audio/soundlib.h	2003-12-23 01:57:33.000000000 +0100
+++ ./lib/audio/soundlib.h	2006-07-12 15:51:19.000000000 +0200
@@ -106,7 +106,7 @@
 extern          AuBucketID
 AuSoundCreateBucketFromFile(
 			    AuServer *,		/* server */
-			    _AuConst char *,	/* filename */
+			    const char *,	/* filename */
 			    AuUint32,	/* access */
 			    AuBucketAttributes **,	/* RETURN_attributes */
 			    AuStatus *		/* RETURN_status */
@@ -115,7 +115,7 @@
 extern          AuBool
 AuSoundCreateFileFromBucket(
 			    AuServer *,		/* server */
-			    _AuConst char *,	/* filename */
+			    const char *,	/* filename */
 			    int,		/* file format */
 			    AuBucketID,		/* bucket */
 			    AuStatus *		/* RETURN_status */
@@ -168,7 +168,7 @@
 extern AuEventHandlerRec *
 AuSoundPlayFromFile(
 		    AuServer *,			/* server */
-		    _AuConst char *,		/* filename */
+		    const char *,		/* filename */
 		    AuDeviceID,			/* destination */
 		    AuFixedPoint,		/* volume */
 		    AuSoundCallback,		/* done_callback */
@@ -212,7 +212,7 @@
 extern AuEventHandlerRec *
 AuSoundRecordToFile(
 		    AuServer *,			/* server */
-		    _AuConst char *,		/* filename */
+		    const char *,		/* filename */
 		    AuDeviceID,			/* source */
 		    AuFixedPoint,		/* gain */
 		    AuSoundCallback,		/* done_callback */
@@ -230,7 +230,7 @@
 extern AuEventHandlerRec *
 AuSoundRecordToFileN(
 		    AuServer *,			/* server */
-		    _AuConst char *,		/* filename */
+		    const char *,		/* filename */
 		    AuDeviceID,			/* source */
 		    AuFixedPoint,		/* gain */
                     AuUint32,		        /* num samples */	
@@ -249,7 +249,7 @@
 extern          AuBool
 AuSoundPlaySynchronousFromFile(
 			       AuServer *,	/* server */
-			       _AuConst char *,	/* filename */
+			       const char *,	/* filename */
 			       int		/* volume */
 );
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/voc.c ./lib/audio/voc.c
--- ../../branches/upstream/nas-1.8/lib/audio/voc.c	2004-06-20 21:06:49.000000000 +0200
+++ ./lib/audio/voc.c	2006-07-12 15:41:43.000000000 +0200
@@ -56,7 +56,7 @@
 }
 
 VocInfo        *
-VocOpenFileForReading(_VocConst char *name)
+VocOpenFileForReading(const char *name)
 {
     VocInfo        *vi;
     int             c,
@@ -154,7 +154,7 @@
 
 VocInfo        *
 VocOpenFileForWriting(
-                      _VocConst char *name,
+                      const char *name,
                       VocInfo        *vi
                       )
 {
diff -ur ../../branches/upstream/nas-1.8/lib/audio/voc.h ./lib/audio/voc.h
--- ../../branches/upstream/nas-1.8/lib/audio/voc.h	2003-12-23 01:14:23.000000000 +0100
+++ ./lib/audio/voc.h	2006-07-12 15:41:57.000000000 +0200
@@ -32,14 +32,6 @@
  * some ANSIfication definitions.
  */
 
-#ifndef _VocConst
-#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
-#define _VocConst const
-#else
-#define _VocConst				/**/
-#endif
-#endif						/* _VocConst */
-
 #ifndef _FUNCPROTOBEGIN
 #ifdef __cplusplus			/* for C++ V2.0 */
 #define _FUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
@@ -88,12 +80,12 @@
 
 extern VocInfo *
 VocOpenFileForReading(
-		      _VocConst char *		/* file name */
+		      const char *		/* file name */
 );
 
 extern VocInfo *
 VocOpenFileForWriting(
-		      _VocConst char *,		/* file name */
+		      const char *,		/* file name */
 		      VocInfo *			/* info */
 );
 
diff -ur ../../branches/upstream/nas-1.8/lib/audio/wave.c ./lib/audio/wave.c
--- ../../branches/upstream/nas-1.8/lib/audio/wave.c	2004-06-20 21:06:48.000000000 +0200
+++ ./lib/audio/wave.c	2006-07-12 15:40:27.000000000 +0200
@@ -66,7 +66,7 @@
 }
 
 WaveInfo       *
-WaveOpenFileForReading(_WaveConst char *name)
+WaveOpenFileForReading(const char *name)
 {
     RiffChunk       ck;
     RIFF_FOURCC     fourcc;
@@ -197,7 +197,7 @@
 
 WaveInfo       *
 WaveOpenFileForWriting(
-                       _WaveConst char *name,
+                       const char *name,
                        WaveInfo       *wi
                        )
 {
diff -ur ../../branches/upstream/nas-1.8/lib/audio/wave.h ./lib/audio/wave.h
--- ../../branches/upstream/nas-1.8/lib/audio/wave.h	2003-12-23 01:14:22.000000000 +0100
+++ ./lib/audio/wave.h	2006-07-12 15:40:53.000000000 +0200
@@ -36,14 +36,6 @@
  * some ANSIfication definitions.
  */
 
-#ifndef _WaveConst
-#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
-#define _WaveConst const
-#else
-#define _WaveConst				/**/
-#endif
-#endif						/* _WaveConst */
-
 #ifndef _FUNCPROTOBEGIN
 #ifdef __cplusplus			/* for C++ V2.0 */
 #define _FUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
@@ -103,12 +95,12 @@
 
 extern WaveInfo *
 WaveOpenFileForReading(
-		       _WaveConst char *	/* file name */
+		       const char *		/* file name */
 );
 
 extern WaveInfo *
 WaveOpenFileForWriting(
-		       _WaveConst char *,	/* file name */
+		       const char *,		/* file name */
 		       WaveInfo *		/* info */
 );
 


More information about the Nas mailing list