Skip to content

Commit b6ff854

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents b14fbbd + 922d25f commit b6ff854

13 files changed

+375
-216
lines changed

src/channel.c

Lines changed: 207 additions & 164 deletions
Large diffs are not rendered by default.

src/eval.c

Lines changed: 58 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ static void f_ceil(typval_T *argvars, typval_T *rettv);
504504
#endif
505505
#ifdef FEAT_CHANNEL
506506
static void f_ch_close(typval_T *argvars, typval_T *rettv);
507+
static void f_ch_log(typval_T *argvars, typval_T *rettv);
507508
static void f_ch_logfile(typval_T *argvars, typval_T *rettv);
508509
static void f_ch_open(typval_T *argvars, typval_T *rettv);
509510
static void f_ch_readraw(typval_T *argvars, typval_T *rettv);
@@ -8124,6 +8125,7 @@ static struct fst
81248125
#endif
81258126
#ifdef FEAT_CHANNEL
81268127
{"ch_close", 1, 1, f_ch_close},
8128+
{"ch_log", 1, 2, f_ch_log},
81278129
{"ch_logfile", 1, 2, f_ch_logfile},
81288130
{"ch_open", 1, 2, f_ch_open},
81298131
{"ch_readraw", 1, 2, f_ch_readraw},
@@ -8973,7 +8975,7 @@ f_abs(typval_T *argvars, typval_T *rettv)
89738975
static void
89748976
f_acos(typval_T *argvars, typval_T *rettv)
89758977
{
8976-
float_T f;
8978+
float_T f = 0.0;
89778979

89788980
rettv->v_type = VAR_FLOAT;
89798981
if (get_float_arg(argvars, &f) == OK)
@@ -9402,7 +9404,7 @@ f_assert_true(typval_T *argvars, typval_T *rettv UNUSED)
94029404
static void
94039405
f_asin(typval_T *argvars, typval_T *rettv)
94049406
{
9405-
float_T f;
9407+
float_T f = 0.0;
94069408

94079409
rettv->v_type = VAR_FLOAT;
94089410
if (get_float_arg(argvars, &f) == OK)
@@ -9432,7 +9434,7 @@ f_atan(typval_T *argvars, typval_T *rettv)
94329434
static void
94339435
f_atan2(typval_T *argvars, typval_T *rettv)
94349436
{
9435-
float_T fx, fy;
9437+
float_T fx = 0.0, fy = 0.0;
94369438

94379439
rettv->v_type = VAR_FLOAT;
94389440
if (get_float_arg(argvars, &fx) == OK
@@ -9840,7 +9842,7 @@ f_call(typval_T *argvars, typval_T *rettv)
98409842
static void
98419843
f_ceil(typval_T *argvars, typval_T *rettv)
98429844
{
9843-
float_T f;
9845+
float_T f = 0.0;
98449846

98459847
rettv->v_type = VAR_FLOAT;
98469848
if (get_float_arg(argvars, &f) == OK)
@@ -9949,6 +9951,21 @@ f_ch_close(typval_T *argvars, typval_T *rettv UNUSED)
99499951
channel_close(channel);
99509952
}
99519953

9954+
/*
9955+
* "ch_log()" function
9956+
*/
9957+
static void
9958+
f_ch_log(typval_T *argvars, typval_T *rettv UNUSED)
9959+
{
9960+
char_u *msg = get_tv_string(&argvars[0]);
9961+
channel_T *channel = NULL;
9962+
9963+
if (argvars[1].v_type != VAR_UNKNOWN)
9964+
channel = get_channel_arg(&argvars[1]);
9965+
9966+
ch_log(channel, (char *)msg);
9967+
}
9968+
99529969
/*
99539970
* "ch_logfile()" function
99549971
*/
@@ -10440,7 +10457,7 @@ f_copy(typval_T *argvars, typval_T *rettv)
1044010457
static void
1044110458
f_cos(typval_T *argvars, typval_T *rettv)
1044210459
{
10443-
float_T f;
10460+
float_T f = 0.0;
1044410461

1044510462
rettv->v_type = VAR_FLOAT;
1044610463
if (get_float_arg(argvars, &f) == OK)
@@ -10455,7 +10472,7 @@ f_cos(typval_T *argvars, typval_T *rettv)
1045510472
static void
1045610473
f_cosh(typval_T *argvars, typval_T *rettv)
1045710474
{
10458-
float_T f;
10475+
float_T f = 0.0;
1045910476

1046010477
rettv->v_type = VAR_FLOAT;
1046110478
if (get_float_arg(argvars, &f) == OK)
@@ -11003,7 +11020,7 @@ f_exists(typval_T *argvars, typval_T *rettv)
1100311020
static void
1100411021
f_exp(typval_T *argvars, typval_T *rettv)
1100511022
{
11006-
float_T f;
11023+
float_T f = 0.0;
1100711024

1100811025
rettv->v_type = VAR_FLOAT;
1100911026
if (get_float_arg(argvars, &f) == OK)
@@ -11584,7 +11601,7 @@ f_findfile(typval_T *argvars, typval_T *rettv)
1158411601
static void
1158511602
f_float2nr(typval_T *argvars, typval_T *rettv)
1158611603
{
11587-
float_T f;
11604+
float_T f = 0.0;
1158811605

1158911606
if (get_float_arg(argvars, &f) == OK)
1159011607
{
@@ -11603,7 +11620,7 @@ f_float2nr(typval_T *argvars, typval_T *rettv)
1160311620
static void
1160411621
f_floor(typval_T *argvars, typval_T *rettv)
1160511622
{
11606-
float_T f;
11623+
float_T f = 0.0;
1160711624

1160811625
rettv->v_type = VAR_FLOAT;
1160911626
if (get_float_arg(argvars, &f) == OK)
@@ -11618,7 +11635,7 @@ f_floor(typval_T *argvars, typval_T *rettv)
1161811635
static void
1161911636
f_fmod(typval_T *argvars, typval_T *rettv)
1162011637
{
11621-
float_T fx, fy;
11638+
float_T fx = 0.0, fy = 0.0;
1162211639

1162311640
rettv->v_type = VAR_FLOAT;
1162411641
if (get_float_arg(argvars, &fx) == OK
@@ -14622,9 +14639,30 @@ f_job_start(typval_T *argvars UNUSED, typval_T *rettv)
1462214639
cmd = ga.ga_data;
1462314640
#endif
1462414641
}
14642+
1462514643
#ifdef USE_ARGV
14644+
# ifdef FEAT_CHANNEL
14645+
if (ch_log_active())
14646+
{
14647+
garray_T ga;
14648+
int i;
14649+
14650+
ga_init2(&ga, (int)sizeof(char), 200);
14651+
for (i = 0; i < argc; ++i)
14652+
{
14653+
if (i > 0)
14654+
ga_concat(&ga, (char_u *)" ");
14655+
ga_concat(&ga, (char_u *)argv[i]);
14656+
}
14657+
ch_logs(NULL, "Starting job: %s", ga.ga_data);
14658+
ga_clear(&ga);
14659+
}
14660+
# endif
1462614661
mch_start_job(argv, job, &options);
1462714662
#else
14663+
# ifdef FEAT_CHANNEL
14664+
ch_logs(NULL, "Starting job: %s", cmd);
14665+
# endif
1462814666
mch_start_job((char *)cmd, job, &options);
1462914667
#endif
1463014668

@@ -15041,7 +15079,7 @@ get_maparg(typval_T *argvars, typval_T *rettv, int exact)
1504115079
static void
1504215080
f_log(typval_T *argvars, typval_T *rettv)
1504315081
{
15044-
float_T f;
15082+
float_T f = 0.0;
1504515083

1504615084
rettv->v_type = VAR_FLOAT;
1504715085
if (get_float_arg(argvars, &f) == OK)
@@ -15056,7 +15094,7 @@ f_log(typval_T *argvars, typval_T *rettv)
1505615094
static void
1505715095
f_log10(typval_T *argvars, typval_T *rettv)
1505815096
{
15059-
float_T f;
15097+
float_T f = 0.0;
1506015098

1506115099
rettv->v_type = VAR_FLOAT;
1506215100
if (get_float_arg(argvars, &f) == OK)
@@ -15852,7 +15890,7 @@ f_perleval(typval_T *argvars, typval_T *rettv)
1585215890
static void
1585315891
f_pow(typval_T *argvars, typval_T *rettv)
1585415892
{
15855-
float_T fx, fy;
15893+
float_T fx = 0.0, fy = 0.0;
1585615894

1585715895
rettv->v_type = VAR_FLOAT;
1585815896
if (get_float_arg(argvars, &fx) == OK
@@ -17143,7 +17181,7 @@ vim_round(float_T f)
1714317181
static void
1714417182
f_round(typval_T *argvars, typval_T *rettv)
1714517183
{
17146-
float_T f;
17184+
float_T f = 0.0;
1714717185

1714817186
rettv->v_type = VAR_FLOAT;
1714917187
if (get_float_arg(argvars, &f) == OK)
@@ -18315,7 +18353,7 @@ f_simplify(typval_T *argvars, typval_T *rettv)
1831518353
static void
1831618354
f_sin(typval_T *argvars, typval_T *rettv)
1831718355
{
18318-
float_T f;
18356+
float_T f = 0.0;
1831918357

1832018358
rettv->v_type = VAR_FLOAT;
1832118359
if (get_float_arg(argvars, &f) == OK)
@@ -18330,7 +18368,7 @@ f_sin(typval_T *argvars, typval_T *rettv)
1833018368
static void
1833118369
f_sinh(typval_T *argvars, typval_T *rettv)
1833218370
{
18333-
float_T f;
18371+
float_T f = 0.0;
1833418372

1833518373
rettv->v_type = VAR_FLOAT;
1833618374
if (get_float_arg(argvars, &f) == OK)
@@ -18916,7 +18954,7 @@ f_split(typval_T *argvars, typval_T *rettv)
1891618954
static void
1891718955
f_sqrt(typval_T *argvars, typval_T *rettv)
1891818956
{
18919-
float_T f;
18957+
float_T f = 0.0;
1892018958

1892118959
rettv->v_type = VAR_FLOAT;
1892218960
if (get_float_arg(argvars, &f) == OK)
@@ -19978,7 +20016,7 @@ f_test(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
1997820016
static void
1997920017
f_tan(typval_T *argvars, typval_T *rettv)
1998020018
{
19981-
float_T f;
20019+
float_T f = 0.0;
1998220020

1998320021
rettv->v_type = VAR_FLOAT;
1998420022
if (get_float_arg(argvars, &f) == OK)
@@ -19993,7 +20031,7 @@ f_tan(typval_T *argvars, typval_T *rettv)
1999320031
static void
1999420032
f_tanh(typval_T *argvars, typval_T *rettv)
1999520033
{
19996-
float_T f;
20034+
float_T f = 0.0;
1999720035

1999820036
rettv->v_type = VAR_FLOAT;
1999920037
if (get_float_arg(argvars, &f) == OK)
@@ -20182,7 +20220,7 @@ f_tr(typval_T *argvars, typval_T *rettv)
2018220220
static void
2018320221
f_trunc(typval_T *argvars, typval_T *rettv)
2018420222
{
20185-
float_T f;
20223+
float_T f = 0.0;
2018620224

2018720225
rettv->v_type = VAR_FLOAT;
2018820226
if (get_float_arg(argvars, &f) == OK)

src/gui_w32.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ directx_enabled(void)
5757
gui_mch_set_rendering_options(char_u *s)
5858
{
5959
#ifdef FEAT_DIRECTX
60-
int retval = FAIL;
6160
char_u *p, *q;
6261

6362
int dx_enable = 0;
@@ -95,36 +94,36 @@ gui_mch_set_rendering_options(char_u *s)
9594
else if (STRCMP(name, "gamma") == 0)
9695
{
9796
dx_flags |= 1 << 0;
98-
dx_gamma = (float)atof(value);
97+
dx_gamma = (float)atof((char *)value);
9998
}
10099
else if (STRCMP(name, "contrast") == 0)
101100
{
102101
dx_flags |= 1 << 1;
103-
dx_contrast = (float)atof(value);
102+
dx_contrast = (float)atof((char *)value);
104103
}
105104
else if (STRCMP(name, "level") == 0)
106105
{
107106
dx_flags |= 1 << 2;
108-
dx_level = (float)atof(value);
107+
dx_level = (float)atof((char *)value);
109108
}
110109
else if (STRCMP(name, "geom") == 0)
111110
{
112111
dx_flags |= 1 << 3;
113-
dx_geom = atoi(value);
112+
dx_geom = atoi((char *)value);
114113
if (dx_geom < 0 || dx_geom > 2)
115114
return FAIL;
116115
}
117116
else if (STRCMP(name, "renmode") == 0)
118117
{
119118
dx_flags |= 1 << 4;
120-
dx_renmode = atoi(value);
119+
dx_renmode = atoi((char *)value);
121120
if (dx_renmode < 0 || dx_renmode > 6)
122121
return FAIL;
123122
}
124123
else if (STRCMP(name, "taamode") == 0)
125124
{
126125
dx_flags |= 1 << 5;
127-
dx_taamode = atoi(value);
126+
dx_taamode = atoi((char *)value);
128127
if (dx_taamode < 0 || dx_taamode > 3)
129128
return FAIL;
130129
}
@@ -1772,7 +1771,7 @@ gui_mch_init(void)
17721771
# if !defined(_MSC_VER) || (_MSC_VER < 1400)
17731772
/* Define HandleToLong for old MS and non-MS compilers if not defined. */
17741773
# ifndef HandleToLong
1775-
# define HandleToLong(h) ((long)(h))
1774+
# define HandleToLong(h) ((long)(intptr_t)(h))
17761775
# endif
17771776
# endif
17781777
/* set the v:windowid variable */

src/gui_w48.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,7 @@ add_tabline_popup_menu_entry(HMENU pmenu, UINT item_id, char_u *item_text)
24422442
info.fMask = MIIM_TYPE | MIIM_ID;
24432443
info.wID = item_id;
24442444
info.fType = MFT_STRING;
2445-
info.dwTypeData = item_text;
2445+
info.dwTypeData = (LPTSTR)item_text;
24462446
info.cch = (UINT)STRLEN(item_text);
24472447
InsertMenuItem(pmenu, item_id, FALSE, &info);
24482448
}

src/if_mzsch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,10 +1101,10 @@ startup_mzscheme(void)
11011101
MZ_GC_VAR_IN_REG(0, coll_path);
11021102
MZ_GC_REG();
11031103
/* workaround for dynamic loading on windows */
1104-
s = vim_getenv("PLTCOLLECTS", &mustfree);
1104+
s = vim_getenv((char_u *)"PLTCOLLECTS", &mustfree);
11051105
if (s != NULL)
11061106
{
1107-
coll_path = scheme_make_path(s);
1107+
coll_path = scheme_make_path((char *)s);
11081108
MZ_GC_CHECK();
11091109
if (mustfree)
11101110
vim_free(s);

src/message.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ emsg(char_u *s)
531531
return TRUE;
532532

533533
called_emsg = TRUE;
534-
ex_exitval = 1;
534+
if (emsg_silent == 0)
535+
ex_exitval = 1;
535536

536537
/*
537538
* If "emsg_severe" is TRUE: When an error exception is to be thrown,

src/netbeans.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ netbeans_connect(char *params, int doabort)
213213
if (hostname != NULL && address != NULL && password != NULL)
214214
{
215215
port = atoi(address);
216-
nb_channel = channel_open(hostname, port, 0, nb_channel_closed);
216+
nb_channel = channel_open(hostname, port, 3000, nb_channel_closed);
217217
if (nb_channel != NULL)
218218
{
219219
/* success */

src/os_unix.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5367,11 +5367,12 @@ WaitForChar(long msec)
53675367
#if defined(__BEOS__)
53685368
int
53695369
#else
5370-
static int
5370+
static int
53715371
#endif
53725372
RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
53735373
{
53745374
int ret;
5375+
int result;
53755376
#if defined(FEAT_XCLIPBOARD) || defined(USE_XSMP) || defined(FEAT_MZSCHEME)
53765377
static int busy = FALSE;
53775378

@@ -5488,6 +5489,9 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
54885489
#endif
54895490

54905491
ret = poll(fds, nfd, towait);
5492+
5493+
result = ret > 0 && (fds[0].revents & POLLIN);
5494+
54915495
# ifdef FEAT_MZSCHEME
54925496
if (ret == 0 && mzquantum_used)
54935497
/* MzThreads scheduling is required and timeout occurred */
@@ -5635,6 +5639,10 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
56355639
# endif
56365640

56375641
ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
5642+
result = ret > 0 && FD_ISSET(fd, &rfds);
5643+
if (result)
5644+
--ret;
5645+
56385646
# ifdef EINTR
56395647
if (ret == -1 && errno == EINTR)
56405648
{
@@ -5755,7 +5763,7 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED)
57555763
#endif
57565764
}
57575765

5758-
return (ret > 0);
5766+
return result;
57595767
}
57605768

57615769
#ifndef NO_EXPANDPATH

0 commit comments

Comments
 (0)