From b5f608d0266a6f74d0a2359a60398a7d1f05ce32 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 18 Oct 2013 11:52:43 +0200 Subject: filter/route: use int8_t instead of signed char --- src/filter/RouteFilterPlugin.cxx | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/filter/RouteFilterPlugin.cxx b/src/filter/RouteFilterPlugin.cxx index 58c0b36d8..c8e210a24 100644 --- a/src/filter/RouteFilterPlugin.cxx +++ b/src/filter/RouteFilterPlugin.cxx @@ -54,14 +54,14 @@ #include #include -#include +#include 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 = strtol(sd[0], NULL, 10); - dest = strtol(sd[1], NULL, 10); + unsigned source = strtoul(sd[0], NULL, 10); + unsigned dest = strtoul(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; ib 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 = strtol(sd[0], NULL, 10); - dest = strtol(sd[1], NULL, 10); + unsigned source = strtoul(sd[0], NULL, 10); + unsigned dest = strtoul(sd[1], NULL, 10); sources[dest] = source; -- cgit v1.2.3