diff --git a/common/JackAudioAdapterInterface.cpp b/common/JackAudioAdapterInterface.cpp index cb589893..c4577293 100644 --- a/common/JackAudioAdapterInterface.cpp +++ b/common/JackAudioAdapterInterface.cpp @@ -46,7 +46,6 @@ namespace Jack void MeasureTable::Save(unsigned int fHostBufferSize, unsigned int fHostSampleRate, unsigned int fAdaptedSampleRate, unsigned int fAdaptedBufferSize) { - char buffer[1024]; FILE* file = fopen("JackAudioAdapter.log", "w"); int max = (fCount) % TABLE_MAX - 1; @@ -68,10 +67,8 @@ namespace Jack fprintf(file, "set xlabel \"audio cycles\"\n"); fprintf(file, "set ylabel \"frames\"\n"); fprintf(file, "plot "); - sprintf(buffer, "\"JackAudioAdapter.log\" using 2 title \"Ringbuffer error\" with lines,"); - fprintf(file, buffer); - sprintf(buffer, "\"JackAudioAdapter.log\" using 3 title \"Ringbuffer error with timing correction\" with lines"); - fprintf(file, buffer); + fprintf(file, "\"JackAudioAdapter.log\" using 2 title \"Ringbuffer error\" with lines,"); + fprintf(file, "\"JackAudioAdapter.log\" using 3 title \"Ringbuffer error with timing correction\" with lines"); fprintf(file, "\n unset multiplot\n"); fprintf(file, "set output 'AdapterTiming1.svg\n"); @@ -84,10 +81,8 @@ namespace Jack fprintf(file, "set xlabel \"audio cycles\"\n"); fprintf(file, "set ylabel \"frames\"\n"); fprintf(file, "plot "); - sprintf(buffer, "\"JackAudioAdapter.log\" using 2 title \"Consumer interrupt period\" with lines,"); - fprintf(file, buffer); - sprintf(buffer, "\"JackAudioAdapter.log\" using 3 title \"Producer interrupt period\" with lines\n"); - fprintf(file, buffer); + fprintf(file, "\"JackAudioAdapter.log\" using 2 title \"Consumer interrupt period\" with lines,"); + fprintf(file, "\"JackAudioAdapter.log\" using 3 title \"Producer interrupt period\" with lines\n"); fprintf(file, "unset multiplot\n"); fprintf(file, "unset output\n"); @@ -102,10 +97,8 @@ namespace Jack fprintf(file, "set xlabel \"audio cycles\"\n"); fprintf(file, "set ylabel \"resampling ratio\"\n"); fprintf(file, "plot "); - sprintf(buffer, "\"JackAudioAdapter.log\" using 4 title \"Ratio 1\" with lines,"); - fprintf(file, buffer); - sprintf(buffer, "\"JackAudioAdapter.log\" using 5 title \"Ratio 2\" with lines"); - fprintf(file, buffer); + fprintf(file, "\"JackAudioAdapter.log\" using 4 title \"Ratio 1\" with lines,"); + fprintf(file, "\"JackAudioAdapter.log\" using 5 title \"Ratio 2\" with lines"); fprintf(file, "\n unset multiplot\n"); fprintf(file, "set output 'AdapterTiming2.svg\n"); @@ -118,10 +111,8 @@ namespace Jack fprintf(file, "set xlabel \"audio cycles\"\n"); fprintf(file, "set ylabel \"resampling ratio\"\n"); fprintf(file, "plot "); - sprintf(buffer, "\"JackAudioAdapter.log\" using 4 title \"Ratio 1\" with lines,"); - fprintf(file, buffer); - sprintf(buffer, "\"JackAudioAdapter.log\" using 5 title \"Ratio 2\" with lines\n"); - fprintf(file, buffer); + fprintf(file, "\"JackAudioAdapter.log\" using 4 title \"Ratio 1\" with lines,"); + fprintf(file, "\"JackAudioAdapter.log\" using 5 title \"Ratio 2\" with lines\n"); fprintf(file, "unset multiplot\n"); fprintf(file, "unset output\n"); @@ -136,10 +127,8 @@ namespace Jack fprintf(file, "set xlabel \"audio cycles\"\n"); fprintf(file, "set ylabel \"frames\"\n"); fprintf(file, "plot "); - sprintf(buffer, "\"JackAudioAdapter.log\" using 6 title \"Frames position in consumer ringbuffer\" with lines,"); - fprintf(file, buffer); - sprintf(buffer, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines"); - fprintf(file, buffer); + fprintf(file, "\"JackAudioAdapter.log\" using 6 title \"Frames position in consumer ringbuffer\" with lines,"); + fprintf(file, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines"); fprintf(file, "\n unset multiplot\n"); fprintf(file, "set output 'AdapterTiming3.svg\n"); @@ -152,10 +141,8 @@ namespace Jack fprintf(file, "set xlabel \"audio cycles\"\n"); fprintf(file, "set ylabel \"frames\"\n"); fprintf(file, "plot "); - sprintf(buffer, "\"JackAudioAdapter.log\" using 6 title \"Frames position in consumer ringbuffer\" with lines,"); - fprintf(file, buffer); - sprintf(buffer, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines\n"); - fprintf(file, buffer); + fprintf(file, "\"JackAudioAdapter.log\" using 6 title \"Frames position in consumer ringbuffer\" with lines,"); + fprintf(file, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines\n"); fprintf(file, "unset multiplot\n"); fprintf(file, "unset output\n"); diff --git a/common/netjack.c b/common/netjack.c index 34c32fb9..0f059482 100644 --- a/common/netjack.c +++ b/common/netjack.c @@ -57,6 +57,7 @@ $Id: net_driver.c,v 1.17 2006/04/16 20:16:10 torbenh Exp $ #include "netjack.h" #include "netjack_packet.h" +#include "JackError.h" #define MIN(x,y) ((x)<(y) ? (x) : (y)) diff --git a/common/netjack_packet.c b/common/netjack_packet.c index 52e7c7ad..9919a85b 100644 --- a/common/netjack_packet.c +++ b/common/netjack_packet.c @@ -73,6 +73,7 @@ #endif #include "netjack_packet.h" +#include "JackError.h" #ifdef NO_JACK_ERROR #define jack_error printf diff --git a/example-clients/midi_latency_test.c b/example-clients/midi_latency_test.c index f5b274f7..1806946f 100644 --- a/example-clients/midi_latency_test.c +++ b/example-clients/midi_latency_test.c @@ -866,36 +866,36 @@ main(int argc, char **argv) printf("\nJitter Plot:\n"); for (i = 0; i < 100; i++) { if (jitter_plot[i]) { - printf("%.1f - %.1f ms: %u\n", ((float) i) / 10.0, + printf("%.1f - %.1f ms: %zu\n", ((float) i) / 10.0, ((float) (i + 1)) / 10.0, jitter_plot[i]); } } if (jitter_plot[100]) { - printf(" > 10 ms: %u\n", jitter_plot[100]); + printf(" > 10 ms: %zu\n", jitter_plot[100]); } printf("\nLatency Plot:\n"); for (i = 0; i < 100; i++) { if (latency_plot[i]) { - printf("%.1f - %.1f ms: %u\n", + printf("%.1f - %.1f ms: %zu\n", latency_plot_offset + (((float) i) / 10.0), latency_plot_offset + (((float) (i + 1)) / 10.0), latency_plot[i]); } } if (latency_plot[100]) { - printf(" > %.1f ms: %u\n", latency_plot_offset + 10.0, + printf(" > %.1f ms: %zu\n", latency_plot_offset + 10.0, latency_plot[100]); } } deactivate_client: jack_deactivate(client); - printf("\nMessages sent: %d\nMessages received: %d\n", messages_sent, + printf("\nMessages sent: %zu\nMessages received: %zu\n", messages_sent, messages_received); if (unexpected_messages) { - printf("Unexpected messages received: %d\n", unexpected_messages); + printf("Unexpected messages received: %zu\n", unexpected_messages); } if (xrun_count) { - printf("Xruns: %d\n", xrun_count); + printf("Xruns: %zu\n", xrun_count); } destroy_process_semaphore: destroy_semaphore(process_semaphore, 2); diff --git a/example-clients/server_control.cpp b/example-clients/server_control.cpp index 46efa1bc..e131c73d 100644 --- a/example-clients/server_control.cpp +++ b/example-clients/server_control.cpp @@ -53,6 +53,7 @@ static jackctl_internal_t * jackctl_server_get_internal(jackctl_server_t *server return NULL; } +#if 0 static jackctl_parameter_t * jackctl_get_parameter( const JSList * parameters_list, @@ -70,6 +71,7 @@ jackctl_get_parameter( return NULL; } +#endif static void print_value(union jackctl_parameter_value value, jackctl_param_type_t type) { diff --git a/linux/alsa/alsa_driver.c b/linux/alsa/alsa_driver.c index c185e5fb..8e588e93 100644 --- a/linux/alsa/alsa_driver.c +++ b/linux/alsa/alsa_driver.c @@ -20,6 +20,7 @@ #define __STDC_FORMAT_MACROS // For inttypes.h to work in C++ +#define _GNU_SOURCE /* for strcasestr() from string.h */ #include #include diff --git a/linux/alsarawmidi/JackALSARawMidiPort.cpp b/linux/alsarawmidi/JackALSARawMidiPort.cpp index 12ae9259..1ead4623 100644 --- a/linux/alsarawmidi/JackALSARawMidiPort.cpp +++ b/linux/alsarawmidi/JackALSARawMidiPort.cpp @@ -116,7 +116,7 @@ JackALSARawMidiPort::JackALSARawMidiPort(snd_rawmidi_info_t *info, snprintf(alias, sizeof(alias), "system:%d-%d %s %d %s", card + 1, device + 1, snd_rawmidi_info_get_name(info), subdevice + 1, alias_suffix); - snprintf(name, sizeof(name), "%s%d", name_prefix, index + 1); + snprintf(name, sizeof(name), "%s%zu", name_prefix, index + 1); this->io_mask = io_mask; return; free_params: diff --git a/tests/test.cpp b/tests/test.cpp index 232be4ea..a48a5036 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -647,7 +647,7 @@ int main (int argc, char *argv[]) &status, "inprocess", ""); if (intclient == 0 || status & JackFailure) { - printf("!!! ERROR !!! cannot load internal client \"inprocess\" intclient %d status 0x%2.0x !\n", intclient, status); + printf("!!! ERROR !!! cannot load internal client \"inprocess\" intclient 0x%llX status 0x%2.0x !\n", (unsigned long long)intclient, status); } else { Log("\"inprocess\" server internal client loaded\n"); @@ -663,7 +663,7 @@ int main (int argc, char *argv[]) if (intclient1 == intclient) { Log("jack_internal_client_handle returns correct handle\n"); } else { - printf("!!! ERROR !!! jack_internal_client_handle returns incorrect handle %d\n", intclient1); + printf("!!! ERROR !!! jack_internal_client_handle returns incorrect handle 0x%llX\n", (unsigned long long)intclient1); } // Unload internal client