aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-29 09:01:53 +0200
committerEric Wong <normalperson@yhbt.net>2008-08-31 04:02:09 -0700
commit6982a829e22d2bc7cf7c829c4430a4ea6f5bc7fa (patch)
tree94de57b9d0bae82be9e385c68b477d493179949e /src
parentc52667aa8eee2a40547026735b9670a2221d4168 (diff)
downloadmpd-6982a829e22d2bc7cf7c829c4430a4ea6f5bc7fa.tar.gz
mpd-6982a829e22d2bc7cf7c829c4430a4ea6f5bc7fa.tar.xz
mpd-6982a829e22d2bc7cf7c829c4430a4ea6f5bc7fa.zip
pass constant pointers
And again, convert arguments to const.
Diffstat (limited to 'src')
-rw-r--r--src/audio.c2
-rw-r--r--src/audio.h2
-rw-r--r--src/audioOutput.c2
-rw-r--r--src/audioOutput.h4
-rw-r--r--src/ls.c6
-rw-r--r--src/ls.h4
-rw-r--r--src/tagTracker.c2
-rw-r--r--src/tagTracker.h2
-rw-r--r--src/tree.c6
-rw-r--r--src/tree.h3
10 files changed, 17 insertions, 16 deletions
diff --git a/src/audio.c b/src/audio.c
index 34b74e6e1..409761177 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -419,7 +419,7 @@ void closeAudioDevice(void)
audioOpened = 0;
}
-void sendMetadataToAudioDevice(MpdTag * tag)
+void sendMetadataToAudioDevice(const MpdTag * tag)
{
unsigned int i;
diff --git a/src/audio.h b/src/audio.h
index c9dea54d2..0032cff22 100644
--- a/src/audio.h
+++ b/src/audio.h
@@ -55,7 +55,7 @@ int isAudioDeviceOpen(void);
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
process is busy playing to the audio */
diff --git a/src/audioOutput.c b/src/audioOutput.c
index 24779a04d..f165979d0 100644
--- a/src/audioOutput.c
+++ b/src/audioOutput.c
@@ -244,7 +244,7 @@ void finishAudioOutput(AudioOutput * audioOutput)
free(audioOutput->convBuffer);
}
-void sendMetadataToAudioOutput(AudioOutput * audioOutput, MpdTag * tag)
+void sendMetadataToAudioOutput(AudioOutput * audioOutput, const MpdTag * tag)
{
if (!audioOutput->sendMetdataFunc)
return;
diff --git a/src/audioOutput.h b/src/audioOutput.h
index 71c1e4b14..f82eedfba 100644
--- a/src/audioOutput.h
+++ b/src/audioOutput.h
@@ -50,7 +50,7 @@ typedef void (*AudioOutputDropBufferedAudioFunc) (AudioOutput * audioOutput);
typedef void (*AudioOutputCloseDeviceFunc) (AudioOutput * audioOutput);
typedef void (*AudioOutputSendMetadataFunc) (AudioOutput * audioOutput,
- MpdTag * tag);
+ const MpdTag * tag);
struct _AudioOutput {
int open;
@@ -104,7 +104,7 @@ void dropBufferedAudioOutput(AudioOutput * audioOutput);
void closeAudioOutput(AudioOutput * audioOutput);
void finishAudioOutput(AudioOutput * audioOutput);
int keepAudioOutputAlive(AudioOutput * audioOutput, int ms);
-void sendMetadataToAudioOutput(AudioOutput * audioOutput, MpdTag * tag);
+void sendMetadataToAudioOutput(AudioOutput * audioOutput, const MpdTag * tag);
void printAllOutputPluginTypes(FILE * fp);
diff --git a/src/ls.c b/src/ls.c
index 3032935c6..f87e09fdb 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -42,10 +42,10 @@ int printRemoteUrlHandlers(int fd)
return 0;
}
-int isValidRemoteUtf8Url(char *utf8url)
+int isValidRemoteUtf8Url(const char *utf8url)
{
int ret = 0;
- char *temp;
+ const char *temp;
switch (isRemoteUrl(utf8url)) {
case 1:
@@ -82,7 +82,7 @@ int isValidRemoteUtf8Url(char *utf8url)
return ret;
}
-int isRemoteUrl(char *url)
+int isRemoteUrl(const char *url)
{
int count = 0;
const char **urlPrefixes = remoteUrlPrefixes;
diff --git a/src/ls.h b/src/ls.h
index ed49c99d8..ce4f94b56 100644
--- a/src/ls.h
+++ b/src/ls.h
@@ -25,9 +25,9 @@ int lsPlaylists(int fd, const char *utf8path);
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);
diff --git a/src/tagTracker.c b/src/tagTracker.c
index acc8a4d2e..892cc2955 100644
--- a/src/tagTracker.c
+++ b/src/tagTracker.c
@@ -117,7 +117,7 @@ void resetVisitedFlagsInTagTracker(int type)
}
}
-void visitInTagTracker(int type, char *str)
+void visitInTagTracker(int type, const char *str)
{
TreeIterator iter;
diff --git a/src/tagTracker.h b/src/tagTracker.h
index 17958f3af..84506426e 100644
--- a/src/tagTracker.h
+++ b/src/tagTracker.h
@@ -29,7 +29,7 @@ void printMemorySavedByTagTracker(void);
void resetVisitedFlagsInTagTracker(int type);
-void visitInTagTracker(int type, char *str);
+void visitInTagTracker(int type, const char *str);
void printVisitedInTagTracker(int fd, int type);
diff --git a/src/tree.c b/src/tree.c
index 40dc4224c..d583aee7c 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -71,7 +71,7 @@ _ClearKeyData(TreeKeyData * keyData)
static
int
-_FindPosition(Tree * tree, TreeNode * node, void * key, int * pos)
+_FindPosition(Tree * tree, TreeNode * node, const void * key, int * pos)
{
#ifdef USE_BINARY_SEARCH
int low = 0;
@@ -113,7 +113,7 @@ _FindPosition(Tree * tree, TreeNode * node, void * key, int * pos)
static
int
-_Find(TreeIterator * iter, void * key)
+_Find(TreeIterator * iter, const void * key)
{
while (1)
{
@@ -680,7 +680,7 @@ RemoveFromTreeByIterator(Tree * tree, TreeIterator * iter)
}
int
-FindInTree(Tree * tree, void * key, TreeIterator * iter)
+FindInTree(Tree * tree, const void * key, TreeIterator * iter)
{
TreeIterator i;
diff --git a/src/tree.h b/src/tree.h
index 4d30e0106..ef397bbd4 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -57,6 +57,7 @@ int InsertInTree(Tree * tree, void * key, void * data);
int RemoveFromTreeByKey(Tree * tree, void * key);
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