[nas] [patch] remove/simplify _AuConst part2
Stefan Huehner
stefan at huehner.org
Wed Aug 30 06:17:37 MDT 2006
Hi,
attached is part two of the _.*Const removal patch. Some more defines of
_.*Const were removed which have been missed by the last patch and the
interval usage of _.*Const has been simplified to just use const.
Regards,
Stefan
-------------- next part --------------
Index: lib/audio/audioutil.h
===================================================================
--- lib/audio/audioutil.h (revision 225)
+++ lib/audio/audioutil.h (working copy)
@@ -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 */
);
/*****************************************************************************
Index: lib/audio/8svx.c
===================================================================
--- lib/audio/8svx.c (revision 225)
+++ lib/audio/8svx.c (working copy)
@@ -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;
Index: lib/audio/AuErrDes.c
===================================================================
--- lib/audio/AuErrDes.c (revision 225)
+++ lib/audio/AuErrDes.c (working copy)
@@ -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)
{
Index: lib/audio/SvrName.c
===================================================================
--- lib/audio/SvrName.c (revision 225)
+++ lib/audio/SvrName.c (working copy)
@@ -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;
Index: lib/audio/8svx.h
===================================================================
--- lib/audio/8svx.h (revision 225)
+++ lib/audio/8svx.h (working copy)
@@ -82,12 +82,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 */
);
Index: lib/audio/fileutil.c
===================================================================
--- lib/audio/fileutil.c (revision 225)
+++ lib/audio/fileutil.c (working copy)
@@ -103,9 +103,9 @@
}
char *
-FileCommentFromFilename(_FileConst char *fname)
+FileCommentFromFilename(const char *fname)
{
- _FileConst char *f;
+ const char *f;
char *t;
/* ignore piped files */
Index: lib/audio/fileutil.h
===================================================================
--- lib/audio/fileutil.h (revision 225)
+++ lib/audio/fileutil.h (working copy)
@@ -103,7 +103,7 @@
extern char *
FileCommentFromFilename(
- _FileConst char * /* file name */
+ const char * /* file name */
);
_FUNCPROTOEND
Index: lib/audio/ConnSvr.c
===================================================================
--- lib/audio/ConnSvr.c (revision 225)
+++ lib/audio/ConnSvr.c (working copy)
@@ -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 */
const 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 */
Index: lib/audio/audiolib.h
===================================================================
--- lib/audio/audiolib.h (revision 225)
+++ lib/audio/audiolib.h (working copy)
@@ -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 */
);
Index: lib/audio/aiff.c
===================================================================
--- lib/audio/aiff.c (revision 225)
+++ lib/audio/aiff.c (working copy)
@@ -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
)
Index: lib/audio/aiff.h
===================================================================
--- lib/audio/aiff.h (revision 225)
+++ lib/audio/aiff.h (working copy)
@@ -86,12 +86,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 */
);
Index: lib/audio/soundlib.c
===================================================================
--- lib/audio/soundlib.c (revision 225)
+++ lib/audio/soundlib.c (working copy)
@@ -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
)
{
Index: lib/audio/soundlib.h
===================================================================
--- lib/audio/soundlib.h (revision 225)
+++ lib/audio/soundlib.h (working copy)
@@ -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 */
);
Index: lib/audio/snd.c
===================================================================
--- lib/audio/snd.c (revision 225)
+++ lib/audio/snd.c (working copy)
@@ -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
)
{
Index: lib/audio/Alibint.h
===================================================================
--- lib/audio/Alibint.h (revision 225)
+++ lib/audio/Alibint.h (working copy)
@@ -706,7 +706,7 @@
int
_AuConnectServer(
- _AuConst char *, /* server_name */
+ const char *, /* server_name */
char **, /* fullnamep */
int *, /* svrnump */
char **, /* auth_namep */
Index: lib/audio/sound.c
===================================================================
--- lib/audio/sound.c (revision 225)
+++ lib/audio/sound.c (working copy)
@@ -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;
Index: lib/audio/snd.h
===================================================================
--- lib/audio/snd.h (revision 225)
+++ lib/audio/snd.h (working copy)
@@ -34,11 +34,7 @@
#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
@@ -119,12 +115,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 */
);
Index: lib/audio/OpenSvr.c
===================================================================
--- lib/audio/OpenSvr.c (revision 225)
+++ lib/audio/OpenSvr.c (working copy)
@@ -68,16 +69,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 */
Index: lib/audio/sound.h
===================================================================
--- lib/audio/sound.h (revision 225)
+++ lib/audio/sound.h (working copy)
@@ -37,11 +37,7 @@
#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
@@ -95,12 +91,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 +128,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 +216,6 @@
extern SoundFileInfoProc SoundFileGetProc(int format, int proc);
-extern _SoundConst int SoundNumFileFormats;
+extern const int SoundNumFileFormats;
#endif /* _SOUND_H_ */
Index: lib/audio/wave.c
===================================================================
--- lib/audio/wave.c (revision 225)
+++ lib/audio/wave.c (working copy)
@@ -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
)
{
Index: lib/audio/wave.h
===================================================================
--- lib/audio/wave.h (revision 225)
+++ lib/audio/wave.h (working copy)
@@ -31,17 +31,8 @@
#include <audio/audio.h> /* for AuInt32 and AuUint32 */
-/*
- * If we are being used outside the NCD-AUDIO sound library, then we'll need
- * 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
@@ -103,12 +94,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 */
);
Index: lib/audio/Util.c
===================================================================
--- lib/audio/Util.c (revision 225)
+++ lib/audio/Util.c (working copy)
@@ -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;
Index: lib/audio/voc.c
===================================================================
--- lib/audio/voc.c (revision 225)
+++ lib/audio/voc.c (working copy)
@@ -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
)
{
Index: lib/audio/voc.h
===================================================================
--- lib/audio/voc.h (revision 225)
+++ lib/audio/voc.h (working copy)
@@ -27,17 +27,8 @@
#include <audio/audio.h> /* for AuInt32 and AuUint32 */
-/*
- * If we are being used outside the NCD-AUDIO sound library, then we'll need
- * 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
@@ -88,12 +79,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 */
);
More information about the Nas
mailing list