Fix a few integer truncation warnings

This commit is contained in:
derselbst 2020-01-10 17:07:58 +01:00
parent 7af62902b6
commit 7f816029ab
2 changed files with 4 additions and 5 deletions

View file

@ -93,7 +93,7 @@ static int fluid_portaudio_get_device_name(int device_num, char **name_ptr)
device_index:host_api_name:host_device_name.
*/
int i = device_num;
int size = 0;
size_t size = 0;
do
{
@ -103,7 +103,7 @@ static int fluid_portaudio_get_device_name(int device_num, char **name_ptr)
while(i); /* index size */
/* host API size + host device size + 2 separators + zero termination */
size += strlen(hostInfo->name) + strlen(deviceInfo->name) + 3;
size += FLUID_STRLEN(hostInfo->name) + FLUID_STRLEN(deviceInfo->name) + 3u;
*name_ptr = FLUID_MALLOC(size);
if(*name_ptr)

View file

@ -406,8 +406,7 @@ fluid_isasciistring(char *s)
/* From ctype.h */
#define fluid_isascii(c) (((c) & ~0x7f) == 0)
int i;
int len = (int) FLUID_STRLEN(s);
size_t i, len = FLUID_STRLEN(s);
for(i = 0; i < len; i++)
{
@ -1457,7 +1456,7 @@ delete_fluid_track(fluid_track_t *track)
int
fluid_track_set_name(fluid_track_t *track, char *name)
{
int len;
size_t len;
if(track->name != NULL)
{