aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option_defs.h
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@proton.me>2023-06-20 13:09:06 +0600
committerFamiu Haque <famiuhaque@proton.me>2023-06-20 20:38:15 +0600
commit3681b7bb3bb942462c4261ab477e8912ae35b1a9 (patch)
treeeed274e4907c0fa6d9f8546830e60fa2859ceeb1 /src/nvim/option_defs.h
parentc07dceba335c56c9a356395ad0d1e5a14d416752 (diff)
downloadrneovim-3681b7bb3bb942462c4261ab477e8912ae35b1a9.tar.gz
rneovim-3681b7bb3bb942462c4261ab477e8912ae35b1a9.tar.bz2
rneovim-3681b7bb3bb942462c4261ab477e8912ae35b1a9.zip
refactor(option): use `void *` for pointer to option value
Option related code uses `char *` for pointer to option value, which is not the best way of representing a type-agnostic pointer. Solution: Make pointers to option value use `void *` instead.
Diffstat (limited to 'src/nvim/option_defs.h')
-rw-r--r--src/nvim/option_defs.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index e42654bf5d..35687a19b7 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -985,7 +985,7 @@ enum {
typedef struct {
// Pointer to the option variable. The variable can be a long (numeric
// option), an int (boolean option) or a char pointer (string option).
- char *os_varp;
+ void *os_varp;
int os_idx;
int os_flags;
@@ -1048,19 +1048,19 @@ typedef enum {
} idopt_T;
typedef struct vimoption {
- char *fullname; // full option name
- char *shortname; // permissible abbreviation
- uint32_t flags; // see above
- char *var; // global option: pointer to variable;
- // window-local option: VAR_WIN;
- // buffer-local option: global value
- idopt_T indir; // global option: PV_NONE;
- // local option: indirect option index
- // callback function to invoke after an option is modified to validate and
- // apply the new value.
+ char *fullname; // full option name
+ char *shortname; // permissible abbreviation
+ uint32_t flags; // see above
+ void *var; // global option: pointer to variable;
+ // window-local option: VAR_WIN;
+ // buffer-local option: global value
+ idopt_T indir; // global option: PV_NONE;
+ // local option: indirect option index
+ // callback function to invoke after an option is modified to validate and
+ // apply the new value.
opt_did_set_cb_T opt_did_set_cb;
- char *def_val; // default values for variable (neovim!!)
- LastSet last_set; // script in which the option was last set
+ void *def_val; // default values for variable (neovim!!)
+ LastSet last_set; // script in which the option was last set
} vimoption_T;
// The options that are local to a window or buffer have "indir" set to one of