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
fc0b6d14
Commit
fc0b6d14
authored
Dec 09, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DespotifyUtils: use ARRAY_SIZE()
parent
5f4252bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
DespotifyUtils.cxx
src/lib/despotify/DespotifyUtils.cxx
+4
-11
No files found.
src/lib/despotify/DespotifyUtils.cxx
View file @
fc0b6d14
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "config/ConfigGlobal.hxx"
#include "config/ConfigGlobal.hxx"
#include "config/ConfigOption.hxx"
#include "config/ConfigOption.hxx"
#include "util/Domain.hxx"
#include "util/Domain.hxx"
#include "util/Macros.hxx"
#include "Log.hxx"
#include "Log.hxx"
extern
"C"
{
extern
"C"
{
...
@@ -42,9 +43,7 @@ static void
...
@@ -42,9 +43,7 @@ static void
callback
(
struct
despotify_session
*
ds
,
int
sig
,
callback
(
struct
despotify_session
*
ds
,
int
sig
,
void
*
data
,
gcc_unused
void
*
callback_data
)
void
*
data
,
gcc_unused
void
*
callback_data
)
{
{
size_t
i
;
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
registered_callbacks
);
++
i
)
{
for
(
i
=
0
;
i
<
sizeof
(
registered_callbacks
)
/
sizeof
(
registered_callbacks
[
0
]);
i
++
)
{
void
(
*
cb
)(
struct
despotify_session
*
,
int
,
void
*
,
void
*
)
=
registered_callbacks
[
i
];
void
(
*
cb
)(
struct
despotify_session
*
,
int
,
void
*
,
void
*
)
=
registered_callbacks
[
i
];
void
*
cb_data
=
registered_callback_data
[
i
];
void
*
cb_data
=
registered_callback_data
[
i
];
...
@@ -56,10 +55,7 @@ callback(struct despotify_session* ds, int sig,
...
@@ -56,10 +55,7 @@ callback(struct despotify_session* ds, int sig,
bool
mpd_despotify_register_callback
(
void
(
*
cb
)(
struct
despotify_session
*
,
int
,
void
*
,
void
*
),
bool
mpd_despotify_register_callback
(
void
(
*
cb
)(
struct
despotify_session
*
,
int
,
void
*
,
void
*
),
void
*
cb_data
)
void
*
cb_data
)
{
{
size_t
i
;
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
registered_callbacks
);
++
i
)
{
for
(
i
=
0
;
i
<
sizeof
(
registered_callbacks
)
/
sizeof
(
registered_callbacks
[
0
]);
i
++
)
{
if
(
!
registered_callbacks
[
i
])
{
if
(
!
registered_callbacks
[
i
])
{
registered_callbacks
[
i
]
=
cb
;
registered_callbacks
[
i
]
=
cb
;
registered_callback_data
[
i
]
=
cb_data
;
registered_callback_data
[
i
]
=
cb_data
;
...
@@ -73,10 +69,7 @@ bool mpd_despotify_register_callback(void (*cb)(struct despotify_session *, int,
...
@@ -73,10 +69,7 @@ bool mpd_despotify_register_callback(void (*cb)(struct despotify_session *, int,
void
mpd_despotify_unregister_callback
(
void
(
*
cb
)(
struct
despotify_session
*
,
int
,
void
*
,
void
*
))
void
mpd_despotify_unregister_callback
(
void
(
*
cb
)(
struct
despotify_session
*
,
int
,
void
*
,
void
*
))
{
{
size_t
i
;
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
registered_callbacks
);
++
i
)
{
for
(
i
=
0
;
i
<
sizeof
(
registered_callbacks
)
/
sizeof
(
registered_callbacks
[
0
]);
i
++
)
{
if
(
registered_callbacks
[
i
]
==
cb
)
{
if
(
registered_callbacks
[
i
]
==
cb
)
{
registered_callbacks
[
i
]
=
nullptr
;
registered_callbacks
[
i
]
=
nullptr
;
}
}
...
...
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