summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0770
blob: 54998f1fdd0d80d512056e69822b556953cbd418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0770
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0770
Problem:    Inconsistent use of ELAPSED_FUNC.
Solution:   Consistently use ELAPSED_FUNC.  Also turn ELAPSED_TYPE into a
            typedef. (Ozaki Kiichi, closes #3815)
Files:	    src/channel.c, src/gui.c, src/misc1.c, src/os_unix.c, src/vim.h


*** ../vim-8.1.0769/src/channel.c	2019-01-17 14:31:10.190919265 +0100
--- src/channel.c	2019-01-17 22:20:19.225226754 +0100
***************
*** 4290,4296 ****
      int		r;
      ch_part_T	part = PART_SOCK;
  #ifdef ELAPSED_FUNC
!     ELAPSED_TYPE  start_tv;
  
      ELAPSED_INIT(start_tv);
  #endif
--- 4290,4296 ----
      int		r;
      ch_part_T	part = PART_SOCK;
  #ifdef ELAPSED_FUNC
!     elapsed_T	start_tv;
  
      ELAPSED_INIT(start_tv);
  #endif
*** ../vim-8.1.0769/src/gui.c	2019-01-17 15:43:21.761878368 +0100
--- src/gui.c	2019-01-17 22:20:19.225226754 +0100
***************
*** 2951,2959 ****
      int
  gui_wait_for_chars(long wtime, int tb_change_cnt)
  {
!     int	    retval;
  #if defined(ELAPSED_FUNC)
!     ELAPSED_TYPE start_tv;
  #endif
  
  #ifdef FEAT_MENU
--- 2951,2959 ----
      int
  gui_wait_for_chars(long wtime, int tb_change_cnt)
  {
!     int		retval;
  #if defined(ELAPSED_FUNC)
!     elapsed_T	start_tv;
  #endif
  
  #ifdef FEAT_MENU
***************
*** 3002,3008 ****
      if (gui_wait_for_chars_or_timer(p_ut) == OK)
  	retval = OK;
      else if (trigger_cursorhold()
! #ifdef ELAPSED_FUNC
  	    && ELAPSED_FUNC(start_tv) >= p_ut
  #endif
  	    && typebuf.tb_change_cnt == tb_change_cnt)
--- 3002,3008 ----
      if (gui_wait_for_chars_or_timer(p_ut) == OK)
  	retval = OK;
      else if (trigger_cursorhold()
! #if defined(ELAPSED_FUNC)
  	    && ELAPSED_FUNC(start_tv) >= p_ut
  #endif
  	    && typebuf.tb_change_cnt == tb_change_cnt)
*** ../vim-8.1.0769/src/misc1.c	2019-01-13 23:38:33.399773248 +0100
--- src/misc1.c	2019-01-17 22:20:19.229226723 +0100
***************
*** 3891,3897 ****
  	{
  #ifdef ELAPSED_FUNC
  	    static int		did_init = FALSE;
! 	    static ELAPSED_TYPE	start_tv;
  
  	    /* Only beep once per half a second, otherwise a sequence of beeps
  	     * would freeze Vim. */
--- 3891,3897 ----
  	{
  #ifdef ELAPSED_FUNC
  	    static int		did_init = FALSE;
! 	    static elapsed_T	start_tv;
  
  	    /* Only beep once per half a second, otherwise a sequence of beeps
  	     * would freeze Vim. */
*** ../vim-8.1.0769/src/os_unix.c	2019-01-13 23:38:33.407773189 +0100
--- src/os_unix.c	2019-01-17 22:20:19.229226723 +0100
***************
*** 374,380 ****
      long	wait_time;
      long	elapsed_time = 0;
  #ifdef ELAPSED_FUNC
!     ELAPSED_TYPE start_tv;
  
      ELAPSED_INIT(start_tv);
  #endif
--- 374,380 ----
      long	wait_time;
      long	elapsed_time = 0;
  #ifdef ELAPSED_FUNC
!     elapsed_T	start_tv;
  
      ELAPSED_INIT(start_tv);
  #endif
***************
*** 480,486 ****
  	}
  
  	/* no character available */
! #if !(defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H))
  	/* estimate the elapsed time */
  	elapsed_time += wait_time;
  #endif
--- 480,486 ----
  	}
  
  	/* no character available */
! #ifndef ELAPSED_FUNC
  	/* estimate the elapsed time */
  	elapsed_time += wait_time;
  #endif
***************
*** 1907,1917 ****
  #ifdef SET_SIG_ALARM
  	RETSIGTYPE (*sig_save)();
  #endif
! #if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
! 	struct timeval  start_tv;
  
  	if (p_verbose > 0)
! 	    gettimeofday(&start_tv, NULL);
  #endif
  
  #ifdef SET_SIG_ALARM
--- 1907,1917 ----
  #ifdef SET_SIG_ALARM
  	RETSIGTYPE (*sig_save)();
  #endif
! #ifdef ELAPSED_FUNC
! 	elapsed_T start_tv;
  
  	if (p_verbose > 0)
! 	    ELAPSED_INIT(start_tv);
  #endif
  
  #ifdef SET_SIG_ALARM
***************
*** 4831,4838 ****
  		int	    fromshell_fd;
  		garray_T    ga;
  		int	    noread_cnt;
! # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
! 		struct timeval  start_tv;
  # endif
  
  # ifdef FEAT_GUI
--- 4831,4838 ----
  		int	    fromshell_fd;
  		garray_T    ga;
  		int	    noread_cnt;
! # ifdef ELAPSED_FUNC
! 		elapsed_T   start_tv;
  # endif
  
  # ifdef FEAT_GUI
***************
*** 6073,6080 ****
  # ifdef ELAPSED_FUNC
      /* Remember at what time we started, so that we know how much longer we
       * should wait after being interrupted. */
!     long	    start_msec = msec;
!     ELAPSED_TYPE  start_tv;
  
      if (msec > 0)
  	ELAPSED_INIT(start_tv);
--- 6073,6080 ----
  # ifdef ELAPSED_FUNC
      /* Remember at what time we started, so that we know how much longer we
       * should wait after being interrupted. */
!     long	start_msec = msec;
!     elapsed_T	start_tv;
  
      if (msec > 0)
  	ELAPSED_INIT(start_tv);
***************
*** 7494,7500 ****
  	int (*oldIOhandler)();
  #endif
  # ifdef ELAPSED_FUNC
! 	ELAPSED_TYPE  start_tv;
  
  	if (p_verbose > 0)
  	    ELAPSED_INIT(start_tv);
--- 7494,7500 ----
  	int (*oldIOhandler)();
  #endif
  # ifdef ELAPSED_FUNC
! 	elapsed_T start_tv;
  
  	if (p_verbose > 0)
  	    ELAPSED_INIT(start_tv);
*** ../vim-8.1.0769/src/vim.h	2019-01-17 17:13:25.924984061 +0100
--- src/vim.h	2019-01-17 22:20:19.229226723 +0100
***************
*** 2625,2641 ****
  # define ELAPSED_TIMEVAL
  # define ELAPSED_INIT(v) gettimeofday(&v, NULL)
  # define ELAPSED_FUNC(v) elapsed(&v)
! # define ELAPSED_TYPE struct timeval
!     long elapsed(struct timeval *start_tv);
! #else
! # if defined(WIN32)
! #  define ELAPSED_TICKCOUNT
! #  define ELAPSED_INIT(v) v = GetTickCount()
! #  define ELAPSED_FUNC(v) elapsed(v)
! #  define ELAPSED_TYPE DWORD
! #   ifndef PROTO
!      long elapsed(DWORD start_tick);
! #   endif
  # endif
  #endif
  
--- 2625,2639 ----
  # define ELAPSED_TIMEVAL
  # define ELAPSED_INIT(v) gettimeofday(&v, NULL)
  # define ELAPSED_FUNC(v) elapsed(&v)
! typedef struct timeval elapsed_T;
! long elapsed(struct timeval *start_tv);
! #elif defined(WIN32)
! # define ELAPSED_TICKCOUNT
! # define ELAPSED_INIT(v) v = GetTickCount()
! # define ELAPSED_FUNC(v) elapsed(v)
! typedef DWORD elapsed_T;
! # ifndef PROTO
! long elapsed(DWORD start_tick);
  # endif
  #endif
  
*** ../vim-8.1.0769/src/version.c	2019-01-17 22:13:50.588531539 +0100
--- src/version.c	2019-01-17 22:20:47.004998591 +0100
***************
*** 793,794 ****
--- 793,796 ----
  {   /* Add new patch number below this line */
+ /**/
+     770,
  /**/

-- 
Eagles may soar, but weasels don't get sucked into jet engines.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///