refactor: remove unused local variable in looper commands
Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
13
src/looper.c
13
src/looper.c
@@ -433,10 +433,9 @@ void looper_process_commands(jack_client_t *client) {
|
|||||||
switch (cmd.type) {
|
switch (cmd.type) {
|
||||||
case CMD_ADD_CHANNEL: {
|
case CMD_ADD_CHANNEL: {
|
||||||
int cap = atomic_load(&channel_capacity);
|
int cap = atomic_load(&channel_capacity);
|
||||||
struct channel_t *cur = get_channels_array();
|
|
||||||
int idx;
|
int idx;
|
||||||
for (idx = 0; idx < cap; idx++)
|
for (idx = 0; idx < cap; idx++)
|
||||||
if (!atomic_load(&cur[idx].active))
|
if (!atomic_load(&(get_channels_array()[idx].active)))
|
||||||
break;
|
break;
|
||||||
if (idx == cap) {
|
if (idx == cap) {
|
||||||
if (ensure_capacity(client, idx) != 0)
|
if (ensure_capacity(client, idx) != 0)
|
||||||
@@ -447,10 +446,9 @@ void looper_process_commands(jack_client_t *client) {
|
|||||||
}
|
}
|
||||||
case CMD_ADD_MIDI_CHANNEL: {
|
case CMD_ADD_MIDI_CHANNEL: {
|
||||||
int cap = atomic_load(&channel_capacity);
|
int cap = atomic_load(&channel_capacity);
|
||||||
struct channel_t *cur = get_channels_array();
|
|
||||||
int idx;
|
int idx;
|
||||||
for (idx = 0; idx < cap; idx++)
|
for (idx = 0; idx < cap; idx++)
|
||||||
if (!atomic_load(&cur[idx].active))
|
if (!atomic_load(&(get_channels_array()[idx].active)))
|
||||||
break;
|
break;
|
||||||
if (idx == cap) {
|
if (idx == cap) {
|
||||||
if (ensure_capacity(client, idx) != 0)
|
if (ensure_capacity(client, idx) != 0)
|
||||||
@@ -461,10 +459,9 @@ void looper_process_commands(jack_client_t *client) {
|
|||||||
}
|
}
|
||||||
case CMD_REMOVE_CHANNEL: {
|
case CMD_REMOVE_CHANNEL: {
|
||||||
int cap = atomic_load(&channel_capacity);
|
int cap = atomic_load(&channel_capacity);
|
||||||
struct channel_t *cur = get_channels_array();
|
|
||||||
int remove_idx = -1;
|
int remove_idx = -1;
|
||||||
for (int idx = 1; idx < cap; idx++)
|
for (int idx = 1; idx < cap; idx++)
|
||||||
if (atomic_load(&cur[idx].active))
|
if (atomic_load(&(get_channels_array()[idx].active)))
|
||||||
remove_idx = idx;
|
remove_idx = idx;
|
||||||
if (remove_idx != -1) {
|
if (remove_idx != -1) {
|
||||||
channel_remove(client, remove_idx);
|
channel_remove(client, remove_idx);
|
||||||
@@ -475,7 +472,6 @@ void looper_process_commands(jack_client_t *client) {
|
|||||||
}
|
}
|
||||||
case CMD_ADD_SCENE: {
|
case CMD_ADD_SCENE: {
|
||||||
int cap = atomic_load(&channel_capacity);
|
int cap = atomic_load(&channel_capacity);
|
||||||
struct channel_t *cur = get_channels_array();
|
|
||||||
int bind = atomic_load(&bind_channel);
|
int bind = atomic_load(&bind_channel);
|
||||||
int ch = bind;
|
int ch = bind;
|
||||||
if (ch < cap) {
|
if (ch < cap) {
|
||||||
@@ -485,7 +481,6 @@ void looper_process_commands(jack_client_t *client) {
|
|||||||
}
|
}
|
||||||
case CMD_REMOVE_SCENE: {
|
case CMD_REMOVE_SCENE: {
|
||||||
int cap = atomic_load(&channel_capacity);
|
int cap = atomic_load(&channel_capacity);
|
||||||
struct channel_t *cur = get_channels_array();
|
|
||||||
int bind = atomic_load(&bind_channel);
|
int bind = atomic_load(&bind_channel);
|
||||||
int ch = bind;
|
int ch = bind;
|
||||||
if (ch < cap) {
|
if (ch < cap) {
|
||||||
@@ -495,7 +490,6 @@ void looper_process_commands(jack_client_t *client) {
|
|||||||
}
|
}
|
||||||
case CMD_NEXT_SCENE: {
|
case CMD_NEXT_SCENE: {
|
||||||
int cap = atomic_load(&channel_capacity);
|
int cap = atomic_load(&channel_capacity);
|
||||||
struct channel_t *cur = get_channels_array();
|
|
||||||
int bind = atomic_load(&bind_channel);
|
int bind = atomic_load(&bind_channel);
|
||||||
int ch = bind;
|
int ch = bind;
|
||||||
if (ch < cap) {
|
if (ch < cap) {
|
||||||
@@ -505,7 +499,6 @@ void looper_process_commands(jack_client_t *client) {
|
|||||||
}
|
}
|
||||||
case CMD_PREV_SCENE: {
|
case CMD_PREV_SCENE: {
|
||||||
int cap = atomic_load(&channel_capacity);
|
int cap = atomic_load(&channel_capacity);
|
||||||
struct channel_t *cur = get_channels_array();
|
|
||||||
int bind = atomic_load(&bind_channel);
|
int bind = atomic_load(&bind_channel);
|
||||||
int ch = bind;
|
int ch = bind;
|
||||||
if (ch < cap) {
|
if (ch < cap) {
|
||||||
|
|||||||
Reference in New Issue
Block a user