mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
jack: fix signed and unsigned compares
This commit is contained in:
parent
4cb36762b0
commit
a4593a0d96
2 changed files with 6 additions and 6 deletions
|
|
@ -1648,8 +1648,8 @@ jack_client_t * jack_client_open (const char *client_name,
|
||||||
pw_array_init(&client->mems, 64);
|
pw_array_init(&client->mems, 64);
|
||||||
pw_array_ensure_size(&client->mems, sizeof(struct mem) * 64);
|
pw_array_ensure_size(&client->mems, sizeof(struct mem) * 64);
|
||||||
|
|
||||||
client->buffer_size = -1;
|
client->buffer_size = (uint32_t)-1;
|
||||||
client->sample_rate = -1;
|
client->sample_rate = (uint32_t)-1;
|
||||||
|
|
||||||
spa_list_init(&client->mix[SPA_DIRECTION_INPUT]);
|
spa_list_init(&client->mix[SPA_DIRECTION_INPUT]);
|
||||||
spa_list_init(&client->mix[SPA_DIRECTION_OUTPUT]);
|
spa_list_init(&client->mix[SPA_DIRECTION_OUTPUT]);
|
||||||
|
|
@ -2068,7 +2068,7 @@ int jack_set_buffer_size (jack_client_t *client, jack_nframes_t nframes)
|
||||||
jack_nframes_t jack_get_sample_rate (jack_client_t *client)
|
jack_nframes_t jack_get_sample_rate (jack_client_t *client)
|
||||||
{
|
{
|
||||||
struct client *c = (struct client *) client;
|
struct client *c = (struct client *) client;
|
||||||
if (c->sample_rate == -1)
|
if (c->sample_rate == (uint32_t)-1)
|
||||||
return DEFAULT_SAMPLE_RATE;
|
return DEFAULT_SAMPLE_RATE;
|
||||||
return c->sample_rate;
|
return c->sample_rate;
|
||||||
}
|
}
|
||||||
|
|
@ -2076,7 +2076,7 @@ jack_nframes_t jack_get_sample_rate (jack_client_t *client)
|
||||||
jack_nframes_t jack_get_buffer_size (jack_client_t *client)
|
jack_nframes_t jack_get_buffer_size (jack_client_t *client)
|
||||||
{
|
{
|
||||||
struct client *c = (struct client *) client;
|
struct client *c = (struct client *) client;
|
||||||
if (c->buffer_size == -1)
|
if (c->buffer_size == (uint32_t)-1)
|
||||||
return DEFAULT_BUFFER_SIZE;
|
return DEFAULT_BUFFER_SIZE;
|
||||||
return c->buffer_size;
|
return c->buffer_size;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,14 @@
|
||||||
|
|
||||||
jack_ringbuffer_t *jack_ringbuffer_create(size_t sz)
|
jack_ringbuffer_t *jack_ringbuffer_create(size_t sz)
|
||||||
{
|
{
|
||||||
int power_of_two;
|
size_t power_of_two;
|
||||||
jack_ringbuffer_t *rb;
|
jack_ringbuffer_t *rb;
|
||||||
|
|
||||||
rb = calloc(1, sizeof(jack_ringbuffer_t));
|
rb = calloc(1, sizeof(jack_ringbuffer_t));
|
||||||
if (rb == NULL)
|
if (rb == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (power_of_two = 1; 1 << power_of_two < sz; power_of_two++);
|
for (power_of_two = 1; 1u << power_of_two < sz; power_of_two++);
|
||||||
|
|
||||||
rb->size = 1 << power_of_two;
|
rb->size = 1 << power_of_two;
|
||||||
rb->size_mask = rb->size - 1;
|
rb->size_mask = rb->size - 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue