Hello community, here is the log from the commit of package libgaminggear for openSUSE:Factory checked in at 2015-08-21 07:41:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libgaminggear (Old) and /work/SRC/openSUSE:Factory/.libgaminggear.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgaminggear" Changes: -------- --- /work/SRC/openSUSE:Factory/libgaminggear/libgaminggear.changes 2015-08-05 19:14:45.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libgaminggear.new/libgaminggear.changes 2015-08-21 07:42:12.000000000 +0200 @@ -1,0 +2,12 @@ +Wed Aug 19 23:27:02 UTC 2015 - mrueck...@suse.de + +- update to 0.11.0 + - Added: Import for Roccat Swarm macro files + - Fixed: Macroeditor clipboard pasting now handles \t,\n,\r + - Software implementation of shortcuts/macros now handle multiple + events like Roccats hardware implementation +- add head.patch (d4c46c76342a9c4d5c213cf5d42f36a8f39e0e1e): + fixes compilation of the swarm config converter. patch can be + removed with the next update. + +------------------------------------------------------------------- Old: ---- libgaminggear-0.10.1.tar.bz2 New: ---- head.patch libgaminggear-0.11.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libgaminggear.spec ++++++ --- /var/tmp/diff_new_pack.oPYLzP/_old 2015-08-21 07:42:12.000000000 +0200 +++ /var/tmp/diff_new_pack.oPYLzP/_new 2015-08-21 07:42:12.000000000 +0200 @@ -18,13 +18,14 @@ %define majorversion 0 Name: libgaminggear -Version: 0.10.1 +Version: 0.11.0 Release: 0 Summary: Library for gaming input devices License: GPL-2.0 and CC-BY-3.0 Group: Development/Libraries/C and C++ Url: https://sourceforge.net/projects/libgaminggear/ Source: http://downloads.sourceforge.net/project/%{name}/%{name}-%{version}.tar.bz2 +Patch: head.patch BuildRequires: cmake >= 2.6.4 BuildRequires: doxygen BuildRequires: fdupes @@ -84,6 +85,7 @@ %prep %setup -q +%patch -p1 %build %cmake ++++++ head.patch ++++++ commit d4c46c76342a9c4d5c213cf5d42f36a8f39e0e1e Author: Stefan Achatz <erazor...@users.sourceforge.net> Date: Fri Aug 14 11:36:58 2015 +0200 Fixed compilation problems of Swarm macro converter diff --git a/libgaminggear/macros_converter_roccat_swarm.c b/libgaminggear/macros_converter_roccat_swarm.c index c2dc834..69f8fac 100644 --- a/libgaminggear/macros_converter_roccat_swarm.c +++ b/libgaminggear/macros_converter_roccat_swarm.c @@ -64,11 +64,10 @@ static void swarm_macro_set_name(SwarmMacro *macro, gchar const *new_name) { g_strlcpy((gchar *)(macro->name), new_name, SWARM_MACRO_NAME_LENGTH); } -static gboolean read32be(int fd, guint32 *value, GError **error) { - guint32 buffer; +static gboolean myread(int fd, void *buffer, size_t nbytes, GError **error) { int result; - result = read(fd, &buffer, sizeof(guint32)); + result = read(fd, buffer, nbytes); if (result == 0) { g_set_error(error, G_FILE_ERROR, G_FILE_ERROR_IO, _("Trying to read behind file boundaries")); return FALSE; @@ -76,26 +75,37 @@ static gboolean read32be(int fd, guint32 *value, GError **error) { g_set_error(error, G_FILE_ERROR, g_file_error_from_errno(errno), _("Could not read: %s"), g_strerror(errno)); return FALSE; } - - *value = GUINT32_FROM_BE(buffer); return TRUE; } -static gboolean write32be(int fd, guint32 value, GError **error) { +static gboolean read32be(int fd, guint32 *value, GError **error) { guint32 buffer; int result; - buffer = GUINT32_TO_BE(value); + result = myread(fd, &buffer, sizeof(guint32), error); + if (!result) + return FALSE; + + *value = GUINT32_FROM_BE(buffer); - result = write(fd, &buffer, sizeof(guint32)); - if (result < 0) { + return TRUE; +} + +static gboolean mywrite(int fd, void const *buffer, size_t nbytes, GError **error) { + if (write(fd, buffer, nbytes) < 0) { g_set_error(error, G_FILE_ERROR, g_file_error_from_errno(errno), _("Could not write: %s"), g_strerror(errno)); return FALSE; } - return TRUE; } +static gboolean write32be(int fd, guint32 value, GError **error) { + guint32 buffer; + buffer = GUINT32_TO_BE(value); + + return mywrite(fd, &buffer, sizeof(guint32), error); +} + static void utf16_from_be(gunichar2 *data, guint length) { guint i; @@ -165,7 +175,7 @@ gboolean macros_conversions_roccat_swarm_export(gchar const *filename, Gaminggea glong size; int fd; - fd = open(filename, O_WRONLY | O_CREAT); + fd = open(filename, O_WRONLY | O_CREAT, 0666); if (fd < 0) { g_set_error(error, G_FILE_ERROR, g_file_error_from_errno(errno), _("Could not open %2$s macro file %1$s: %3$s"), filename, "Roccat Swarm", g_strerror(errno)); return FALSE; @@ -181,7 +191,9 @@ gboolean macros_conversions_roccat_swarm_export(gchar const *filename, Gaminggea utf16_to_be(macroset_name, size); if (!write32be(fd, size * 2, error)) goto free_macrosets; - write(fd, macroset_name, size * 2); + if (!mywrite(fd, macroset_name, size * 2, error)) + goto free_macrosets; + g_free(macroset_name); macros = gaminggear_macros_get_macros(gaminggear_macros, *macroset, ¯o_count, error); @@ -202,7 +214,8 @@ gboolean macros_conversions_roccat_swarm_export(gchar const *filename, Gaminggea if (!write32be(fd, sizeof(SwarmMacro), error)) goto free_macros; - write(fd, swarm_macro, sizeof(SwarmMacro)); + if (!mywrite(fd, swarm_macro, sizeof(SwarmMacro), error)) + goto free_macros; g_free(swarm_macro); } @@ -244,7 +257,7 @@ GaminggearMacros *macros_conversions_roccat_swarm_import(gchar const *filename, for (macroset_index = 0; macroset_index < macroset_count; ++macroset_index) { if (!read32be(fd, &size, error)) goto exit; raw_macroset_name = (gunichar2 *)g_malloc(size); - read(fd, raw_macroset_name, size); + if (!myread(fd, raw_macroset_name, size, error)) goto exit; utf16_from_be(raw_macroset_name, size / 2); macroset_name = g_utf16_to_utf8(raw_macroset_name, size / 2, NULL, NULL, NULL); g_free(raw_macroset_name); @@ -256,7 +269,7 @@ GaminggearMacros *macros_conversions_roccat_swarm_import(gchar const *filename, g_warning("%u != %lu", size, sizeof(SwarmMacro)); // FIXME consequence } - read(fd, &swarm_macro, size); + if (!myread(fd, &swarm_macro, size, error)) goto exit; gaminggear_macro_keystrokes = swarm_macro_to_gaminggear_macro_keystrokes(&swarm_macro); gaminggear_macro = gaminggear_macro_new(macroset_name, (gchar const *)swarm_macro.name, gaminggear_macro_keystrokes); ++++++ libgaminggear-0.10.1.tar.bz2 -> libgaminggear-0.11.0.tar.bz2 ++++++ ++++ 3570 lines of diff (skipped)