comparison src/vim.h @ 33856:32bc4c71f8a6 v9.0.2138

patch 9.0.2138: Overflow logic requires long long Commit: https://github.com/vim/vim/commit/fda700cb04612fe2f9301a9ba820309175decabf Author: Ernie Rael <errael@raelity.com> Date: Thu Nov 30 18:20:00 2023 +0100 patch 9.0.2138: Overflow logic requires long long Problem: Overflow logic requires long long Solution: Define vimlong_T data type to make life easier for porters closes: #13598 Signed-off-by: Ernie Rael <errael@raelity.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 30 Nov 2023 18:30:03 +0100
parents 7d9d2404a3d4
children cb88e5c589d0
comparison
equal deleted inserted replaced
33855:8ef8da090c3b 33856:32bc4c71f8a6
432 /* 432 /*
433 * The u8char_T can hold one decoded UTF-8 character. 433 * The u8char_T can hold one decoded UTF-8 character.
434 * We use 32 bits, since some Asian characters don't fit in 16 bits. 434 * We use 32 bits, since some Asian characters don't fit in 16 bits.
435 */ 435 */
436 typedef unsigned int u8char_T; // int is 32 bits or more 436 typedef unsigned int u8char_T; // int is 32 bits or more
437
438 /*
439 * The vimlong_T has sizeof(vimlong_T) >= 2 * sizeof(int).
440 * One use is simple handling of overflow in int calculations.
441 */
442 typedef long long vimlong_T;
437 443
438 #ifndef UNIX // For Unix this is included in os_unix.h 444 #ifndef UNIX // For Unix this is included in os_unix.h
439 # include <stdio.h> 445 # include <stdio.h>
440 # include <ctype.h> 446 # include <ctype.h>
441 #endif 447 #endif