Skip to content

Commit 473952e

Browse files
committed
patch 8.1.2094: the fileio.c file is too big
Problem: The fileio.c file is too big. Solution: Move buf_write() to bufwrite.c. (Yegappan Lakshmanan, closes #4990)
1 parent 9be0e0b commit 473952e

15 files changed

Lines changed: 2983 additions & 2933 deletions

Filelist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SRC_ALL = \
2121
src/blob.c \
2222
src/blowfish.c \
2323
src/buffer.c \
24+
src/bufwrite.c \
2425
src/change.c \
2526
src/channel.c \
2627
src/charset.c \
@@ -186,6 +187,7 @@ SRC_ALL = \
186187
src/proto/blob.pro \
187188
src/proto/blowfish.pro \
188189
src/proto/buffer.pro \
190+
src/proto/bufwrite.pro \
189191
src/proto/change.pro \
190192
src/proto/channel.pro \
191193
src/proto/charset.pro \

src/Make_cyg_ming.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ OBJ = \
709709
$(OUTDIR)/blob.o \
710710
$(OUTDIR)/blowfish.o \
711711
$(OUTDIR)/buffer.o \
712+
$(OUTDIR)/bufwrite.o \
712713
$(OUTDIR)/change.o \
713714
$(OUTDIR)/charset.o \
714715
$(OUTDIR)/cmdexpand.o \

src/Make_morph.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ SRC = arabic.c \
2929
autocmd.c \
3030
blowfish.c \
3131
buffer.c \
32+
bufwrite.c \
3233
change.c \
3334
charset.c \
3435
cmdexpand.c \

src/Make_mvc.mak

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ OBJ = \
716716
$(OUTDIR)\blob.obj \
717717
$(OUTDIR)\blowfish.obj \
718718
$(OUTDIR)\buffer.obj \
719+
$(OUTDIR)\bufwrite.obj \
719720
$(OUTDIR)\change.obj \
720721
$(OUTDIR)\charset.obj \
721722
$(OUTDIR)\cmdexpand.obj \
@@ -1457,6 +1458,8 @@ $(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
14571458

14581459
$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
14591460

1461+
$(OUTDIR)/bufwrite.obj: $(OUTDIR) bufwrite.c $(INCL)
1462+
14601463
$(OUTDIR)/change.obj: $(OUTDIR) change.c $(INCL)
14611464

14621465
$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
@@ -1788,6 +1791,7 @@ proto.h: \
17881791
proto/blob.pro \
17891792
proto/blowfish.pro \
17901793
proto/buffer.pro \
1794+
proto/bufwrite.pro \
17911795
proto/change.pro \
17921796
proto/charset.pro \
17931797
proto/cmdexpand.pro \

src/Make_vms.mms

Lines changed: 204 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Makefile for Vim on OpenVMS
33
#
44
# Maintainer: Zoltan Arpadffy <[email protected]>
5-
# Last change: 2019 Sep 27
5+
# Last change: 2019 Sep 28
66
#
77
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
88
# with MMS and MMK
@@ -307,48 +307,210 @@ ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
307307
ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \
308308
$(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(RUBY_LIB)
309309

310-
SRC = arabic.c arglist.c autocmd.c beval.c blob.c blowfish.c buffer.c \
311-
change.c charset.c cmdexpand.c cmdhist.c crypt.c crypt_zip.c \
312-
debugger.c dict.c diff.c digraph.c drawline.c drawscreen.c edit.c \
313-
eval.c evalbuffer.c evalfunc.c \
314-
evalvars.c evalwindow.c ex_cmds.c ex_cmds2.c ex_docmd.c ex_eval.c \
310+
SRC = \
311+
arabic.c \
312+
arglist.c \
313+
autocmd.c \
314+
beval.c \
315+
blob.c \
316+
blowfish.c \
317+
buffer.c \
318+
bufwrite.c \
319+
change.c \
320+
charset.c \
321+
cmdexpand.c \
322+
cmdhist.c \
323+
crypt.c \
324+
crypt_zip.c \
325+
debugger.c \
326+
dict.c \
327+
diff.c \
328+
digraph.c \
329+
drawline.c \
330+
drawscreen.c \
331+
edit.c \
332+
eval.c \
333+
evalbuffer.c \
334+
evalfunc.c \
335+
evalvars.c \
336+
evalwindow.c \
337+
ex_cmds.c \
338+
ex_cmds2.c \
339+
ex_docmd.c \
340+
ex_eval.c \
315341
ex_getln.c \
316-
if_cscope.c if_xcmdsrv.c fileio.c filepath.c, findfile.c fold.c \
317-
getchar.c hardcopy.c hashtab.c highlight.c \
318-
indent.c insexpand.c json.c list.c main.c map.c mark.c menu.c mbyte.c \
319-
memfile.c memline.c message.c misc1.c misc2.c mouse.c move.c normal.c \
342+
fileio.c \
343+
filepath.c, \
344+
findfile.c \
345+
fold.c \
346+
getchar.c \
347+
hardcopy.c \
348+
hashtab.c \
349+
highlight.c \
350+
if_cscope.c \
351+
if_xcmdsrv.c \
352+
indent.c \
353+
insexpand.c \
354+
json.c \
355+
list.c \
356+
main.c \
357+
map.c \
358+
mark.c \
359+
mbyte.c \
360+
memfile.c \
361+
memline.c \
362+
menu.c \
363+
message.c \
364+
misc1.c \
365+
misc2.c \
366+
mouse.c \
367+
move.c \
368+
normal.c \
320369
ops.c \
321-
option.c optionstr.c popupmenu.c popupwin.c profiler.c quickfix.c \
322-
regexp.c register.c scriptfile.c \
323-
search.c session.c sha256.c sign.c spell.c spellfile.c spellsuggest.c \
324-
syntax.c tag.c \
325-
term.c termlib.c testing.c textprop.c ui.c undo.c usercmd.c \
326-
userfunc.c version.c viminfo.c screen.c window.c os_unix.c os_vms.c \
370+
option.c \
371+
optionstr.c \
372+
os_unix.c \
373+
os_vms.c \
327374
pathdef.c \
328-
$(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) \
329-
$(RUBY_SRC) $(HANGULIN_SRC) $(MZSCH_SRC) $(XDIFF_SRC)
330-
331-
OBJ = arabic.obj arglist.obj autocmd.obj beval.obj blob.obj blowfish.obj \
332-
buffer.obj change.obj charset.obj cmdexpand.obj cmdhist.obj \
333-
crypt.obj crypt_zip.obj debugger.obj dict.obj diff.obj digraph.obj \
334-
drawline.obj drawscreen.obj edit.obj eval.obj evalbuffer.obj \
335-
evalfunc.obj evalvars.obj evalwindow.obj ex_cmds.obj ex_cmds2.obj \
336-
ex_docmd.obj ex_eval.obj ex_getln.obj if_cscope.obj if_xcmdsrv.obj \
337-
fileio.obj filepath.obj \
338-
findfile.obj fold.obj getchar.obj hardcopy.obj hashtab.obj \
339-
highlight.obj indent.obj insexpand.obj json.obj list.obj main.obj \
340-
map.obj mark.obj menu.obj memfile.obj memline.obj message.obj \
341-
misc1.obj misc2.obj mouse.obj move.obj mbyte.obj normal.obj ops.obj \
375+
popupmenu.c \
376+
popupwin.c \
377+
profiler.c \
378+
quickfix.c \
379+
regexp.c \
380+
register.c \
381+
screen.c \
382+
scriptfile.c \
383+
search.c \
384+
session.c \
385+
sha256.c \
386+
sign.c \
387+
spell.c \
388+
spellfile.c \
389+
spellsuggest.c \
390+
syntax.c \
391+
tag.c \
392+
term.c \
393+
termlib.c \
394+
testing.c \
395+
textprop.c \
396+
ui.c \
397+
undo.c \
398+
usercmd.c \
399+
userfunc.c \
400+
version.c \
401+
viminfo.c \
402+
window.c \
403+
$(GUI_SRC) \
404+
$(PERL_SRC) \
405+
$(PYTHON_SRC) \
406+
$(TCL_SRC) \
407+
$(RUBY_SRC) \
408+
$(HANGULIN_SRC) \
409+
$(MZSCH_SRC) \
410+
$(XDIFF_SRC)
411+
412+
OBJ = \
413+
arabic.obj \
414+
arglist.obj \
415+
autocmd.obj \
416+
beval.obj \
417+
blob.obj \
418+
blowfish.obj \
419+
buffer.obj \
420+
bufwrite.obj \
421+
change.obj \
422+
charset.obj \
423+
cmdexpand.obj \
424+
cmdhist.obj \
425+
crypt.obj \
426+
crypt_zip.obj \
427+
debugger.obj \
428+
dict.obj \
429+
diff.obj \
430+
digraph.obj \
431+
drawline.obj \
432+
drawscreen.obj \
433+
edit.obj \
434+
eval.obj \
435+
evalbuffer.obj \
436+
evalfunc.obj \
437+
evalvars.obj \
438+
evalwindow.obj \
439+
ex_cmds.obj \
440+
ex_cmds2.obj \
441+
ex_docmd.obj \
442+
ex_eval.obj \
443+
ex_getln.obj \
444+
fileio.obj \
445+
filepath.obj \
446+
findfile.obj \
447+
fold.obj \
448+
getchar.obj \
449+
hardcopy.obj \
450+
hashtab.obj \
451+
highlight.obj \
452+
if_cscope.obj \
453+
if_mzsch.obj \
454+
if_xcmdsrv.obj \
455+
indent.obj \
456+
insexpand.obj \
457+
json.obj \
458+
list.obj \
459+
main.obj \
460+
map.obj \
461+
mark.obj \
462+
mbyte.obj \
463+
memfile.obj \
464+
memline.obj \
465+
menu.obj \
466+
message.obj \
467+
misc1.obj \
468+
misc2.obj \
469+
mouse.obj \
470+
move.obj \
471+
normal.obj \
472+
ops.obj \
342473
option.obj \
343-
optionstr.obj popupmenu.obj popupwin.obj profiler.obj quickfix.obj \
344-
regexp.obj register.obj scriptfile.obj \
345-
search.obj session.obj sha256.obj sign.obj spell.obj spellfile.obj \
346-
spellsuggest.obj syntax.obj tag.obj term.obj termlib.obj testing.obj \
474+
optionstr.obj \
475+
os_unix.obj \
476+
os_vms.obj \
477+
pathdef.obj \
478+
popupmenu.obj \
479+
popupwin.obj \
480+
profiler.obj \
481+
quickfix.obj \
482+
regexp.obj \
483+
register.obj \
484+
screen.obj \
485+
scriptfile.obj \
486+
search.obj \
487+
session.obj \
488+
sha256.obj \
489+
sign.obj \
490+
spell.obj \
491+
spellfile.obj \
492+
spellsuggest.obj \
493+
syntax.obj \
494+
tag.obj \
495+
term.obj \
496+
termlib.obj \
497+
testing.obj \
347498
textprop.obj \
348-
ui.obj undo.obj usercmd.obj userfunc.obj screen.obj version.obj \
349-
viminfo.obj window.obj os_unix.obj os_vms.obj pathdef.obj if_mzsch.obj \
350-
$(GUI_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(TCL_OBJ) \
351-
$(RUBY_OBJ) $(HANGULIN_OBJ) $(MZSCH_OBJ) $(XDIFF_OBJ)
499+
ui.obj \
500+
undo.obj \
501+
usercmd.obj \
502+
userfunc.obj \
503+
version.obj \
504+
viminfo.obj \
505+
window.obj \
506+
$(GUI_OBJ) \
507+
$(PERL_OBJ) \
508+
$(PYTHON_OBJ) \
509+
$(TCL_OBJ) \
510+
$(RUBY_OBJ) \
511+
$(HANGULIN_OBJ) \
512+
$(MZSCH_OBJ) \
513+
$(XDIFF_OBJ)
352514

353515
# Default target is making the executable
354516
all : [.auto]config.h mmk_compat motif_env gtk_env perl_env python_env tcl_env ruby_env $(TARGET)
@@ -526,6 +688,10 @@ buffer.obj : buffer.c vim.h [.auto]config.h feature.h os_unix.h \
526688
ascii.h keymap.h term.h macros.h structs.h regexp.h \
527689
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
528690
globals.h version.h
691+
bufwrite.obj : bufwrite.c vim.h [.auto]config.h feature.h os_unix.h \
692+
ascii.h keymap.h term.h macros.h structs.h regexp.h \
693+
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
694+
globals.h version.h
529695
change.obj : change.c vim.h [.auto]config.h feature.h os_unix.h \
530696
ascii.h keymap.h term.h macros.h structs.h regexp.h \
531697
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \

src/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,7 @@ BASIC_SRC = \
16681668
version.c \
16691669
viminfo.c \
16701670
window.c \
1671+
bufwrite.c \
16711672
$(OS_EXTRA_SRC)
16721673

16731674
SRC = $(BASIC_SRC) \
@@ -1804,6 +1805,7 @@ OBJ_COMMON = \
18041805
objects/version.o \
18051806
objects/viminfo.o \
18061807
objects/window.o \
1808+
objects/bufwrite.o \
18071809
$(GUI_OBJ) \
18081810
$(TERM_OBJ) \
18091811
$(LUA_OBJ) \
@@ -1966,6 +1968,7 @@ PRO_AUTO = \
19661968
version.pro \
19671969
viminfo.pro \
19681970
window.pro \
1971+
bufwrite.pro \
19691972
beval.pro \
19701973
gui_beval.pro \
19711974
netbeans.pro \
@@ -3432,6 +3435,9 @@ objects/viminfo.o: viminfo.c
34323435
objects/window.o: window.c
34333436
$(CCC) -o $@ window.c
34343437

3438+
objects/bufwrite.o: bufwrite.c
3439+
$(CCC) -o $@ bufwrite.c
3440+
34353441
objects/netbeans.o: netbeans.c
34363442
$(CCC) -o $@ netbeans.c
34373443

@@ -3949,6 +3955,10 @@ objects/window.o: window.c vim.h protodef.h auto/config.h feature.h os_unix.h \
39493955
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
39503956
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
39513957
proto.h globals.h
3958+
objects/bufwrite.o: bufwrite.c vim.h protodef.h auto/config.h feature.h os_unix.h \
3959+
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
3960+
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
3961+
proto.h globals.h
39523962
objects/gui.o: gui.c vim.h protodef.h auto/config.h feature.h os_unix.h \
39533963
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
39543964
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \

src/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ arglist.c | handling argument list
2727
autocmd.c | autocommands
2828
blob.c | blob data type
2929
buffer.c | manipulating buffers (loaded files)
30+
bufwrite.c | writing a buffer to file
3031
change.c | handling changes to text
3132
cmdexpand.c | command-line completion
3233
cmdhist.c | command-line history

0 commit comments

Comments
 (0)