From 37ed970319ab83dd1f33c3b7acfed05a7372b34f Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 25 Aug 2019 22:16:00 +0200 Subject: [PATCH] More use of direct initializations --- ChangeLog | 3 + examples/7segment.cpp | 4 +- examples/calculator.cpp | 38 +++-- examples/checklist.cpp | 2 +- examples/choice.cpp | 10 +- examples/keyboard.cpp | 2 +- examples/listbox.cpp | 4 +- examples/listview.cpp | 2 +- examples/mandelbrot.cpp | 41 +++-- examples/menu.cpp | 2 +- examples/mouse.cpp | 18 +-- examples/opti-move.cpp | 25 ++- examples/scrollview.cpp | 4 +- examples/string-operations.cpp | 52 +++--- examples/term-attributes.cpp | 4 +- examples/termcap.cpp | 11 +- examples/timer.cpp | 2 +- examples/transparent.cpp | 2 +- examples/ui.cpp | 10 +- examples/watch.cpp | 7 +- examples/windows.cpp | 6 +- src/fapplication.cpp | 56 +++---- src/fbutton.cpp | 41 +++-- src/fbuttongroup.cpp | 20 ++- src/fcheckmenuitem.cpp | 2 +- src/fdialog.cpp | 50 +++--- src/ffiledialog.cpp | 71 ++++----- src/fkeyboard.cpp | 42 +++-- src/flabel.cpp | 19 ++- src/flineedit.cpp | 33 ++-- src/flistbox.cpp | 83 ++++------ src/flistview.cpp | 58 ++++--- src/fmenu.cpp | 25 ++- src/fmenubar.cpp | 24 +-- src/fmenuitem.cpp | 12 +- src/fmessagebox.cpp | 32 ++-- src/fmouse.cpp | 54 +++---- src/fobject.cpp | 25 ++- src/foptiattr.cpp | 14 +- src/foptimove.cpp | 37 ++--- src/fprogressbar.cpp | 2 +- src/frect.cpp | 4 +- src/fscrollbar.cpp | 34 ++-- src/fscrollview.cpp | 31 ++-- src/fstatusbar.cpp | 32 ++-- src/fstring.cpp | 248 +++++++++++------------------ src/fswitch.cpp | 8 +- src/fterm.cpp | 92 +++++------ src/ftermbuffer.cpp | 9 +- src/ftermcap.cpp | 38 ++--- src/ftermcapquirks.cpp | 6 +- src/ftermdebugdata.cpp | 4 +- src/ftermdetection.cpp | 105 ++++++------ src/ftermfreebsd.cpp | 18 +-- src/ftermios.cpp | 12 +- src/ftermlinux.cpp | 57 ++++--- src/ftermopenbsd.cpp | 10 +- src/ftermxterminal.cpp | 48 +++--- src/ftextview.cpp | 41 +++-- src/ftogglebutton.cpp | 8 +- src/ftooltip.cpp | 15 +- src/fvterm.cpp | 226 ++++++++++++-------------- src/fwidget.cpp | 99 ++++++------ src/fwindow.cpp | 22 +-- src/include/final/fdialog.h | 2 +- src/include/final/flistbox.h | 2 +- src/include/final/flistview.h | 4 +- src/include/final/fmessagebox.h | 10 +- src/include/final/fobject.h | 4 +- src/include/final/fstatusbar.h | 2 +- src/include/final/fstring.h | 2 +- src/include/final/fsystemimpl.h | 4 +- src/include/final/ftermdetection.h | 38 ++--- 73 files changed, 979 insertions(+), 1205 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4366dc81..f5557143 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2019-08-25 Markus Gans + * More use of direct initializations + 2019-08-18 Markus Gans * Solved problem detecting terminal size on quick changes * Update VTerm information only in case of changes diff --git a/examples/7segment.cpp b/examples/7segment.cpp index b784c0cd..e7761fa5 100644 --- a/examples/7segment.cpp +++ b/examples/7segment.cpp @@ -136,7 +136,7 @@ void SegmentView::hexEncoding() //---------------------------------------------------------------------- void SegmentView::get7Segment (const wchar_t c) { - for (int i = 0; i < 3; i++) + for (int i{0}; i < 3; i++) line[i].clear(); switch ( c ) @@ -207,7 +207,7 @@ void SegmentView::draw() FColorPair color(fc::LightRed, fc::Black); get7Segment(ch); - for (std::size_t i = 0; i < 3; i++) + for (std::size_t i{0}; i < 3; i++) tbuffer[i] << color << line[i] << " "; } diff --git a/examples/calculator.cpp b/examples/calculator.cpp index af97ee2f..36d2f31d 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -35,7 +35,7 @@ using finalcut::FPoint; using finalcut::FSize; using finalcut::FColorPair; -constexpr lDouble PI = 3.141592653589793238L; +constexpr lDouble PI{3.141592653589793238L}; //---------------------------------------------------------------------- @@ -255,7 +255,7 @@ Calc::Calc (FWidget* parent) setText ("Calculator"); setGeometry (FPoint(19, 6), FSize(37, 18)); - for (std::size_t key = 0; key < Calc::NUM_OF_BUTTONS; key++) + for (std::size_t key{0}; key < Calc::NUM_OF_BUTTONS; key++) { auto btn = std::make_shared