aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h12
-rw-r--r--OpenAL32/alAuxEffectSlot.cpp6
-rw-r--r--OpenAL32/alBuffer.cpp4
-rw-r--r--OpenAL32/alEffect.cpp4
-rw-r--r--OpenAL32/alFilter.cpp4
-rw-r--r--OpenAL32/alSource.cpp5
-rw-r--r--OpenAL32/event.cpp9
7 files changed, 24 insertions, 20 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 0f65965a..d44671db 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -146,7 +146,7 @@ typedef ALuint64SOFT ALuint64;
inline int msvc64_popcnt64(ALuint64 v)
{
- return __popcnt64(v);
+ return (int)__popcnt64(v);
}
#define POPCNT64 msvc64_popcnt64
@@ -162,7 +162,7 @@ inline int msvc64_ctz64(ALuint64 v)
inline int msvc_popcnt64(ALuint64 v)
{
- return __popcnt((ALuint)v) + __popcnt((ALuint)(v>>32));
+ return (int)(__popcnt((ALuint)v) + __popcnt((ALuint)(v>>32)));
}
#define POPCNT64 msvc_popcnt64
@@ -887,14 +887,14 @@ void SetRTPriority(void);
void SetDefaultChannelOrder(ALCdevice *device);
void SetDefaultWFXChannelOrder(ALCdevice *device);
-const ALCchar *DevFmtTypeString(enum DevFmtType type);
-const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans);
+const ALCchar *DevFmtTypeString(DevFmtType type);
+const ALCchar *DevFmtChannelsString(DevFmtChannels chans);
-inline ALint GetChannelIndex(const enum Channel (&names)[MAX_OUTPUT_CHANNELS], enum Channel chan)
+inline ALint GetChannelIndex(const Channel (&names)[MAX_OUTPUT_CHANNELS], Channel chan)
{
auto iter = std::find(std::begin(names), std::end(names), chan);
if(iter == std::end(names)) return -1;
- return std::distance(std::begin(names), iter);
+ return static_cast<ALint>(std::distance(std::begin(names), iter));
}
/**
* GetChannelIdxByName
diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp
index 1e841c43..db22ca4c 100644
--- a/OpenAL32/alAuxEffectSlot.cpp
+++ b/OpenAL32/alAuxEffectSlot.cpp
@@ -90,7 +90,7 @@ void AddActiveEffectSlots(const ALuint *slotids, ALsizei count, ALCcontext *cont
if(start == last) break;
++start;
}
- newcount = std::distance(newarray->slot, last);
+ newcount = static_cast<ALsizei>(std::distance(newarray->slot, last));
/* Reallocate newarray if the new size ended up smaller from duplicate
* removal.
@@ -130,7 +130,7 @@ void RemoveActiveEffectSlots(const ALuint *slotids, ALsizei count, ALCcontext *c
[slotids, slotids_end](const ALeffectslot *slot) -> bool
{ return std::find(slotids, slotids_end, slot->id) == slotids_end; }
);
- newarray->count = std::distance(newarray->slot, slotiter);
+ newarray->count = static_cast<ALsizei>(std::distance(newarray->slot, slotiter));
/* TODO: Could reallocate newarray now that we know it's needed size. */
@@ -225,7 +225,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
}
aluInitEffectPanning(iter->get());
- ALuint id = std::distance(context->EffectSlotList.begin(), iter) + 1;
+ auto id = static_cast<ALuint>(std::distance(context->EffectSlotList.begin(), iter) + 1);
(*iter)->id = id;
effectslots[cur] = id;
}
diff --git a/OpenAL32/alBuffer.cpp b/OpenAL32/alBuffer.cpp
index dbd48ad0..6bc965c2 100644
--- a/OpenAL32/alBuffer.cpp
+++ b/OpenAL32/alBuffer.cpp
@@ -59,7 +59,7 @@ ALbuffer *AllocBuffer(ALCcontext *context)
{ return entry.FreeMask != 0; }
);
- auto lidx = std::distance(device->BufferList.begin(), sublist);
+ auto lidx = static_cast<ALsizei>(std::distance(device->BufferList.begin(), sublist));
ALbuffer *buffer{nullptr};
ALsizei slidx{0};
if(LIKELY(sublist != device->BufferList.end()))
@@ -442,7 +442,7 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
ALbuffer *buffer = AllocBuffer(context.get());
if(!buffer)
{
- alDeleteBuffers(ids.size(), ids.data());
+ alDeleteBuffers(static_cast<ALsizei>(ids.size()), ids.data());
return;
}
diff --git a/OpenAL32/alEffect.cpp b/OpenAL32/alEffect.cpp
index 1c08d402..dd16acfb 100644
--- a/OpenAL32/alEffect.cpp
+++ b/OpenAL32/alEffect.cpp
@@ -216,7 +216,7 @@ ALeffect *AllocEffect(ALCcontext *context)
{ return entry.FreeMask != 0; }
);
- auto lidx = std::distance(device->EffectList.begin(), sublist);
+ auto lidx = static_cast<ALsizei>(std::distance(device->EffectList.begin(), sublist));
ALeffect *effect{nullptr};
ALsizei slidx{0};
if(LIKELY(sublist != device->EffectList.end()))
@@ -314,7 +314,7 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
ALeffect *effect = AllocEffect(context.get());
if(!effect)
{
- alDeleteEffects(ids.size(), ids.data());
+ alDeleteEffects(static_cast<ALsizei>(ids.size()), ids.data());
return;
}
diff --git a/OpenAL32/alFilter.cpp b/OpenAL32/alFilter.cpp
index 52135569..c4416a38 100644
--- a/OpenAL32/alFilter.cpp
+++ b/OpenAL32/alFilter.cpp
@@ -276,7 +276,7 @@ ALfilter *AllocFilter(ALCcontext *context)
{ return entry.FreeMask != 0; }
);
- auto lidx = std::distance(device->FilterList.begin(), sublist);
+ auto lidx = static_cast<ALsizei>(std::distance(device->FilterList.begin(), sublist));
ALfilter *filter{nullptr};
ALsizei slidx{0};
if(LIKELY(sublist != device->FilterList.end()))
@@ -375,7 +375,7 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
ALfilter *filter = AllocFilter(context.get());
if(!filter)
{
- alDeleteFilters(ids.size(), ids.data());
+ alDeleteFilters(static_cast<ALsizei>(ids.size()), ids.data());
return;
}
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp
index f257da83..3697b232 100644
--- a/OpenAL32/alSource.cpp
+++ b/OpenAL32/alSource.cpp
@@ -468,7 +468,7 @@ ALsource *AllocSource(ALCcontext *context)
[](const SourceSubList &entry) -> bool
{ return entry.FreeMask != 0; }
);
- ALsizei lidx = std::distance(context->SourceList.begin(), sublist);
+ auto lidx = static_cast<ALsizei>(std::distance(context->SourceList.begin(), sublist));
ALsource *source;
ALsizei slidx;
if(LIKELY(sublist != context->SourceList.end()))
@@ -2122,7 +2122,8 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
}
);
if(alloc_end != tempids.end())
- alDeleteSources(std::distance(tempids.begin(), alloc_end), tempids.data());
+ alDeleteSources(static_cast<ALsizei>(std::distance(tempids.begin(), alloc_end)),
+ tempids.data());
else
std::copy(tempids.cbegin(), tempids.cend(), sources);
}
diff --git a/OpenAL32/event.cpp b/OpenAL32/event.cpp
index ad3fd4ab..6a3dc4bc 100644
--- a/OpenAL32/event.cpp
+++ b/OpenAL32/event.cpp
@@ -52,7 +52,8 @@ static int EventThread(ALCcontext *context)
(evt.u.srcstate.state==AL_PAUSED) ? "AL_PAUSED" :
(evt.u.srcstate.state==AL_STOPPED) ? "AL_STOPPED" : "<unknown>";
context->EventCb(AL_EVENT_TYPE_SOURCE_STATE_CHANGED_SOFT, evt.u.srcstate.id,
- evt.u.srcstate.state, msg.length(), msg.c_str(), context->EventParam
+ evt.u.srcstate.state, static_cast<ALsizei>(msg.length()), msg.c_str(),
+ context->EventParam
);
}
else if(evt.EnumType == EventType_BufferCompleted)
@@ -63,12 +64,14 @@ static int EventThread(ALCcontext *context)
if(evt.u.bufcomp.count == 1) msg += " buffer completed";
else msg += " buffers completed";
context->EventCb(AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT, evt.u.bufcomp.id,
- evt.u.bufcomp.count, msg.length(), msg.c_str(), context->EventParam
+ evt.u.bufcomp.count, static_cast<ALsizei>(msg.length()), msg.c_str(),
+ context->EventParam
);
}
else if((enabledevts&evt.EnumType) == evt.EnumType)
context->EventCb(evt.u.user.type, evt.u.user.id, evt.u.user.param,
- (ALsizei)strlen(evt.u.user.msg), evt.u.user.msg, context->EventParam
+ static_cast<ALsizei>(strlen(evt.u.user.msg)), evt.u.user.msg,
+ context->EventParam
);
} while(ll_ringbuffer_read(context->AsyncEvents, &evt, 1) != 0);
}