Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on FreeBSD #22

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/db/Count.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,14 @@ Print(Response &r, TagType group, const TagCountMap &m)
}
}

static bool
static void
stats_visitor_song(SearchStats &stats, const LightSong &song)
{
stats.n_songs++;

const auto duration = song.GetDuration();
if (!duration.IsNegative())
stats.total_duration += duration;

return true;
}

static bool
Expand All @@ -94,7 +92,7 @@ CollectGroupCounts(TagCountMap &map, TagType group, const Tag &tag)
return found;
}

static bool
static void
GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song)
{
assert(song.tag != nullptr);
Expand All @@ -103,8 +101,6 @@ GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song)
if (!CollectGroupCounts(map, group, tag) && group == TAG_ALBUM_ARTIST)
/* fall back to "Artist" if no "AlbumArtist" was found */
CollectGroupCounts(map, TAG_ARTIST, tag);

return true;
}

void
Expand Down
3 changes: 1 addition & 2 deletions src/db/DatabasePlaylist.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@

#include <functional>

static bool
static void
AddSong(const Storage &storage, const char *playlist_path_utf8,
const LightSong &song)
{
spl_append_song(playlist_path_utf8,
DatabaseDetachSong(storage, song));
return true;
}

void
Expand Down
31 changes: 8 additions & 23 deletions src/db/DatabasePrint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@ PrintDirectoryURI(Response &r, bool base, const LightDirectory &directory)
ApplyBaseFlag(directory.GetPath(), base));
}

static bool
static void
PrintDirectoryBrief(Response &r, bool base, const LightDirectory &directory)
{
if (!directory.IsRoot())
PrintDirectoryURI(r, base, directory);

return true;
}

static bool
static void
PrintDirectoryFull(Response &r, bool base, const LightDirectory &directory)
{
if (!directory.IsRoot()) {
Expand All @@ -67,8 +65,6 @@ PrintDirectoryFull(Response &r, bool base, const LightDirectory &directory)
if (directory.mtime > 0)
time_print(r, "Last-Modified", directory.mtime);
}

return true;
}

static void
Expand Down Expand Up @@ -96,7 +92,7 @@ print_playlist_in_directory(Response &r, bool base,
directory->GetPath(), name_utf8);
}

static bool
static void
PrintSongBrief(Response &r, Partition &partition,
bool base, const LightSong &song)
{
Expand All @@ -106,11 +102,9 @@ PrintSongBrief(Response &r, Partition &partition,
/* this song file has an embedded CUE sheet */
print_playlist_in_directory(r, base,
song.directory, song.uri);

return true;
}

static bool
static void
PrintSongFull(Response &r, Partition &partition,
bool base, const LightSong &song)
{
Expand All @@ -120,21 +114,18 @@ PrintSongFull(Response &r, Partition &partition,
/* this song file has an embedded CUE sheet */
print_playlist_in_directory(r, base,
song.directory, song.uri);

return true;
}

static bool
static void
PrintPlaylistBrief(Response &r, bool base,
const PlaylistInfo &playlist,
const LightDirectory &directory)
{
print_playlist_in_directory(r, base,
&directory, playlist.name.c_str());
return true;
}

static bool
static void
PrintPlaylistFull(Response &r, bool base,
const PlaylistInfo &playlist,
const LightDirectory &directory)
Expand All @@ -144,8 +135,6 @@ PrintPlaylistFull(Response &r, bool base,

if (playlist.mtime > 0)
time_print(r, "Last-Modified", playlist.mtime);

return true;
}

void
Expand Down Expand Up @@ -191,15 +180,13 @@ db_selection_print(Response &r, Partition &partition,
0, std::numeric_limits<int>::max());
}

static bool
static void
PrintSongURIVisitor(Response &r, Partition &partition, const LightSong &song)
{
song_print_uri(r, partition, song);

return true;
}

static bool
static void
PrintUniqueTag(Response &r, TagType tag_type,
const Tag &tag)
{
Expand All @@ -211,8 +198,6 @@ PrintUniqueTag(Response &r, TagType tag_type,
if (item.type != tag_type)
r.Format("%s: %s\n",
tag_item_names[item.type], item.value);

return true;
}

void
Expand Down
3 changes: 1 addition & 2 deletions src/db/DatabaseQueue.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@

#include <functional>

static bool
static void
AddToQueue(Partition &partition, const LightSong &song)
{
const Storage &storage = *partition.instance.storage;
partition.playlist.AppendSong(partition.pc,
DatabaseDetachSong(storage,
song));
return true;
}

void
Expand Down
4 changes: 1 addition & 3 deletions src/db/Helpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ StatsVisitTag(DatabaseStats &stats, StringSet &artists, StringSet &albums,
}
}

static bool
static void
StatsVisitSong(DatabaseStats &stats, StringSet &artists, StringSet &albums,
const LightSong &song)
{
++stats.song_count;

StatsVisitTag(stats, artists, albums, *song.tag);

return true;
}

DatabaseStats
Expand Down
1 change: 1 addition & 0 deletions src/util/VarSize.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <type_traits>
#include <utility>
#include <new>
#include <cstdlib>

/**
* Allocate and construct a variable-size object. That is useful for
Expand Down