MT#57422 statement with no effect, cycles in the opus.c

This commit takes car of the following mistake in the code:

     opus.c: In function 'read_param':
     opus.c:178:5: warning: statement with no effect [-Wunused-value]
       178 |     input;
           |     ^~~~~
     opus.c:186:8: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
       186 |   input=param_size+1;
           |        ^
     opus.c:191:5: warning: statement with no effect [-Wunused-value]
       191 |     input;
           |     ^~~~~
     opus.c:197:2: warning: statement with no effect [-Wunused-value]
       197 |  input;
           |  ^~~~~
     opus.c: In function 'decode_format_parameters':
     opus.c:257:4: warning: statement with no effect [-Wunused-value]
       257 |    buffer;
           |    ^~~~~~

Change-Id: I469d9cc433eaebe5e3ffbe32b963363dd29a2aac
mr11.4.1
Donat Zenichev 3 years ago
parent 7e0153adf3
commit a241f56e18

@ -174,30 +174,37 @@ static char* read_param(char* input, const char *param, char** param_value)
int param_size;
/* Eat spaces and semi-colons */
while (*input && (*input==' ' || *input==';' || *input=='"'))
input;
while (*input && (*input == ' ' || *input == ';' || *input == '"'))
input++;
*param_value = NULL;
param_size = strlen(param);
if (strncmp(input, param, param_size))
return input;
if (*(input+param_size) != '=')
return input;
input=param_size+1;
/* Found and discarded a matching parameter */
*param_value = input;
while (*input && *input!=' ' && *input!=';' && *input!='"')
input;
while (*input && *input != ' ' && *input != ';' && *input != '"')
input++;
if (*input=='"')
{
*param_value = *param_value+1; /* remove " */
/* string will end after next: " */
while (*input && *input!='"' && *input!='\r' && *input!='\n')
input;
if (*input=='"')
input--; /* remove " */
}
{
*param_value = *param_value + 1; /* remove " */
/* string will end after next: " */
while (*input && *input != '"' && *input != '\r' && *input != '\n')
input++;
if (*input == '"')
input--; /* remove " */
}
if (*input)
*input = 0;
@ -252,9 +259,10 @@ void decode_format_parameters(const char* format_parameters, unsigned int* maxba
/* Unknown parameter */
if (*buffer) {
param_value = buffer;
while (*buffer && *buffer!=';')
buffer;
param_value = buffer;
while (*buffer && *buffer != ';')
buffer++;
if (*buffer)
*buffer = 0;

Loading…
Cancel
Save