patch 8.0.0003
Problem:    getwinvar() returns wrong Value of boolean and number options,
            especially non big endian systems. (James McCoy)
Solution:   Cast the pointer to long or int. (closes #1060)
diff --git a/src/option.c b/src/option.c
index 93e3c39..2d5f3b8 100644
--- a/src/option.c
+++ b/src/option.c
@@ -12363,8 +12363,10 @@
 	    {
 		if (opt->flags & P_STRING)
 		    dict_add_nr_str(d, opt->fullname, 0L, *(char_u **)varp);
+		else if (opt->flags & P_NUM)
+		    dict_add_nr_str(d, opt->fullname, *(long *)varp, NULL);
 		else
-		    dict_add_nr_str(d, opt->fullname, *varp, NULL);
+		    dict_add_nr_str(d, opt->fullname, *(int *)varp, NULL);
 	    }
 	}
     }