Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
35c0b84f
Commit
35c0b84f
authored
Sep 06, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbUtils, playlist, directory: pass constant pointers
The usual bunch of const pointer conversions.
parent
d38d2bc3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
37 deletions
+38
-37
dbUtils.c
src/dbUtils.c
+10
-9
dbUtils.h
src/dbUtils.h
+9
-9
directory.c
src/directory.c
+2
-2
directory.h
src/directory.h
+2
-2
playlist.c
src/playlist.c
+7
-7
playlist.h
src/playlist.h
+8
-8
No files found.
src/dbUtils.c
View file @
35c0b84f
...
...
@@ -80,7 +80,8 @@ static int searchInDirectory(int fd, Song * song, void *data)
return
0
;
}
int
searchForSongsIn
(
int
fd
,
char
*
name
,
int
numItems
,
LocateTagItem
*
items
)
int
searchForSongsIn
(
int
fd
,
const
char
*
name
,
int
numItems
,
LocateTagItem
*
items
)
{
int
ret
;
int
i
;
...
...
@@ -118,7 +119,7 @@ static int findInDirectory(int fd, Song * song, void *data)
return
0
;
}
int
findSongsIn
(
int
fd
,
char
*
name
,
int
numItems
,
LocateTagItem
*
items
)
int
findSongsIn
(
int
fd
,
c
onst
c
har
*
name
,
int
numItems
,
LocateTagItem
*
items
)
{
LocateTagItemArray
array
;
...
...
@@ -148,7 +149,7 @@ static int searchStatsInDirectory(mpd_unused int fd, Song * song, void *data)
return
0
;
}
int
searchStatsForSongsIn
(
int
fd
,
char
*
name
,
int
numItems
,
int
searchStatsForSongsIn
(
int
fd
,
c
onst
c
har
*
name
,
int
numItems
,
LocateTagItem
*
items
)
{
SearchStats
stats
;
...
...
@@ -166,7 +167,7 @@ int searchStatsForSongsIn(int fd, char *name, int numItems,
return
ret
;
}
int
printAllIn
(
int
fd
,
char
*
name
)
int
printAllIn
(
int
fd
,
c
onst
c
har
*
name
)
{
return
traverseAllIn
(
fd
,
name
,
printSongInDirectory
,
printDirectoryInDirectory
,
NULL
);
...
...
@@ -185,12 +186,12 @@ static int directoryAddSongToStoredPlaylist(int fd, Song *song, void *data)
return
0
;
}
int
addAllIn
(
int
fd
,
char
*
name
)
int
addAllIn
(
int
fd
,
c
onst
c
har
*
name
)
{
return
traverseAllIn
(
fd
,
name
,
directoryAddSongToPlaylist
,
NULL
,
NULL
);
}
int
addAllInToStoredPlaylist
(
int
fd
,
c
har
*
name
,
char
*
utf8file
)
int
addAllInToStoredPlaylist
(
int
fd
,
c
onst
char
*
name
,
const
char
*
utf8file
)
{
return
traverseAllIn
(
fd
,
name
,
directoryAddSongToStoredPlaylist
,
NULL
,
(
void
*
)
utf8file
);
...
...
@@ -211,13 +212,13 @@ static int sumSongTime(mpd_unused int fd, Song * song, void *data)
return
0
;
}
int
printInfoForAllIn
(
int
fd
,
char
*
name
)
int
printInfoForAllIn
(
int
fd
,
c
onst
c
har
*
name
)
{
return
traverseAllIn
(
fd
,
name
,
directoryPrintSongInfo
,
printDirectoryInDirectory
,
NULL
);
}
int
countSongsIn
(
int
fd
,
char
*
name
)
int
countSongsIn
(
int
fd
,
c
onst
c
har
*
name
)
{
int
count
=
0
;
void
*
ptr
=
(
void
*
)
&
count
;
...
...
@@ -227,7 +228,7 @@ int countSongsIn(int fd, char *name)
return
count
;
}
unsigned
long
sumSongTimesIn
(
int
fd
,
char
*
name
)
unsigned
long
sumSongTimesIn
(
int
fd
,
c
onst
c
har
*
name
)
{
unsigned
long
dbPlayTime
=
0
;
void
*
ptr
=
(
void
*
)
&
dbPlayTime
;
...
...
src/dbUtils.h
View file @
35c0b84f
...
...
@@ -21,25 +21,25 @@
#include "locate.h"
int
printAllIn
(
int
fd
,
char
*
name
);
int
printAllIn
(
int
fd
,
c
onst
c
har
*
name
);
int
addAllIn
(
int
fd
,
char
*
name
);
int
addAllIn
(
int
fd
,
c
onst
c
har
*
name
);
int
addAllInToStoredPlaylist
(
int
fd
,
c
har
*
name
,
char
*
utf8file
);
int
addAllInToStoredPlaylist
(
int
fd
,
c
onst
char
*
name
,
const
char
*
utf8file
);
int
printInfoForAllIn
(
int
fd
,
char
*
name
);
int
printInfoForAllIn
(
int
fd
,
c
onst
c
har
*
name
);
int
searchForSongsIn
(
int
fd
,
char
*
name
,
int
numItems
,
int
searchForSongsIn
(
int
fd
,
c
onst
c
har
*
name
,
int
numItems
,
LocateTagItem
*
items
);
int
findSongsIn
(
int
fd
,
char
*
name
,
int
numItems
,
LocateTagItem
*
items
);
int
findSongsIn
(
int
fd
,
c
onst
c
har
*
name
,
int
numItems
,
LocateTagItem
*
items
);
int
searchStatsForSongsIn
(
int
fd
,
char
*
name
,
int
numItems
,
int
searchStatsForSongsIn
(
int
fd
,
c
onst
c
har
*
name
,
int
numItems
,
LocateTagItem
*
items
);
int
countSongsIn
(
int
fd
,
char
*
name
);
int
countSongsIn
(
int
fd
,
c
onst
c
har
*
name
);
unsigned
long
sumSongTimesIn
(
int
fd
,
char
*
name
);
unsigned
long
sumSongTimesIn
(
int
fd
,
c
onst
c
har
*
name
);
int
listAllUniqueTags
(
int
fd
,
int
type
,
int
numConditiionals
,
LocateTagItem
*
conditionals
);
...
...
src/directory.c
View file @
35c0b84f
...
...
@@ -1219,7 +1219,7 @@ static int traverseAllInSubDirectory(int fd, Directory * directory,
return
errFlag
;
}
int
traverseAllIn
(
int
fd
,
char
*
name
,
int
traverseAllIn
(
int
fd
,
c
onst
c
har
*
name
,
int
(
*
forEachSong
)
(
int
,
Song
*
,
void
*
),
int
(
*
forEachDir
)
(
int
,
Directory
*
,
void
*
),
void
*
data
)
{
...
...
@@ -1303,7 +1303,7 @@ static Song *getSongDetails(const char *file, const char **shortnameRet,
return
(
Song
*
)
song
;
}
Song
*
getSongFromDB
(
char
*
file
)
Song
*
getSongFromDB
(
c
onst
c
har
*
file
)
{
return
getSongDetails
(
file
,
NULL
,
NULL
);
}
...
...
src/directory.h
View file @
35c0b84f
...
...
@@ -60,11 +60,11 @@ int readDirectoryDB(void);
void
updateMp3Directory
(
void
);
Song
*
getSongFromDB
(
char
*
file
);
Song
*
getSongFromDB
(
c
onst
c
har
*
file
);
time_t
getDbModTime
(
void
);
int
traverseAllIn
(
int
fd
,
char
*
name
,
int
traverseAllIn
(
int
fd
,
c
onst
c
har
*
name
,
int
(
*
forEachSong
)
(
int
,
Song
*
,
void
*
),
int
(
*
forEachDir
)
(
int
,
Directory
*
,
void
*
),
void
*
data
);
...
...
src/playlist.c
View file @
35c0b84f
...
...
@@ -211,7 +211,7 @@ void clearPlaylist(void)
incrPlaylistVersion
();
}
int
clearStoredPlaylist
(
int
fd
,
char
*
utf8file
)
int
clearStoredPlaylist
(
int
fd
,
c
onst
c
har
*
utf8file
)
{
return
removeAllFromStoredPlaylistByPath
(
fd
,
utf8file
);
}
...
...
@@ -561,7 +561,7 @@ static void clearPlayerQueue(void)
playerQueueUnlock
();
}
int
addToPlaylist
(
int
fd
,
char
*
url
,
int
*
added_id
)
int
addToPlaylist
(
int
fd
,
c
onst
c
har
*
url
,
int
*
added_id
)
{
Song
*
song
;
...
...
@@ -579,7 +579,7 @@ int addToPlaylist(int fd, char *url, int *added_id)
return
addSongToPlaylist
(
fd
,
song
,
added_id
);
}
int
addToStoredPlaylist
(
int
fd
,
c
har
*
url
,
char
*
utf8file
)
int
addToStoredPlaylist
(
int
fd
,
c
onst
char
*
url
,
const
char
*
utf8file
)
{
Song
*
song
;
...
...
@@ -1270,7 +1270,7 @@ int shufflePlaylist(mpd_unused int fd)
return
0
;
}
int
deletePlaylist
(
int
fd
,
char
*
utf8file
)
int
deletePlaylist
(
int
fd
,
c
onst
c
har
*
utf8file
)
{
char
path_max_tmp
[
MPD_PATH_MAX
];
...
...
@@ -1291,7 +1291,7 @@ int deletePlaylist(int fd, char *utf8file)
return
0
;
}
int
savePlaylist
(
int
fd
,
char
*
utf8file
)
int
savePlaylist
(
int
fd
,
c
onst
c
har
*
utf8file
)
{
FILE
*
fp
;
int
i
;
...
...
@@ -1400,7 +1400,7 @@ int getPlaylistSongId(int song)
return
playlist
.
positionToId
[
song
];
}
int
PlaylistInfo
(
int
fd
,
char
*
utf8file
,
int
detail
)
int
PlaylistInfo
(
int
fd
,
c
onst
c
har
*
utf8file
,
int
detail
)
{
ListNode
*
node
;
List
*
list
;
...
...
@@ -1432,7 +1432,7 @@ int PlaylistInfo(int fd, char *utf8file, int detail)
return
0
;
}
int
loadPlaylist
(
int
fd
,
char
*
utf8file
)
int
loadPlaylist
(
int
fd
,
c
onst
c
har
*
utf8file
)
{
ListNode
*
node
;
List
*
list
;
...
...
src/playlist.h
View file @
35c0b84f
...
...
@@ -53,11 +53,11 @@ void savePlaylistState(FILE *);
void
clearPlaylist
(
void
);
int
clearStoredPlaylist
(
int
fd
,
char
*
utf8file
);
int
clearStoredPlaylist
(
int
fd
,
c
onst
c
har
*
utf8file
);
int
addToPlaylist
(
int
fd
,
char
*
file
,
int
*
added_id
);
int
addToPlaylist
(
int
fd
,
c
onst
c
har
*
file
,
int
*
added_id
);
int
addToStoredPlaylist
(
int
fd
,
c
har
*
file
,
char
*
utf8file
);
int
addToStoredPlaylist
(
int
fd
,
c
onst
char
*
file
,
const
char
*
utf8file
);
int
addSongToPlaylist
(
int
fd
,
Song
*
song
,
int
*
added_id
);
...
...
@@ -85,11 +85,11 @@ void previousSongInPlaylist(void);
int
shufflePlaylist
(
int
fd
);
int
savePlaylist
(
int
fd
,
char
*
utf8file
);
int
savePlaylist
(
int
fd
,
c
onst
c
har
*
utf8file
);
int
deletePlaylist
(
int
fd
,
char
*
utf8file
);
int
deletePlaylist
(
int
fd
,
c
onst
c
har
*
utf8file
);
int
deletePlaylistById
(
int
fd
,
char
*
utf8file
);
int
deletePlaylistById
(
int
fd
,
c
onst
c
har
*
utf8file
);
void
deleteASongFromPlaylist
(
Song
*
song
);
...
...
@@ -101,7 +101,7 @@ int swapSongsInPlaylist(int fd, int song1, int song2);
int
swapSongsInPlaylistById
(
int
fd
,
int
id1
,
int
id2
);
int
loadPlaylist
(
int
fd
,
char
*
utf8file
);
int
loadPlaylist
(
int
fd
,
c
onst
c
har
*
utf8file
);
int
getPlaylistRepeatStatus
(
void
);
...
...
@@ -131,7 +131,7 @@ int playlistChanges(int fd, mpd_uint32 version);
int
playlistChangesPosId
(
int
fd
,
mpd_uint32
version
);
int
PlaylistInfo
(
int
fd
,
char
*
utf8file
,
int
detail
);
int
PlaylistInfo
(
int
fd
,
c
onst
c
har
*
utf8file
,
int
detail
);
void
searchForSongsInPlaylist
(
int
fd
,
int
numItems
,
LocateTagItem
*
items
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment