Fix some unsigned/signed comparisons.

This commit is contained in:
BearOso 2023-10-10 19:44:06 -05:00
parent 397cb98347
commit b8d0b8ec9e
3 changed files with 5 additions and 5 deletions

View File

@ -191,7 +191,7 @@ bool S9xPulseSoundDriver::write_samples(int16_t *data, int samples)
if (draining)
{
if (bytes > buffer_size / 2)
if (bytes > (size_t)buffer_size / 2)
{
return false;
}
@ -201,13 +201,13 @@ bool S9xPulseSoundDriver::write_samples(int16_t *data, int samples)
}
}
if (samples * 2 > bytes)
if ((size_t)samples * 2 > bytes)
{
draining = true;
return false;
}
if (samples * 2 < bytes)
if ((size_t)samples * 2 < bytes)
bytes = samples * 2;
if (bytes == 0)

View File

@ -205,7 +205,7 @@ bool Context::init_device(int preferred_device)
return device_list[0];
};
if (preferred_device > -1 && preferred_device < device_list.size())
if (preferred_device > -1 && (size_t)preferred_device < device_list.size())
physical_device = device_list[preferred_device];
else
physical_device = find_device();

View File

@ -55,7 +55,7 @@ SimpleOutput::~SimpleOutput()
void SimpleOutput::create_objects()
{
descriptors.clear();
for (size_t i = 0; i < queue_size; i++)
for (int i = 0; i < queue_size; i++)
{
vk::DescriptorSetAllocateInfo dsai{};
dsai