python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / dwb / patches / dwb-isnan.patch
blob6d0611100b6a377656467538cf0030e6fe0cacf7
1 diff --git src/scripts.c src/scripts.c
2 index 16784fc..71efc50 100644
3 --- src/scripts.c
4 +++ src/scripts.c
5 @@ -3231,16 +3231,17 @@ sutil_checksum(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, s
6 if (original == NULL)
7 return NIL;
9 + double dtype;
10 GChecksumType type = G_CHECKSUM_SHA256;
11 if (argc > 1)
13 - type = JSValueToNumber(ctx, argv[1], exc);
14 - if (isnan(type))
15 + dtype = JSValueToNumber(ctx, argv[1], exc);
16 + if (isnan(dtype))
18 ret = NIL;
19 goto error_out;
21 - type = MIN(MAX(type, G_CHECKSUM_MD5), G_CHECKSUM_SHA256);
22 + type = MIN(MAX((GChecksumType)dtype, G_CHECKSUM_MD5), G_CHECKSUM_SHA256);
24 checksum = g_compute_checksum_for_data(type, original, -1);
26 @@ -6247,11 +6248,14 @@ gobject_unblock_signal(JSContextRef ctx, JSObjectRef function, JSObjectRef this,
27 static JSValueRef
28 gobject_disconnect(JSContextRef ctx, JSObjectRef function, JSObjectRef this, size_t argc, const JSValueRef argv[], JSValueRef* exc)
30 - int id;
31 - if (argc > 0 && JSValueIsNumber(ctx, argv[0]) && !isnan(id = JSValueToNumber(ctx, argv[0], exc)))
32 + if (argc == 0) {
33 + return JSValueMakeBoolean(ctx, false);
34 + }
35 + double id = JSValueToNumber(ctx, argv[0], exc);
36 + if (!isnan(id))
38 GObject *o = JSObjectGetPrivate(this);
39 - if (o != NULL && g_signal_handler_is_connected(o, id))
40 + if (o != NULL && g_signal_handler_is_connected(o, (int)id))
42 sigdata_remove(id, o);
43 g_signal_handler_disconnect(o, id);