Fix several compiler warnings and build issues detected with Fedora 24 builds.
authorAlexander Koenig <alex@lisas.de>
Thu, 12 May 2016 19:31:15 +0000 (21:31 +0200)
committerAlexander Koenig <alex@lisas.de>
Thu, 12 May 2016 19:31:15 +0000 (21:31 +0200)
src/main.cc
src/tX_audiodevice.cc
src/tX_dialog.cc
src/tX_mastergui.cc
src/tX_mouse.cc

index 8e7995916866f726de2c909ca2ffe2688a68543e..55d5cacdf0f38cad6bd7555a28ac329e4ddcf911 100644 (file)
@@ -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();
index f80e4647cbcdbd0440be1875023c116e22487727..b21580a7ac370e84eeace26ad034883da6898d88 100644 (file)
@@ -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;
index 136a153d9b09094fb8a08517054cff661cfdf4e3..8e105e585cc2b7c2f2fc50ceea97486c0958de71 100644 (file)
@@ -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 <alex@lisas.de>");
+               label=gtk_label_new("This is " PACKAGE " release " VERSION ".\nCopyright (C) 1999-2016 by Alexander König <alex@lisas.de>");
 
                gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
                add_about_wid_fix(label);
index ad8f1b21ab3ab72940461d0312326acb38ab371f..0fe171e39e8db78db407a36fd048d74447ff49eb 100644 (file)
@@ -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);
index c99b84bfe1c18cde55eaa3f18399c3557882889d..e5953922056a0fc73b3615a9dc17e12c9f4ab163 100644 (file)
@@ -39,6 +39,7 @@
 #include "tX_vtt.h"
 #include <stdlib.h>
 #include <string.h>
+#include <math.h>
 
 #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;
                }