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
6b2b5af3
Commit
6b2b5af3
authored
Oct 16, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/byte_reverse: convert to C++
parent
f32fbd9e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
27 deletions
+21
-27
Makefile.am
Makefile.am
+2
-2
PcmDecoderPlugin.cxx
src/decoder/PcmDecoderPlugin.cxx
+1
-4
PcmExport.cxx
src/pcm/PcmExport.cxx
+1
-4
ByteReverse.cxx
src/util/ByteReverse.cxx
+12
-12
ByteReverse.hxx
src/util/ByteReverse.hxx
+3
-3
test_byte_reverse.cxx
test/test_byte_reverse.cxx
+2
-2
No files found.
Makefile.am
View file @
6b2b5af3
...
...
@@ -266,7 +266,7 @@ libutil_a_SOURCES = \
src/util/PeakBuffer.cxx src/util/PeakBuffer.hxx
\
src/util/list.h
\
src/util/list_sort.c src/util/list_sort.h
\
src/util/
byte_reverse.c src/util/byte_reverse.h
\
src/util/
ByteReverse.cxx src/util/ByteReverse.hxx
\
src/util/bit_reverse.c src/util/bit_reverse.h
# System library
...
...
@@ -1408,7 +1408,7 @@ test_run_inotify_LDADD = \
endif
test_test_byte_reverse_SOURCES
=
\
test
/test_byte_reverse.c
test
/test_byte_reverse.c
xx
test_test_byte_reverse_LDADD
=
\
libutil.a
\
$(GLIB_LIBS)
...
...
src/decoder/PcmDecoderPlugin.cxx
View file @
6b2b5af3
...
...
@@ -22,12 +22,9 @@
#include "DecoderAPI.hxx"
#include "InputStream.hxx"
#include "util/Error.hxx"
#include "util/ByteReverse.hxx"
#include "Log.hxx"
extern
"C"
{
#include "util/byte_reverse.h"
}
#include <glib.h>
#include <unistd.h>
#include <string.h>
...
...
src/pcm/PcmExport.cxx
View file @
6b2b5af3
...
...
@@ -21,10 +21,7 @@
#include "PcmExport.hxx"
#include "PcmDsdUsb.hxx"
#include "PcmPack.hxx"
extern
"C"
{
#include "util/byte_reverse.h"
}
#include "util/ByteReverse.hxx"
void
PcmExport
::
Open
(
SampleFormat
sample_format
,
unsigned
_channels
,
...
...
src/util/
byte_reverse.c
→
src/util/
ByteReverse.cxx
View file @
6b2b5af3
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "
byte_reverse.h
"
#include "
ByteReverse.hxx
"
#include <glib.h>
#include <assert.h>
...
...
@@ -25,8 +25,8 @@
void
reverse_bytes_16
(
uint16_t
*
dest
,
const
uint16_t
*
src
,
const
uint16_t
*
src_end
)
{
assert
(
dest
!=
NULL
);
assert
(
src
!=
NULL
);
assert
(
dest
!=
nullptr
);
assert
(
src
!=
nullptr
);
assert
(
src_end
>=
src
);
while
(
src
<
src_end
)
{
...
...
@@ -38,8 +38,8 @@ reverse_bytes_16(uint16_t *dest, const uint16_t *src, const uint16_t *src_end)
void
reverse_bytes_32
(
uint32_t
*
dest
,
const
uint32_t
*
src
,
const
uint32_t
*
src_end
)
{
assert
(
dest
!=
NULL
);
assert
(
src
!=
NULL
);
assert
(
dest
!=
nullptr
);
assert
(
src
!=
nullptr
);
assert
(
src_end
>=
src
);
while
(
src
<
src_end
)
{
...
...
@@ -51,8 +51,8 @@ reverse_bytes_32(uint32_t *dest, const uint32_t *src, const uint32_t *src_end)
void
reverse_bytes_64
(
uint64_t
*
dest
,
const
uint64_t
*
src
,
const
uint64_t
*
src_end
)
{
assert
(
dest
!=
NULL
);
assert
(
src
!=
NULL
);
assert
(
dest
!=
nullptr
);
assert
(
src
!=
nullptr
);
assert
(
src_end
>=
src
);
while
(
src
<
src_end
)
{
...
...
@@ -75,8 +75,8 @@ reverse_bytes_generic(uint8_t *dest,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
,
size_t
frame_size
)
{
assert
(
dest
!=
NULL
);
assert
(
src
!=
NULL
);
assert
(
dest
!=
nullptr
);
assert
(
src
!=
nullptr
);
assert
(
src_end
>=
src
);
assert
(
frame_size
>
0
);
assert
((
src_end
-
src
)
%
frame_size
==
0
);
...
...
@@ -92,8 +92,8 @@ void
reverse_bytes
(
uint8_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
,
size_t
frame_size
)
{
assert
(
dest
!=
NULL
);
assert
(
src
!=
NULL
);
assert
(
dest
!=
nullptr
);
assert
(
src
!=
nullptr
);
assert
(
src_end
>=
src
);
assert
(
frame_size
>
0
);
assert
((
src_end
-
src
)
%
frame_size
==
0
);
...
...
src/util/
byte_reverse.h
→
src/util/
ByteReverse.hxx
View file @
6b2b5af3
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_BYTE_REVERSE_H
#define MPD_BYTE_REVERSE_H
#ifndef MPD_BYTE_REVERSE_H
XX
#define MPD_BYTE_REVERSE_H
XX
#include <stdint.h>
#include <stddef.h>
...
...
test/test_byte_reverse.c
→
test/test_byte_reverse.c
xx
View file @
6b2b5af3
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "util/
byte_reverse.h
"
#include "util/
ByteReverse.hxx
"
#include "util/Macros.hxx"
#include <glib.h>
...
...
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