hameg-hmo/yokogawa-dlm: Fix warning about pointer typecast

This commit is contained in:
Soeren Apel 2016-01-29 23:13:32 +01:00
parent a084a8f2a4
commit 10c4ca9c5b
2 changed files with 6 additions and 6 deletions

View File

@ -355,7 +355,8 @@ static int scope_state_get_array_option(struct sr_scpi_dev_inst *scpi,
static int array_float_get(gchar *value, const uint64_t array[][2], static int array_float_get(gchar *value, const uint64_t array[][2],
int array_len, unsigned int *result) int array_len, unsigned int *result)
{ {
int i, pos, e; int i, e;
size_t pos;
uint64_t f; uint64_t f;
float s; float s;
unsigned int s_int; unsigned int s_int;
@ -365,8 +366,7 @@ static int array_float_get(gchar *value, const uint64_t array[][2],
memset(es, 0, sizeof(es)); memset(es, 0, sizeof(es));
/* Get index of the separating 'E' character and break up the string. */ /* Get index of the separating 'E' character and break up the string. */
pos = (int)g_strstr_len(value, strlen(value), "E"); pos = strcspn(value, "E");
pos -= (int)value;
strncpy(ss, value, pos); strncpy(ss, value, pos);
strncpy(es, &(value[pos+1]), 3); strncpy(es, &(value[pos+1]), 3);

View File

@ -372,7 +372,8 @@ static int array_option_get(char *value, const char *(*array)[],
static int array_float_get(gchar *value, const uint64_t array[][2], static int array_float_get(gchar *value, const uint64_t array[][2],
int array_len, int *result) int array_len, int *result)
{ {
int i, pos, e; int i, e;
size_t pos;
uint64_t f; uint64_t f;
float s; float s;
unsigned int s_int; unsigned int s_int;
@ -382,8 +383,7 @@ static int array_float_get(gchar *value, const uint64_t array[][2],
memset(es, 0, sizeof(es)); memset(es, 0, sizeof(es));
/* Get index of the separating 'E' character and break up the string. */ /* Get index of the separating 'E' character and break up the string. */
pos = (int)g_strstr_len(value, strlen(value), "E"); pos = strcspn(value, "E");
pos -= (int)value;
strncpy(ss, value, pos); strncpy(ss, value, pos);
strncpy(es, &(value[pos+1]), 3); strncpy(es, &(value[pos+1]), 3);