You should not assign `guint32` value to `VALUE`. If you want to assign to `time`, use `UINT2NUM(GDK_CURRENT_TIME)`.

But the following is recommended because it doesn't introduce needless C -> Ruby type conversion:

```c
VALUE rb_time;
guint32 time = GDK_CURRENT_TIME;

rb_scan_args(argc, argv, "01", &rb_time);
if (!NIL(rb_time)) {
  time = NUM2ULONG(rb_time);
}
```