From 636a9592eab1963c2b1a77bd59eaff317fa55b75 Mon Sep 17 00:00:00 2001 From: cbdev Date: Tue, 17 Mar 2020 01:09:52 +0100 Subject: Fix registry apply bug, fix openpixelcontrol broadcast --- backend.c | 3 +-- backends/openpixelcontrol.c | 10 +++++----- midimonster.c | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/backend.c b/backend.c index cb8bf3f..9e7989e 100644 --- a/backend.c +++ b/backend.c @@ -55,7 +55,7 @@ int backends_notify(size_t nev, channel** c, channel_value* v){ channel_value xval; channel* xchnl = NULL; - for(u = 0; u < nev && !rv; u++){ + for(u = 0; u < nev && !rv; u = n){ //sort for this instance n = u + 1; for(p = u + 1; p < nev; p++){ @@ -75,7 +75,6 @@ int backends_notify(size_t nev, channel** c, channel_value* v){ //TODO eliminate duplicates DBGPF("Calling handler for instance %s with %" PRIsize_t " events\n", c[u]->instance->name, n - u); rv |= c[u]->instance->backend->handle(c[u]->instance, n - u, c + u, v + u); - u = n; } return 0; diff --git a/backends/openpixelcontrol.c b/backends/openpixelcontrol.c index 168e077..2a5e01f 100644 --- a/backends/openpixelcontrol.c +++ b/backends/openpixelcontrol.c @@ -495,11 +495,11 @@ static ssize_t openpixel_client_headerdata(instance* inst, openpixel_client* cli } else{ client->buffer = openpixel_buffer_find(data, client->hdr.strip, 1); - } - //if no buffer or mode mismatch, ignore data - if(client->buffer < 0 - || data->mode != client->hdr.mode){ - client->buffer = -2; //mark for ignore + //if no buffer or mode mismatch, ignore data + if(client->buffer < 0 + || data->mode != client->hdr.mode){ + client->buffer = -2; //mark for ignore + } } client->left = be16toh(client->hdr.length); client->offset = 0; diff --git a/midimonster.c b/midimonster.c index afb6a2b..1691671 100644 --- a/midimonster.c +++ b/midimonster.c @@ -409,7 +409,7 @@ static int core_loop(){ #ifndef _WIN32 fprintf(stderr, "select failed: %s\n", strerror(errno)); #else - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, WSAGetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &error_message, 0, NULL); fprintf(stderr, "select failed: %s\n", error_message); LocalFree(error_message); -- cgit v1.2.3