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
a493aafe
Commit
a493aafe
authored
Nov 22, 2008
by
Laszlo Ashin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wavpack: use assert_static()
parent
457a6f4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
wavpack_plugin.c
src/decoder/wavpack_plugin.c
+5
-4
No files found.
src/decoder/wavpack_plugin.c
View file @
a493aafe
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "../decoder_api.h"
#include "../decoder_api.h"
#include "../path.h"
#include "../path.h"
#include "../utils.h"
#include <wavpack/wavpack.h>
#include <wavpack/wavpack.h>
#include <glib.h>
#include <glib.h>
...
@@ -71,7 +72,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count)
...
@@ -71,7 +72,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count)
* of the output samples never can be greater than the size
* of the output samples never can be greater than the size
* of the input ones. Otherwise we would have an overflow.
* of the input ones. Otherwise we would have an overflow.
*/
*/
assert
(
sizeof
(
uchar
)
<=
sizeof
(
uint32_t
));
assert
_static
(
sizeof
(
*
dst
)
<=
sizeof
(
*
src
));
/* pass through and align 8-bit samples */
/* pass through and align 8-bit samples */
while
(
count
--
)
{
while
(
count
--
)
{
...
@@ -81,7 +82,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count)
...
@@ -81,7 +82,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count)
}
}
case
2
:
{
case
2
:
{
uint16_t
*
dst
=
buffer
;
uint16_t
*
dst
=
buffer
;
assert
(
sizeof
(
uint16_t
)
<=
sizeof
(
uint32_t
));
assert
_static
(
sizeof
(
*
dst
)
<=
sizeof
(
*
src
));
/* pass through and align 16-bit samples */
/* pass through and align 16-bit samples */
while
(
count
--
)
{
while
(
count
--
)
{
...
@@ -94,7 +95,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count)
...
@@ -94,7 +95,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count)
break
;
break
;
case
4
:
{
case
4
:
{
uint32_t
*
dst
=
buffer
;
uint32_t
*
dst
=
buffer
;
assert
(
sizeof
(
uint32_t
)
<=
sizeof
(
uint32_t
));
assert
_static
(
sizeof
(
*
dst
)
<=
sizeof
(
*
src
));
/* downsample to 24-bit */
/* downsample to 24-bit */
while
(
count
--
)
{
while
(
count
--
)
{
...
@@ -114,7 +115,7 @@ format_samples_float(mpd_unused int bytes_per_sample, void *buffer,
...
@@ -114,7 +115,7 @@ format_samples_float(mpd_unused int bytes_per_sample, void *buffer,
{
{
int32_t
*
dst
=
buffer
;
int32_t
*
dst
=
buffer
;
float
*
src
=
buffer
;
float
*
src
=
buffer
;
assert
(
sizeof
(
int32_t
)
<=
sizeof
(
float
));
assert
_static
(
sizeof
(
*
dst
)
<=
sizeof
(
*
src
));
while
(
count
--
)
{
while
(
count
--
)
{
*
dst
++
=
(
int32_t
)(
*
src
++
+
0
.
5
f
);
*
dst
++
=
(
int32_t
)(
*
src
++
+
0
.
5
f
);
...
...
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