diff options
author | Max Kellermann <max@duempel.org> | 2013-10-18 11:52:43 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-18 12:24:47 +0200 |
commit | b5f608d0266a6f74d0a2359a60398a7d1f05ce32 (patch) | |
tree | 07ddcf93abae86d42c3069310e9030dbcf0895d5 /src | |
parent | 58fe352fdaff93737d067a0cb90d83ebd5cbe180 (diff) | |
download | mpd-b5f608d0266a6f74d0a2359a60398a7d1f05ce32.tar.gz mpd-b5f608d0266a6f74d0a2359a60398a7d1f05ce32.tar.xz mpd-b5f608d0266a6f74d0a2359a60398a7d1f05ce32.zip |
filter/route: use int8_t instead of signed char
Diffstat (limited to 'src')
-rw-r--r-- | src/filter/RouteFilterPlugin.cxx | 24 |
1 files changed, 11 insertions, 13 deletions
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 <assert.h> #include <string.h> -#include <stdlib.h> +#include <stdint.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 = 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; 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 = 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; |