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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
|
To: vim-dev@vim.org
Subject: Patch 7.2.169
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 7.2.169
Problem: Splint complains about a lot of things.
Solution: Add type casts, #ifdefs and other changes to avoid warnings.
Change colnr_T from unsigned to int. Avoids mistakes with
subtracting columns.
Files: src/cleanlint.vim, src/diff.c, src/edit.c, src/ex_cmds.c,
src/ex_cmds2.c, src/ex_docmd.c, src/proto/ex_cmds.pro,
src/proto/spell.pro, src/quickfix.c, src/spell.c, src/structs.h,
src/term.h, src/vim.h
*** ../vim-7.2.168/src/cleanlint.vim 2009-05-13 12:46:36.000000000 +0200
--- src/cleanlint.vim 2009-05-13 18:03:11.000000000 +0200
***************
*** 1,27 ****
" Vim tool: Filter output of splint
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
! " Last Change: 2009 May 05
" Usage: redirect output of "make lint" to a file, edit that file with Vim and
" :call CleanLint()
" This deletes irrelevant messages. What remains might be valid warnings.
fun! CleanLint()
- g/^ Types are incompatible/lockmarks d
g/Assignment of dev_t to __dev_t:/lockmarks d
g/Assignment of __dev_t to dev_t:/lockmarks d
g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
! g/Operands of == have incompatible types (unsigned int, int): /lockmarks d
g/Assignment of char to char_u: /lockmarks d
g/Assignment of unsigned int to int: /lockmarks d
! g/Assignment of colnr_T to int: /lockmarks d
g/Assignment of int to char_u: /lockmarks d
g/Function .* expects arg . to be wint_t gets int: /lockmarks d
! g/^digraph.c.*digraphdefault.*is type char, expects char_u:/lockmarks d
g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
endfun
--- 1,32 ----
" Vim tool: Filter output of splint
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
! " Last Change: 2009 May 13
" Usage: redirect output of "make lint" to a file, edit that file with Vim and
" :call CleanLint()
" This deletes irrelevant messages. What remains might be valid warnings.
fun! CleanLint()
g/Assignment of dev_t to __dev_t:/lockmarks d
g/Assignment of __dev_t to dev_t:/lockmarks d
g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
! g/Operands of == have incompatible types (char_u, int): /lockmarks d
g/Assignment of char to char_u: /lockmarks d
g/Assignment of unsigned int to int: /lockmarks d
! g/Assignment of int to unsigned int: /lockmarks d
! g/Assignment of unsigned int to long int: /lockmarks d
g/Assignment of int to char_u: /lockmarks d
g/Function .* expects arg . to be wint_t gets int: /lockmarks d
! g/Function .* expects arg . to be size_t gets int: /lockmarks d
! g/Initial value of .* is type char, expects char_u: /lockmarks d
! g/^ex_cmds.h:.* Function types are inconsistent. Parameter 1 is implicitly temp, but unqualified in assigned function:/lockmarks d
! g/^ex_docmd.c:.* nospec_str/lockmarks d
g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
+ g/^ Types are incompatible/lockmarks d
g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
+ g+ A variable is declared but never used. Use /.@unused@./ in front of declaration to suppress message.+lockmarks d
endfun
*** ../vim-7.2.168/src/diff.c 2009-03-11 12:45:44.000000000 +0100
--- src/diff.c 2009-05-13 16:16:11.000000000 +0200
***************
*** 827,832 ****
--- 827,833 ----
char_u *tmp_diff;
{
char_u *cmd;
+ size_t len;
#ifdef FEAT_EVAL
if (*p_dex != NUL)
***************
*** 835,842 ****
else
#endif
{
! cmd = alloc((unsigned)(STRLEN(tmp_orig) + STRLEN(tmp_new)
! + STRLEN(tmp_diff) + STRLEN(p_srr) + 27));
if (cmd != NULL)
{
/* We don't want $DIFF_OPTIONS to get in the way. */
--- 836,844 ----
else
#endif
{
! len = STRLEN(tmp_orig) + STRLEN(tmp_new)
! + STRLEN(tmp_diff) + STRLEN(p_srr) + 27;
! cmd = alloc((unsigned)len);
if (cmd != NULL)
{
/* We don't want $DIFF_OPTIONS to get in the way. */
***************
*** 846,852 ****
/* Build the diff command and execute it. Always use -a, binary
* differences are of no use. Ignore errors, diff returns
* non-zero when differences have been found. */
! sprintf((char *)cmd, "diff %s%s%s%s%s %s",
diff_a_works == FALSE ? "" : "-a ",
#if defined(MSWIN) || defined(MSDOS)
diff_bin_works == TRUE ? "--binary " : "",
--- 848,854 ----
/* Build the diff command and execute it. Always use -a, binary
* differences are of no use. Ignore errors, diff returns
* non-zero when differences have been found. */
! vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s",
diff_a_works == FALSE ? "" : "-a ",
#if defined(MSWIN) || defined(MSDOS)
diff_bin_works == TRUE ? "--binary " : "",
***************
*** 856,862 ****
(diff_flags & DIFF_IWHITE) ? "-b " : "",
(diff_flags & DIFF_ICASE) ? "-i " : "",
tmp_orig, tmp_new);
! append_redir(cmd, p_srr, tmp_diff);
#ifdef FEAT_AUTOCMD
block_autocmds(); /* Avoid ShellCmdPost stuff */
#endif
--- 858,864 ----
(diff_flags & DIFF_IWHITE) ? "-b " : "",
(diff_flags & DIFF_ICASE) ? "-i " : "",
tmp_orig, tmp_new);
! append_redir(cmd, (int)len, p_srr, tmp_diff);
#ifdef FEAT_AUTOCMD
block_autocmds(); /* Avoid ShellCmdPost stuff */
#endif
***************
*** 881,886 ****
--- 883,889 ----
char_u *tmp_orig; /* name of original temp file */
char_u *tmp_new; /* name of patched temp file */
char_u *buf = NULL;
+ size_t buflen;
win_T *old_curwin = curwin;
char_u *newname = NULL; /* name of patched file buffer */
#ifdef UNIX
***************
*** 920,930 ****
/* Get the absolute path of the patchfile, changing directory below. */
fullname = FullName_save(eap->arg, FALSE);
#endif
! buf = alloc((unsigned)(STRLEN(tmp_orig) + (
# ifdef UNIX
fullname != NULL ? STRLEN(fullname) :
# endif
! STRLEN(eap->arg)) + STRLEN(tmp_new) + 16));
if (buf == NULL)
goto theend;
--- 923,934 ----
/* Get the absolute path of the patchfile, changing directory below. */
fullname = FullName_save(eap->arg, FALSE);
#endif
! buflen = STRLEN(tmp_orig) + (
# ifdef UNIX
fullname != NULL ? STRLEN(fullname) :
# endif
! STRLEN(eap->arg)) + STRLEN(tmp_new) + 16;
! buf = alloc((unsigned)buflen);
if (buf == NULL)
goto theend;
***************
*** 961,967 ****
{
/* Build the patch command and execute it. Ignore errors. Switch to
* cooked mode to allow the user to respond to prompts. */
! sprintf((char *)buf, "patch -o %s %s < \"%s\"", tmp_new, tmp_orig,
# ifdef UNIX
fullname != NULL ? fullname :
# endif
--- 965,972 ----
{
/* Build the patch command and execute it. Ignore errors. Switch to
* cooked mode to allow the user to respond to prompts. */
! vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",
! tmp_new, tmp_orig,
# ifdef UNIX
fullname != NULL ? fullname :
# endif
*** ../vim-7.2.168/src/edit.c 2009-05-13 12:46:36.000000000 +0200
--- src/edit.c 2009-05-13 18:29:21.000000000 +0200
***************
*** 169,175 ****
static int ins_compl_key2count __ARGS((int c));
static int ins_compl_use_match __ARGS((int c));
static int ins_complete __ARGS((int c));
! static int quote_meta __ARGS((char_u *dest, char_u *str, int len));
#endif /* FEAT_INS_EXPAND */
#define BACKSPACE_CHAR 1
--- 169,175 ----
static int ins_compl_key2count __ARGS((int c));
static int ins_compl_use_match __ARGS((int c));
static int ins_complete __ARGS((int c));
! static unsigned quote_meta __ARGS((char_u *dest, char_u *str, int len));
#endif /* FEAT_INS_EXPAND */
#define BACKSPACE_CHAR 1
***************
*** 757,763 ****
* there is nothing to add, CTRL-L works like CTRL-P then. */
if (c == Ctrl_L
&& (ctrl_x_mode != CTRL_X_WHOLE_LINE
! || STRLEN(compl_shown_match->cp_str)
> curwin->w_cursor.col - compl_col))
{
ins_compl_addfrommatch();
--- 757,763 ----
* there is nothing to add, CTRL-L works like CTRL-P then. */
if (c == Ctrl_L
&& (ctrl_x_mode != CTRL_X_WHOLE_LINE
! || (int)STRLEN(compl_shown_match->cp_str)
> curwin->w_cursor.col - compl_col))
{
ins_compl_addfrommatch();
***************
*** 3837,3843 ****
--- 3837,3847 ----
char_u *word;
int icase = FALSE;
int adup = FALSE;
+ #ifdef S_SPLINT_S /* splint doesn't parse array of pointers correctly */
+ char_u **cptext;
+ #else
char_u *(cptext[CPT_COUNT]);
+ #endif
if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
{
***************
*** 3994,4000 ****
else if (*e_cpt == ']' || *e_cpt == 't')
{
type = CTRL_X_TAGS;
! sprintf((char*)IObuff, _("Scanning tags."));
(void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
}
else
--- 3998,4004 ----
else if (*e_cpt == ']' || *e_cpt == 't')
{
type = CTRL_X_TAGS;
! vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags."));
(void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
}
else
***************
*** 4093,4099 ****
case CTRL_X_SPELL:
#ifdef FEAT_SPELL
num_matches = expand_spelling(first_match_pos.lnum,
! first_match_pos.col, compl_pattern, &matches);
if (num_matches > 0)
ins_compl_add_matches(num_matches, matches, p_ic);
#endif
--- 4097,4103 ----
case CTRL_X_SPELL:
#ifdef FEAT_SPELL
num_matches = expand_spelling(first_match_pos.lnum,
! compl_pattern, &matches);
if (num_matches > 0)
ins_compl_add_matches(num_matches, matches, p_ic);
#endif
***************
*** 4803,4812 ****
{
char_u *prefix = (char_u *)"\\<";
! /* we need 3 extra chars, 1 for the NUL and
! * 2 >= strlen(prefix) -- Acevedo */
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
! compl_length) + 3);
if (compl_pattern == NULL)
return FAIL;
if (!vim_iswordp(line + compl_col)
--- 4807,4815 ----
{
char_u *prefix = (char_u *)"\\<";
! /* we need up to 2 extra chars for the prefix */
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
! compl_length) + 2);
if (compl_pattern == NULL)
return FAIL;
if (!vim_iswordp(line + compl_col)
***************
*** 4881,4887 ****
else
{
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
! compl_length) + 3);
if (compl_pattern == NULL)
return FAIL;
STRCPY((char *)compl_pattern, "\\<");
--- 4884,4890 ----
else
{
compl_pattern = alloc(quote_meta(NULL, line + compl_col,
! compl_length) + 2);
if (compl_pattern == NULL)
return FAIL;
STRCPY((char *)compl_pattern, "\\<");
***************
*** 4963,4969 ****
if (col < 0)
col = curs_col;
compl_col = col;
! if ((colnr_T)compl_col > curs_col)
compl_col = curs_col;
/* Setup variables for completion. Need to obtain "line" again,
--- 4966,4972 ----
if (col < 0)
col = curs_col;
compl_col = col;
! if (compl_col > curs_col)
compl_col = curs_col;
/* Setup variables for completion. Need to obtain "line" again,
***************
*** 5236,5250 ****
* a backslash) the metachars, and dest would be NUL terminated.
* Returns the length (needed) of dest
*/
! static int
quote_meta(dest, src, len)
char_u *dest;
char_u *src;
int len;
{
! int m;
! for (m = len; --len >= 0; src++)
{
switch (*src)
{
--- 5239,5253 ----
* a backslash) the metachars, and dest would be NUL terminated.
* Returns the length (needed) of dest
*/
! static unsigned
quote_meta(dest, src, len)
char_u *dest;
char_u *src;
int len;
{
! unsigned m = (unsigned)len + 1; /* one extra for the NUL */
! for ( ; --len >= 0; src++)
{
switch (*src)
{
***************
*** 6073,6079 ****
* in 'formatoptions' and there is a single character before the cursor.
* Otherwise the line would be broken and when typing another non-white
* next they are not joined back together. */
! wasatend = (pos.col == STRLEN(old));
if (*old != NUL && !trailblank && wasatend)
{
dec_cursor();
--- 6076,6082 ----
* in 'formatoptions' and there is a single character before the cursor.
* Otherwise the line would be broken and when typing another non-white
* next they are not joined back together. */
! wasatend = (pos.col == (colnr_T)STRLEN(old));
if (*old != NUL && !trailblank && wasatend)
{
dec_cursor();
***************
*** 6250,6256 ****
* three digits. */
if (VIM_ISDIGIT(c))
{
! sprintf((char *)buf, "%03d", c);
AppendToRedobuff(buf);
}
else
--- 6253,6259 ----
* three digits. */
if (VIM_ISDIGIT(c))
{
! vim_snprintf((char *)buf, sizeof(buf), "%03d", c);
AppendToRedobuff(buf);
}
else
***************
*** 6453,6462 ****
* deleted characters. */
if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
{
! cc = (int)STRLEN(ml_get_curline());
! if (VIsual.col > (colnr_T)cc)
{
! VIsual.col = cc;
# ifdef FEAT_VIRTUALEDIT
VIsual.coladd = 0;
# endif
--- 6457,6467 ----
* deleted characters. */
if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
{
! int len = (int)STRLEN(ml_get_curline());
!
! if (VIsual.col > len)
{
! VIsual.col = len;
# ifdef FEAT_VIRTUALEDIT
VIsual.coladd = 0;
# endif
***************
*** 8315,8320 ****
--- 8320,8326 ----
linenr_T lnum;
int cc;
int temp = 0; /* init for GCC */
+ colnr_T save_col;
colnr_T mincol;
int did_backspace = FALSE;
int in_indent;
***************
*** 8472,8484 ****
*/
while (cc > 0)
{
! temp = curwin->w_cursor.col;
#ifdef FEAT_MBYTE
mb_replace_pop_ins(cc);
#else
ins_char(cc);
#endif
! curwin->w_cursor.col = temp;
cc = replace_pop();
}
/* restore the characters that NL replaced */
--- 8478,8490 ----
*/
while (cc > 0)
{
! save_col = curwin->w_cursor.col;
#ifdef FEAT_MBYTE
mb_replace_pop_ins(cc);
#else
ins_char(cc);
#endif
! curwin->w_cursor.col = save_col;
cc = replace_pop();
}
/* restore the characters that NL replaced */
***************
*** 8510,8520 ****
#endif
)
{
! temp = curwin->w_cursor.col;
beginline(BL_WHITE);
if (curwin->w_cursor.col < (colnr_T)temp)
mincol = curwin->w_cursor.col;
! curwin->w_cursor.col = temp;
}
/*
--- 8516,8526 ----
#endif
)
{
! save_col = curwin->w_cursor.col;
beginline(BL_WHITE);
if (curwin->w_cursor.col < (colnr_T)temp)
mincol = curwin->w_cursor.col;
! curwin->w_cursor.col = save_col;
}
/*
*** ../vim-7.2.168/src/ex_cmds.c 2009-05-13 12:46:36.000000000 +0200
--- src/ex_cmds.c 2009-05-13 18:24:18.000000000 +0200
***************
*** 87,99 ****
))
{
transchar_nonprint(buf3, c);
! sprintf(buf1, " <%s>", (char *)buf3);
}
else
buf1[0] = NUL;
#ifndef EBCDIC
if (c >= 0x80)
! sprintf(buf2, " <M-%s>", transchar(c & 0x7f));
else
#endif
buf2[0] = NUL;
--- 87,100 ----
))
{
transchar_nonprint(buf3, c);
! vim_snprintf(buf1, sizeof(buf1), " <%s>", (char *)buf3);
}
else
buf1[0] = NUL;
#ifndef EBCDIC
if (c >= 0x80)
! vim_snprintf(buf2, sizeof(buf2), " <M-%s>",
! (char *)transchar(c & 0x7f));
else
#endif
buf2[0] = NUL;
***************
*** 358,364 ****
linenr_T lnum;
long maxlen = 0;
sorti_T *nrs;
! size_t count = eap->line2 - eap->line1 + 1;
size_t i;
char_u *p;
char_u *s;
--- 359,365 ----
linenr_T lnum;
long maxlen = 0;
sorti_T *nrs;
! size_t count = (size_t)(eap->line2 - eap->line1 + 1);
size_t i;
char_u *p;
char_u *s;
***************
*** 957,963 ****
}
len += (int)STRLEN(prevcmd);
}
! if ((t = alloc(len)) == NULL)
{
vim_free(newcmd);
return;
--- 958,964 ----
}
len += (int)STRLEN(prevcmd);
}
! if ((t = alloc((unsigned)len)) == NULL)
{
vim_free(newcmd);
return;
***************
*** 1548,1554 ****
* redirecting input and/or output.
*/
if (itmp != NULL || otmp != NULL)
! sprintf((char *)buf, "(%s)", (char *)cmd);
else
STRCPY(buf, cmd);
if (itmp != NULL)
--- 1549,1555 ----
* redirecting input and/or output.
*/
if (itmp != NULL || otmp != NULL)
! vim_snprintf((char *)buf, len, "(%s)", (char *)cmd);
else
STRCPY(buf, cmd);
if (itmp != NULL)
***************
*** 1597,1633 ****
}
#endif
if (otmp != NULL)
! append_redir(buf, p_srr, otmp);
return buf;
}
/*
! * Append output redirection for file "fname" to the end of string buffer "buf"
* Works with the 'shellredir' and 'shellpipe' options.
* The caller should make sure that there is enough room:
* STRLEN(opt) + STRLEN(fname) + 3
*/
void
! append_redir(buf, opt, fname)
char_u *buf;
char_u *opt;
char_u *fname;
{
char_u *p;
! buf += STRLEN(buf);
/* find "%s", skipping "%%" */
for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
if (p[1] == 's')
break;
if (p != NULL)
{
! *buf = ' '; /* not really needed? Not with sh, ksh or bash */
! sprintf((char *)buf + 1, (char *)opt, (char *)fname);
}
else
! sprintf((char *)buf,
#ifdef FEAT_QUICKFIX
# ifndef RISCOS
opt != p_sp ? " %s%s" :
--- 1598,1638 ----
}
#endif
if (otmp != NULL)
! append_redir(buf, (int)len, p_srr, otmp);
return buf;
}
/*
! * Append output redirection for file "fname" to the end of string buffer
! * "buf[buflen]"
* Works with the 'shellredir' and 'shellpipe' options.
* The caller should make sure that there is enough room:
* STRLEN(opt) + STRLEN(fname) + 3
*/
void
! append_redir(buf, buflen, opt, fname)
char_u *buf;
+ int buflen;
char_u *opt;
char_u *fname;
{
char_u *p;
+ char_u *end;
! end = buf + STRLEN(buf);
/* find "%s", skipping "%%" */
for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
if (p[1] == 's')
break;
if (p != NULL)
{
! *end = ' '; /* not really needed? Not with sh, ksh or bash */
! vim_snprintf((char *)end + 1, (size_t)(buflen - (end + 1 - buf)),
! (char *)opt, (char *)fname);
}
else
! vim_snprintf((char *)end, (size_t)(buflen - (end - buf)),
#ifdef FEAT_QUICKFIX
# ifndef RISCOS
opt != p_sp ? " %s%s" :
***************
*** 2390,2396 ****
if (curwin->w_p_nu || use_number)
{
! sprintf((char *)numbuf, "%*ld ", number_width(curwin), (long)lnum);
msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
}
msg_prt_line(ml_get(lnum), list);
--- 2395,2402 ----
if (curwin->w_p_nu || use_number)
{
! vim_snprintf((char *)numbuf, sizeof(numbuf),
! "%*ld ", number_width(curwin), (long)lnum);
msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
}
msg_prt_line(ml_get(lnum), list);
***************
*** 4486,4492 ****
char_u *p1;
int did_sub = FALSE;
int lastone;
! unsigned len, needed_len;
long nmatch_tl = 0; /* nr of lines matched below lnum */
int do_again; /* do it again after joining lines */
int skip_match = FALSE;
--- 4492,4498 ----
char_u *p1;
int did_sub = FALSE;
int lastone;
! int len, copy_len, needed_len;
long nmatch_tl = 0; /* nr of lines matched below lnum */
int do_again; /* do it again after joining lines */
int skip_match = FALSE;
***************
*** 4631,4636 ****
--- 4637,4644 ----
if (do_ask)
{
+ int typed;
+
/* change State to CONFIRM, so that the mouse works
* properly */
save_State = State;
***************
*** 4669,4675 ****
resp = getexmodeline('?', NULL, 0);
if (resp != NULL)
{
! i = *resp;
vim_free(resp);
}
}
--- 4677,4683 ----
resp = getexmodeline('?', NULL, 0);
if (resp != NULL)
{
! typed = *resp;
vim_free(resp);
}
}
***************
*** 4721,4727 ****
#endif
++no_mapping; /* don't map this key */
++allow_keys; /* allow special keys */
! i = plain_vgetc();
--allow_keys;
--no_mapping;
--- 4729,4735 ----
#endif
++no_mapping; /* don't map this key */
++allow_keys; /* allow special keys */
! typed = plain_vgetc();
--allow_keys;
--no_mapping;
***************
*** 4732,4766 ****
}
need_wait_return = FALSE; /* no hit-return prompt */
! if (i == 'q' || i == ESC || i == Ctrl_C
#ifdef UNIX
! || i == intr_char
#endif
)
{
got_quit = TRUE;
break;
}
! if (i == 'n')
break;
! if (i == 'y')
break;
! if (i == 'l')
{
/* last: replace and then stop */
do_all = FALSE;
line2 = lnum;
break;
}
! if (i == 'a')
{
do_ask = FALSE;
break;
}
#ifdef FEAT_INS_EXPAND
! if (i == Ctrl_E)
scrollup_clamp();
! else if (i == Ctrl_Y)
scrolldown_clamp();
#endif
}
--- 4740,4774 ----
}
need_wait_return = FALSE; /* no hit-return prompt */
! if (typed == 'q' || typed == ESC || typed == Ctrl_C
#ifdef UNIX
! || typed == intr_char
#endif
)
{
got_quit = TRUE;
break;
}
! if (typed == 'n')
break;
! if (typed == 'y')
break;
! if (typed == 'l')
{
/* last: replace and then stop */
do_all = FALSE;
line2 = lnum;
break;
}
! if (typed == 'a')
{
do_ask = FALSE;
break;
}
#ifdef FEAT_INS_EXPAND
! if (typed == Ctrl_E)
scrollup_clamp();
! else if (typed == Ctrl_Y)
scrolldown_clamp();
#endif
}
***************
*** 4771,4777 ****
if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
--no_u_sync;
! if (i == 'n')
{
/* For a multi-line match, put matchcol at the NUL at
* the end of the line and set nmatch to one, so that
--- 4779,4785 ----
if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
--no_u_sync;
! if (typed == 'n')
{
/* For a multi-line match, put matchcol at the NUL at
* the end of the line and set nmatch to one, so that
***************
*** 4822,4830 ****
p1 = ml_get(sub_firstlnum + nmatch - 1);
nmatch_tl += nmatch - 1;
}
! i = regmatch.startpos[0].col - copycol;
! needed_len = i + ((unsigned)STRLEN(p1) - regmatch.endpos[0].col)
! + sublen + 1;
if (new_start == NULL)
{
/*
--- 4830,4838 ----
p1 = ml_get(sub_firstlnum + nmatch - 1);
nmatch_tl += nmatch - 1;
}
! copy_len = regmatch.startpos[0].col - copycol;
! needed_len = copy_len + ((unsigned)STRLEN(p1)
! - regmatch.endpos[0].col) + sublen + 1;
if (new_start == NULL)
{
/*
***************
*** 4847,4853 ****
*/
len = (unsigned)STRLEN(new_start);
needed_len += len;
! if (needed_len > new_start_len)
{
new_start_len = needed_len + 50;
if ((p1 = alloc_check(new_start_len)) == NULL)
--- 4855,4861 ----
*/
len = (unsigned)STRLEN(new_start);
needed_len += len;
! if (needed_len > (int)new_start_len)
{
new_start_len = needed_len + 50;
if ((p1 = alloc_check(new_start_len)) == NULL)
***************
*** 4865,4872 ****
/*
* copy the text up to the part that matched
*/
! mch_memmove(new_end, sub_firstline + copycol, (size_t)i);
! new_end += i;
(void)vim_regsub_multi(®match,
sub_firstlnum - regmatch.startpos[0].lnum,
--- 4873,4880 ----
/*
* copy the text up to the part that matched
*/
! mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len);
! new_end += copy_len;
(void)vim_regsub_multi(®match,
sub_firstlnum - regmatch.startpos[0].lnum,
***************
*** 5768,5773 ****
--- 5776,5785 ----
{
char_u *s, *d;
int i;
+ #ifdef S_SPLINT_S /* splint doesn't understand array of pointers */
+ static char **mtable;
+ static char **rtable;
+ #else
static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
"/*", "/\\*", "\"*", "**",
"/\\(\\)",
***************
*** 5782,5787 ****
--- 5794,5800 ----
"/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
"\\[count]", "\\[quotex]", "\\[range]",
"\\[pattern]", "\\\\bar", "/\\\\%\\$"};
+ #endif
int flags;
d = IObuff; /* assume IObuff is long enough! */
***************
*** 5790,5796 ****
* Recognize a few exceptions to the rule. Some strings that contain '*'
* with "star". Otherwise '*' is recognized as a wildcard.
*/
! for (i = sizeof(mtable) / sizeof(char *); --i >= 0; )
if (STRCMP(arg, mtable[i]) == 0)
{
STRCPY(d, rtable[i]);
--- 5803,5809 ----
* Recognize a few exceptions to the rule. Some strings that contain '*'
* with "star". Otherwise '*' is recognized as a wildcard.
*/
! for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
if (STRCMP(arg, mtable[i]) == 0)
{
STRCPY(d, rtable[i]);
*** ../vim-7.2.168/src/ex_cmds2.c 2009-02-05 20:47:14.000000000 +0100
--- src/ex_cmds2.c 2009-05-13 16:22:33.000000000 +0200
***************
*** 3373,3379 ****
p = skipwhite(sp->nextline);
if (*p != '\\')
break;
! s = alloc((int)(STRLEN(line) + STRLEN(p)));
if (s == NULL) /* out of memory */
break;
STRCPY(s, line);
--- 3373,3379 ----
p = skipwhite(sp->nextline);
if (*p != '\\')
break;
! s = alloc((unsigned)(STRLEN(line) + STRLEN(p)));
if (s == NULL) /* out of memory */
break;
STRCPY(s, line);
*** ../vim-7.2.168/src/ex_docmd.c 2009-04-29 18:44:38.000000000 +0200
--- src/ex_docmd.c 2009-05-13 17:56:44.000000000 +0200
***************
*** 2737,2743 ****
int i;
for (i = 0; cmd[i] != NUL; ++i)
! if (cmd[i] != (*pp)[i])
break;
if (i >= len && !isalpha((*pp)[i]))
{
--- 2737,2743 ----
int i;
for (i = 0; cmd[i] != NUL; ++i)
! if (((char_u *)cmd)[i] != (*pp)[i])
break;
if (i >= len && !isalpha((*pp)[i]))
{
***************
*** 2803,2809 ****
/* Check for ":dl", ":dell", etc. to ":deletel": that's
* :delete with the 'l' flag. Same for 'p'. */
for (i = 0; i < len; ++i)
! if (eap->cmd[i] != "delete"[i])
break;
if (i == len - 1)
{
--- 2803,2809 ----
/* Check for ":dl", ":dell", etc. to ":deletel": that's
* :delete with the 'l' flag. Same for 'p'. */
for (i = 0; i < len; ++i)
! if (eap->cmd[i] != ((char_u *)"delete")[i])
break;
if (i == len - 1)
{
***************
*** 3823,3829 ****
char_u *cmd;
int *ctx; /* pointer to xp_context or NULL */
{
! int delim;
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
{
--- 3823,3829 ----
char_u *cmd;
int *ctx; /* pointer to xp_context or NULL */
{
! unsigned delim;
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
{
***************
*** 9417,9423 ****
{
int len;
int i;
! static char *(spec_str[]) = {
"%",
#define SPEC_PERC 0
"#",
--- 9417,9429 ----
{
int len;
int i;
! #ifdef S_SPLINT_S /* splint can't handle array of pointers */
! static char **spec_str;
! static char *(nospec_str[])
! #else
! static char *(spec_str[])
! #endif
! = {
"%",
#define SPEC_PERC 0
"#",
***************
*** 9443,9451 ****
# define SPEC_CLIENT 9
#endif
};
- #define SPEC_COUNT (sizeof(spec_str) / sizeof(char *))
! for (i = 0; i < SPEC_COUNT; ++i)
{
len = (int)STRLEN(spec_str[i]);
if (STRNCMP(src, spec_str[i], len) == 0)
--- 9449,9456 ----
# define SPEC_CLIENT 9
#endif
};
! for (i = 0; i < (int)(sizeof(spec_str) / sizeof(char *)); ++i)
{
len = (int)STRLEN(spec_str[i]);
if (STRNCMP(src, spec_str[i], len) == 0)
***************
*** 9796,9802 ****
}
/* allocate memory */
! retval = alloc(len + 1);
if (retval == NULL)
break;
}
--- 9801,9807 ----
}
/* allocate memory */
! retval = alloc((unsigned)len + 1);
if (retval == NULL)
break;
}
*** ../vim-7.2.168/src/proto/ex_cmds.pro 2009-04-29 18:44:38.000000000 +0200
--- src/proto/ex_cmds.pro 2009-05-13 15:53:39.000000000 +0200
***************
*** 9,15 ****
void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
void do_shell __ARGS((char_u *cmd, int flags));
char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
! void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
int read_viminfo __ARGS((char_u *file, int flags));
void write_viminfo __ARGS((char_u *file, int forceit));
--- 9,15 ----
void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
void do_shell __ARGS((char_u *cmd, int flags));
char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
! void append_redir __ARGS((char_u *buf, int buflen, char_u *opt, char_u *fname));
int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
int read_viminfo __ARGS((char_u *file, int flags));
void write_viminfo __ARGS((char_u *file, int forceit));
*** ../vim-7.2.168/src/proto/spell.pro 2007-05-05 19:19:19.000000000 +0200
--- src/proto/spell.pro 2009-05-13 16:43:13.000000000 +0200
***************
*** 22,26 ****
char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
int spell_word_start __ARGS((int startcol));
void spell_expand_check_cap __ARGS((colnr_T col));
! int expand_spelling __ARGS((linenr_T lnum, int col, char_u *pat, char_u ***matchp));
/* vim: set ft=c : */
--- 22,26 ----
char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
int spell_word_start __ARGS((int startcol));
void spell_expand_check_cap __ARGS((colnr_T col));
! int expand_spelling __ARGS((linenr_T lnum, char_u *pat, char_u ***matchp));
/* vim: set ft=c : */
*** ../vim-7.2.168/src/quickfix.c 2009-04-29 11:49:57.000000000 +0200
--- src/quickfix.c 2009-05-13 15:53:18.000000000 +0200
***************
*** 2774,2780 ****
sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
(char *)p_shq);
if (*p_sp != NUL)
! append_redir(cmd, p_sp, fname);
/*
* Output a newline if there's something else than the :make command that
* was typed (in which case the cursor is in column 0).
--- 2774,2780 ----
sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
(char *)p_shq);
if (*p_sp != NUL)
! append_redir(cmd, len, p_sp, fname);
/*
* Output a newline if there's something else than the :make command that
* was typed (in which case the cursor is in column 0).
*** ../vim-7.2.168/src/spell.c 2009-02-11 17:57:43.000000000 +0100
--- src/spell.c 2009-05-13 16:31:15.000000000 +0200
***************
*** 16151,16161 ****
* Returns the number of matches. The matches are in "matchp[]", array of
* allocated strings.
*/
- /*ARGSUSED*/
int
! expand_spelling(lnum, col, pat, matchp)
linenr_T lnum;
- int col;
char_u *pat;
char_u ***matchp;
{
--- 16151,16159 ----
* Returns the number of matches. The matches are in "matchp[]", array of
* allocated strings.
*/
int
! expand_spelling(lnum, pat, matchp)
linenr_T lnum;
char_u *pat;
char_u ***matchp;
{
*** ../vim-7.2.168/src/structs.h 2009-05-13 12:46:36.000000000 +0200
--- src/structs.h 2009-05-13 16:45:51.000000000 +0200
***************
*** 16,22 ****
*/
#if defined(SASC) && SASC < 658
typedef long linenr_T;
! typedef unsigned colnr_T;
typedef unsigned short short_u;
#endif
--- 16,22 ----
*/
#if defined(SASC) && SASC < 658
typedef long linenr_T;
! typedef int colnr_T;
typedef unsigned short short_u;
#endif
*** ../vim-7.2.168/src/term.h 2005-03-16 10:53:56.000000000 +0100
--- src/term.h 2009-05-13 17:27:41.000000000 +0200
***************
*** 96,102 ****
--- 96,106 ----
* - there should be code in term.c to obtain the value from the termcap
*/
+ #ifdef S_SPLINT_S /* splint doesn't understand array of pointers */
+ extern char_u **term_strings; /* current terminal strings */
+ #else
extern char_u *(term_strings[]); /* current terminal strings */
+ #endif
/*
* strings used for terminal
*** ../vim-7.2.168/src/vim.h 2009-04-29 18:44:38.000000000 +0200
--- src/vim.h 2009-05-13 16:45:39.000000000 +0200
***************
*** 1460,1467 ****
# define PERROR(msg) perror(msg)
#endif
! typedef long linenr_T; /* line number type */
! typedef unsigned colnr_T; /* column number type */
typedef unsigned short disptick_T; /* display tick type */
#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
--- 1460,1467 ----
# define PERROR(msg) perror(msg)
#endif
! typedef long linenr_T; /* line number type */
! typedef int colnr_T; /* column number type */
typedef unsigned short disptick_T; /* display tick type */
#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
*** ../vim-7.2.168/src/version.c 2009-05-13 14:48:55.000000000 +0200
--- src/version.c 2009-05-13 18:44:28.000000000 +0200
***************
*** 678,679 ****
--- 678,681 ----
{ /* Add new patch number below this line */
+ /**/
+ 169,
/**/
--
Females are strictly forbidden to appear unshaven in public.
[real standing law in New Mexico, United States of America]
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|