From 61199ac4f899e68a4721b03c013887bbad693b10 Mon Sep 17 00:00:00 2001 From: Alexander Koenig Date: Thu, 12 May 2016 21:31:15 +0200 Subject: [PATCH] Fix several compiler warnings and build issues detected with Fedora 24 builds. --- src/main.cc | 5 +++-- src/tX_audiodevice.cc | 6 +++--- src/tX_dialog.cc | 4 ++-- src/tX_mastergui.cc | 2 +- src/tX_mouse.cc | 9 +++++---- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main.cc b/src/main.cc index 8e79959..55d5cac 100644 --- a/src/main.cc +++ b/src/main.cc @@ -255,7 +255,7 @@ int main(int argc, char **argv) if (globals.show_nag) { while (!timesup) { - while (gtk_events_pending()) gtk_main_iteration(); + while (gtk_events_pending()) { gtk_main_iteration(); } gdk_flush(); usleep(250); } @@ -268,7 +268,8 @@ int main(int argc, char **argv) display_mastergui(); if (globals.startup_set) { - while (gtk_events_pending()) gtk_main_iteration(); gdk_flush(); + while (gtk_events_pending()) { gtk_main_iteration(); } + gdk_flush(); tX_cursor::set_cursor(tX_cursor::WAIT_CURSOR); load_tt_part(globals.startup_set); tX_cursor::reset_cursor(); diff --git a/src/tX_audiodevice.cc b/src/tX_audiodevice.cc index f80e464..b21580a 100644 --- a/src/tX_audiodevice.cc +++ b/src/tX_audiodevice.cc @@ -367,11 +367,11 @@ int tX_audiodevice_pulse :: open() pa_buffer_attr attr = { - .maxlength = -1, + .maxlength = (uint32_t) -1, .tlength = 2048, .prebuf = 1, - .minreq = -1, - .fragsize = -1 + .minreq = (uint32_t) -1, + .fragsize = (uint32_t) -1 }; attr.minreq = attr.tlength / 4; diff --git a/src/tX_dialog.cc b/src/tX_dialog.cc index 136a153..8e105e5 100644 --- a/src/tX_dialog.cc +++ b/src/tX_dialog.cc @@ -526,7 +526,7 @@ void show_about(int nag) gtk_box_pack_start(GTK_BOX(box), iwid, WID_FIX); gtk_box_pack_start(GTK_BOX(box), box2, WID_FIX); - label=gtk_label_new(PACKAGE" release "VERSION); + label=gtk_label_new(PACKAGE " release " VERSION); gtk_box_pack_start(GTK_BOX(box2), label, WID_DYN); gtk_widget_set_halign(label, GTK_ALIGN_START); gtk_widget_show(label); @@ -549,7 +549,7 @@ void show_about(int nag) sep=gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); add_about_wid_fix(sep); - label=gtk_label_new("This is "PACKAGE" release "VERSION".\nCopyright (C) 1999-2016 by Alexander König "); + label=gtk_label_new("This is " PACKAGE " release " VERSION ".\nCopyright (C) 1999-2016 by Alexander König "); gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER); add_about_wid_fix(label); diff --git a/src/tX_mastergui.cc b/src/tX_mastergui.cc index ad8f1b2..0fe171e 100644 --- a/src/tX_mastergui.cc +++ b/src/tX_mastergui.cc @@ -1535,7 +1535,7 @@ void create_mastergui(int x, int y) add_sep2(); - dummy=gtk_label_new("v"VERSION); + dummy=gtk_label_new("v" VERSION); gtk_widget_set_halign(dummy, GTK_ALIGN_END); gtk_box_pack_end(GTK_BOX(status_box), dummy, WID_FIX); gtk_widget_show(dummy); diff --git a/src/tX_mouse.cc b/src/tX_mouse.cc index c99b84b..e595392 100644 --- a/src/tX_mouse.cc +++ b/src/tX_mouse.cc @@ -39,6 +39,7 @@ #include "tX_vtt.h" #include #include +#include #define TX_MOUSE_SPEED_NORMAL 0.05 #define TX_MOUSE_SPEED_WARP 250000 @@ -226,13 +227,13 @@ void tx_mouse::motion_notify(GtkWidget *widget, GdkEventMotion *eventMotion) { gdouble d_y = eventMotion->y_root - y_abs; if ((d_x != 0.0) || (d_y != 0.0)) { - gdouble xnow, ynow; + //gdouble xnow, ynow; //gdk_device_get_position_double(pointer, NULL, &xnow, &ynow); //printf("%lf -> %lf, %lf -> %lf\n", eventMotion->x_root, xnow, eventMotion->y_root, ynow); gdk_device_warp(pointer, screen, x_abs, y_abs); if (warp_override) { - f_prec value=(abs(d_x)>abs(d_y)) ? d_x : d_y; + f_prec value=(fabs(d_x)>fabs(d_y)) ? d_x : d_y; vtt->sp_speed.handle_mouse_input(value*globals.mouse_speed*warp); } else { vtt->xy_input((f_prec) d_x*warp, (f_prec) d_y*warp); @@ -249,7 +250,7 @@ void tx_mouse::linux_input(tx_input_event *event) { gdouble d_y = event->y_motion; if (warp_override) { - f_prec value=(abs(d_x)>abs(d_y)) ? d_x : d_y; + f_prec value=(fabs(d_x)>fabs(d_y)) ? d_x : d_y; vtt->sp_speed.handle_mouse_input(value*globals.mouse_speed*warp); } else { vtt->xy_input((f_prec) d_x*warp, (f_prec) d_y*warp); @@ -406,7 +407,7 @@ gboolean tx_mouse::linux_input_wrap(GIOChannel *source, GIOCondition condition, sum.x_motion = 0; sum.y_motion = 0; - for (int i = 0; i < bytes_read / sizeof(tx_input_event); i++) { + for (ssize_t i = 0; i < bytes_read / ((ssize_t) sizeof(tx_input_event)); i++) { sum.x_motion += eventbuffer[i].x_motion; sum.y_motion += eventbuffer[i].y_motion; } -- 2.25.4