mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Remove project int types: Case long_i: Replace with plain long.
Replace long_i with plain long. long_i was just plain long, adding marker __w64, to be used by Microsoft's compilers only, as an aid when transitioning from 32 bits to 64 bits. Purpose of this marker was, in fact, to make a 32 bit compiler emit the same warnings that a 64 bit compiler would. This __w64 marker is nowadays deprecated by said compilers, and use of a real 64 bit compiler is recommended instead. See http://msdn.microsoft.com/en-us/library/s04b5w00.aspx for details. So, there's no reason to maintain this anymore, and thus is removed. Refactoring long into int64_t is not attempted, as doing that in a bulk way is too much complicated. That is left to be done later, on a file-by-file basis, probably intermixed with file-by-file -Wconversion activation. Requested in #459.
This commit is contained in:
parent
ad966753d4
commit
4fe0a51844
22
src/option.c
22
src/option.c
@ -2231,16 +2231,14 @@ set_option_default (
|
|||||||
if (options[opt_idx].indir == PV_SCROLL)
|
if (options[opt_idx].indir == PV_SCROLL)
|
||||||
win_comp_scroll(curwin);
|
win_comp_scroll(curwin);
|
||||||
else {
|
else {
|
||||||
*(long *)varp = (long)(long_i)options[opt_idx].def_val[dvi];
|
*(long *)varp = (long)options[opt_idx].def_val[dvi];
|
||||||
/* May also set global value for local option. */
|
/* May also set global value for local option. */
|
||||||
if (both)
|
if (both)
|
||||||
*(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) =
|
*(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) =
|
||||||
*(long *)varp;
|
*(long *)varp;
|
||||||
}
|
}
|
||||||
} else { /* P_BOOL */
|
} else { /* P_BOOL */
|
||||||
/* the cast to long is required for Manx C, long_i is needed for
|
*(int *)varp = (int)(intptr_t)options[opt_idx].def_val[dvi];
|
||||||
* MSVC */
|
|
||||||
*(int *)varp = (int)(long)(long_i)options[opt_idx].def_val[dvi];
|
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
/* 'modeline' defaults to off for root */
|
/* 'modeline' defaults to off for root */
|
||||||
if (options[opt_idx].indir == PV_ML && getuid() == ROOT_UID)
|
if (options[opt_idx].indir == PV_ML && getuid() == ROOT_UID)
|
||||||
@ -2312,7 +2310,7 @@ void set_number_default(char *name, long val)
|
|||||||
|
|
||||||
opt_idx = findoption((char_u *)name);
|
opt_idx = findoption((char_u *)name);
|
||||||
if (opt_idx >= 0)
|
if (opt_idx >= 0)
|
||||||
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)(long_i)val;
|
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(EXITFREE) || defined(PROTO)
|
#if defined(EXITFREE) || defined(PROTO)
|
||||||
@ -2554,13 +2552,13 @@ void set_title_defaults(void)
|
|||||||
idx1 = findoption((char_u *)"title");
|
idx1 = findoption((char_u *)"title");
|
||||||
if (idx1 >= 0 && !(options[idx1].flags & P_WAS_SET)) {
|
if (idx1 >= 0 && !(options[idx1].flags & P_WAS_SET)) {
|
||||||
val = mch_can_restore_title();
|
val = mch_can_restore_title();
|
||||||
options[idx1].def_val[VI_DEFAULT] = (char_u *)(long_i)val;
|
options[idx1].def_val[VI_DEFAULT] = (char_u *)val;
|
||||||
p_title = val;
|
p_title = val;
|
||||||
}
|
}
|
||||||
idx1 = findoption((char_u *)"icon");
|
idx1 = findoption((char_u *)"icon");
|
||||||
if (idx1 >= 0 && !(options[idx1].flags & P_WAS_SET)) {
|
if (idx1 >= 0 && !(options[idx1].flags & P_WAS_SET)) {
|
||||||
val = mch_can_restore_icon();
|
val = mch_can_restore_icon();
|
||||||
options[idx1].def_val[VI_DEFAULT] = (char_u *)(long_i)val;
|
options[idx1].def_val[VI_DEFAULT] = (char_u *)val;
|
||||||
p_icon = val;
|
p_icon = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2853,7 +2851,7 @@ do_set (
|
|||||||
if (nextchar == '!')
|
if (nextchar == '!')
|
||||||
value = *(int *)(varp) ^ 1;
|
value = *(int *)(varp) ^ 1;
|
||||||
else if (nextchar == '&')
|
else if (nextchar == '&')
|
||||||
value = (int)(long)(long_i)options[opt_idx].def_val[
|
value = (int)(intptr_t)options[opt_idx].def_val[
|
||||||
((flags & P_VI_DEF) || cp_val)
|
((flags & P_VI_DEF) || cp_val)
|
||||||
? VI_DEFAULT : VIM_DEFAULT];
|
? VI_DEFAULT : VIM_DEFAULT];
|
||||||
else if (nextchar == '<') {
|
else if (nextchar == '<') {
|
||||||
@ -2900,7 +2898,7 @@ do_set (
|
|||||||
*/
|
*/
|
||||||
++arg;
|
++arg;
|
||||||
if (nextchar == '&')
|
if (nextchar == '&')
|
||||||
value = (long)(long_i)options[opt_idx].def_val[
|
value = (long)options[opt_idx].def_val[
|
||||||
((flags & P_VI_DEF) || cp_val)
|
((flags & P_VI_DEF) || cp_val)
|
||||||
? VI_DEFAULT : VIM_DEFAULT];
|
? VI_DEFAULT : VIM_DEFAULT];
|
||||||
else if (nextchar == '<') {
|
else if (nextchar == '<') {
|
||||||
@ -6189,11 +6187,9 @@ static int optval_default(struct vimoption *p, char_u *varp)
|
|||||||
return TRUE; /* hidden option is always at default */
|
return TRUE; /* hidden option is always at default */
|
||||||
dvi = ((p->flags & P_VI_DEF) || p_cp) ? VI_DEFAULT : VIM_DEFAULT;
|
dvi = ((p->flags & P_VI_DEF) || p_cp) ? VI_DEFAULT : VIM_DEFAULT;
|
||||||
if (p->flags & P_NUM)
|
if (p->flags & P_NUM)
|
||||||
return *(long *)varp == (long)(long_i)p->def_val[dvi];
|
return *(long *)varp == (long)p->def_val[dvi];
|
||||||
if (p->flags & P_BOOL)
|
if (p->flags & P_BOOL)
|
||||||
/* the cast to long is required for Manx C, long_i is
|
return *(int *)varp == (int)(intptr_t)p->def_val[dvi];
|
||||||
* needed for MSVC */
|
|
||||||
return *(int *)varp == (int)(long)(long_i)p->def_val[dvi];
|
|
||||||
/* P_STRING */
|
/* P_STRING */
|
||||||
return STRCMP(*(char_u **)varp, p->def_val[dvi]) == 0;
|
return STRCMP(*(char_u **)varp, p->def_val[dvi]) == 0;
|
||||||
}
|
}
|
||||||
|
15
src/vim.h
15
src/vim.h
@ -71,17 +71,10 @@ Error: configure did not run properly.Check auto/config.log.
|
|||||||
|
|
||||||
#define NUMBUFLEN 30 /* length of a buffer to store a number in ASCII */
|
#define NUMBUFLEN 30 /* length of a buffer to store a number in ASCII */
|
||||||
|
|
||||||
/* Make sure long_u is big enough to hold a pointer.
|
// Make sure long_u is big enough to hold a pointer.
|
||||||
* On Win64, longs are 32 bits and pointers are 64 bits.
|
// On Win64, longs are 32 bits and pointers are 64 bits.
|
||||||
* For printf() and scanf(), we need to take care of long_u specifically. */
|
// For printf() and scanf(), we need to take care of long_u specifically.
|
||||||
/* Microsoft-specific. The __w64 keyword should be specified on any typedefs
|
typedef unsigned long long_u;
|
||||||
* that change size between 32-bit and 64-bit platforms. For any such type,
|
|
||||||
* __w64 should appear only on the 32-bit definition of the typedef.
|
|
||||||
* Define __w64 as an empty token for everything but MSVC 7.x or later.
|
|
||||||
*/
|
|
||||||
# define __w64
|
|
||||||
typedef unsigned long __w64 long_u;
|
|
||||||
typedef long __w64 long_i;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The characters and attributes cached for the screen.
|
* The characters and attributes cached for the screen.
|
||||||
|
Loading…
Reference in New Issue
Block a user