diff options
Diffstat (limited to 'src/xwidget.c')
| -rw-r--r-- | src/xwidget.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xwidget.c b/src/xwidget.c index 4ba1617d8df..5c276b1371c 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -301,13 +301,13 @@ webkit_js_to_lisp (JSContextRef context, JSValueRef value) { JSStringRef pname = JSStringCreateWithUTF8CString("length"); JSValueRef len = JSObjectGetProperty (context, (JSObjectRef) value, pname, NULL); - int n = JSValueToNumber (context, len, NULL); + EMACS_INT n = JSValueToNumber (context, len, NULL); JSStringRelease(pname); Lisp_Object obj; struct Lisp_Vector *p = allocate_vector (n); - for (int i = 0; i < n; ++i) + for (ptrdiff_t i = 0; i < n; ++i) { p->contents[i] = webkit_js_to_lisp (context, @@ -323,13 +323,13 @@ webkit_js_to_lisp (JSContextRef context, JSValueRef value) JSPropertyNameArrayRef properties = JSObjectCopyPropertyNames (context, (JSObjectRef) value); - int n = JSPropertyNameArrayGetCount (properties); + ptrdiff_t n = JSPropertyNameArrayGetCount (properties); Lisp_Object obj; /* TODO: can we use a regular list here? */ struct Lisp_Vector *p = allocate_vector (n); - for (int i = 0; i < n; ++i) + for (ptrdiff_t i = 0; i < n; ++i) { JSStringRef name = JSPropertyNameArrayGetNameAtIndex (properties, i); JSValueRef property = JSObjectGetProperty (context, @@ -733,8 +733,8 @@ DEFUN ("xwidget-resize", Fxwidget_resize, Sxwidget_resize, 3, 3, 0, (Lisp_Object xwidget, Lisp_Object new_width, Lisp_Object new_height) { CHECK_XWIDGET (xwidget); - CHECK_NATNUM (new_width); - CHECK_NATNUM (new_height); + CHECK_RANGED_INTEGER (new_width, 0, INT_MAX); + CHECK_RANGED_INTEGER (new_height, 0, INT_MAX); struct xwidget *xw = XXWIDGET (xwidget); int w = XFASTINT (new_width); int h = XFASTINT (new_height); |
