diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jalv.c | 14 | ||||
-rw-r--r-- | src/jalv_gtk.c | 19 | ||||
-rw-r--r-- | src/symap.c | 6 | ||||
-rw-r--r-- | src/worker.c | 8 |
4 files changed, 24 insertions, 23 deletions
@@ -205,9 +205,9 @@ void jalv_create_ports(Jalv* jalv) { jalv->num_ports = lilv_plugin_get_num_ports(jalv->plugin); - jalv->ports = calloc((size_t)jalv->num_ports, sizeof(struct Port)); - float* default_values = calloc(lilv_plugin_get_num_ports(jalv->plugin), - sizeof(float)); + jalv->ports = (struct Port*)calloc(jalv->num_ports, sizeof(struct Port)); + float* default_values = (float*)calloc( + lilv_plugin_get_num_ports(jalv->plugin), sizeof(float)); lilv_plugin_get_port_ranges_float(jalv->plugin, NULL, NULL, default_values); for (uint32_t i = 0; i < jalv->num_ports; ++i) { @@ -814,9 +814,9 @@ main(int argc, char** argv) jalv.temp_dir = jalv_strdup("jalvXXXXXX"); _mktemp(jalv.temp_dir); #else - char* template = jalv_strdup("/tmp/jalv-XXXXXX"); - jalv.temp_dir = jalv_strjoin(mkdtemp(template), "/"); - free(template); + char* templ = jalv_strdup("/tmp/jalv-XXXXXX"); + jalv.temp_dir = jalv_strjoin(mkdtemp(templ), "/"); + free(templ); #endif LV2_State_Make_Path make_path = { &jalv, jalv_make_path }; @@ -938,7 +938,7 @@ main(int argc, char** argv) /* Truncate plugin name to suit JACK (if necessary) */ char* jack_name = NULL; if (strlen(name_str) >= (unsigned)jack_client_name_size() - 1) { - jack_name = calloc(jack_client_name_size(), 1); + jack_name = (char*)calloc(jack_client_name_size(), 1); strncpy(jack_name, name_str, jack_client_name_size() - 1); } else { jack_name = jalv_strdup(name_str); diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c index f853c46..083d96f 100644 --- a/src/jalv_gtk.c +++ b/src/jalv_gtk.c @@ -112,7 +112,7 @@ on_save_activate(GtkWidget* widget, void* ptr) Jalv* jalv = (Jalv*)ptr; GtkWidget* dialog = gtk_file_chooser_dialog_new( "Save State", - jalv->window, + (GtkWindow*)jalv->window, GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, @@ -145,7 +145,7 @@ static char* symbolify(const char* in) { const size_t len = strlen(in); - char* out = calloc(len + 1, 1); + char* out = (char*)calloc(len + 1, 1); for (size_t i = 0; i < len; ++i) { if (g_ascii_isalnum(in[i])) { out[i] = in[i]; @@ -163,7 +163,7 @@ on_save_preset_activate(GtkWidget* widget, void* ptr) GtkWidget* dialog = gtk_file_chooser_dialog_new( "Save Preset", - jalv->window, + (GtkWindow*)jalv->window, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, @@ -254,7 +254,7 @@ jalv_ui_port_event(Jalv* jalv, uint32_t protocol, const void* buffer) { - GtkWidget* widget = jalv->ports[port_index].widget; + GtkWidget* widget = (GtkWidget*)jalv->ports[port_index].widget; if (!widget) { return; } @@ -325,7 +325,7 @@ toggle_changed(GtkToggleButton* button, gpointer data) static gchar* scale_format(GtkScale* scale, gdouble value, gpointer user_data) { - gpointer hval = g_hash_table_lookup(user_data, &value); + gpointer hval = g_hash_table_lookup((GHashTable*)user_data, &value); return hval ? g_strdup(hval) : g_strdup_printf("%0.*f", gtk_scale_get_digits(scale), value); } @@ -432,9 +432,9 @@ build_control_widget(Jalv* jalv, GtkWidget* window) LilvNode* lv2_log = lilv_new_uri(jalv->world, LV2_PORT_PROPS__logarithmic); LilvNode* rdfs_comment = lilv_new_uri(jalv->world, LILV_NS_RDFS "comment"); GtkWidget* port_table = gtk_table_new(jalv->num_ports, 2, false); - float* defaults = calloc(jalv->num_ports, sizeof(float)); - float* mins = calloc(jalv->num_ports, sizeof(float)); - float* maxs = calloc(jalv->num_ports, sizeof(float)); + float* defaults = (float*)calloc(jalv->num_ports, sizeof(float)); + float* mins = (float*)calloc(jalv->num_ports, sizeof(float)); + float* maxs = (float*)calloc(jalv->num_ports, sizeof(float)); int num_controls = 0; lilv_plugin_get_port_ranges_float(jalv->plugin, mins, maxs, defaults); for (unsigned i = 0; i < jalv->num_ports; i++) { @@ -456,8 +456,9 @@ build_control_widget(Jalv* jalv, GtkWidget* window) GHashTable* points = NULL; if (sp) { points = g_hash_table_new(g_double_hash, g_double_equal); - gdouble* values = malloc(lilv_scale_points_size(sp) * sizeof(gdouble)); int idx = 0; + gdouble* values = (gdouble*)malloc( + lilv_scale_points_size(sp) * sizeof(gdouble)); LILV_FOREACH(scale_points, s, sp) { const LilvScalePoint* p = lilv_scale_points_get(sp, s); values[idx] = lilv_node_as_float(lilv_scale_point_get_value(p)); diff --git a/src/symap.c b/src/symap.c index b0b594d..a218c81 100644 --- a/src/symap.c +++ b/src/symap.c @@ -81,7 +81,7 @@ static char* symap_strdup(const char* str) { const size_t len = strlen(str); - char* copy = malloc(len + 1); + char* copy = (char*)malloc(len + 1); memcpy(copy, str, len + 1); return copy; } @@ -153,11 +153,11 @@ symap_map(Symap* map, const char* sym) char* const str = symap_strdup(sym); /* Append new symbol to symbols array */ - map->symbols = realloc(map->symbols, map->size * sizeof(str)); + map->symbols = (char**)realloc(map->symbols, map->size * sizeof(str)); map->symbols[id - 1] = str; /* Insert new index element into sorted index */ - map->index = realloc(map->index, map->size * sizeof(uint32_t)); + map->index = (uint32_t*)realloc(map->index, map->size * sizeof(uint32_t)); if (index < map->size - 1) { memmove(map->index + index + 1, map->index + index, diff --git a/src/worker.c b/src/worker.c index a055d53..d958605 100644 --- a/src/worker.c +++ b/src/worker.c @@ -24,7 +24,7 @@ jalv_worker_respond(LV2_Worker_Respond_Handle handle, Jalv* jalv = (Jalv*)handle; jack_ringbuffer_write(jalv->worker.responses, (const char*)&size, sizeof(size)); - jack_ringbuffer_write(jalv->worker.responses, data, size); + jack_ringbuffer_write(jalv->worker.responses, (const char*)data, size); return LV2_WORKER_SUCCESS; } @@ -48,7 +48,7 @@ worker_func(void* data) return NULL; } - jack_ringbuffer_read(jalv->worker.requests, buf, size); + jack_ringbuffer_read(jalv->worker.requests, (char*)buf, size); jalv->worker.iface->work( jalv->instance->lv2_handle, jalv_worker_respond, jalv, size, buf); @@ -90,7 +90,7 @@ jalv_worker_schedule(LV2_Worker_Schedule_Handle handle, Jalv* jalv = (Jalv*)handle; jack_ringbuffer_write(jalv->worker.requests, (const char*)&size, sizeof(size)); - jack_ringbuffer_write(jalv->worker.requests, data, size); + jack_ringbuffer_write(jalv->worker.requests, (const char*)data, size); zix_sem_post(&jalv->worker.sem); return LV2_WORKER_SUCCESS; } @@ -105,7 +105,7 @@ jalv_worker_emit_responses(Jalv* jalv, JalvWorker* worker) jack_ringbuffer_read(worker->responses, (char*)&size, sizeof(size)); jack_ringbuffer_read( - worker->responses, worker->response, size); + worker->responses, (char*)worker->response, size); worker->iface->work_response( jalv->instance->lv2_handle, size, worker->response); |