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
28ad79c9
Commit
28ad79c9
authored
Dec 01, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Traits: add typedef long_type
parent
7661ad66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
Traits.hxx
src/pcm/Traits.hxx
+13
-0
No files found.
src/pcm/Traits.hxx
View file @
28ad79c9
...
...
@@ -51,6 +51,13 @@ struct SampleTraits<SampleFormat::S8> {
typedef
const
value_type
*
const_pointer_type
;
/**
* A "long" type that is large and accurate enough for
* arithmetic without risking an (integer) overflow or
* (floating point) precision loss.
*/
typedef
int
long_type
;
/**
* The size of one sample in bytes.
*/
static
constexpr
size_t
SAMPLE_SIZE
=
sizeof
(
value_type
);
...
...
@@ -68,6 +75,8 @@ struct SampleTraits<SampleFormat::S16> {
typedef
value_type
*
pointer_type
;
typedef
const
value_type
*
const_pointer_type
;
typedef
int
long_type
;
static
constexpr
size_t
SAMPLE_SIZE
=
sizeof
(
value_type
);
static
constexpr
unsigned
BITS
=
sizeof
(
value_type
)
*
8
;
};
...
...
@@ -78,6 +87,8 @@ struct SampleTraits<SampleFormat::S32> {
typedef
value_type
*
pointer_type
;
typedef
const
value_type
*
const_pointer_type
;
typedef
int64_t
long_type
;
static
constexpr
size_t
SAMPLE_SIZE
=
sizeof
(
value_type
);
static
constexpr
unsigned
BITS
=
sizeof
(
value_type
)
*
8
;
};
...
...
@@ -88,6 +99,8 @@ struct SampleTraits<SampleFormat::S24_P32> {
typedef
value_type
*
pointer_type
;
typedef
const
value_type
*
const_pointer_type
;
typedef
int
long_type
;
static
constexpr
size_t
SAMPLE_SIZE
=
sizeof
(
value_type
);
static
constexpr
unsigned
BITS
=
24
;
};
...
...
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