pass constant pointers

And again, convert arguments to const.
This commit is contained in:
Max Kellermann 2008-08-29 09:01:53 +02:00
parent d8a8fa63b4
commit 12bcba8b89
10 changed files with 17 additions and 16 deletions

View File

@ -419,7 +419,7 @@ void closeAudioDevice(void)
audioOpened = 0; audioOpened = 0;
} }
void sendMetadataToAudioDevice(MpdTag * tag) void sendMetadataToAudioDevice(const MpdTag * tag)
{ {
unsigned int i; unsigned int i;

View File

@ -55,7 +55,7 @@ int isAudioDeviceOpen(void);
int isCurrentAudioFormat(const AudioFormat * audioFormat); int isCurrentAudioFormat(const AudioFormat * audioFormat);
void sendMetadataToAudioDevice(MpdTag * tag); void sendMetadataToAudioDevice(const MpdTag * tag);
/* these functions are called in the main parent process while the child /* these functions are called in the main parent process while the child
process is busy playing to the audio */ process is busy playing to the audio */

View File

@ -244,7 +244,7 @@ void finishAudioOutput(AudioOutput * audioOutput)
free(audioOutput->convBuffer); free(audioOutput->convBuffer);
} }
void sendMetadataToAudioOutput(AudioOutput * audioOutput, MpdTag * tag) void sendMetadataToAudioOutput(AudioOutput * audioOutput, const MpdTag * tag)
{ {
if (!audioOutput->sendMetdataFunc) if (!audioOutput->sendMetdataFunc)
return; return;

View File

@ -50,7 +50,7 @@ typedef void (*AudioOutputDropBufferedAudioFunc) (AudioOutput * audioOutput);
typedef void (*AudioOutputCloseDeviceFunc) (AudioOutput * audioOutput); typedef void (*AudioOutputCloseDeviceFunc) (AudioOutput * audioOutput);
typedef void (*AudioOutputSendMetadataFunc) (AudioOutput * audioOutput, typedef void (*AudioOutputSendMetadataFunc) (AudioOutput * audioOutput,
MpdTag * tag); const MpdTag * tag);
struct _AudioOutput { struct _AudioOutput {
int open; int open;
@ -104,7 +104,7 @@ void dropBufferedAudioOutput(AudioOutput * audioOutput);
void closeAudioOutput(AudioOutput * audioOutput); void closeAudioOutput(AudioOutput * audioOutput);
void finishAudioOutput(AudioOutput * audioOutput); void finishAudioOutput(AudioOutput * audioOutput);
int keepAudioOutputAlive(AudioOutput * audioOutput, int ms); int keepAudioOutputAlive(AudioOutput * audioOutput, int ms);
void sendMetadataToAudioOutput(AudioOutput * audioOutput, MpdTag * tag); void sendMetadataToAudioOutput(AudioOutput * audioOutput, const MpdTag * tag);
void printAllOutputPluginTypes(FILE * fp); void printAllOutputPluginTypes(FILE * fp);

View File

@ -42,10 +42,10 @@ int printRemoteUrlHandlers(int fd)
return 0; return 0;
} }
int isValidRemoteUtf8Url(char *utf8url) int isValidRemoteUtf8Url(const char *utf8url)
{ {
int ret = 0; int ret = 0;
char *temp; const char *temp;
switch (isRemoteUrl(utf8url)) { switch (isRemoteUrl(utf8url)) {
case 1: case 1:
@ -82,7 +82,7 @@ int isValidRemoteUtf8Url(char *utf8url)
return ret; return ret;
} }
int isRemoteUrl(char *url) int isRemoteUrl(const char *url)
{ {
int count = 0; int count = 0;
const char **urlPrefixes = remoteUrlPrefixes; const char **urlPrefixes = remoteUrlPrefixes;

View File

@ -25,9 +25,9 @@ int lsPlaylists(int fd, const char *utf8path);
const char *getSuffix(const char *utf8file); const char *getSuffix(const char *utf8file);
int isValidRemoteUtf8Url(char *utf8url); int isValidRemoteUtf8Url(const char *utf8url);
int isRemoteUrl(char *url); int isRemoteUrl(const char *url);
int myStat(const char *utf8file, struct stat *st); int myStat(const char *utf8file, struct stat *st);

View File

@ -106,7 +106,7 @@ void resetVisitedFlagsInTagTracker(int type)
} }
} }
void visitInTagTracker(int type, char *str) void visitInTagTracker(int type, const char *str)
{ {
TreeIterator iter; TreeIterator iter;

View File

@ -29,7 +29,7 @@ void printMemorySavedByTagTracker(void);
void resetVisitedFlagsInTagTracker(int type); void resetVisitedFlagsInTagTracker(int type);
void visitInTagTracker(int type, char *str); void visitInTagTracker(int type, const char *str);
void printVisitedInTagTracker(int fd, int type); void printVisitedInTagTracker(int fd, int type);

View File

@ -71,7 +71,7 @@ _ClearKeyData(TreeKeyData * keyData)
static static
int int
_FindPosition(Tree * tree, TreeNode * node, void * key, int * pos) _FindPosition(Tree * tree, TreeNode * node, const void * key, int * pos)
{ {
#ifdef USE_BINARY_SEARCH #ifdef USE_BINARY_SEARCH
int low = 0; int low = 0;
@ -113,7 +113,7 @@ _FindPosition(Tree * tree, TreeNode * node, void * key, int * pos)
static static
int int
_Find(TreeIterator * iter, void * key) _Find(TreeIterator * iter, const void * key)
{ {
while (1) while (1)
{ {
@ -680,7 +680,7 @@ RemoveFromTreeByIterator(Tree * tree, TreeIterator * iter)
} }
int int
FindInTree(Tree * tree, void * key, TreeIterator * iter) FindInTree(Tree * tree, const void * key, TreeIterator * iter)
{ {
TreeIterator i; TreeIterator i;

View File

@ -57,6 +57,7 @@ int InsertInTree(Tree * tree, void * key, void * data);
int RemoveFromTreeByKey(Tree * tree, void * key); int RemoveFromTreeByKey(Tree * tree, void * key);
void RemoveFromTreeByIterator(Tree * tree, TreeIterator * iter); void RemoveFromTreeByIterator(Tree * tree, TreeIterator * iter);
int FindInTree(Tree * tree, void * key, TreeIterator * iter /* can be NULL */); int FindInTree(Tree * tree, const void * key,
TreeIterator * iter /* can be NULL */);
#endif #endif