mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
Remove sizeof(int) < 4 related code
This commit is contained in:

committed by
Thiago de Arruda

parent
0072ba9361
commit
b10341ce5b
@@ -3,11 +3,7 @@
|
|||||||
|
|
||||||
#include "hashtab.h"
|
#include "hashtab.h"
|
||||||
|
|
||||||
#if SIZEOF_INT <= 3 /* use long if int is smaller than 32 bits */
|
|
||||||
typedef long varnumber_T;
|
|
||||||
#else
|
|
||||||
typedef int varnumber_T;
|
typedef int varnumber_T;
|
||||||
#endif
|
|
||||||
typedef double float_T;
|
typedef double float_T;
|
||||||
|
|
||||||
typedef struct listvar_S list_T;
|
typedef struct listvar_S list_T;
|
||||||
|
15
src/fileio.c
15
src/fileio.c
@@ -983,24 +983,9 @@ retry:
|
|||||||
* The amount is limited by the fact that read() only can read
|
* The amount is limited by the fact that read() only can read
|
||||||
* upto max_unsigned characters (and other things).
|
* upto max_unsigned characters (and other things).
|
||||||
*/
|
*/
|
||||||
#if SIZEOF_INT <= 2
|
|
||||||
if (linerest >= 0x7ff0) {
|
|
||||||
++split;
|
|
||||||
*ptr = NL; /* split line by inserting a NL */
|
|
||||||
size = 1;
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (!skip_read) {
|
if (!skip_read) {
|
||||||
#if SIZEOF_INT > 2
|
|
||||||
# if defined(SSIZE_MAX) && (SSIZE_MAX < 0x10000L)
|
|
||||||
size = SSIZE_MAX; /* use max I/O size, 52K */
|
|
||||||
# else
|
|
||||||
size = 0x10000L; /* use buffer >= 64K */
|
size = 0x10000L; /* use buffer >= 64K */
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
size = 0x7ff0L - linerest; /* limit buffer to 32K */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (; size >= 10; size = (long)((long_u)size >> 1)) {
|
for (; size >= 10; size = (long)((long_u)size >> 1)) {
|
||||||
if ((new_buffer = lalloc((long_u)(size + linerest + 1),
|
if ((new_buffer = lalloc((long_u)(size + linerest + 1),
|
||||||
|
@@ -3351,14 +3351,10 @@ int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs)
|
|||||||
else {
|
else {
|
||||||
/* Don't put the #if inside memchr(), it can be a
|
/* Don't put the #if inside memchr(), it can be a
|
||||||
* macro. */
|
* macro. */
|
||||||
#if SIZEOF_INT <= 2
|
|
||||||
char *q = memchr(str_arg, '\0', precision);
|
|
||||||
#else
|
|
||||||
/* memchr on HP does not like n > 2^31 !!! */
|
/* memchr on HP does not like n > 2^31 !!! */
|
||||||
char *q = memchr(str_arg, '\0',
|
char *q = memchr(str_arg, '\0',
|
||||||
precision <= (size_t)0x7fffffffL ? precision
|
precision <= (size_t)0x7fffffffL ? precision
|
||||||
: (size_t)0x7fffffffL);
|
: (size_t)0x7fffffffL);
|
||||||
#endif
|
|
||||||
str_arg_l = (q == NULL) ? precision
|
str_arg_l = (q == NULL) ? precision
|
||||||
: (size_t)(q - str_arg);
|
: (size_t)(q - str_arg);
|
||||||
}
|
}
|
||||||
|
@@ -341,11 +341,7 @@
|
|||||||
|
|
||||||
/* Type used for indexes in the word tree need to be at least 4 bytes. If int
|
/* Type used for indexes in the word tree need to be at least 4 bytes. If int
|
||||||
* is 8 bytes we could use something smaller, but what? */
|
* is 8 bytes we could use something smaller, but what? */
|
||||||
#if SIZEOF_INT > 3
|
|
||||||
typedef int idx_T;
|
typedef int idx_T;
|
||||||
#else
|
|
||||||
typedef long idx_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
# define SPL_FNAME_TMPL "%s.%s.spl"
|
# define SPL_FNAME_TMPL "%s.%s.spl"
|
||||||
# define SPL_FNAME_ADD ".add."
|
# define SPL_FNAME_ADD ".add."
|
||||||
|
20
src/vim.h
20
src/vim.h
@@ -1076,25 +1076,7 @@ typedef int colnr_T; /* column number type */
|
|||||||
typedef unsigned short disptick_T; /* display tick type */
|
typedef unsigned short disptick_T; /* display tick type */
|
||||||
|
|
||||||
#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
|
#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
|
||||||
|
#define MAXCOL (0x7fffffffL) /* maximum column number, 31 bits */
|
||||||
/*
|
|
||||||
* Well, you won't believe it, but some S/390 machines ("host", now also known
|
|
||||||
* as zServer) use 31 bit pointers. There are also some newer machines, that
|
|
||||||
* use 64 bit pointers. I don't know how to distinguish between 31 and 64 bit
|
|
||||||
* machines, so the best way is to assume 31 bits whenever we detect OS/390
|
|
||||||
* Unix.
|
|
||||||
* With this we restrict the maximum line length to 1073741823. I guess this is
|
|
||||||
* not a real problem. BTW: Longer lines are split.
|
|
||||||
*/
|
|
||||||
#if SIZEOF_INT >= 4
|
|
||||||
# ifdef __MVS__
|
|
||||||
# define MAXCOL (0x3fffffffL) /* maximum column number, 30 bits */
|
|
||||||
# else
|
|
||||||
# define MAXCOL (0x7fffffffL) /* maximum column number, 31 bits */
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define MAXCOL (0x7fff) /* maximum column number, 15 bits */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SHOWCMD_COLS 10 /* columns needed by shown command */
|
#define SHOWCMD_COLS 10 /* columns needed by shown command */
|
||||||
#define STL_MAX_ITEM 80 /* max nr of %<flag> in statusline */
|
#define STL_MAX_ITEM 80 /* max nr of %<flag> in statusline */
|
||||||
|
Reference in New Issue
Block a user