aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2021-06-26 18:36:12 +0200
committercbdev <cb@cbcdn.com>2021-06-26 18:36:12 +0200
commit933ca8e600e9f481080ee42a4f77a376c7038b14 (patch)
treeafe65a411c53ee9a0cbef653fc4933920ab6efce
parentf646d10ae1c7f9df1cc91243d7166d74791b487b (diff)
downloadmidimonster-933ca8e600e9f481080ee42a4f77a376c7038b14.tar.gz
midimonster-933ca8e600e9f481080ee42a4f77a376c7038b14.tar.bz2
midimonster-933ca8e600e9f481080ee42a4f77a376c7038b14.zip
Update debug messages
-rw-r--r--core/backend.c10
-rw-r--r--midimonster.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/core/backend.c b/core/backend.c
index 8a8588f..83121bd 100644
--- a/core/backend.c
+++ b/core/backend.c
@@ -51,7 +51,7 @@ int backends_handle(size_t nfds, managed_fd* fds){
//handle if there is data ready or the backend has active instances for polling
if(n || registry.instances[u]){
- DBGPF("Notifying backend %s of %" PRIsize_t " waiting FDs\n", registry.backends[u].name, n);
+ DBGPF("Notifying backend %s of %" PRIsize_t " waiting FDs", registry.backends[u].name, n);
rv |= registry.backends[u].process(n, fds);
if(rv){
fprintf(stderr, "Backend %s failed to handle input\n", registry.backends[u].name);
@@ -85,7 +85,7 @@ 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);
+ DBGPF("Calling handler for instance %s with %" PRIsize_t " events", c[u]->instance->name, n - u);
rv |= c[u]->instance->backend->handle(c[u]->instance, n - u, c + u, v + u);
}
@@ -105,11 +105,11 @@ MM_API channel* mm_channel(instance* inst, uint64_t ident, uint8_t create){
}
if(!create){
- DBGPF("Requested unknown channel %" PRIu64 " (bucket %" PRIsize_t ") on instance %s\n", ident, bucket, inst->name);
+ DBGPF("Requested unknown channel %" PRIu64 " (bucket %" PRIsize_t ") on instance %s", ident, bucket, inst->name);
return NULL;
}
- DBGPF("Creating previously unknown channel %" PRIu64 " on instance %s, bucket %" PRIsize_t "\n", ident, inst->name, bucket);
+ DBGPF("Creating previously unknown channel %" PRIu64 " on instance %s, bucket %" PRIsize_t, ident, inst->name, bucket);
channels.entry[bucket] = realloc(channels.entry[bucket], (channels.n[bucket] + 1) * sizeof(channel*));
if(!channels.entry[bucket]){
fprintf(stderr, "Failed to allocate memory\n");
@@ -353,7 +353,7 @@ static void channels_free(){
for(u = 0; u < sizeof(channels.n) / sizeof(channels.n[0]); u++){
DBGPF("Cleaning up channel registry bucket %" PRIsize_t " with %" PRIsize_t " channels", u, channels.n[u]);
for(p = 0; p < channels.n[u]; p++){
- DBGPF("Destroying channel %" PRIu64 " on instance %s\n", channels.entry[u][p]->ident, channels.entry[u][p]->instance->name);
+ DBGPF("Destroying channel %" PRIu64 " on instance %s", channels.entry[u][p]->ident, channels.entry[u][p]->instance->name);
//call the channel_free function if the backend supports it
if(channels.entry[u][p]->impl && channels.entry[u][p]->instance->backend->channel_free){
channels.entry[u][p]->instance->backend->channel_free(channels.entry[u][p]);
diff --git a/midimonster.c b/midimonster.c
index 5817ac7..b73eeff 100644
--- a/midimonster.c
+++ b/midimonster.c
@@ -263,7 +263,7 @@ static fd_set fds_collect(int* max_fd){
*max_fd = -1;
}
- DBGPF("Building selector set from %lu FDs registered to core\n", fds);
+ DBGPF("Building selector set from %" PRIsize_t " FDs registered to core", fds);
FD_ZERO(&rv_fds);
for(u = 0; u < fds; u++){
if(fd[u].fd >= 0){
@@ -346,7 +346,7 @@ static int core_process(size_t nfds, managed_fd* signaled_fds){
size_t u, swaps = 0;
//run backend processing, collect events
- DBGPF("%lu backend FDs signaled", nfds);
+ DBGPF("%" PRIsize_t " backend FDs signaled", nfds);
if(backends_handle(nfds, signaled_fds)){
return 1;
}
@@ -354,7 +354,7 @@ static int core_process(size_t nfds, managed_fd* signaled_fds){
//limit number of collector swaps per iteration to prevent complete deadlock
while(routing.events->n && swaps < MM_SWAP_LIMIT){
//swap primary and secondary event collectors
- DBGPF("Swapping event collectors, %lu events in primary", routing.events->n);
+ DBGPF("Swapping event collectors, %" PRIsize_t " events in primary", routing.events->n);
for(u = 0; u < sizeof(routing.pool) / sizeof(routing.pool[0]); u++){
if(routing.events != routing.pool + u){
secondary = routing.events;