Skip to content

Gtk3 migration - removed functions, type conversion warnings

This is another set toward migrating to gtk3. The first commit replaces the gdk_input functions with g_io replacements. The return value of g_io_add_watch is guint, so the previous one struct member input_tag is now accompanied with event_source_id. The second commit makes input_tag a boolean. The third commit replaces gtk_timeout functions with g_timeout.

I hope the next commit is not too controversial - for writing safe code for gtk3, I would like to be able to compile the code with -Wconversion and -Wtype-limits. This is, what the next commit achieves (getting rid of all warning messages). One thing is, that there are wild conversions going on between double and float - for example because of the constants all being doubles. So I have consistently brought the whole application to only work with doubles - gtk3 and even sane backends (SANE_FIX) use those. I hope there should not be any disadvantage by that. The other thing is of course signedness. I only made a very few changes from gint gunint and in the typecasts did not change (often) the present compiler behaviour (so 64bit issues might not have changed yet). But I hope it makes in the code more clear, where conversions occur. Apologies, that this makes (trivial) changes to a lot of lines of code.

The final commit is just fixing a use after free issue that I detected with valgrind.

Merge request reports