mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
patch 8.0.1550: various small problems in source files
Problem: Various small problems in source files. Solution: Fix the problems.
This commit is contained in:
parent
5d7ead3bc8
commit
792f0e3659
@ -651,12 +651,16 @@ LINT_OPTIONS = -beprxzF
|
|||||||
|
|
||||||
# PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
|
# PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
|
||||||
# Might not work with GUI or Perl.
|
# Might not work with GUI or Perl.
|
||||||
# For unknown reasons adding "-lc" fixes a linking problem with some versions
|
|
||||||
# of GCC. That's probably a bug in the "-pg" implementation.
|
|
||||||
# After running Vim see the profile result with: gprof vim gmon.out | vim -
|
# After running Vim see the profile result with: gprof vim gmon.out | vim -
|
||||||
# Need to recompile everything after changing this: "make clean" "make".
|
# Need to recompile everything after changing this: "make clean" "make".
|
||||||
#PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING
|
#PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING
|
||||||
#PROFILE_LIBS = -pg
|
#PROFILE_LIBS = -pg
|
||||||
|
|
||||||
|
# GCC 5 and later need the -no-pie argument.
|
||||||
|
#PROFILE_LIBS = -pg -no-pie
|
||||||
|
|
||||||
|
# For unknown reasons adding "-lc" fixes a linking problem with some versions
|
||||||
|
# of GCC. That's probably a bug in the "-pg" implementation.
|
||||||
#PROFILE_LIBS = -pg -lc
|
#PROFILE_LIBS = -pg -lc
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ You might also want to read ":help development".
|
|||||||
|
|
||||||
JUMPING AROUND
|
JUMPING AROUND
|
||||||
|
|
||||||
First of all, use ":make tags" to generate a tags file, so that you can use
|
First of all, use ":make tags" to generate a tags file, so that you can jump
|
||||||
the ":tag" command to jump around the source code.
|
around in the source code.
|
||||||
|
|
||||||
To jump to a function or variable definition, move the cursor on the name and
|
To jump to a function or variable definition, move the cursor on the name and
|
||||||
use the CTRL-] command. Use CTRL-T or CTRL-O to jump back.
|
use the CTRL-] command. Use CTRL-T or CTRL-O to jump back.
|
||||||
@ -43,6 +43,21 @@ Most code can be found in a file with an obvious name (incomplete list):
|
|||||||
window.c handling split windows
|
window.c handling split windows
|
||||||
|
|
||||||
|
|
||||||
|
DEBUGGING
|
||||||
|
|
||||||
|
If you have a reasonable recent version of gdb, you can use the :Termdebug
|
||||||
|
command to debug Vim. See ":help :Termdebug".
|
||||||
|
|
||||||
|
When something is time critical or stepping through code is a hassle, use the
|
||||||
|
channel logging to create a time-stamped log file. Add lines to the code like
|
||||||
|
this:
|
||||||
|
ch_log(NULL, "Value is now %02x", value);
|
||||||
|
After compiling and starting Vim, do:
|
||||||
|
:call ch_logfile('debuglog', 'w')
|
||||||
|
And edit "debuglog" to see what happens. The channel functions already have
|
||||||
|
ch_log() calls, thus you always see that in the log.
|
||||||
|
|
||||||
|
|
||||||
IMPORTANT VARIABLES
|
IMPORTANT VARIABLES
|
||||||
|
|
||||||
The current mode is stored in "State". The values it can have are NORMAL,
|
The current mode is stored in "State". The values it can have are NORMAL,
|
||||||
|
@ -137,7 +137,7 @@ get_beval_info(
|
|||||||
* Show a balloon with "mesg" or "list".
|
* Show a balloon with "mesg" or "list".
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list)
|
post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list UNUSED)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_BEVAL_TERM
|
# ifdef FEAT_BEVAL_TERM
|
||||||
# ifdef FEAT_GUI
|
# ifdef FEAT_GUI
|
||||||
|
@ -1200,8 +1200,8 @@ install_vimrc(int idx)
|
|||||||
|
|
||||||
/* If the path has a space: When using cmd.exe (Win NT/2000/XP) put
|
/* If the path has a space: When using cmd.exe (Win NT/2000/XP) put
|
||||||
* quotes around the diff command and rely on the default value of
|
* quotes around the diff command and rely on the default value of
|
||||||
* shellxquote to solve the quoting problem for the whole command.
|
* shellxquote to solve the quoting problem for the whole command.
|
||||||
*
|
*
|
||||||
* Otherwise put a double quote just before the space and at the
|
* Otherwise put a double quote just before the space and at the
|
||||||
* end of the command. Putting quotes around the whole thing
|
* end of the command. Putting quotes around the whole thing
|
||||||
* doesn't work on Win 95/98/ME. This is mostly guessed! */
|
* doesn't work on Win 95/98/ME. This is mostly guessed! */
|
||||||
|
@ -1895,8 +1895,8 @@ gui_mch_show_popupmenu(vimmenu_T *menu)
|
|||||||
trigger.window = gtk_widget_get_window(gui.drawarea);
|
trigger.window = gtk_widget_get_window(gui.drawarea);
|
||||||
trigger.send_event = FALSE;
|
trigger.send_event = FALSE;
|
||||||
trigger.time = gui.event_time;
|
trigger.time = gui.event_time;
|
||||||
trigger.x = 0.0;
|
trigger.x = 0.0;
|
||||||
trigger.y = 0.0;
|
trigger.y = 0.0;
|
||||||
trigger.axes = NULL;
|
trigger.axes = NULL;
|
||||||
trigger.state = 0;
|
trigger.state = 0;
|
||||||
trigger.button = 3;
|
trigger.button = 3;
|
||||||
@ -1983,8 +1983,8 @@ gui_make_popup(char_u *path_name, int mouse_pos)
|
|||||||
trigger.window = win;
|
trigger.window = win;
|
||||||
trigger.send_event = FALSE;
|
trigger.send_event = FALSE;
|
||||||
trigger.time = GDK_CURRENT_TIME;
|
trigger.time = GDK_CURRENT_TIME;
|
||||||
trigger.x = 0.0;
|
trigger.x = 0.0;
|
||||||
trigger.y = 0.0;
|
trigger.y = 0.0;
|
||||||
trigger.axes = NULL;
|
trigger.axes = NULL;
|
||||||
trigger.state = 0;
|
trigger.state = 0;
|
||||||
trigger.button = 0;
|
trigger.button = 0;
|
||||||
|
@ -5996,7 +5996,7 @@ convert_dl(PyObject *obj, typval_T *tv,
|
|||||||
PyObject *capsule;
|
PyObject *capsule;
|
||||||
char hexBuf[sizeof(void *) * 2 + 3];
|
char hexBuf[sizeof(void *) * 2 + 3];
|
||||||
|
|
||||||
sprintf(hexBuf, "%p", obj);
|
sprintf(hexBuf, "%p", (void *)obj);
|
||||||
|
|
||||||
# ifdef PY_USE_CAPSULE
|
# ifdef PY_USE_CAPSULE
|
||||||
capsule = PyDict_GetItemString(lookup_dict, hexBuf);
|
capsule = PyDict_GetItemString(lookup_dict, hexBuf);
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
#undef HAVE_FCNTL_H /* Clash with os_win32.h */
|
#undef HAVE_FCNTL_H /* Clash with os_win32.h */
|
||||||
|
|
||||||
#define PyBytes_FromString PyString_FromString
|
#define PyBytes_FromString PyString_FromString
|
||||||
#define PyBytes_Check PyString_Check
|
#define PyBytes_Check PyString_Check
|
||||||
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
|
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
|
||||||
|
|
||||||
#if !defined(FEAT_PYTHON) && defined(PROTO)
|
#if !defined(FEAT_PYTHON) && defined(PROTO)
|
||||||
|
@ -1123,7 +1123,7 @@ GetRegProp(
|
|||||||
* This procedure is invoked by the various X event loops throughout Vims when
|
* This procedure is invoked by the various X event loops throughout Vims when
|
||||||
* a property changes on the communication window. This procedure reads the
|
* a property changes on the communication window. This procedure reads the
|
||||||
* property and enqueues command requests and responses. If immediate is true,
|
* property and enqueues command requests and responses. If immediate is true,
|
||||||
* it runs the event immediatly instead of enqueuing it. Immediate can cause
|
* it runs the event immediately instead of enqueuing it. Immediate can cause
|
||||||
* unintended behavior and should only be used for code that blocks for a
|
* unintended behavior and should only be used for code that blocks for a
|
||||||
* response.
|
* response.
|
||||||
*/
|
*/
|
||||||
|
@ -62,20 +62,18 @@
|
|||||||
//#define USE_DYNFILEID
|
//#define USE_DYNFILEID
|
||||||
#ifdef USE_DYNFILEID
|
#ifdef USE_DYNFILEID
|
||||||
typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)(
|
typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)(
|
||||||
HANDLE hFile,
|
HANDLE hFile,
|
||||||
FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
|
FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
|
||||||
LPVOID lpFileInformation,
|
LPVOID lpFileInformation,
|
||||||
DWORD dwBufferSize
|
DWORD dwBufferSize);
|
||||||
);
|
|
||||||
static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL;
|
static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL;
|
||||||
|
|
||||||
# ifndef USE_FILEEXTD
|
# ifndef USE_FILEEXTD
|
||||||
static BOOL WINAPI stub_GetFileInformationByHandleEx(
|
static BOOL WINAPI stub_GetFileInformationByHandleEx(
|
||||||
HANDLE hFile,
|
HANDLE hFile,
|
||||||
FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
|
FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
|
||||||
LPVOID lpFileInformation,
|
LPVOID lpFileInformation,
|
||||||
DWORD dwBufferSize
|
DWORD dwBufferSize)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ test_fill_called_on_find_end(void)
|
|||||||
reader.js_fill = fill_from_cookie;
|
reader.js_fill = fill_from_cookie;
|
||||||
reader.js_used = 0;
|
reader.js_used = 0;
|
||||||
reader.js_buf = (char_u *)" [ \"a\" , 123 ";
|
reader.js_buf = (char_u *)" [ \"a\" , 123 ";
|
||||||
reader.js_cookie = " [ \"a\" , 123 ] ";
|
reader.js_cookie = " [ \"a\" , 123 ] ";
|
||||||
assert(json_find_end(&reader, 0) == OK);
|
assert(json_find_end(&reader, 0) == OK);
|
||||||
reader.js_buf = (char_u *)" [ \"a\" , ";
|
reader.js_buf = (char_u *)" [ \"a\" , ";
|
||||||
assert(json_find_end(&reader, 0) == OK);
|
assert(json_find_end(&reader, 0) == OK);
|
||||||
@ -186,7 +186,7 @@ test_fill_called_on_string(void)
|
|||||||
reader.js_used = 0;
|
reader.js_used = 0;
|
||||||
reader.js_buf = (char_u *)" \"foo";
|
reader.js_buf = (char_u *)" \"foo";
|
||||||
reader.js_end = reader.js_buf + STRLEN(reader.js_buf);
|
reader.js_end = reader.js_buf + STRLEN(reader.js_buf);
|
||||||
reader.js_cookie = " \"foobar\" ";
|
reader.js_cookie = " \"foobar\" ";
|
||||||
assert(json_decode_string(&reader, NULL, '"') == OK);
|
assert(json_decode_string(&reader, NULL, '"') == OK);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -8,6 +8,7 @@ typedef enum {
|
|||||||
VTERM_MOD_CTRL = 0x04
|
VTERM_MOD_CTRL = 0x04
|
||||||
} VTermModifier;
|
} VTermModifier;
|
||||||
|
|
||||||
|
/* The order here must match keycodes[] in src/keyboard.c! */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VTERM_KEY_NONE,
|
VTERM_KEY_NONE,
|
||||||
|
|
||||||
|
@ -2260,7 +2260,6 @@ utf_char2len(int c)
|
|||||||
/*
|
/*
|
||||||
* Convert Unicode character "c" to UTF-8 string in "buf[]".
|
* Convert Unicode character "c" to UTF-8 string in "buf[]".
|
||||||
* Returns the number of bytes.
|
* Returns the number of bytes.
|
||||||
* This does not include composing characters.
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
utf_char2bytes(int c, char_u *buf)
|
utf_char2bytes(int c, char_u *buf)
|
||||||
|
102
src/os_vms.c
102
src/os_vms.c
@ -18,7 +18,7 @@
|
|||||||
/* based on Alpha's gen64def.h; the file is absent on VAX */
|
/* based on Alpha's gen64def.h; the file is absent on VAX */
|
||||||
typedef struct _generic_64 {
|
typedef struct _generic_64 {
|
||||||
# pragma __nomember_alignment
|
# pragma __nomember_alignment
|
||||||
__union { /* You can treat me as... */
|
__union { /* You can treat me as... */
|
||||||
/* long long is not available on VAXen */
|
/* long long is not available on VAXen */
|
||||||
/* unsigned __int64 gen64$q_quadword; ...a single 64-bit value, or */
|
/* unsigned __int64 gen64$q_quadword; ...a single 64-bit value, or */
|
||||||
|
|
||||||
@ -461,8 +461,7 @@ mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, i
|
|||||||
result = decc$translate_vms(vms_fixfilename(buf));
|
result = decc$translate_vms(vms_fixfilename(buf));
|
||||||
if ( (int) result == 0 || (int) result == -1 ) {
|
if ( (int) result == 0 || (int) result == -1 ) {
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
cnt = decc$to_vms(result, vms_wproc, 1 /*allow wild*/ , (flags & EW_DIR ? 0:1 ) /*allow directory*/) ;
|
cnt = decc$to_vms(result, vms_wproc, 1 /*allow wild*/ , (flags & EW_DIR ? 0:1 ) /*allow directory*/) ;
|
||||||
}
|
}
|
||||||
if (cnt > 0)
|
if (cnt > 0)
|
||||||
@ -519,10 +518,9 @@ mch_expandpath(garray_T *gap, char_u *path, int flags)
|
|||||||
/* otherwise it might create ACCVIO error in decc$to_vms */
|
/* otherwise it might create ACCVIO error in decc$to_vms */
|
||||||
result = decc$translate_vms(vms_fixfilename(path));
|
result = decc$translate_vms(vms_fixfilename(path));
|
||||||
if ( (int) result == 0 || (int) result == -1 ) {
|
if ( (int) result == 0 || (int) result == -1 ) {
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/);
|
||||||
cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/);
|
|
||||||
}
|
}
|
||||||
if (cnt > 0)
|
if (cnt > 0)
|
||||||
cnt = vms_match_num;
|
cnt = vms_match_num;
|
||||||
@ -741,68 +739,66 @@ RealWaitForChar(
|
|||||||
get_tty();
|
get_tty();
|
||||||
|
|
||||||
if (sec > 0) {
|
if (sec > 0) {
|
||||||
/* time-out specified; convert it to absolute time */
|
/* time-out specified; convert it to absolute time */
|
||||||
/* sec>0 requirement of lib$cvtf_to_internal_time()*/
|
/* sec>0 requirement of lib$cvtf_to_internal_time()*/
|
||||||
|
|
||||||
/* get current time (number of 100ns ticks since the VMS Epoch) */
|
/* get current time (number of 100ns ticks since the VMS Epoch) */
|
||||||
status = sys$gettim(&time_curr);
|
status = sys$gettim(&time_curr);
|
||||||
if (status != SS$_NORMAL)
|
if (status != SS$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; /* error */
|
||||||
/* construct the delta time */
|
/* construct the delta time */
|
||||||
#if __G_FLOAT==0
|
#if __G_FLOAT==0
|
||||||
# ifndef VAX
|
# ifndef VAX
|
||||||
/* IEEE is default on IA64, but can be used on Alpha too - but not on VAX */
|
/* IEEE is default on IA64, but can be used on Alpha too - but not on VAX */
|
||||||
status = lib$cvts_to_internal_time(
|
status = lib$cvts_to_internal_time(
|
||||||
&convert_operation, &sec, &time_diff);
|
&convert_operation, &sec, &time_diff);
|
||||||
# endif
|
# endif
|
||||||
#else /* default on Alpha and VAX */
|
#else /* default on Alpha and VAX */
|
||||||
status = lib$cvtf_to_internal_time(
|
status = lib$cvtf_to_internal_time(
|
||||||
&convert_operation, &sec, &time_diff);
|
&convert_operation, &sec, &time_diff);
|
||||||
#endif
|
#endif
|
||||||
if (status != LIB$_NORMAL)
|
if (status != LIB$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; /* error */
|
||||||
/* add them up */
|
/* add them up */
|
||||||
status = lib$add_times(
|
status = lib$add_times(
|
||||||
&time_curr,
|
&time_curr,
|
||||||
&time_diff,
|
&time_diff,
|
||||||
&time_out);
|
&time_out);
|
||||||
if (status != LIB$_NORMAL)
|
if (status != LIB$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; /* error */
|
||||||
}
|
}
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
/* select() */
|
/* select() */
|
||||||
status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb,
|
status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb,
|
||||||
0, 0, &typeahead, 8, 0, 0, 0, 0);
|
0, 0, &typeahead, 8, 0, 0, 0, 0);
|
||||||
if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL)
|
if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; /* error */
|
||||||
|
|
||||||
if (typeahead.numchars)
|
if (typeahead.numchars)
|
||||||
return 1; /* ready to read */
|
return 1; /* ready to read */
|
||||||
|
|
||||||
/* there's nothing to read; what now? */
|
/* there's nothing to read; what now? */
|
||||||
if (msec == 0) {
|
if (msec == 0) {
|
||||||
/* immediate time-out; return impatiently */
|
/* immediate time-out; return impatiently */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else if (msec < 0) {
|
||||||
else if (msec < 0) {
|
/* no time-out; wait on indefinitely */
|
||||||
/* no time-out; wait on indefinitely */
|
continue;
|
||||||
continue;
|
} else {
|
||||||
}
|
/* time-out needs to be checked */
|
||||||
else {
|
status = sys$gettim(&time_curr);
|
||||||
/* time-out needs to be checked */
|
if (status != SS$_NORMAL)
|
||||||
status = sys$gettim(&time_curr);
|
return 0; /* error */
|
||||||
if (status != SS$_NORMAL)
|
|
||||||
return 0; /* error */
|
|
||||||
|
|
||||||
status = lib$sub_times(
|
status = lib$sub_times(
|
||||||
&time_out,
|
&time_out,
|
||||||
&time_curr,
|
&time_curr,
|
||||||
&time_diff);
|
&time_diff);
|
||||||
if (status != LIB$_NORMAL)
|
if (status != LIB$_NORMAL)
|
||||||
return 0; /* error, incl. time_diff < 0 (i.e. time-out) */
|
return 0; /* error, incl. time_diff < 0 (i.e. time-out) */
|
||||||
|
|
||||||
/* otherwise wait some more */
|
/* otherwise wait some more */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ OpenPTY(char **ttyn)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux) \
|
#if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux) \
|
||||||
&& !(defined(MACOS_X) && !defined(MAC_OS_X_VERSION_10_6))
|
&& !(defined(MACOS_X) && !defined(MAC_OS_X_VERSION_10_6))
|
||||||
|
|
||||||
/* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work!
|
/* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work!
|
||||||
* Same for Mac OS X Leopard (10.5). */
|
* Same for Mac OS X Leopard (10.5). */
|
||||||
|
@ -778,6 +778,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1550,
|
||||||
/**/
|
/**/
|
||||||
1549,
|
1549,
|
||||||
/**/
|
/**/
|
||||||
|
@ -55,7 +55,7 @@ main(void)
|
|||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
while (*p == L' ')
|
while (*p == L' ')
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "-s" argument: don't wait for a key hit.
|
* "-s" argument: don't wait for a key hit.
|
||||||
|
@ -5,7 +5,7 @@ There are three ways to remove Vim:
|
|||||||
1. With the GUI uninstaller.
|
1. With the GUI uninstaller.
|
||||||
This is only available when Vim was installed with the self-installing
|
This is only available when Vim was installed with the self-installing
|
||||||
executable. This has a minimal number of questions. It can delete
|
executable. This has a minimal number of questions. It can delete
|
||||||
everything that was installed. This also unregisters the VisVim.dll
|
everything that was installed. This also unregisters the VisVim.dll.
|
||||||
|
|
||||||
2. With uninstal.exe.
|
2. With uninstal.exe.
|
||||||
This removes most installed items, but does not delete the files you
|
This removes most installed items, but does not delete the files you
|
||||||
|
Loading…
x
Reference in New Issue
Block a user