From 84582ceb030794f67858bbae3efffb9865eae117 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 13 Oct 2014 07:00:43 -0700 Subject: Use more appropriate size types --- Alc/helpers.c | 6 +++--- Alc/midi/sf2load.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'Alc') diff --git a/Alc/helpers.c b/Alc/helpers.c index 0e69b195..8c9b1a4b 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -643,7 +643,7 @@ ALboolean vector_reserve(char *ptr, size_t base_size, size_t obj_size, size_t ob vector_ *vecptr = (vector_*)ptr; if((*vecptr ? (*vecptr)->Capacity : 0) < obj_count) { - ALsizei old_size = (*vecptr ? (*vecptr)->Size : 0); + size_t old_size = (*vecptr ? (*vecptr)->Size : 0); void *temp; /* Use the next power-of-2 size if we don't need to allocate the exact @@ -743,12 +743,12 @@ int al_string_cmp(const_al_string str1, const_al_string str2) int al_string_cmp_cstr(const_al_string str1, const al_string_char_type *str2) { return al_string_compare(&VECTOR_FRONT(str1), al_string_length(str1), - str2, (ALsizei)strlen(str2)); + str2, strlen(str2)); } void al_string_copy(al_string *str, const_al_string from) { - ALsizei len = VECTOR_SIZE(from); + size_t len = al_string_length(from); VECTOR_RESERVE(*str, len+1); VECTOR_RESIZE(*str, 0); VECTOR_INSERT(*str, VECTOR_ITER_END(*str), VECTOR_ITER_BEGIN(from), VECTOR_ITER_BEGIN(from)+len); diff --git a/Alc/midi/sf2load.c b/Alc/midi/sf2load.c index 0975d2a4..a4c5d36d 100644 --- a/Alc/midi/sf2load.c +++ b/Alc/midi/sf2load.c @@ -949,15 +949,15 @@ static void processInstrument(ALfontsound ***sounds, ALsizei *sounds_size, ALCco GenModList_Destruct(&gzone); } -static size_t printStringChunk(Reader *stream, const RiffHdr *chnk, const char *title) +static ALuint printStringChunk(Reader *stream, const RiffHdr *chnk, const char *title) { - size_t len = 0; + ALuint len = 0; if(chnk->mSize == 0 || (chnk->mSize&1)) ERR("Invalid "FOURCCFMT" size: %d\n", FOURCCARGS(chnk->mCode), chnk->mSize); else { char *str = calloc(1, chnk->mSize+1); - len = Reader_read(stream, str, chnk->mSize); + len = (ALuint)Reader_read(stream, str, chnk->mSize); TRACE("%s: %s\n", title, str); free(str); @@ -1112,7 +1112,7 @@ ALboolean loadSf2(Reader *stream, ALsoundfont *soundfont, ALCcontext *context) ptr = buffer->data; if(IS_LITTLE_ENDIAN) - smpl.mSize -= Reader_read(stream, ptr, smpl.mSize); + smpl.mSize -= (ALuint)Reader_read(stream, ptr, smpl.mSize); else { ALuint total = 0; @@ -1122,7 +1122,7 @@ ALboolean loadSf2(Reader *stream, ALsoundfont *soundfont, ALCcontext *context) ALuint todo = minu(smpl.mSize-total, sizeof(buf)); ALuint i; - smpl.mSize -= Reader_read(stream, buf, todo); + smpl.mSize -= (ALuint)Reader_read(stream, buf, todo); for(i = 0;i < todo;i++) ptr[total+i] = buf[i^1]; -- cgit v1.2.3