]> granicus.if.org Git - vim/commitdiff
updated for version 7.0054
authorBram Moolenaar <Bram@vim.org>
Mon, 28 Feb 2005 22:44:58 +0000 (22:44 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 28 Feb 2005 22:44:58 +0000 (22:44 +0000)
runtime/doc/repeat.txt
src/Make_ming.mak
src/ex_cmds2.c
src/feature.h
src/fileio.c
src/globals.h
src/os_unix.c
src/quickfix.c
src/regexp.c
src/version.h

index b165bf123c5be3efe242f25b8ab3fe024a5ae0ac..57221023f8cac0f1d2000fb5abe2d9dc8cd8c914 100644 (file)
@@ -1,4 +1,4 @@
-*repeat.txt*    For Vim version 7.0aa.  Last change: 2005 Feb 26
+*repeat.txt*    For Vim version 7.0aa.  Last change: 2005 Feb 28
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -572,7 +572,8 @@ It is only included when Vim was compiled with "huge" features.
                This only profiles the script itself, not the functions
                defined in it.
                When the [!] is added then all functions defined in the script
-               will also be profiled.
+               will also be profiled.  But only if the script is loaded after
+               this command.
 
 
 You must always start with a ":profile start fname" command.  The resulting
@@ -632,5 +633,7 @@ mind there are various things that may clobber the results:
        :   delfunc MyFunc
        :endif
 <
+- Profiling may give weird results on multi-processor systems, when sleep
+  mode kicks in or the processor frequency is reduced to save power.
 
  vim:tw=78:ts=8:ft=help:norl:
index 47b1910a1bbd8c0c07e027426a3ea8151cb892f2..7cbceb85951a17b149f0a3fe9266ea449a56c27c 100644 (file)
@@ -254,14 +254,14 @@ endif
 CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
 
 ifdef GETTEXT
-DEFINES +=-DHAVE_GETTEXT -DHAVE_LOCALE_H
+DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
 GETTEXTINCLUDE = $(GETTEXT)/include
 GETTEXTLIB = $(INTLPATH)
 ifeq (yes, $(GETTEXT))
-DEFINES +=-DDYNAMIC_GETTEXT
+DEFINES += -DDYNAMIC_GETTEXT
 else
 ifdef DYNAMIC_GETTEXT
-DEFINES +=-D$(DYNAMIC_GETTEXT)
+DEFINES += -D$(DYNAMIC_GETTEXT)
 ifdef GETTEXT_DYNAMIC
 DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
 endif
index f1b8d2a874f37d9d774f32d7789dcf6cb640c7da..0761a6998c75943401f6e3650b540c1ae6a05f2d 100644 (file)
@@ -26,7 +26,7 @@
 static void    cmd_source __ARGS((char_u *fname, exarg_T *eap));
 
 #ifdef FEAT_EVAL
-/* Growarray to store the names of sourced scripts.
+/* Growarray to store info about already sourced scripts.
  * For Unix also store the dev/ino, so that we don't have to stat() each
  * script when going through the list. */
 typedef struct scriptitem_S
@@ -38,7 +38,7 @@ typedef struct scriptitem_S
 # endif
 # ifdef FEAT_PROFILE
     int                sn_prof_on;     /* TRUE when script is/was profiled */
-    int                sn_pr_force;    /* forceit: profile defined functions */
+    int                sn_pr_force;    /* forceit: profile functions in this script */
     proftime_T sn_pr_child;    /* time set when going into first child */
     int                sn_pr_nest;     /* nesting for sn_pr_child */
     /* profiling the script as a whole */
@@ -802,8 +802,12 @@ static proftime_T prof_wait_time;
 profile_zero(tm)
     proftime_T *tm;
 {
+# ifdef WIN3264
+    tm->QuadPart = 0;
+# else
     tm->tv_usec = 0;
     tm->tv_sec = 0;
+# endif
 }
 
 /*
@@ -813,7 +817,11 @@ profile_zero(tm)
 profile_start(tm)
     proftime_T *tm;
 {
+# ifdef WIN3264
+    QueryPerformanceCounter(tm);
+# else
     gettimeofday(tm, NULL);
+# endif
 }
 
 /*
@@ -825,6 +833,10 @@ profile_end(tm)
 {
     proftime_T now;
 
+# ifdef WIN3264
+    QueryPerformanceCounter(&now);
+    tm->QuadPart = now.QuadPart - tm->QuadPart;
+# else
     gettimeofday(&now, NULL);
     tm->tv_usec = now.tv_usec - tm->tv_usec;
     tm->tv_sec = now.tv_sec - tm->tv_sec;
@@ -833,6 +845,7 @@ profile_end(tm)
        tm->tv_usec += 1000000;
        --tm->tv_sec;
     }
+# endif
 }
 
 /*
@@ -842,6 +855,9 @@ profile_end(tm)
 profile_sub(tm, tm2)
     proftime_T *tm, *tm2;
 {
+# ifdef WIN3264
+    tm->QuadPart -= tm2->QuadPart;
+# else
     tm->tv_usec -= tm2->tv_usec;
     tm->tv_sec -= tm2->tv_sec;
     if (tm->tv_usec < 0)
@@ -849,6 +865,7 @@ profile_sub(tm, tm2)
        tm->tv_usec += 1000000;
        --tm->tv_sec;
     }
+# endif
 }
 
 /*
@@ -858,6 +875,9 @@ profile_sub(tm, tm2)
 profile_add(tm, tm2)
     proftime_T *tm, *tm2;
 {
+# ifdef WIN3264
+    tm->QuadPart += tm2->QuadPart;
+# else
     tm->tv_usec += tm2->tv_usec;
     tm->tv_sec += tm2->tv_sec;
     if (tm->tv_usec >= 1000000)
@@ -865,6 +885,7 @@ profile_add(tm, tm2)
        tm->tv_usec -= 1000000;
        ++tm->tv_sec;
     }
+# endif
 }
 
 /*
@@ -897,7 +918,27 @@ profile_sub_wait(tm, tma)
 profile_equal(tm1, tm2)
     proftime_T *tm1, *tm2;
 {
+# ifdef WIN3264
+    return (tm1->QuadPart == tm2->QuadPart);
+# else
     return (tm1->tv_usec == tm2->tv_usec && tm1->tv_sec == tm2->tv_sec);
+# endif
+}
+
+/*
+ * Return <0, 0 or >0 if "tm1" < "tm2", "tm1" == "tm2" or "tm1" > "tm2"
+ */
+    int
+profile_cmp(tm1, tm2)
+    proftime_T *tm1, *tm2;
+{
+# ifdef WIN3264
+    return (int)(tm2->QuadPart - tm1->QuadPart);
+# else
+    if (tm1->tv_sec == tm2->tv_sec)
+       return tm2->tv_usec - tm1->tv_usec;
+    return tm2->tv_sec - tm1->tv_sec;
+# endif
 }
 
 /*
@@ -910,7 +951,14 @@ profile_msg(tm)
 {
     static char buf[50];
 
+# ifdef WIN3264
+    LARGE_INTEGER   fr;
+
+    QueryPerformanceFrequency(&fr);
+    sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);
+# else
     sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);
+#endif
     return buf;
 }
 
@@ -962,8 +1010,8 @@ profile_dump()
            EMSG2(_(e_notopen), profile_fname);
        else
        {
-           func_dump_profile(fd);
            script_dump_profile(fd);
+           func_dump_profile(fd);
            fclose(fd);
        }
     }
index 3173901b2721596ad857277b59eeea6fa744ada2..fa874ed7a7dc6d2070772517625528e486b20099 100644 (file)
@@ -1,4 +1,4 @@
-/* vi:set ts=8 sts=0 sw=8:
+/* vi:set ts=8 sts=4 sw=4:
  *
  * VIM - Vi IMproved           by Bram Moolenaar
  *
 /*
  * +profile            Profiling for functions and scripts.
  */
-#if defined(FEAT_HUGE) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+#if defined(FEAT_HUGE) \
+       && ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \
+               || defined(WIN3264))
 # define FEAT_PROFILE
 #endif
 
