diff options
author | IOhannes m zmölnig <zmoelnig@umlautQ.umlaeute.mur.at> | 2017-08-16 20:26:21 +0200 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@umlautQ.umlaeute.mur.at> | 2017-08-16 20:26:21 +0200 |
commit | 5a088b89e9cce5dce3daf2aca5e8c2ed3dd59fff (patch) | |
tree | c96bbe186ef9ddf978e11d66ee4da90f9bf3d9e9 /snd-motif.c | |
parent | e56861860a027030bb6d8386ba25f95a057bccdd (diff) |
New upstream version 17.5
Diffstat (limited to 'snd-motif.c')
-rw-r--r-- | snd-motif.c | 89 |
1 files changed, 47 insertions, 42 deletions
diff --git a/snd-motif.c b/snd-motif.c index 2ceefb8..503c913 100644 --- a/snd-motif.c +++ b/snd-motif.c @@ -5984,9 +5984,9 @@ static void get_fft_window_data(void) mus_make_fft_window_with_window(fft_window(ss), GRAPH_SIZE, fft_window_beta(ss) * fft_beta_max(fft_window(ss)), fft_window_alpha(ss), graph_data); - memset((void *)graph_fftr, 0, GRAPH_SIZE * 2 * sizeof(mus_float_t)); - memset((void *)graph_ffti, 0, GRAPH_SIZE * 2 * sizeof(mus_float_t)); - memcpy((void *)graph_fftr, (void *)graph_data, GRAPH_SIZE * sizeof(mus_float_t)); + clear_floats(graph_fftr, GRAPH_SIZE * 2); + clear_floats(graph_ffti, GRAPH_SIZE * 2); + copy_floats(graph_fftr, graph_data, GRAPH_SIZE); mus_spectrum(graph_fftr, graph_ffti, NULL, GRAPH_SIZE * 2, MUS_SPECTRUM_IN_DB); for (i = 0; i < GRAPH_SIZE; i++) graph_fftr[i] = (graph_fftr[i] + 80.0) / 80.0; /* min dB here is -80 */ @@ -6572,14 +6572,14 @@ void set_fft_with_phases(bool val) static void alpha_drag_callback(Widget w, XtPointer context, XtPointer info) { - char alpha_number_buffer[11]; + char alpha_number_buffer[512]; /* 11 before gcc 7.1 */ mus_float_t alpha; alpha = (((XmScrollBarCallbackStruct *)info)->value) / 90.0; in_set_fft_window_alpha(alpha); chans_field(FCP_ALPHA, alpha); - snprintf(alpha_number_buffer, 11, "alpha:%.3f", alpha); + snprintf(alpha_number_buffer, 512, "alpha:%.3f", alpha); set_label(alpha_number, alpha_number_buffer); if (fft_window_alpha_in_use(fft_window(ss))) @@ -6593,9 +6593,9 @@ static void alpha_drag_callback(Widget w, XtPointer context, XtPointer info) static void set_alpha_scale(mus_float_t val) { - char alpha_number_buffer[11]; + char alpha_number_buffer[512]; XtVaSetValues(alpha_scale, XmNvalue, (int)(val * 90), NULL); - snprintf(alpha_number_buffer, 11, "alpha:%.3f", val); + snprintf(alpha_number_buffer, 512, "alpha:%.3f", val); set_label(alpha_number, alpha_number_buffer); } @@ -7736,7 +7736,7 @@ void reflect_regions_in_region_browser(void) { if (rsp) { - int i; + unsigned int i; rsp->active = true; if (rsp->chans) for (i = 0; i < rsp->nchans; i++) @@ -7749,7 +7749,7 @@ void reflect_no_regions_in_region_browser(void) { if (rsp) { - int i; + unsigned int i; rsp->active = false; if (rsp->chans) for (i = 0; i < rsp->nchans; i++) @@ -11305,7 +11305,7 @@ static void make_auto_comment(save_as_dialog_info *sd) fd->saved_comment = NULL; } - for (i = 0; i < sp->nchans; i++) + for (i = 0; i < (int)sp->nchans; i++) if (sp->chans[i]->edit_ctr != 0) { edits = true; @@ -11333,7 +11333,7 @@ static void make_auto_comment(save_as_dialog_info *sd) mus_strlen(original_sound_comment); edit_strs = (char **)malloc(sp->nchans * sizeof(char *)); - for (i = 0; i < sp->nchans; i++) + for (i = 0; i < (int)sp->nchans; i++) { edit_strs[i] = edit_list_to_function(sp->chans[i], 1, sp->chans[i]->edit_ctr); len += mus_strlen(edit_strs[i]); @@ -11346,7 +11346,7 @@ static void make_auto_comment(save_as_dialog_info *sd) snd_local_time(), sp->filename); - for (i = 0; i < sp->nchans; i++) + for (i = 0; i < (int)sp->nchans; i++) { if (sp->nchans > 1) { @@ -22162,7 +22162,7 @@ static void full_dur_callback(Widget w, XtPointer info, XtPointer context) sp = any_selected_sound(); if (sp) { - int i; + unsigned int i; for (i = 0; i < sp->nchans; i++) set_x_axis_x0x1(sp->chans[i], 0.0, sp->chans[i]->axis->xmax); } @@ -22175,7 +22175,7 @@ static void zoom_out_callback(Widget w, XtPointer info, XtPointer context) sp = any_selected_sound(); if (sp) { - int i; + unsigned int i; for (i = 0; i < sp->nchans; i++) zx_incremented(sp->chans[i], 2.0); } @@ -22188,7 +22188,7 @@ static void zoom_in_callback(Widget w, XtPointer info, XtPointer context) sp = any_selected_sound(); if (sp) { - int i; + unsigned int i; for (i = 0; i < sp->nchans; i++) zx_incremented(sp->chans[i], 0.5); } @@ -22201,7 +22201,7 @@ static void goto_start_callback(Widget w, XtPointer info, XtPointer context) sp = any_selected_sound(); if (sp) { - int i; + unsigned int i; for (i = 0; i < sp->nchans; i++) set_x_axis_x0x1(sp->chans[i], 0.0, sp->chans[i]->axis->x1 - sp->chans[i]->axis->x0); } @@ -22213,7 +22213,7 @@ static void go_back_callback(Widget w, XtPointer info, XtPointer context) sp = any_selected_sound(); if (sp) { - int i; + unsigned int i; for (i = 0; i < sp->nchans; i++) sx_incremented(sp->chans[i], -1.0); } @@ -22226,7 +22226,7 @@ static void go_forward_callback(Widget w, XtPointer info, XtPointer context) sp = any_selected_sound(); if (sp) { - int i; + unsigned int i; for (i = 0; i < sp->nchans; i++) sx_incremented(sp->chans[i], 1.0); } @@ -22238,7 +22238,7 @@ static void goto_end_callback(Widget w, XtPointer info, XtPointer context) sp = any_selected_sound(); if (sp) { - int i; + unsigned int i; for (i = 0; i < sp->nchans; i++) set_x_axis_x0x1(sp->chans[i], sp->chans[i]->axis->xmax - sp->chans[i]->axis->x1 + sp->chans[i]->axis->x0, sp->chans[i]->axis->xmax); } @@ -24732,7 +24732,7 @@ static void make_listener_widget(int height) XtVaSetValues(main_shell(ss), XmNallowShellResize, false, NULL); XtManageChild(listener_text); - XmTextSetCursorPosition(listener_text, 1); + XmTextSetCursorPosition(listener_text, ss->listener_prompt_length); if (!transTable4) transTable4 = XtParseTranslationTable(TextTrans4); XtOverrideTranslations(listener_text, transTable4); @@ -25551,7 +25551,8 @@ static void remake_edit_history(Widget lst, chan_info *cp, int from_graph) if (sp->channel_style != CHANNELS_SEPARATE) { chan_info *ncp; - int k, all_eds = 0, ed, filelen; + unsigned int k; + int all_eds = 0, ed, filelen; char *title; for (k = 0; k < sp->nchans; k++) @@ -26338,7 +26339,7 @@ void change_channel_style(snd_info *sp, channel_style_t new_style) if (new_style != old_style) { - int i, height; + unsigned int i, height; #if WITH_RELATIVE_PANES if ((new_style == CHANNELS_SEPARATE) || (old_style == CHANNELS_SEPARATE)) @@ -26382,7 +26383,7 @@ void change_channel_style(snd_info *sp, channel_style_t new_style) for (i = 0; i < sp->nchans; i++) { - if (i != selected_cp->chan) + if ((int)i != selected_cp->chan) { chan_info *ncp; ncp = sp->chans[i]; @@ -26411,7 +26412,7 @@ void change_channel_style(snd_info *sp, channel_style_t new_style) for (i = 0; i < sp->nchans; i++) { - if (i != selected_cp->chan) + if ((int)i != selected_cp->chan) set_axes(sp->chans[i], ap->x0, ap->x1, ap->y0, ap->y1); if (i > 0) cleanup_cw(sp->chans[i]); @@ -27811,7 +27812,7 @@ static void watch_sash(Widget w, XtPointer closure, XtPointer info) inner_sizes[outer_ctr] = (Dimension *)calloc(sp->nchans, sizeof(Dimension)); XtVaGetValues(child, XmNheight, &(outer_sizes[outer_ctr]), NULL); - for (k = 0; k < sp->nchans; k++) + for (k = 0; k < (int)sp->nchans; k++) XtVaGetValues(channel_main_pane(sp->chans[k]), XmNheight, &(inner_sizes[outer_ctr][k]), NULL); outer_ctr++; @@ -27840,23 +27841,23 @@ static void watch_sash(Widget w, XtPointer closure, XtPointer info) XtVaGetValues(SND_PANE(sp), XmNheight, &cur_outer_size, NULL); if ((cur_outer_size > 40) && - (abs(cur_outer_size - outer_sizes[outer_ctr]) > (sp->nchans * 2))) + (abs(cur_outer_size - outer_sizes[outer_ctr]) > (int)(sp->nchans * 2))) { /* this pane has multiple chans and its size has changed enough to matter */ Dimension total_inner = 0, diff; float ratio; - for (k = 0; k < sp->nchans; k++) + for (k = 0; k < (int)sp->nchans; k++) total_inner += inner_sizes[outer_ctr][k]; diff = outer_sizes[outer_ctr] - total_inner; /* this is non-channel stuff */ - for (k = 0; k < sp->nchans; k++) + for (k = 0; k < (int)sp->nchans; k++) XtUnmanageChild(channel_main_pane(sp->chans[k])); ratio = (float)(cur_outer_size - diff) / (float)(outer_sizes[outer_ctr] - diff); if (ratio > 0.0) { - for (k = 0; k < sp->nchans; k++) + for (k = 0; k < (int)sp->nchans; k++) { int size; size = (int)(ratio * inner_sizes[outer_ctr][k]); @@ -27865,9 +27866,9 @@ static void watch_sash(Widget w, XtPointer closure, XtPointer info) XmNpaneMaximum, size + 1, NULL); } - for (k = 0; k < sp->nchans; k++) + for (k = 0; k < (int)sp->nchans; k++) XtManageChild(channel_main_pane(sp->chans[k])); - for (k = 0; k < sp->nchans; k++) + for (k = 0; k < (int)sp->nchans; k++) XtVaSetValues(channel_main_pane(sp->chans[k]), XmNpaneMinimum, 1, XmNpaneMaximum, LOTSA_PIXELS, @@ -28446,7 +28447,7 @@ snd_info *add_sound_window(char *filename, read_only_t read_only, file_info *hdr LOCK_OR_BOMB(sp) = XtCreateManagedWidget("", xmLabelWidgetClass, NAME_BOX(sp), args, n); { - int i; + unsigned int i; Widget left_widget; left_widget = LOCK_OR_BOMB(sp); @@ -29974,7 +29975,6 @@ static Widget *iconify_active_dialogs = NULL; static void minify_maxify_window(Widget w, XtPointer context, XEvent *event, Boolean *cont) { XMapEvent *ev = (XMapEvent *)event; - int i; if ((!ss) || (!(ss->dialogs))) return; @@ -30004,7 +30004,7 @@ static void minify_maxify_window(Widget w, XtPointer context, XEvent *event, Boo { Atom _NET_WM_STATE, _NET_WM_STATE_HIDDEN, actual_type; int actual_format; - unsigned long i, nitems, bytes_after; + unsigned long nitems, bytes_after; unsigned char *prop = NULL; /* this code thanks to Tito Latini */ @@ -30017,6 +30017,7 @@ static void minify_maxify_window(Widget w, XtPointer context, XEvent *event, Boo { Atom *atoms = (Atom *)prop; bool iconified = false; + unsigned long i; for (i = 0; i < nitems; i++) { if (atoms[i] == _NET_WM_STATE_HIDDEN) @@ -30031,14 +30032,17 @@ static void minify_maxify_window(Widget w, XtPointer context, XEvent *event, Boo if (iconify_active_dialogs) free(iconify_active_dialogs); iconify_active_dialogs = (Widget *)calloc(ss->num_dialogs, sizeof(Widget)); - - for (i = 0; i < ss->num_dialogs; i++) - if (ss->dialogs[i]) - { - if (XtIsManaged(ss->dialogs[i])) - iconify_active_dialogs[i] = ss->dialogs[i]; - XtUnmanageChild(ss->dialogs[i]); - } + + { + int i; + for (i = 0; i < ss->num_dialogs; i++) + if (ss->dialogs[i]) + { + if (XtIsManaged(ss->dialogs[i])) + iconify_active_dialogs[i] = ss->dialogs[i]; + XtUnmanageChild(ss->dialogs[i]); + } + } } else { @@ -30046,6 +30050,7 @@ static void minify_maxify_window(Widget w, XtPointer context, XEvent *event, Boo { if (iconify_active_dialogs) { + int i; for (i = 0; i < ss->num_dialogs; i++) if (iconify_active_dialogs[i]) XtManageChild(iconify_active_dialogs[i]); |