mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
Use int as the standard type for boolean options.
All options are accessed by passing char_u pointers around, casting the pointer to the right pointer type for the specific option, and then dereferencing that pointer. This dance works fine on little-endian systems when some bool options are int types (as in Vim) and some are bool types (as would make more sense), but on big-endian systems *(int *)varp when varp is pointing to a bool will read random memory. Therefore, all boolean options must remain a consistent type and int is currently the easiest to choose.
This commit is contained in:
@@ -488,7 +488,7 @@ struct file_buffer {
|
||||
bool file_id_valid;
|
||||
FileID file_id;
|
||||
|
||||
bool b_changed; /* 'modified': Set to true if something in the
|
||||
int b_changed; /* 'modified': Set to true if something in the
|
||||
file has been changed and not written out. */
|
||||
int b_changedtick; /* incremented for each change, also for undo */
|
||||
|
||||
@@ -655,7 +655,7 @@ struct file_buffer {
|
||||
long b_p_sts; ///< 'softtabstop'
|
||||
long b_p_sts_nopaste; ///< b_p_sts saved for paste mode
|
||||
char_u *b_p_sua; ///< 'suffixesadd'
|
||||
bool b_p_swf; ///< 'swapfile'
|
||||
int b_p_swf; ///< 'swapfile'
|
||||
long b_p_smc; ///< 'synmaxcol'
|
||||
char_u *b_p_syn; ///< 'syntax'
|
||||
long b_p_ts; ///< 'tabstop'
|
||||
|
Reference in New Issue
Block a user