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
ba372197
Commit
ba372197
authored
Jan 19, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/simple: make borrowed_song_count "mutable"
Simpler to use than const_cast.
parent
bde27cce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
SimpleDatabasePlugin.cxx
src/db/SimpleDatabasePlugin.cxx
+2
-2
SimpleDatabasePlugin.hxx
src/db/SimpleDatabasePlugin.hxx
+1
-1
No files found.
src/db/SimpleDatabasePlugin.cxx
View file @
ba372197
...
...
@@ -206,7 +206,7 @@ SimpleDatabase::GetSong(const char *uri, Error &error) const
"No such song: %s"
,
uri
);
#ifndef NDEBUG
else
++
const_cast
<
unsigned
&>
(
borrowed_song_count
)
;
++
borrowed_song_count
;
#endif
return
song
;
...
...
@@ -219,7 +219,7 @@ SimpleDatabase::ReturnSong(gcc_unused Song *song) const
#ifndef NDEBUG
assert
(
borrowed_song_count
>
0
);
--
const_cast
<
unsigned
&>
(
borrowed_song_count
)
;
--
borrowed_song_count
;
#endif
}
...
...
src/db/SimpleDatabasePlugin.hxx
View file @
ba372197
...
...
@@ -37,7 +37,7 @@ class SimpleDatabase : public Database {
time_t
mtime
;
#ifndef NDEBUG
unsigned
borrowed_song_count
;
mutable
unsigned
borrowed_song_count
;
#endif
SimpleDatabase
()
...
...
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