[alsa-devel] [PATCH 3/7] topology: apply the same type to compared two variables
Takashi Sakamoto
o-takashi at sakamocchi.jp
Mon Jul 11 14:05:59 CEST 2016
This commit fixes below compiler warnings.
data.c: In function ‘get_token_value’:
data.c:262:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < tokens->num_tokens; i++) {
^
data.c: In function ‘copy_tuples’:
data.c:351:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < tuples->num_sets ; i++) {
^
data.c:378:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (j = 0; j < tuple_set->num_tuples; j++) {
^
data.c: In function ‘tplg_free_tuples’:
data.c:723:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < tuples->num_sets; i++)
^
Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
src/topology/data.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/topology/data.c b/src/topology/data.c
index 4ecd2c2..93eaf91 100644
--- a/src/topology/data.c
+++ b/src/topology/data.c
@@ -257,7 +257,7 @@ static int tplg_parse_data_hex(snd_config_t *cfg, struct tplg_elem *elem,
static int get_token_value(const char *token_id,
struct tplg_vendor_tokens *tokens)
{
- int i;
+ unsigned int i;
for (i = 0; i < tokens->num_tokens; i++) {
if (strcmp(token_id, tokens->token[i].id) == 0)
@@ -338,7 +338,8 @@ static int copy_tuples(struct tplg_elem *elem,
struct snd_soc_tplg_vendor_string_elem *string;
struct snd_soc_tplg_vendor_value_elem *value;
int set_size, size, off;
- int i, j, token_val;
+ unsigned int i, j;
+ int token_val;
if (priv) {
SNDERR("error: %s has more data than tuples\n", elem->id);
@@ -713,7 +714,7 @@ int tplg_parse_tuples(snd_tplg_t *tplg, snd_config_t *cfg,
void tplg_free_tuples(void *obj)
{
struct tplg_vendor_tuples *tuples = (struct tplg_vendor_tuples *)obj;
- int i;
+ unsigned int i;
if (!tuples || !tuples->set)
return;
--
2.7.4
More information about the Alsa-devel
mailing list