diff options
author | dundargoc <gocdundar@gmail.com> | 2023-09-29 14:58:48 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-11-05 20:19:06 +0100 |
commit | acc646ad8fc3ef11fcc63b69f3d8484e4a91accd (patch) | |
tree | 613753f19fe6f6fa45884750eb176c1517269ec2 /src/nvim/charset.c | |
parent | c513cbf361000e6f09cd5b71b718e9de3f88904d (diff) | |
download | rneovim-acc646ad8fc3ef11fcc63b69f3d8484e4a91accd.tar.gz rneovim-acc646ad8fc3ef11fcc63b69f3d8484e4a91accd.tar.bz2 rneovim-acc646ad8fc3ef11fcc63b69f3d8484e4a91accd.zip |
refactor: the long goodbye
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r-- | src/nvim/charset.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index c2722af971..eb858b8d5e 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1167,14 +1167,14 @@ long getdigits_long(char **pp, bool strict, long def) /// Gets a int32_t number from a string. /// /// @see getdigits -int32_t getdigits_int32(char **pp, bool strict, long def) +int32_t getdigits_int32(char **pp, bool strict, int32_t def) { intmax_t number = getdigits(pp, strict, def); #if SIZEOF_INTMAX_T > 4 if (strict) { assert(number >= INT32_MIN && number <= INT32_MAX); } else if (!(number >= INT32_MIN && number <= INT32_MAX)) { - return (int32_t)def; + return def; } #endif return (int32_t)number; |