mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 23:48:32 +00:00

Problem: We have `P_(BOOL|NUM|STRING)` macros to represent an option's type, which is redundant because `OptValType` can already do that. The current implementation of option type flags is also too limited to allow adding multitype options in the future. Solution: Remove `P_(BOOL|NUM|STRING)` and replace it with a new `type_flags` attribute in `vimoption_T`. Also do some groundwork for adding multitype options in the future. Side-effects: Attempting to set an invalid keycode option (e.g. `set t_foo=123`) no longer gives an error.
15 lines
263 B
C
15 lines
263 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
/// Check if number is a power of two
|
|
static inline bool is_power_of_two(uint64_t x)
|
|
{
|
|
return x != 0 && ((x & (x - 1)) == 0);
|
|
}
|
|
|
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
|
# include "math.h.generated.h"
|
|
#endif
|