The bitwise NOT operator is not defined on signed integers.
Thanks to Wim Taymans for finding the cause.
https://bugzilla.gnome.org/show_bug.cgi?id=711819
result = timestamp;
} else {
/* pick wraparound counter from previous timestamp and add to new timestamp */
- result = timestamp + (ext & ~(G_GINT64_CONSTANT (0xffffffff)));
+ result = timestamp + (ext & ~(G_GUINT64_CONSTANT (0xffffffff)));
/* check for timestamp wraparound */
if (result < ext)
if (diff > G_MAXINT32) {
/* timestamp went backwards more than allowed, we wrap around and get
* updated extended timestamp. */
- result += (G_GINT64_CONSTANT (1) << 32);
+ result += (G_GUINT64_CONSTANT (1) << 32);
}
}
*exttimestamp = result;