summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile8
-rw-r--r--src/README.txt19
-rw-r--r--src/beval.c2
-rw-r--r--src/dosinst.c4
-rw-r--r--src/gui_gtk.c8
-rw-r--r--src/if_py_both.h2
-rw-r--r--src/if_python.c2
-rw-r--r--src/if_xcmdsrv.c2
-rw-r--r--src/iscygpty.c18
-rw-r--r--src/json_test.c4
-rw-r--r--src/libvterm/include/vterm_keycodes.h1
-rw-r--r--src/mbyte.c1
-rw-r--r--src/os_vms.c110
-rw-r--r--src/pty.c2
-rw-r--r--src/version.c2
-rw-r--r--src/vimrun.c2
16 files changed, 101 insertions, 86 deletions
diff --git a/src/Makefile b/src/Makefile
index 5a134a6f4..1b13aa94c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -651,12 +651,16 @@ LINT_OPTIONS = -beprxzF
# PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
# 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 -
# Need to recompile everything after changing this: "make clean" "make".
#PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING
#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
diff --git a/src/README.txt b/src/README.txt
index 2fafd4f7c..e13430601 100644
--- a/src/README.txt
+++ b/src/README.txt
@@ -8,8 +8,8 @@ You might also want to read ":help development".
JUMPING AROUND
-First of all, use ":make tags" to generate a tags file, so that you can use
-the ":tag" command to jump around the source code.
+First of all, use ":make tags" to generate a tags file, so that you can jump
+around in the source code.
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.
@@ -43,6 +43,21 @@ Most code can be found in a file with an obvious name (incomplete list):
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
The current mode is stored in "State". The values it can have are NORMAL,
diff --git a/src/beval.c b/src/beval.c
index 981e5ea46..4ceddca19 100644
--- a/src/beval.c
+++ b/src/beval.c
@@ -137,7 +137,7 @@ get_beval_info(
* Show a balloon with "mesg" or "list".
*/
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_GUI
diff --git a/src/dosinst.c b/src/dosinst.c
index 94e866953..6a12e3dc8 100644
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -1200,8 +1200,8 @@ install_vimrc(int idx)
/* 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
- * 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
* end of the command. Putting quotes around the whole thing
* doesn't work on Win 95/98/ME. This is mostly guessed! */
diff --git a/src/gui_gtk.c b/src/gui_gtk.c
index 7ae9cbfdb..ed539e386 100644
--- a/src/gui_gtk.c
+++ b/src/gui_gtk.c
@@ -1895,8 +1895,8 @@ gui_mch_show_popupmenu(vimmenu_T *menu)
trigger.window = gtk_widget_get_window(gui.drawarea);
trigger.send_event = FALSE;
trigger.time = gui.event_time;
- trigger.x = 0.0;
- trigger.y = 0.0;
+ trigger.x = 0.0;
+ trigger.y = 0.0;
trigger.axes = NULL;
trigger.state = 0;
trigger.button = 3;
@@ -1983,8 +1983,8 @@ gui_make_popup(char_u *path_name, int mouse_pos)
trigger.window = win;
trigger.send_event = FALSE;
trigger.time = GDK_CURRENT_TIME;
- trigger.x = 0.0;
- trigger.y = 0.0;
+ trigger.x = 0.0;
+ trigger.y = 0.0;
trigger.axes = NULL;
trigger.state = 0;
trigger.button = 0;
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 3380142d1..48137f1e3 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -5996,7 +5996,7 @@ convert_dl(PyObject *obj, typval_T *tv,
PyObject *capsule;
char hexBuf[sizeof(void *) * 2 + 3];
- sprintf(hexBuf, "%p", obj);
+ sprintf(hexBuf, "%p", (void *)obj);
# ifdef PY_USE_CAPSULE
capsule = PyDict_GetItemString(lookup_dict, hexBuf);
diff --git a/src/if_python.c b/src/if_python.c
index ab9c854b2..8ba124150 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -74,7 +74,7 @@
#undef HAVE_FCNTL_H /* Clash with os_win32.h */
#define PyBytes_FromString PyString_FromString
-#define PyBytes_Check PyString_Check
+#define PyBytes_Check PyString_Check
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
#if !defined(FEAT_PYTHON) && defined(PROTO)
diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c
index 2d87e3050..af2e672cb 100644
--- a/src/if_xcmdsrv.c
+++ b/src/if_xcmdsrv.c
@@ -1123,7 +1123,7 @@ GetRegProp(
* This procedure is invoked by the various X event loops throughout Vims when
* a property changes on the communication window. This procedure reads the
* 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
* response.
*/
diff --git a/src/iscygpty.c b/src/iscygpty.c
index 722f88f2f..b018a1de6 100644
--- a/src/iscygpty.c
+++ b/src/iscygpty.c
@@ -62,20 +62,18 @@
//#define USE_DYNFILEID
#ifdef USE_DYNFILEID
typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)(
- HANDLE hFile,
- FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
- LPVOID lpFileInformation,
- DWORD dwBufferSize
-);
+ HANDLE hFile,
+ FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
+ LPVOID lpFileInformation,
+ DWORD dwBufferSize);
static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL;
# ifndef USE_FILEEXTD
static BOOL WINAPI stub_GetFileInformationByHandleEx(
- HANDLE hFile,
- FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
- LPVOID lpFileInformation,
- DWORD dwBufferSize
- )
+ HANDLE hFile,
+ FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
+ LPVOID lpFileInformation,
+ DWORD dwBufferSize)
{
return FALSE;
}
diff --git a/src/json_test.c b/src/json_test.c
index c7779b29a..47bec8ee6 100644
--- a/src/json_test.c
+++ b/src/json_test.c
@@ -162,7 +162,7 @@ test_fill_called_on_find_end(void)
reader.js_fill = fill_from_cookie;
reader.js_used = 0;
reader.js_buf = (char_u *)" [ \"a\" , 123 ";
- reader.js_cookie = " [ \"a\" , 123 ] ";
+ reader.js_cookie = " [ \"a\" , 123 ] ";
assert(json_find_end(&reader, 0) == OK);
reader.js_buf = (char_u *)" [ \"a\" , ";
assert(json_find_end(&reader, 0) == OK);
@@ -186,7 +186,7 @@ test_fill_called_on_string(void)
reader.js_used = 0;
reader.js_buf = (char_u *)" \"foo";
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);
}
#endif
diff --git a/src/libvterm/include/vterm_keycodes.h b/src/libvterm/include/vterm_keycodes.h
index 7a7791696..2c5448345 100644
--- a/src/libvterm/include/vterm_keycodes.h
+++ b/src/libvterm/include/vterm_keycodes.h
@@ -8,6 +8,7 @@ typedef enum {
VTERM_MOD_CTRL = 0x04
} VTermModifier;
+/* The order here must match keycodes[] in src/keyboard.c! */
typedef enum {
VTERM_KEY_NONE,
diff --git a/src/mbyte.c b/src/mbyte.c
index 575fd52d4..9b788b0d5 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -2260,7 +2260,6 @@ utf_char2len(int c)
/*
* Convert Unicode character "c" to UTF-8 string in "buf[]".
* Returns the number of bytes.
- * This does not include composing characters.
*/
int
utf_char2bytes(int c, char_u *buf)
diff --git a/src/os_vms.c b/src/os_vms.c
index f1c06985c..02c594c5b 100644
--- a/src/os_vms.c
+++ b/src/os_vms.c
@@ -18,7 +18,7 @@
/* based on Alpha's gen64def.h; the file is absent on VAX */
typedef struct _generic_64 {
# pragma __nomember_alignment
- __union { /* You can treat me as... */
+ __union { /* You can treat me as... */
/* long long is not available on VAXen */
/* 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));
if ( (int) result == 0 || (int) result == -1 ) {
cnt = 0;
- }
- else {
+ } else {
cnt = decc$to_vms(result, vms_wproc, 1 /*allow wild*/ , (flags & EW_DIR ? 0:1 ) /*allow directory*/) ;
}
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 */
result = decc$translate_vms(vms_fixfilename(path));
if ( (int) result == 0 || (int) result == -1 ) {
- cnt = 0;
- }
- else {
- cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/);
+ cnt = 0;
+ } else {
+ cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/);
}
if (cnt > 0)
cnt = vms_match_num;
@@ -741,68 +739,66 @@ RealWaitForChar(
get_tty();
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()*/
- /* get current time (number of 100ns ticks since the VMS Epoch) */
- status = sys$gettim(&time_curr);
- if (status != SS$_NORMAL)
- return 0; /* error */
- /* construct the delta time */
+ /* get current time (number of 100ns ticks since the VMS Epoch) */
+ status = sys$gettim(&time_curr);
+ if (status != SS$_NORMAL)
+ return 0; /* error */
+ /* construct the delta time */
#if __G_FLOAT==0
# ifndef VAX
/* IEEE is default on IA64, but can be used on Alpha too - but not on VAX */
- status = lib$cvts_to_internal_time(
- &convert_operation, &sec, &time_diff);
+ status = lib$cvts_to_internal_time(
+ &convert_operation, &sec, &time_diff);
# endif
#else /* default on Alpha and VAX */
- status = lib$cvtf_to_internal_time(
+ status = lib$cvtf_to_internal_time(
&convert_operation, &sec, &time_diff);
#endif
- if (status != LIB$_NORMAL)
- return 0; /* error */
- /* add them up */
- status = lib$add_times(
- &time_curr,
- &time_diff,
- &time_out);
- if (status != LIB$_NORMAL)
- return 0; /* error */
+ if (status != LIB$_NORMAL)
+ return 0; /* error */
+ /* add them up */
+ status = lib$add_times(
+ &time_curr,
+ &time_diff,
+ &time_out);
+ if (status != LIB$_NORMAL)
+ return 0; /* error */
}
while (TRUE) {
- /* select() */
- status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb,
- 0, 0, &typeahead, 8, 0, 0, 0, 0);
+ /* select() */
+ status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb,
+ 0, 0, &typeahead, 8, 0, 0, 0, 0);
if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL)
- return 0; /* error */
-
- if (typeahead.numchars)
- return 1; /* ready to read */
-
- /* there's nothing to read; what now? */
- if (msec == 0) {
- /* immediate time-out; return impatiently */
- return 0;
- }
- else if (msec < 0) {
- /* no time-out; wait on indefinitely */
- continue;
- }
- else {
- /* time-out needs to be checked */
- status = sys$gettim(&time_curr);
- if (status != SS$_NORMAL)
- return 0; /* error */
-
- status = lib$sub_times(
- &time_out,
- &time_curr,
- &time_diff);
- if (status != LIB$_NORMAL)
- return 0; /* error, incl. time_diff < 0 (i.e. time-out) */
-
- /* otherwise wait some more */
- }
+ return 0; /* error */
+
+ if (typeahead.numchars)
+ return 1; /* ready to read */
+
+ /* there's nothing to read; what now? */
+ if (msec == 0) {
+ /* immediate time-out; return impatiently */
+ return 0;
+ } else if (msec < 0) {
+ /* no time-out; wait on indefinitely */
+ continue;
+ } else {
+ /* time-out needs to be checked */
+ status = sys$gettim(&time_curr);
+ if (status != SS$_NORMAL)
+ return 0; /* error */
+
+ status = lib$sub_times(
+ &time_out,
+ &time_curr,
+ &time_diff);
+ if (status != LIB$_NORMAL)
+ return 0; /* error, incl. time_diff < 0 (i.e. time-out) */
+
+ /* otherwise wait some more */
+ }
}
}
diff --git a/src/pty.c b/src/pty.c
index 1a27ab69b..940f63e02 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -268,7 +268,7 @@ OpenPTY(char **ttyn)
#endif
#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!
* Same for Mac OS X Leopard (10.5). */
diff --git a/src/version.c b/src/version.c
index f5ffe20ac..048387b26 100644
--- a/src/version.c
+++ b/src/version.c
@@ -779,6 +779,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1550,
+/**/
1549,
/**/
1548,
diff --git a/src/vimrun.c b/src/vimrun.c
index 2566859fa..13efd911e 100644
--- a/src/vimrun.c
+++ b/src/vimrun.c
@@ -55,7 +55,7 @@ main(void)
++p;
}
while (*p == L' ')
- ++p;
+ ++p;
/*
* "-s" argument: don't wait for a key hit.