index 328431a07b1f83da326eabf29eb4844e1cd34c6c..c3aef90a11170181fe416c873f8b3952649250a5 100644 (file)
@@ -1333,10 +1333,19 @@ retry:
                 * If there is conversion error or not enough room try using
                 * another conversion.
                 */
-               if ((iconv(iconv_fd, (void *)&fromp, &from_size, &top, &to_size)
+               while ((iconv(iconv_fd, (void *)&fromp, &from_size,
+                                                              &top, &to_size)
                            == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL)
                                                  || from_size > CONV_RESTLEN)
-                   goto rewind_retry;
+               {
+                   if (!keep_dest_enc)
+                       goto rewind_retry;
+                   /* Ignore a byte and try again. */
+                   ++fromp;
+                   --from_size;
+                   *top++ = '?';
+                   --to_size;
+               }
 
                if (from_size > 0)
                {
index fdfb1f57097c17051b235d33ee72c95f05f0deda..445b453fc524200296b17ef637f524d0a965a5d9 100644 (file)
@@ -656,10 +656,10 @@ EXTERN JMP_BUF x_jump_env;
  * Used to protect areas where we could crash.
  */
 EXTERN JMP_BUF lc_jump_env;    /* argument to SETJMP() */
-#ifdef SIGHASARG
+# ifdef SIGHASARG
 EXTERN int lc_signal;          /* catched signal number, 0 when no was signal
                                   catched; used for mch_libcall() */
-#endif
+# endif
 EXTERN int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */
 #endif
 
@@ -1412,7 +1412,7 @@ EXTERN char_u e_nbreadonly[]      INIT(=N_("E744: NetBeans does not allow changes in
 #if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO)
 EXTERN char_u e_intern2[]      INIT(=N_("E685: Internal error: %s"));
 #endif
-#if defined(HAVE_SETJMP_H) || defined(HAVE_TRY_EXCEPT)
+#if defined(HAVE_SETJMP_H) || defined(HAVE_TRY_EXCEPT) || defined(__MINGW32__)
 EXTERN char_u e_complex[]      INIT(=N_("E361: Crash intercepted; regexp too complex?"));
 #endif
 EXTERN char_u e_outofstack[]   INIT(=N_("E363: pattern caused out-of-stack error"));
index 945092f15765c7577f6a20b397210fdcea573f53..c64a39e0271314eea9f8dd5ed22246b486ae6698 100644 (file)
@@ -3830,6 +3830,7 @@ mch_call_shell(cmd, options)
                        size_t      l;
 
                        /* child */
+                       close(fromshell_fd);
                        for (;;)
                        {
                            l = STRLEN(p + written);
index 38f7d95d0b54a322a949728f70dee807706e4d77..8d76e28613030a2d65f87916e510e092b02692b9 100644 (file)
@@ -2514,7 +2514,7 @@ jumpend:
                {
                    /* The buffer is still loaded, the Filetype autocommands
                     * need to be done now, in that buffer.  And then the
-                    * modelines (again). */
+                    * modelines need to be done (again). */
                    aucmd_prepbuf(&aco, buf);
                    apply_autocmds(EVENT_FILETYPE, buf->b_p_ft,
                                                     buf->b_fname, TRUE, buf);
@@ -2632,6 +2632,9 @@ load_dummy_buffer(fname)
     if (newbuf == NULL)
        return NULL;
 
+    /* Init the options. */
+    buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP);
+
 #ifdef FEAT_AUTOCMD
     /* set curwin/curbuf to buf and save a few things */
     aucmd_prepbuf(&aco, newbuf);
index 6f15824dfb55c0dd78fde1b3ffcfe05f38955798..bf5f7afd1f2a2594bc366c48d4719a1f5f54ede5 100644 (file)
@@ -3182,6 +3182,36 @@ vim_regexec_multi(rmp, win, buf, lnum, col)
     return r;
 }
 
+#if 0  /* this does not appear to work... */
+# ifdef __MINGW32__
+#  define MINGW_TRY
+# endif
+#endif
+
+#ifdef MINGW_TRY
+/*
+ * Special assembly code for MingW to simulate __try / __except.
+ * Does not work with the optimizer!
+ */
+# include <excpt.h>
+
+static void *ESP_save; /* used as _ESP below */
+static void *EBP_save; /* used as _EBP below */
+
+__attribute__ ((cdecl))
+    EXCEPTION_DISPOSITION
+    _except_regexec_handler(
+           struct _EXCEPTION_RECORD *ExceptionRecord,
+           void *EstablisherFrame,
+           struct _CONTEXT *ContextRecord,
+           void *DispatcherContext)
+{
+    __asm__ __volatile__ (
+           "jmp regexec_reentry");
+    return 0; /* Function does not return */
+}
+#endif
+
 /*
  * Match a regexp against a string ("line" points to the string) or multiple
  * lines ("line" is NULL, use reg_getline()).
@@ -3301,6 +3331,17 @@ vim_regexec_both(line, col)
            goto theend;
     }
 
+#ifdef MINGW_TRY
+    /* Ugly assembly code that is necessary to simulate "__try". */
+    __asm__ __volatile__ (
+           "movl  %esp, _ESP_save" "\n\t"
+           "movl  %ebp, _EBP_save");
+
+    __asm__ __volatile__ (
+           "pushl $__except_regexec_handler" "\n\t"
+           "pushl %fs:0" "\n\t"
+           "mov   %esp, %fs:0");
+#endif
 #ifdef HAVE_TRY_EXCEPT
     __try
     {
@@ -3426,6 +3467,22 @@ inner_end:
        retval = 0L;
     }
 #endif
+#ifdef MINGW_TRY
+    __asm__ __volatile__ (
+           "jmp   regexec_pop" "\n"
+           "regexec_reentry:" "\n\t"
+           "movl  _ESP_save, %esp" "\n\t"
+           "movl  _EBP_save, %ebp");
+
+       EMSG(_(e_complex));
+       retval = 0L;
+
+    __asm__ __volatile__ (
+           "regexec_pop:" "\n\t"
+           "mov   (%esp), %eax" "\n\t"
+           "mov   %eax, %fs:0" "\n\t"
+           "add   $8, %esp");
+#endif
 
 theend:
     /* Didn't find a match. */
index febf243a6ce63758e1907e397543e2bf2f042f0d..9451a0e9f60426842a512bea5a3593580fcbc95b 100644 (file)
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT      "vim70aa"
 #define VIM_VERSION_SHORT      "7.0aa"
 #define VIM_VERSION_MEDIUM     "7.0aa ALPHA"
-#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 26)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 26, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 28)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 28, compiled "