aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-31 17:59:41 -0400
committerDavid Robillard <d@drobilla.net>2016-07-31 17:59:41 -0400
commitefb1e1aaf0441cbd3fec165e3cc53dff6f8ff9de (patch)
tree692e65f4338c56c6edddeffef4221e4861f6bfa7 /src
parente9881593d569f5838cb7897c6fff76ce7406c794 (diff)
downloadjalv-efb1e1aaf0441cbd3fec165e3cc53dff6f8ff9de.tar.gz
jalv-efb1e1aaf0441cbd3fec165e3cc53dff6f8ff9de.tar.bz2
jalv-efb1e1aaf0441cbd3fec165e3cc53dff6f8ff9de.zip
Fix compilation with C++
Diffstat (limited to 'src')
-rw-r--r--src/control.c2
-rw-r--r--src/jalv.c30
-rw-r--r--src/jalv_console.c6
-rw-r--r--src/jalv_gtk.c16
-rw-r--r--src/lv2_evbuf.c2
-rw-r--r--src/zix/common.h2
6 files changed, 30 insertions, 28 deletions
diff --git a/src/control.c b/src/control.c
index 573836a..3a0a0a0 100644
--- a/src/control.c
+++ b/src/control.c
@@ -115,7 +115,7 @@ new_property_control(Jalv* jalv, const LilvNode* property)
void
add_control(Controls* controls, ControlID* control)
{
- controls->controls = realloc(
+ controls->controls = (ControlID**)realloc(
controls->controls, (controls->n_controls + 1) * sizeof(ControlID*));
controls->controls[controls->n_controls++] = control;
}
diff --git a/src/jalv.c b/src/jalv.c
index f0f335e..d745c33 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -300,9 +300,9 @@ static void
jalv_allocate_port_buffers(Jalv* jalv)
{
for (uint32_t i = 0; i < jalv->num_ports; ++i) {
- struct Port* const port = &jalv->ports[i];
+ struct Port* const port = &jalv->ports[i];
switch (port->type) {
- case TYPE_EVENT:
+ case TYPE_EVENT: {
lv2_evbuf_free(port->evbuf);
const size_t buf_size = (port->buf_size > 0)
? port->buf_size
@@ -316,6 +316,7 @@ jalv_allocate_port_buffers(Jalv* jalv)
lilv_node_as_string(jalv->nodes.atom_Sequence)));
lilv_instance_connect_port(
jalv->instance, i, lv2_evbuf_get_buffer(port->evbuf));
+ }
default: break;
}
}
@@ -551,9 +552,9 @@ jack_process_cb(jack_nframes_t nframes, void* data)
/* Write transport change event if applicable */
LV2_Evbuf_Iterator iter = lv2_evbuf_begin(port->evbuf);
if (xport_changed) {
- lv2_evbuf_write(
- &iter, 0, 0,
- lv2_pos->type, lv2_pos->size, LV2_ATOM_BODY(lv2_pos));
+ lv2_evbuf_write(&iter, 0, 0,
+ lv2_pos->type, lv2_pos->size,
+ (const uint8_t*)LV2_ATOM_BODY(lv2_pos));
}
if (jalv->request_update) {
@@ -561,9 +562,9 @@ jack_process_cb(jack_nframes_t nframes, void* data)
const LV2_Atom_Object get = {
{ sizeof(LV2_Atom_Object_Body), jalv->urids.atom_Object },
{ 0, jalv->urids.patch_Get } };
- lv2_evbuf_write(
- &iter, 0, 0,
- get.atom.type, get.atom.size, LV2_ATOM_BODY(&get));
+ lv2_evbuf_write(&iter, 0, 0,
+ get.atom.type, get.atom.size,
+ (const uint8_t*)LV2_ATOM_BODY(&get));
}
if (port->jack_port) {
@@ -605,7 +606,7 @@ jack_process_cb(jack_nframes_t nframes, void* data)
LV2_Evbuf_Iterator e = lv2_evbuf_end(port->evbuf);
const LV2_Atom* const atom = (const LV2_Atom*)body;
lv2_evbuf_write(&e, nframes, 0, atom->type, atom->size,
- LV2_ATOM_BODY_CONST(atom));
+ (const uint8_t*)LV2_ATOM_BODY_CONST(atom));
} else {
fprintf(stderr, "error: Unknown control change protocol %d\n",
ev.protocol);
@@ -680,7 +681,7 @@ jack_process_cb(jack_nframes_t nframes, void* data)
}
jack_ringbuffer_write(jalv->plugin_events, evbuf, sizeof(evbuf));
/* TODO: race, ensure reader handles this correctly */
- jack_ringbuffer_write(jalv->plugin_events, (void*)body, size);
+ jack_ringbuffer_write(jalv->plugin_events, (const char*)body, size);
}
}
} else if (send_ui_updates
@@ -748,7 +749,7 @@ jack_session_cb(jack_session_event_t* event, void* arg)
Jalv* const jalv = (Jalv*)arg;
#define MAX_CMD_LEN 256
- event->command_line = malloc(MAX_CMD_LEN);
+ event->command_line = (char*)malloc(MAX_CMD_LEN);
snprintf(event->command_line, MAX_CMD_LEN, "%s -u %s -l \"${SESSION_DIR}\"",
jalv->prog_name,
event->client_uuid);
@@ -925,7 +926,7 @@ jalv_update(Jalv* jalv)
void* const buf = jalv->ui_event_buf;
/* Read event body */
- jack_ringbuffer_read(jalv->plugin_events, buf, ev.size);
+ jack_ringbuffer_read(jalv->plugin_events, (char*)buf, ev.size);
if (jalv->opts.dump && ev.protocol == jalv->urids.atom_eventTransfer) {
/* Dump event in Turtle to the console */
@@ -1269,7 +1270,8 @@ main(int argc, char** argv)
if (jalv.opts.uuid) {
jalv.jack_client = jack_client_open(
jack_name,
- JackSessionID | (jalv.opts.name_exact ? JackUseExactName : 0),
+ (jack_options_t)(JackSessionID |
+ (jalv.opts.name_exact ? JackUseExactName : 0)),
NULL,
jalv.opts.uuid);
}
@@ -1340,7 +1342,7 @@ main(int argc, char** argv)
{ LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, NULL }
};
- options_feature.data = &options;
+ options_feature.data = (void*)&options;
/* Create Plugin <=> UI communication buffers */
jalv.ui_events = jack_ringbuffer_create(jalv.opts.buffer_size);
diff --git a/src/jalv_console.c b/src/jalv_console.c
index cedb13d..10bf0c1 100644
--- a/src/jalv_console.c
+++ b/src/jalv_console.c
@@ -64,7 +64,7 @@ jalv_ui_port_event(Jalv* jalv,
int
jalv_init(int* argc, char*** argv, JalvOptions* opts)
{
- opts->controls = malloc(sizeof(char*));
+ opts->controls = (char**)malloc(sizeof(char*));
opts->controls[0] = NULL;
int n_controls = 0;
@@ -99,8 +99,8 @@ jalv_init(int* argc, char*** argv, JalvOptions* opts)
fprintf(stderr, "Missing argument for -c\n");
return 1;
}
- opts->controls = realloc(opts->controls,
- (++n_controls + 1) * sizeof(char*));
+ opts->controls = (char**)realloc(
+ opts->controls, (++n_controls + 1) * sizeof(char*));
opts->controls[n_controls - 1] = (*argv)[a];
opts->controls[n_controls] = NULL;
} else if ((*argv)[a][1] == 'd') {
diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c
index 2391254..a2e9680 100644
--- a/src/jalv_gtk.c
+++ b/src/jalv_gtk.c
@@ -118,7 +118,7 @@ jalv_init(int* argc, char*** argv, JalvOptions* opts)
"JACK client name", NULL},
{ "exact-jack-name", 'x', 0, G_OPTION_ARG_NONE, &opts->name_exact,
"Exact JACK client name (exit if taken)", NULL },
- { 0, 0, 0, 0, 0, 0, 0 } };
+ { 0, 0, 0, G_OPTION_ARG_NONE, 0, 0, 0 } };
GError* error = NULL;
const int err = gtk_init_with_args(
argc, argv,
@@ -291,7 +291,7 @@ get_bank_menu(Jalv* jalv, PresetMenu* menu, const LilvNode* bank)
g_sequence_insert_sorted(menu->banks, bank_menu, menu_cmp, NULL);
return bank_menu;
}
- return g_sequence_get(i);
+ return (PresetMenu*)g_sequence_get(i);
}
static int
@@ -327,7 +327,7 @@ add_preset_to_menu(Jalv* jalv,
g_signal_connect_data(G_OBJECT(item), "activate",
G_CALLBACK(on_preset_activate),
record, on_preset_destroy,
- 0);
+ (GConnectFlags)0);
return 0;
}
@@ -353,7 +353,7 @@ rebuild_preset_menu(Jalv* jalv, GtkContainer* pset_menu)
for (GList* items = g_list_nth(gtk_container_get_children(pset_menu), 3);
items;
items = items->next) {
- gtk_container_remove(pset_menu, items->data);
+ gtk_container_remove(pset_menu, GTK_WIDGET(items->data));
}
// Load presets and build new menu
@@ -453,7 +453,7 @@ on_delete_preset_activate(GtkWidget* widget, void* ptr)
GtkWidget* dialog = gtk_dialog_new_with_buttons(
"Delete Preset?",
(GtkWindow*)jalv->window,
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
"_Cancel", GTK_RESPONSE_REJECT,
"_OK", GTK_RESPONSE_ACCEPT,
NULL);
@@ -671,7 +671,7 @@ jalv_ui_port_event(Jalv* jalv,
{
if (protocol == 0) {
control_changed(jalv,
- jalv->ports[port_index].widget,
+ (Controller*)jalv->ports[port_index].widget,
buffer_size,
jalv->forge.Float,
buffer);
@@ -998,7 +998,7 @@ add_control_row(GtkWidget* table,
gtk_table_attach(GTK_TABLE(table),
label,
0, 1, row, row + 1,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 8, 1);
+ GTK_FILL, (GtkAttachOptions)(GTK_FILL|GTK_EXPAND), 8, 1);
int control_left_attach = 1;
if (controller->spin) {
control_left_attach = 2;
@@ -1008,7 +1008,7 @@ add_control_row(GtkWidget* table,
}
gtk_table_attach(GTK_TABLE(table), controller->control,
control_left_attach, 3, row, row + 1,
- GTK_FILL | GTK_EXPAND, GTK_FILL, 2, 1);
+ (GtkAttachOptions)(GTK_FILL|GTK_EXPAND), GTK_FILL, 2, 1);
}
static int
diff --git a/src/lv2_evbuf.c b/src/lv2_evbuf.c
index e8c9b60..1144f8e 100644
--- a/src/lv2_evbuf.c
+++ b/src/lv2_evbuf.c
@@ -213,7 +213,7 @@ lv2_evbuf_get(LV2_Evbuf_Iterator iter,
*subframes = 0;
*type = aev->body.type;
*size = aev->body.size;
- *data = LV2_ATOM_BODY(&aev->body);
+ *data = (uint8_t*)LV2_ATOM_BODY(&aev->body);
break;
}
diff --git a/src/zix/common.h b/src/zix/common.h
index 2d72a57..9cd2dcd 100644
--- a/src/zix/common.h
+++ b/src/zix/common.h
@@ -59,7 +59,7 @@ typedef enum {
ZIX_STATUS_NOT_FOUND,
ZIX_STATUS_EXISTS,
ZIX_STATUS_BAD_ARG,
- ZIX_STATUS_BAD_PERMS,
+ ZIX_STATUS_BAD_PERMS
} ZixStatus;
static inline const char*