aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-10-13 07:00:43 -0700
committerChris Robinson <[email protected]>2014-10-13 07:00:43 -0700
commit84582ceb030794f67858bbae3efffb9865eae117 (patch)
treed9c629ae0fcdceb13191f33940154933c1c179de
parentf05a2b86cd59bd3827ce741dcc0da5ffdf2969e9 (diff)
Use more appropriate size types
-rw-r--r--Alc/helpers.c6
-rw-r--r--Alc/midi/sf2load.c10
2 files changed, 8 insertions, 8 deletions
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];