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
b5f608d0
Commit
b5f608d0
authored
Oct 18, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter/route: use int8_t instead of signed char
parent
58fe352f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
RouteFilterPlugin.cxx
src/filter/RouteFilterPlugin.cxx
+11
-13
No files found.
src/filter/RouteFilterPlugin.cxx
View file @
b5f608d0
...
...
@@ -54,14 +54,14 @@
#include <assert.h>
#include <string.h>
#include <std
lib
.h>
#include <std
int
.h>
class
RouteFilter
final
:
public
Filter
{
/**
* The minimum number of channels we need for output
* to be able to perform all the copies the user has specified
*/
unsigned
char
min_output_channels
;
unsigned
min_output_channels
;
/**
* The minimum number of input channels we need to
...
...
@@ -69,7 +69,7 @@ class RouteFilter final : public Filter {
* than this many are supplied by the input, undefined
* copy operations are given zeroed sources in stead.
*/
unsigned
char
min_input_channels
;
unsigned
min_input_channels
;
/**
* The set of copy operations to perform on each sample
...
...
@@ -77,7 +77,7 @@ class RouteFilter final : public Filter {
* a corresponding input channel from which to take the
* data. A -1 means "no source"
*/
signed
char
*
sources
;
int8_t
*
sources
;
/**
* The actual input format of our signal, once opened
...
...
@@ -155,7 +155,6 @@ RouteFilter::Configure(const config_param ¶m, Error &error) {
// String and int representations of the source/destination
gchar
**
sd
;
int
source
,
dest
;
// Squeeze whitespace
g_strstrip
(
tokens
[
c
]);
...
...
@@ -171,8 +170,8 @@ RouteFilter::Configure(const config_param ¶m, Error &error) {
return
false
;
}
source
=
strto
l
(
sd
[
0
],
NULL
,
10
);
dest
=
strto
l
(
sd
[
1
],
NULL
,
10
);
unsigned
source
=
strtou
l
(
sd
[
0
],
NULL
,
10
);
unsigned
dest
=
strtou
l
(
sd
[
1
],
NULL
,
10
);
// Keep track of the highest channel numbers seen
// as either in- or outputs
...
...
@@ -193,10 +192,10 @@ RouteFilter::Configure(const config_param ¶m, Error &error) {
}
// Allocate a map of "copy nothing to me"
sources
=
(
signed
char
*
)
g_malloc
(
min_output_channels
*
sizeof
(
signed
char
));
sources
=
(
int8_t
*
)
g_malloc
(
min_output_channels
*
sizeof
(
*
sources
));
for
(
int
i
=
0
;
i
<
min_output_channels
;
++
i
)
for
(
unsigned
i
=
0
;
i
<
min_output_channels
;
++
i
)
sources
[
i
]
=
-
1
;
// Run through the spec again, and save the
...
...
@@ -205,7 +204,6 @@ RouteFilter::Configure(const config_param ¶m, Error &error) {
// String and int representations of the source/destination
gchar
**
sd
;
int
source
,
dest
;
// Split the a>b string into source and destination
sd
=
g_strsplit
(
tokens
[
c
],
">"
,
2
);
...
...
@@ -218,8 +216,8 @@ RouteFilter::Configure(const config_param ¶m, Error &error) {
return
false
;
}
source
=
strto
l
(
sd
[
0
],
NULL
,
10
);
dest
=
strto
l
(
sd
[
1
],
NULL
,
10
);
unsigned
source
=
strtou
l
(
sd
[
0
],
NULL
,
10
);
unsigned
dest
=
strtou
l
(
sd
[
1
],
NULL
,
10
);
sources
[
dest
]
=
source
;
...
...
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