change a (int) cast application, to avoid type conversion warnings

This commit is contained in:
rlar 2010-11-06 17:16:53 +00:00
parent 8141892f72
commit fbe0def68e
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2010-11-06 Robert Larice
* src/xspice/idn/idndig.c :
change a (int) cast application, to avoid type conversion warnings
2010-11-06 Robert Larice
* src/frontend/help/readhelp.c :
tiny rewrite, to avoid type conversion warnings

View File

@ -150,15 +150,15 @@ static void idn_digital_resolve(int num_struct,
dig_struct->strength = dig_struct_array[0]->strength;
/* Convert struct to index into map */
index1 = dig_struct->state + ((int)dig_struct->strength) * 3;
index1 = (int) (dig_struct->state + dig_struct->strength * 3);
/* For the remaining members, perform the resolution algorithm */
for(i = 1; i < num_struct; i++) {
/* Convert struct to index into map */
index2 = dig_struct_array[i]->state +
((int)dig_struct_array[i]->strength) * 3;
index2 = (int)(dig_struct_array[i]->state +
dig_struct_array[i]->strength * 3);
/* Compute the result */
index1 = map[index1][index2];
@ -305,7 +305,7 @@ static void idn_digital_print_val(void *evt_struct, char *member, char **val)
}
}
else {
index = dig_struct->state + ((int)dig_struct->strength) * 3;
index = (int)(dig_struct->state + dig_struct->strength * 3);
if((index < 0) || (index > 11))
*val = "??";
else