The value for an option in struct vimoption is defined as char_u. However, long and int values are stored in memory for P_NUM and
*var;
P_BOOL values, respectively.
When get_winbuf_options attempts to retrive the value of a P_NUM option,
it simply dereferences the char_u* and passes that value through the
varnumber_T parameter of dict_add_nr_str. Now that varnumber_T is a
64-bit value, this plain dereference of the char_u pointer passes along
the high (zero) byte of the option's value.
Casting the char_u* to a long* first and then dereferencing that, as is
already done by get_option_value, passes along the value of the entire
long instead of just one byte of it.
https://github.com/vim/vim/pull/1060
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
I'll verify this later today for both P_NUM and P_BOOL options, once I get back to where I have access to big-endian systems for testing. I just wanted to get the PR up for review/comment, since I had already done some investigation when I saw Ismail's email to the list.