From bc3afa6235677b7d168ec4c4ff7d29141e6c46da Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 8 Sep 2019 02:04:24 +0200 Subject: [PATCH] Remove #pragma pack() directive lines --- ChangeLog | 4 + doc/class_template.h | 5 +- examples/7segment.cpp | 4 - examples/Makefile.clang | 2 +- examples/calculator.cpp | 8 -- examples/checklist.cpp | 4 - examples/listbox.cpp | 4 - examples/listview.cpp | 4 - examples/mandelbrot.cpp | 5 +- examples/menu.cpp | 4 - examples/mouse.cpp | 13 +-- examples/scrollview.cpp | 8 -- examples/term-attributes.cpp | 8 -- examples/termcap.cpp | 4 - examples/transparent.cpp | 9 +- examples/treeview.cpp | 7 -- examples/ui.cpp | 12 --- examples/watch.cpp | 4 - examples/windows.cpp | 10 +-- src/Makefile.clang | 2 +- src/fapplication.cpp | 18 ++-- src/fbuttongroup.cpp | 4 +- src/fdialog.cpp | 10 +-- src/flistview.cpp | 2 +- src/fmenu.cpp | 4 +- src/fmenubar.cpp | 8 +- src/fmenulist.cpp | 6 +- src/fmessagebox.cpp | 2 +- src/foptiattr.cpp | 8 +- src/foptimove.cpp | 44 +++++----- src/fstatusbar.cpp | 8 +- src/fterm.cpp | 16 ++-- src/ftermdetection.cpp | 6 +- src/ftooltip.cpp | 2 +- src/fvterm.cpp | 2 +- src/fwidget.cpp | 10 ++- src/fwindow.cpp | 8 +- src/include/final/emptyfstring.h | 4 - src/include/final/fapplication.h | 5 -- src/include/final/fbutton.h | 15 ++-- src/include/final/fbuttongroup.h | 5 -- src/include/final/fcheckbox.h | 5 -- src/include/final/fcheckmenuitem.h | 5 -- src/include/final/fcolorpair.h | 4 - src/include/final/fcolorpalette.h | 4 - src/include/final/fdialog.h | 4 - src/include/final/fdialoglistmenu.h | 4 - src/include/final/fevent.h | 132 ++++++++++------------------ src/include/final/ffiledialog.h | 5 -- src/include/final/fkeyboard.h | 36 +++----- src/include/final/flabel.h | 23 ++--- src/include/final/flineedit.h | 8 +- src/include/final/flistbox.h | 18 ++-- src/include/final/flistview.h | 37 +++----- src/include/final/fmenu.h | 4 - src/include/final/fmenubar.h | 6 +- src/include/final/fmenuitem.h | 16 ++-- src/include/final/fmenulist.h | 4 - src/include/final/fmessagebox.h | 10 +-- src/include/final/fmouse.h | 23 ----- src/include/final/fobject.h | 16 ++-- src/include/final/foptiattr.h | 16 ++-- src/include/final/foptimove.h | 28 +++--- src/include/final/fpoint.h | 4 - src/include/final/fprogressbar.h | 4 - src/include/final/fradiobutton.h | 4 - src/include/final/fradiomenuitem.h | 5 -- src/include/final/frect.h | 5 -- src/include/final/fscrollbar.h | 41 ++++----- src/include/final/fscrollview.h | 5 -- src/include/final/fsize.h | 5 -- src/include/final/fstartoptions.h | 4 - src/include/final/fstatusbar.h | 14 +-- src/include/final/fstring.h | 5 +- src/include/final/fswitch.h | 5 -- src/include/final/fsystem.h | 4 - src/include/final/fsystemimpl.h | 4 - src/include/final/fterm.h | 4 - src/include/final/ftermbuffer.h | 4 - src/include/final/ftermcap.h | 4 +- src/include/final/ftermcapquirks.h | 4 - src/include/final/ftermdata.h | 22 +++-- src/include/final/ftermdetection.h | 6 +- src/include/final/ftermfreebsd.h | 5 +- src/include/final/ftermios.h | 5 +- src/include/final/ftermlinux.h | 5 +- src/include/final/ftermopenbsd.h | 5 +- src/include/final/ftermxterminal.h | 5 +- src/include/final/ftextview.h | 5 -- src/include/final/ftogglebutton.h | 5 -- src/include/final/ftooltip.h | 4 - src/include/final/ftypes.h | 14 ++- src/include/final/fvterm.h | 8 -- src/include/final/fwidget.h | 6 +- src/include/final/fwidgetcolors.h | 4 - src/include/final/fwindow.h | 10 +-- test/Makefile.clang | 2 +- test/conemu.h | 4 - test/fcolorpair-test.cpp | 5 +- test/fkeyboard-test.cpp | 7 -- test/fmouse-test.cpp | 8 -- test/fobject-test.cpp | 14 --- test/foptiattr-test.cpp | 12 +-- test/foptimove-test.cpp | 14 ++- test/fpoint-test.cpp | 5 +- test/frect-test.cpp | 5 +- test/fsize-test.cpp | 4 - test/fstring-test.cpp | 7 +- test/ftermcapquirks-test.cpp | 7 -- test/ftermdata-test.cpp | 4 - test/ftermdetection-test.cpp | 4 - test/ftermfreebsd-test.cpp | 9 +- test/ftermlinux-test.cpp | 9 +- test/ftermopenbsd-test.cpp | 9 +- 114 files changed, 283 insertions(+), 796 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff462328..12a017ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2019-09-08 Markus Gans + * Remove the lines of the #pragma pack() directive from the code + because they caused a misaligned address + 2019-09-06 Markus Gans * Outsourcing the initialization data to a separate struct diff --git a/doc/class_template.h b/doc/class_template.h index 2fef30bc..05cbafed 100644 --- a/doc/class_template.h +++ b/doc/class_template.h @@ -44,9 +44,6 @@ namespace finalcut // class FClassName //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FClassName { public: @@ -121,7 +118,7 @@ class FClassName // Friend class }; -#pragma pack(pop) + // FClassName inline functions //---------------------------------------------------------------------- diff --git a/examples/7segment.cpp b/examples/7segment.cpp index 8c6cd333..ecc1ff02 100644 --- a/examples/7segment.cpp +++ b/examples/7segment.cpp @@ -36,9 +36,6 @@ using finalcut::FSize; // class TextWindow //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class SegmentView : public finalcut::FDialog { public: @@ -69,7 +66,6 @@ class SegmentView : public finalcut::FDialog finalcut::FLineEdit Input{"0123", this}; finalcut::FButton Exit{"E&xit", this}; }; -#pragma pack(pop) //---------------------------------------------------------------------- SegmentView::SegmentView (finalcut::FWidget* parent) diff --git a/examples/Makefile.clang b/examples/Makefile.clang index 3d094f1c..e761ef01 100644 --- a/examples/Makefile.clang +++ b/examples/Makefile.clang @@ -29,7 +29,7 @@ endif all: $(OBJS) debug: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic -Weverything -Wpadded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough -Wno-reserved-id-macro" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic -Weverything -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough -Wno-reserved-id-macro" profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" diff --git a/examples/calculator.cpp b/examples/calculator.cpp index ff674b87..e7bdf3e4 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -42,9 +42,6 @@ constexpr lDouble PI{3.141592653589793238L}; // class Button //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class Button : public finalcut::FButton { public: @@ -61,7 +58,6 @@ class Button : public finalcut::FButton // Data member bool checked{false}; }; -#pragma pack(pop) //---------------------------------------------------------------------- Button::Button (finalcut::FWidget* parent) @@ -110,9 +106,6 @@ void Button::onKeyPress (finalcut::FKeyEvent* ev) // class Calc //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class Calc : public finalcut::FDialog { public: @@ -244,7 +237,6 @@ class Calc : public finalcut::FDialog std::map > calculator_buttons{}; std::map key_map{}; }; -#pragma pack(pop) //---------------------------------------------------------------------- Calc::Calc (FWidget* parent) diff --git a/examples/checklist.cpp b/examples/checklist.cpp index d8a7ab1f..89665f5d 100644 --- a/examples/checklist.cpp +++ b/examples/checklist.cpp @@ -36,9 +36,6 @@ using finalcut::FSize; // class CheckList //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class CheckList : public finalcut::FDialog { public: @@ -69,7 +66,6 @@ class CheckList : public finalcut::FDialog finalcut::FListView listView{this}; finalcut::FStatusBar status_bar{this}; }; -#pragma pack(pop) //---------------------------------------------------------------------- CheckList::CheckList (finalcut::FWidget* parent) diff --git a/examples/listbox.cpp b/examples/listbox.cpp index 3b4a891e..fc00683f 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -76,9 +76,6 @@ FString& mapToString ( std::map", this}; finalcut::FButton back_button{"< &Back", this}; }; -#pragma pack(pop) //---------------------------------------------------------------------- AttribDlg::AttribDlg (finalcut::FWidget* parent) @@ -197,9 +193,6 @@ void AttribDlg::adjustSize() // class AttribDemo //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class AttribDemo : public finalcut::FWidget { public: @@ -241,7 +234,6 @@ class AttribDemo : public finalcut::FWidget // Data member int colors; }; -#pragma pack(pop) //---------------------------------------------------------------------- AttribDemo::AttribDemo (finalcut::FWidget* parent) diff --git a/examples/termcap.cpp b/examples/termcap.cpp index da757cb3..b017d93a 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -45,9 +45,6 @@ void string(); // struct data //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - struct data { static int getNumberOfItems(); @@ -60,7 +57,6 @@ struct data static termcap_string strings[]; }; -#pragma pack(pop) //---------------------------------------------------------------------- // struct data - string data array diff --git a/examples/transparent.cpp b/examples/transparent.cpp index d4ae3676..fd4c373f 100644 --- a/examples/transparent.cpp +++ b/examples/transparent.cpp @@ -31,9 +31,6 @@ using finalcut::FSize; // class Transparent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class Transparent : public finalcut::FDialog { public: @@ -68,7 +65,6 @@ class Transparent : public finalcut::FDialog // Data members trans_type type; }; -#pragma pack(pop) //---------------------------------------------------------------------- Transparent::Transparent ( finalcut::FWidget* parent @@ -147,9 +143,6 @@ void Transparent::onKeyPress (finalcut::FKeyEvent* ev) // class MainWindow //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class MainWindow : public finalcut::FDialog { public: @@ -195,7 +188,7 @@ class MainWindow : public finalcut::FDialog Transparent* ibg{nullptr}; finalcut::FStatusBar status_bar{this}; }; -#pragma pack(pop) + //---------------------------------------------------------------------- MainWindow::MainWindow (finalcut::FWidget* parent) diff --git a/examples/treeview.cpp b/examples/treeview.cpp index c76cebe6..7ddc5799 100644 --- a/examples/treeview.cpp +++ b/examples/treeview.cpp @@ -112,9 +112,6 @@ bool sortDescending ( const finalcut::FObject* lhs // class Treeview //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class Treeview : public finalcut::FDialog { public: @@ -151,15 +148,12 @@ class Treeview : public finalcut::FDialog static TreeItem south_america[]; static TreeItem oceania[]; }; -#pragma pack(pop) //---------------------------------------------------------------------- // struct Treeview::TreeItem //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) struct Treeview::TreeItem { const char* const* begin() const @@ -174,7 +168,6 @@ struct Treeview::TreeItem const char* density; TreeItem* child_element; }; -#pragma pack(pop) //---------------------------------------------------------------------- // class Treeview - array data diff --git a/examples/ui.cpp b/examples/ui.cpp index cd6d8f3f..66320e87 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -37,9 +37,6 @@ using finalcut::FSize; // class ProgressDialog //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class ProgressDialog : public finalcut::FDialog { public: @@ -71,7 +68,6 @@ class ProgressDialog : public finalcut::FDialog finalcut::FButton more{this}; finalcut::FButton quit{this}; }; -#pragma pack(pop) //---------------------------------------------------------------------- ProgressDialog::ProgressDialog (finalcut::FWidget* parent) @@ -183,9 +179,6 @@ void ProgressDialog::cb_exit_bar (finalcut::FWidget*, FDataPtr) // class TextWindow //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class TextWindow : public finalcut::FDialog { public: @@ -211,7 +204,6 @@ class TextWindow : public finalcut::FDialog // Data members finalcut::FTextView scrollText{this}; }; -#pragma pack(pop) //---------------------------------------------------------------------- TextWindow::TextWindow (finalcut::FWidget* parent) @@ -253,9 +245,6 @@ void TextWindow::adjustSize() // class MyDialog //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class MyDialog : public finalcut::FDialog { public: @@ -365,7 +354,6 @@ class MyDialog : public finalcut::FDialog finalcut::FLabel sum_count{this}; finalcut::FString clipboard{}; }; -#pragma pack(pop) //---------------------------------------------------------------------- MyDialog::MyDialog (finalcut::FWidget* parent) diff --git a/examples/watch.cpp b/examples/watch.cpp index b1ddafac..26915b6e 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -31,9 +31,6 @@ using finalcut::FSize; // class Watch //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class Watch : public finalcut::FDialog { public: @@ -73,7 +70,6 @@ class Watch : public finalcut::FDialog finalcut::FSwitch seconds_sw{L"Seconds", this}; finalcut::FButton quit_btn{L"&Quit", this}; }; -#pragma pack(pop) //---------------------------------------------------------------------- Watch::Watch (FWidget* parent) diff --git a/examples/windows.cpp b/examples/windows.cpp index 9f3b7db1..c83c9ef6 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -32,9 +32,6 @@ using finalcut::FSize; // class SmallWindow //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class SmallWindow : public finalcut::FDialog { public: @@ -65,7 +62,7 @@ class SmallWindow : public finalcut::FDialog finalcut::FLabel top_right_label{this}; finalcut::FLabel bottom_label{this}; }; -#pragma pack(pop) + //---------------------------------------------------------------------- SmallWindow::SmallWindow (finalcut::FWidget* parent) @@ -167,9 +164,6 @@ void SmallWindow::onTimer (finalcut::FTimerEvent*) // class Window //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class Window : public finalcut::FDialog { public: @@ -242,7 +236,7 @@ class Window : public finalcut::FDialog finalcut::FButton CloseButton{this}; finalcut::FButton QuitButton{this}; }; -#pragma pack(pop) + //---------------------------------------------------------------------- Window::Window (finalcut::FWidget* parent) diff --git a/src/Makefile.clang b/src/Makefile.clang index e50585a4..2ecf20f3 100644 --- a/src/Makefile.clang +++ b/src/Makefile.clang @@ -159,7 +159,7 @@ all: dep $(OBJS) $(LIB): all debug: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic -Weverything -Wpadded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough -Wno-reserved-id-macro" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic -Weverything -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough -Wno-reserved-id-macro" profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" diff --git a/src/fapplication.cpp b/src/fapplication.cpp index fbd8bc1d..316a044f 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -691,7 +691,7 @@ bool FApplication::processDialogSwitchAccelerator() if ( move_size ) { auto w = move_size; - setMoveSizeWidget(0); + setMoveSizeWidget(nullptr); w->redraw(); } @@ -729,7 +729,7 @@ bool FApplication::processAccelerator (const FWidget*& widget) if ( move_size ) { auto w = move_size; - setMoveSizeWidget(0); + setMoveSizeWidget(nullptr); w->redraw(); } @@ -807,7 +807,7 @@ void FApplication::unsetMoveSizeMode() if ( move_size ) { auto w = move_size; - setMoveSizeWidget(0); + setMoveSizeWidget(nullptr); w->redraw(); } } @@ -1011,7 +1011,7 @@ void FApplication::sendMouseLeftClickEvent ( const FPoint& widgetMousePos if ( ! mouse->isRightButtonPressed() && ! mouse->isMiddleButtonPressed() ) - setClickedWidget(0); + setClickedWidget(nullptr); sendEvent (released_widget, &m_up_ev); } @@ -1045,7 +1045,7 @@ void FApplication::sendMouseRightClickEvent ( const FPoint& widgetMousePos if ( ! mouse->isLeftButtonPressed() && ! mouse->isMiddleButtonPressed() ) - setClickedWidget(0); + setClickedWidget(nullptr); sendEvent (released_widget, &m_up_ev); } @@ -1071,7 +1071,7 @@ void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos // gnome-terminal sends no released on middle click if ( isGnomeTerminal() ) - setClickedWidget(0); + setClickedWidget(nullptr); } else if ( mouse->isMiddleButtonReleased() ) { @@ -1084,7 +1084,7 @@ void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos if ( ! mouse->isLeftButtonPressed() && ! mouse->isRightButtonPressed() ) { - setClickedWidget(0); + setClickedWidget(nullptr); } sendEvent (released_widget, &m_up_ev); @@ -1107,7 +1107,7 @@ void FApplication::sendWheelEvent ( const FPoint& widgetMousePos , mouse_position , fc::WheelUp ); auto scroll_over_widget = clicked; - setClickedWidget(0); + setClickedWidget(nullptr); sendEvent(scroll_over_widget, &wheel_ev); } @@ -1118,7 +1118,7 @@ void FApplication::sendWheelEvent ( const FPoint& widgetMousePos , mouse_position , fc::WheelDown ); auto scroll_over_widget = clicked; - setClickedWidget(0); + setClickedWidget(nullptr); sendEvent (scroll_over_widget, &wheel_ev); } } diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index fc6b4511..48afcb0e 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -63,7 +63,7 @@ FButtonGroup::~FButtonGroup() // destructor while ( iter != buttonlist.end() ) { auto toggle_button = static_cast(*iter); - toggle_button->setGroup(0); + toggle_button->setGroup(nullptr); iter = buttonlist.erase(iter); } } @@ -272,7 +272,7 @@ void FButtonGroup::remove (FToggleButton* button) if ( toggle_button == button ) { iter = buttonlist.erase(iter); - button->setGroup(0); + button->setGroup(nullptr); button->delCallback(this); break; } diff --git a/src/fdialog.cpp b/src/fdialog.cpp index 2541c990..32ccfc3e 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -606,7 +606,7 @@ void FDialog::onMouseDoubleClick (FMouseEvent* ev) if ( window_focus_widget ) window_focus_widget->setFocus(); - setClickedWidget(0); + setClickedWidget(nullptr); if ( isModal() ) done (FDialog::Reject); @@ -1566,7 +1566,7 @@ void FDialog::cancelMouseResize() //---------------------------------------------------------------------- inline void FDialog::acceptMoveSize() { - setMoveSizeWidget(0); + setMoveSizeWidget(nullptr); if ( tooltip ) delete tooltip; @@ -1578,7 +1578,7 @@ inline void FDialog::acceptMoveSize() //---------------------------------------------------------------------- inline void FDialog::cancelMoveSize() { - setMoveSizeWidget(0); + setMoveSizeWidget(nullptr); if ( tooltip ) delete tooltip; @@ -1677,7 +1677,7 @@ void FDialog::cb_zoom (FWidget*, FDataPtr) { dialog_menu->unselectItem(); dialog_menu->hide(); - setClickedWidget(0); + setClickedWidget(nullptr); drawTitleBar(); zoomWindow(); setZoomItem(); @@ -1688,7 +1688,7 @@ void FDialog::cb_close (FWidget*, FDataPtr) { dialog_menu->unselectItem(); dialog_menu->hide(); - setClickedWidget(0); + setClickedWidget(nullptr); drawTitleBar(); close(); } diff --git a/src/flistview.cpp b/src/flistview.cpp index 7cabbbc6..53707db6 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -196,7 +196,7 @@ FListViewItem::FListViewItem (FObjectIterator parent_iter) FListViewItem::FListViewItem ( const FStringList& cols , FDataPtr data , FObjectIterator parent_iter ) - : FObject(0) + : FObject(nullptr) , column_list(cols) , data_pointer(data) { diff --git a/src/fmenu.cpp b/src/fmenu.cpp index 416618e2..6693ddfd 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -111,7 +111,7 @@ void FMenu::hide() if ( openmenu && openmenu != this ) openmenu->hide(); - setOpenMenu(0); + setOpenMenu(nullptr); } mouse_down = false; @@ -882,7 +882,7 @@ void FMenu::mouseMoveDeselection (FMenuItem* m_item, mouseStates& ms) m_item->unsetFocus(); if ( getSelectedItem() == m_item ) - setSelectedItem(0); + setSelectedItem(nullptr); ms.focus_changed = true; } diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index 1e339bf8..5e65bf2e 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -49,7 +49,7 @@ FMenuBar::FMenuBar(FWidget* parent) //---------------------------------------------------------------------- FMenuBar::~FMenuBar() // destructor { - setMenuBar(0); + setMenuBar(nullptr); } @@ -456,7 +456,7 @@ bool FMenuBar::hotkeyMenu (FKeyEvent*& ev) } else { - setSelectedItem(0); + setSelectedItem(nullptr); redraw(); drop_down = false; (*iter)->processClicked(); @@ -785,7 +785,7 @@ bool FMenuBar::clickItem (FMenuItem* item) if ( getSelectedItem() == item ) { - setSelectedItem(0); + setSelectedItem(nullptr); leaveMenuBar(); drop_down = false; item->processClicked(); @@ -805,7 +805,7 @@ void FMenuBar::unselectMenuItem (FMenuItem* item) drop_down = false; if ( getSelectedItem() == item ) - setSelectedItem(0); + setSelectedItem(nullptr); } //---------------------------------------------------------------------- diff --git a/src/fmenulist.cpp b/src/fmenulist.cpp index dbe47e81..2448db58 100644 --- a/src/fmenulist.cpp +++ b/src/fmenulist.cpp @@ -46,7 +46,7 @@ FMenuList::~FMenuList() // destructor while ( iter != item_list.end() ) { - (*iter)->setSuperMenu(0); + (*iter)->setSuperMenu(nullptr); iter = item_list.erase(iter); } } @@ -74,7 +74,7 @@ void FMenuList::remove (FMenuItem* i) if ( (*iter) == i ) { iter = item_list.erase(iter); - i->setSuperMenu(0); + i->setSuperMenu(nullptr); break; } else @@ -131,7 +131,7 @@ void FMenuList::unselectItem() if ( hasSelectedItem() ) getSelectedItem()->unsetSelected(); - setSelectedItem(0); + setSelectedItem(nullptr); } } // namespace finalcut diff --git a/src/fmessagebox.cpp b/src/fmessagebox.cpp index 226ac38a..c0bcc0c8 100644 --- a/src/fmessagebox.cpp +++ b/src/fmessagebox.cpp @@ -63,10 +63,10 @@ FMessageBox::FMessageBox (const FMessageBox& mbox) , text_components(mbox.text_components) , text_split(mbox.text_split) , max_line_width(mbox.max_line_width) - , center_text(mbox.center_text) , emphasis_color(mbox.emphasis_color) , num_buttons(mbox.num_buttons) , text_num_lines(mbox.text_num_lines) + , center_text(mbox.center_text) { setTitlebarText (mbox.getTitlebarText()); init ( mbox.button_digit[0] diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index cf2156eb..3bc2048c 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -56,10 +56,6 @@ void FOptiAttr::setTermEnvironment (termEnv& term_env) // Set all required termcap values at once // and initialize the FOptiAttr environment - ansi_default_color = term_env.ansi_default_color; - max_color = term_env.max_color; - attr_without_color = term_env.attr_without_color; - set_enter_bold_mode (term_env.t_enter_bold_mode); set_exit_bold_mode (term_env.t_exit_bold_mode); set_enter_dim_mode (term_env.t_enter_dim_mode); @@ -96,6 +92,10 @@ void FOptiAttr::setTermEnvironment (termEnv& term_env) set_orig_pair (term_env.t_orig_pair); set_orig_orig_colors (term_env.t_orig_colors); + max_color = term_env.max_color; + attr_without_color = term_env.attr_without_color; + ansi_default_color = term_env.ansi_default_color; + initialize(); } diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 797a84de..7f88cd86 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -85,9 +85,6 @@ void FOptiMove::setTermEnvironment (termEnv& term_env) { // Set all required termcap values at once - set_auto_left_margin (term_env.automatic_left_margin); - set_eat_newline_glitch (term_env.eat_nl_glitch); - setTabStop (term_env.tabstop); set_cursor_home (term_env.t_cursor_home); set_cursor_to_ll (term_env.t_cursor_to_ll); set_carriage_return (term_env.t_carriage_return); @@ -108,6 +105,9 @@ void FOptiMove::setTermEnvironment (termEnv& term_env) set_repeat_char (term_env.t_repeat_char); set_clr_bol (term_env.t_clr_bol); set_clr_eol (term_env.t_clr_eol); + setTabStop (term_env.tabstop); + set_auto_left_margin (term_env.automatic_left_margin); + set_eat_newline_glitch (term_env.eat_nl_glitch); } //---------------------------------------------------------------------- @@ -601,7 +601,7 @@ int FOptiMove::repeatedAppend ( const capability& o , char* dst ) { std::size_t src_len = std::strlen(o.cap); - std::size_t dst_len = ( dst != 0 ) ? std::strlen(dst) : 0; + std::size_t dst_len = ( dst != nullptr ) ? std::strlen(dst) : 0; int total{0}; if ( (dst_len + uInt(count) * src_len) < BUF_SIZE - 1 ) @@ -611,7 +611,7 @@ int FOptiMove::repeatedAppend ( const capability& o if ( dst ) { dst += dst_len; - std::size_t free = BUF_SIZE - dst_len; + std::size_t free = BUF_SIZE - dst_len - 2; while ( count-- > 0 ) { @@ -921,9 +921,8 @@ inline bool FOptiMove::isMethod1Faster ( int& move_time if ( xold >= 0 && yold >= 0 ) { - char null_result[BUF_SIZE]; - char* null_ptr = null_result; - int new_time = relativeMove (null_ptr, xold, yold, xnew, ynew); + char null_result[BUF_SIZE]; + int new_time = relativeMove (null_result, xold, yold, xnew, ynew); if ( new_time < LONG_DURATION && new_time < move_time ) { @@ -944,9 +943,8 @@ inline bool FOptiMove::isMethod2Faster ( int& move_time if ( yold >= 0 && F_carriage_return.cap ) { - char null_result[BUF_SIZE]; - char* null_ptr = null_result; - int new_time = relativeMove (null_ptr, 0, yold, xnew, ynew); + char null_result[BUF_SIZE]; + int new_time = relativeMove (null_result, 0, yold, xnew, ynew); if ( new_time < LONG_DURATION && F_carriage_return.duration + new_time < move_time ) @@ -967,9 +965,8 @@ inline bool FOptiMove::isMethod3Faster ( int& move_time if ( F_cursor_home.cap ) { - char null_result[BUF_SIZE]; - char* null_ptr = null_result; - int new_time = relativeMove (null_ptr, 0, 0, xnew, ynew); + char null_result[BUF_SIZE]; + int new_time = relativeMove (null_result, 0, 0, xnew, ynew); if ( new_time < LONG_DURATION && F_cursor_home.duration + new_time < move_time ) @@ -989,11 +986,10 @@ inline bool FOptiMove::isMethod4Faster ( int& move_time // Test method 4: home-down + local movement if ( F_cursor_to_ll.cap ) { - char null_result[BUF_SIZE]; - char* null_ptr = null_result; - int new_time = relativeMove ( null_ptr - , 0, int(screen_height) - 1 - , xnew, ynew ); + char null_result[BUF_SIZE]; + int new_time = relativeMove ( null_result + , 0, int(screen_height) - 1 + , xnew, ynew ); if ( new_time < LONG_DURATION && F_cursor_to_ll.duration + new_time < move_time ) @@ -1017,11 +1013,10 @@ inline bool FOptiMove::isMethod5Faster ( int& move_time && yold > 0 && F_cursor_left.cap ) { - char null_result[BUF_SIZE]; - char* null_ptr = null_result; - int new_time = relativeMove ( null_ptr - , int(screen_width) - 1, yold - 1 - , xnew, ynew ); + char null_result[BUF_SIZE]; + int new_time = relativeMove ( null_result + , int(screen_width) - 1, yold - 1 + , xnew, ynew ); if ( new_time < LONG_DURATION && F_carriage_return.cap @@ -1030,6 +1025,7 @@ inline bool FOptiMove::isMethod5Faster ( int& move_time { move_time = F_carriage_return.duration + F_cursor_left.duration + new_time; + return true; } } diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index 85f419fa..9b8740cf 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -44,8 +44,8 @@ FStatusKey::FStatusKey(FWidget* parent) //---------------------------------------------------------------------- FStatusKey::FStatusKey (FKey k, const FString& txt, FWidget* parent) : FWidget(parent) - , key(k) , text(txt) + , key(k) { init (parent); } @@ -141,13 +141,13 @@ FStatusBar::~FStatusBar() // destructor while ( iter != key_list.end() ) { - (*iter)->setConnectedStatusbar(0); + (*iter)->setConnectedStatusbar(nullptr); delAccelerator (*iter); iter = key_list.erase(iter); } } - setStatusBar(0); + setStatusBar(nullptr); } @@ -286,7 +286,7 @@ void FStatusBar::remove (FStatusKey* skey) if ( (*iter) == skey ) { iter = key_list.erase(iter); - skey->setConnectedStatusbar(0); + skey->setConnectedStatusbar(nullptr); break; } else diff --git a/src/fterm.cpp b/src/fterm.cpp index 342b2d24..08203f08 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -1614,9 +1614,6 @@ void FTerm::init_optiMove() FOptiMove::termEnv optimove_env = { - FTermcap::automatic_left_margin, - FTermcap::eat_nl_glitch, - FTermcap::tabstop, TCAP(fc::t_cursor_home), TCAP(fc::t_carriage_return), TCAP(fc::t_cursor_to_ll), @@ -1636,7 +1633,10 @@ void FTerm::init_optiMove() TCAP(fc::t_erase_chars), TCAP(fc::t_repeat_char), TCAP(fc::t_clr_bol), - TCAP(fc::t_clr_eol) + TCAP(fc::t_clr_eol), + FTermcap::tabstop, + FTermcap::automatic_left_margin, + FTermcap::eat_nl_glitch }; opti_move->setTermEnvironment(optimove_env); @@ -1649,9 +1649,6 @@ void FTerm::init_optiAttr() FOptiAttr::termEnv optiattr_env = { - FTermcap::ansi_default_color, - FTermcap::max_color, - FTermcap::attr_without_color, TCAP(fc::t_enter_bold_mode), TCAP(fc::t_exit_bold_mode), TCAP(fc::t_enter_dim_mode), @@ -1686,7 +1683,10 @@ void FTerm::init_optiAttr() TCAP(fc::t_set_background), TCAP(fc::t_orig_pair), TCAP(fc::t_orig_pair), - TCAP(fc::t_orig_colors) + TCAP(fc::t_orig_colors), + FTermcap::max_color, + FTermcap::attr_without_color, + FTermcap::ansi_default_color }; opti_attr->setTermEnvironment(optiattr_env); diff --git a/src/ftermdetection.cpp b/src/ftermdetection.cpp index 8b8d9d8b..32938be3 100644 --- a/src/ftermdetection.cpp +++ b/src/ftermdetection.cpp @@ -539,7 +539,7 @@ char* FTermDetection::determineMaxColor (char current_termtype[]) } //---------------------------------------------------------------------- -const FString FTermDetection::getXTermColorName (int color) +const FString FTermDetection::getXTermColorName (FColor color) { FString color_str{""}; fd_set ifds{}; @@ -547,7 +547,7 @@ const FString FTermDetection::getXTermColorName (int color) int stdin_no = FTermios::getStdIn(); char temp[512]{}; - std::fprintf (stdout, OSC "4;%d;?" BEL, color); // get color + std::fprintf (stdout, OSC "4;%hu;?" BEL, color); // get color std::fflush(stdout); FD_ZERO(&ifds); @@ -558,7 +558,7 @@ const FString FTermDetection::getXTermColorName (int color) // read the terminal answer if ( select (stdin_no + 1, &ifds, 0, 0, &tv) > 0 ) { - if ( std::scanf("\033]4;%10d;%509[^\n]s", &color, temp) == 2 ) + if ( std::scanf("\033]4;%10hu;%509[^\n]s", &color, temp) == 2 ) { std::size_t n = std::strlen(temp); diff --git a/src/ftooltip.cpp b/src/ftooltip.cpp index d519ccf2..5700cd55 100644 --- a/src/ftooltip.cpp +++ b/src/ftooltip.cpp @@ -112,7 +112,7 @@ void FToolTip::hide() //---------------------------------------------------------------------- void FToolTip::onMouseDown (FMouseEvent*) { - setClickedWidget(0); + setClickedWidget(nullptr); close(); } diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 7ea4c951..9bb21c94 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -645,7 +645,7 @@ void FVTerm::createArea ( const FRect& box return; } - area->widget = static_cast(this); + area->widget = reinterpret_cast(this); resizeArea (box, shadow, area); } diff --git a/src/fwidget.cpp b/src/fwidget.cpp index c88be8f7..ea3dafc5 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -30,6 +30,7 @@ #include "final/ftermdata.h" #include "final/fwidget.h" #include "final/fwidgetcolors.h" +#include "final/fwindow.h" namespace finalcut { @@ -102,23 +103,23 @@ FWidget::~FWidget() // destructor // unset clicked widget if ( this == getClickedWidget() ) - setClickedWidget(0); + setClickedWidget(nullptr); // unset the local window widget focus if ( flags.focus ) { if ( auto window = FWindow::getWindowWidget(this) ) - window->setWindowFocusWidget(0); + window->setWindowFocusWidget(nullptr); } // unset the global widget focus if ( this == FWidget::getFocusWidget() ) - FWidget::setFocusWidget(0); + FWidget::setFocusWidget(nullptr); // unset main widget if ( this == getMainWidget() ) { - setMainWidget(0); + setMainWidget(nullptr); quit(); } @@ -833,6 +834,7 @@ bool FWidget::close() if ( ! flags.modal ) close_widget->push_back(this); } + return true; } else diff --git a/src/fwindow.cpp b/src/fwindow.cpp index ac9bd989..953751d3 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -144,10 +144,10 @@ void FWindow::setActiveWindow (FWindow* window) } //---------------------------------------------------------------------- -void FWindow::setWindowFocusWidget (const FWidget* obj) +void FWindow::setWindowFocusWidget (FWidget* obj) { // set focus widget of this window - win_focus_widget = const_cast(obj); + win_focus_widget = obj; } //---------------------------------------------------------------------- @@ -167,7 +167,7 @@ bool FWindow::activateWindow (bool enable) void FWindow::unsetActiveWindow() { // unset the active FWindow object - FWidget::setActiveWindow (0); + FWidget::setActiveWindow (nullptr); } //---------------------------------------------------------------------- @@ -499,7 +499,7 @@ FWindow* FWindow::getWindowWidget (const FWidget* obj) } if ( obj->isWindowWidget() ) - return const_cast(static_cast(obj)); + return const_cast(reinterpret_cast(obj)); else return 0; } diff --git a/src/include/final/emptyfstring.h b/src/include/final/emptyfstring.h index 6e195596..b8183cd5 100644 --- a/src/include/final/emptyfstring.h +++ b/src/include/final/emptyfstring.h @@ -39,9 +39,6 @@ namespace fc // class emptyFString //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class emptyFString final { public: @@ -62,7 +59,6 @@ private: // Data member static const FString* empty_string; }; -#pragma pack(pop) // emptyFString inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index a0580022..d3d66dd9 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -90,9 +90,6 @@ class FObject; // class FApplication //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FApplication : public FWidget { public: @@ -201,8 +198,6 @@ class FApplication : public FWidget static FKeyboard* keyboard; static FWidget* keyboard_widget; }; -#pragma pack(pop) - // FApplication inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h index 177b283d..3490c7de 100644 --- a/src/include/final/fbutton.h +++ b/src/include/final/fbutton.h @@ -62,9 +62,6 @@ namespace finalcut // class FButton //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FButton : public FWidget { public: @@ -165,11 +162,6 @@ class FButton : public FWidget bool click_animation{true}; int click_time{150}; int space_char{int(' ')}; - std::size_t hotkeypos{NOT_SET}; - std::size_t indent{0}; - std::size_t center_offset{0}; - std::size_t vcenter_offset{0}; - std::size_t txtlength{0}; FColor button_fg{getFWidgetColors().button_active_fg}; FColor button_bg{getFWidgetColors().button_active_bg}; FColor button_hotkey_fg{getFWidgetColors().button_hotkey_fg}; @@ -177,9 +169,12 @@ class FButton : public FWidget FColor button_focus_bg{getFWidgetColors().button_active_focus_bg}; FColor button_inactive_fg{getFWidgetColors().button_inactive_fg}; FColor button_inactive_bg{getFWidgetColors().button_inactive_bg}; + std::size_t hotkeypos{NOT_SET}; + std::size_t indent{0}; + std::size_t center_offset{0}; + std::size_t vcenter_offset{0}; + std::size_t txtlength{0}; }; -#pragma pack(pop) - // FButton inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h index 1b6bf5f6..1be167f3 100644 --- a/src/include/final/fbuttongroup.h +++ b/src/include/final/fbuttongroup.h @@ -66,9 +66,6 @@ class FToggleButton; // class FButtonGroup //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FButtonGroup : public FScrollView { public: @@ -144,8 +141,6 @@ class FButtonGroup : public FScrollView FString text{}; FObjectList buttonlist{}; }; -#pragma pack(pop) - // FButtonGroup inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fcheckbox.h b/src/include/final/fcheckbox.h index 3448a4be..ed691019 100644 --- a/src/include/final/fcheckbox.h +++ b/src/include/final/fcheckbox.h @@ -66,9 +66,6 @@ namespace finalcut // class FCheckBox //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FCheckBox : public FToggleButton { public: @@ -96,8 +93,6 @@ class FCheckBox : public FToggleButton void drawChecked(); void drawUnchecked(); }; -#pragma pack(pop) - // FCheckBox inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fcheckmenuitem.h b/src/include/final/fcheckmenuitem.h index 97a07ffd..1e502550 100644 --- a/src/include/final/fcheckmenuitem.h +++ b/src/include/final/fcheckmenuitem.h @@ -66,9 +66,6 @@ namespace finalcut // class FCheckMenuItem //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FCheckMenuItem : public FMenuItem { public: @@ -94,8 +91,6 @@ class FCheckMenuItem : public FMenuItem void processToggle(); void processClicked() override; }; -#pragma pack(pop) - // FCheckMenuItem inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fcolorpair.h b/src/include/final/fcolorpair.h index 13183d20..f190b917 100644 --- a/src/include/final/fcolorpair.h +++ b/src/include/final/fcolorpair.h @@ -45,9 +45,6 @@ namespace finalcut // class FColorPair //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FColorPair { public: @@ -114,7 +111,6 @@ class FColorPair FColor fg_color; // Foreground color FColor bg_color; // Background color }; -#pragma pack(pop) } // namespace finalcut diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index e588d824..a14adad4 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -42,9 +42,6 @@ namespace finalcut // class FColorPalette //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FColorPalette final { public: @@ -66,7 +63,6 @@ class FColorPalette final static void reset8ColorPalette (funcp); static void reset16ColorPalette (funcp); }; -#pragma pack(pop) // FColorPalette inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h index fcad0f2c..b43fbd1b 100644 --- a/src/include/final/fdialog.h +++ b/src/include/final/fdialog.h @@ -69,9 +69,6 @@ class FToolTip; // class FDialog //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FDialog : public FWindow { public: @@ -238,7 +235,6 @@ class FDialog : public FWindow // Friend function from FMenu friend void FMenu::hideSuperMenus(); }; -#pragma pack(pop) // FDialog inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fdialoglistmenu.h b/src/include/final/fdialoglistmenu.h index 939b6cf9..ce0a5389 100644 --- a/src/include/final/fdialoglistmenu.h +++ b/src/include/final/fdialoglistmenu.h @@ -72,9 +72,6 @@ namespace finalcut // class FDialogListMenu //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FDialogListMenu : public FMenu { public: @@ -98,7 +95,6 @@ class FDialogListMenu : public FMenu // Method void init(); }; -#pragma pack(pop) // FDialogListMenu inline functions diff --git a/src/include/final/fevent.h b/src/include/final/fevent.h index 3679a566..8be6e58a 100644 --- a/src/include/final/fevent.h +++ b/src/include/final/fevent.h @@ -94,9 +94,6 @@ class FPoint; // class FEvent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FEvent // event base class { public: @@ -108,16 +105,11 @@ class FEvent // event base class fc::events t{fc::None_Event}; }; -#pragma pack(pop) - //---------------------------------------------------------------------- // class FKeyEvent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FKeyEvent : public FEvent // keyboard event { public: @@ -125,26 +117,21 @@ class FKeyEvent : public FEvent // keyboard event FKeyEvent (fc::events, FKey); ~FKeyEvent(); - FKey key() const; - bool isAccepted() const; - void accept(); - void ignore(); + FKey key() const; + bool isAccepted() const; + void accept(); + void ignore(); private: - FKey k{0}; - bool accpt{false}; + FKey k{0}; + bool accpt{false}; }; -#pragma pack(pop) - //---------------------------------------------------------------------- // class FMouseEvent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMouseEvent : public FEvent // mouse event { public: @@ -153,30 +140,25 @@ class FMouseEvent : public FEvent // mouse event FMouseEvent (fc::events, const FPoint&, int); ~FMouseEvent(); - const FPoint& getPos() const; - const FPoint& getTermPos() const; - int getX() const; - int getY() const; - int getTermX() const; - int getTermY() const; - int getButton() const; + const FPoint& getPos() const; + const FPoint& getTermPos() const; + int getX() const; + int getY() const; + int getTermX() const; + int getTermY() const; + int getButton() const; private: - FPoint p{}; - FPoint tp{}; - int b{}; + FPoint p{}; + FPoint tp{}; + int b{}; }; -#pragma pack(pop) - //---------------------------------------------------------------------- // class FWheelEvent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FWheelEvent : public FEvent // wheel event { public: @@ -185,30 +167,25 @@ class FWheelEvent : public FEvent // wheel event FWheelEvent (fc::events, const FPoint&, const FPoint&, int); ~FWheelEvent(); - const FPoint& getPos() const; - const FPoint& getTermPos() const; - int getX() const; - int getY() const; - int getTermX() const; - int getTermY() const; - int getWheel() const; + const FPoint& getPos() const; + const FPoint& getTermPos() const; + int getX() const; + int getY() const; + int getTermX() const; + int getTermY() const; + int getWheel() const; private: - FPoint p; - FPoint tp; - int w; + FPoint p; + FPoint tp; + int w; }; -#pragma pack(pop) - //---------------------------------------------------------------------- // class FFocusEvent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FFocusEvent : public FEvent // focus event { public: @@ -216,29 +193,24 @@ class FFocusEvent : public FEvent // focus event explicit FFocusEvent (fc::events); ~FFocusEvent(); - bool gotFocus() const; - bool lostFocus() const; + bool gotFocus() const; + bool lostFocus() const; fc::FocusTypes getFocusType() const; - void setFocusType(fc::FocusTypes); - bool isAccepted() const; - void accept(); - void ignore(); + void setFocusType(fc::FocusTypes); + bool isAccepted() const; + void accept(); + void ignore(); private: - bool accpt{true}; + bool accpt{true}; fc::FocusTypes focus_type{fc::FocusDefiniteWidget}; }; -#pragma pack(pop) - //---------------------------------------------------------------------- // class FAccelEvent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FAccelEvent : public FEvent // focus event { public: @@ -258,8 +230,6 @@ class FAccelEvent : public FEvent // focus event void* focus_widget{}; }; -#pragma pack(pop) - //---------------------------------------------------------------------- // class FResizeEvent @@ -272,12 +242,12 @@ class FResizeEvent : public FEvent // resize event explicit FResizeEvent (fc::events); ~FResizeEvent(); - bool isAccepted() const; - void accept(); - void ignore(); + bool isAccepted() const; + void accept(); + void ignore(); private: - bool accpt{false}; + bool accpt{false}; }; @@ -318,12 +288,12 @@ class FCloseEvent : public FEvent // close event explicit FCloseEvent(fc::events); ~FCloseEvent(); - bool isAccepted() const; - void accept(); - void ignore(); + bool isAccepted() const; + void accept(); + void ignore(); private: - bool accpt{false}; + bool accpt{false}; }; @@ -331,9 +301,6 @@ class FCloseEvent : public FEvent // close event // class FTimerEvent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTimerEvent : public FEvent // timer event { public: @@ -341,22 +308,17 @@ class FTimerEvent : public FEvent // timer event FTimerEvent (fc::events, int); ~FTimerEvent(); - int getTimerId() const; + int getTimerId() const; private: - int id{0}; + int id{0}; }; -#pragma pack(pop) - //---------------------------------------------------------------------- // class FUserEvent //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FUserEvent : public FEvent // timer event { public: @@ -371,17 +333,15 @@ class FUserEvent : public FEvent // timer event // Disable assignment operator (=) FUserEvent& operator = (const FUserEvent&) = delete; - int getUserId() const; + int getUserId() const; FDataPtr getData() const; - void setData (FDataPtr); + void setData (FDataPtr); private: - int uid{0}; + int uid{0}; FDataPtr data_pointer{nullptr}; }; -#pragma pack(pop) - } // namespace finalcut #endif // FEVENT_H diff --git a/src/include/final/ffiledialog.h b/src/include/final/ffiledialog.h index c3ca69a6..a6cc7390 100644 --- a/src/include/final/ffiledialog.h +++ b/src/include/final/ffiledialog.h @@ -92,9 +92,6 @@ class FSystem; // class FFileDialog //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FFileDialog : public FDialog { public: @@ -216,8 +213,6 @@ class FFileDialog : public FDialog friend bool sortDirFirst ( const FFileDialog::dir_entry& , const FFileDialog::dir_entry& ); }; -#pragma pack(pop) - // FMessageBox inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index 2d6511d3..1a6a75b0 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -50,9 +50,6 @@ class FTermLinux; // class FKeyboardCommand //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FKeyboardCommand final { public: @@ -68,16 +65,12 @@ class FKeyboardCommand final FApplication* instance{nullptr}; void (FApplication::*handler)(){nullptr}; }; -#pragma pack(pop) //---------------------------------------------------------------------- // class FKeyboard //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FKeyboard final { public: @@ -160,30 +153,29 @@ class FKeyboard final void escapeKeyPressed(); // Data members - FKey key{0}; - char read_buf[READ_BUF_SIZE]{'\0'}; - char fifo_buf[FIFO_BUF_SIZE]{'\0'}; - int fifo_offset{0}; - bool fifo_in_use{false}; - int stdin_status_flags{0}; - static uInt64 key_timeout; - bool input_data_pending{false}; - bool utf8_input{false}; - bool mouse_support{true}; - bool non_blocking_stdin{false}; FKeyboardCommand keypressed_cmd{}; FKeyboardCommand keyreleased_cmd{}; FKeyboardCommand escape_key_cmd{}; - static timeval time_keypressed; - fc::fkeymap* key_map{nullptr}; - #if defined(__linux__) #undef linux static FTermLinux* linux; #endif + + static timeval time_keypressed; + static uInt64 key_timeout; + fc::fkeymap* key_map{nullptr}; + FKey key{0}; + char read_buf[READ_BUF_SIZE]{'\0'}; + char fifo_buf[FIFO_BUF_SIZE]{'\0'}; + int fifo_offset{0}; + int stdin_status_flags{0}; + bool fifo_in_use{false}; + bool input_data_pending{false}; + bool utf8_input{false}; + bool mouse_support{true}; + bool non_blocking_stdin{false}; }; -#pragma pack(pop) // FKeyboard inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index 898bec6a..bcf75b63 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -64,9 +64,6 @@ namespace finalcut // class FLabel //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FLabel : public FWidget { public: @@ -153,18 +150,16 @@ class FLabel : public FWidget , std::size_t, std::size_t = 0 ); // Data members - FStringList multiline_text{}; - bool multiline{false}; - FString text{}; - fc::text_alignment alignment{fc::alignLeft}; - FColor emphasis_color{getFWidgetColors().label_emphasis_fg}; - FColor ellipsis_color{getFWidgetColors().label_ellipsis_fg}; - bool emphasis{false}; - bool reverse_mode{false}; - FWidget* accel_widget{nullptr}; + FStringList multiline_text{}; + FString text{}; + FWidget* accel_widget{nullptr}; + fc::text_alignment alignment{fc::alignLeft}; + FColor emphasis_color{getFWidgetColors().label_emphasis_fg}; + FColor ellipsis_color{getFWidgetColors().label_ellipsis_fg}; + bool multiline{false}; + bool emphasis{false}; + bool reverse_mode{false}; }; -#pragma pack(pop) - // FLabel inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h index a732c806..4287d51e 100644 --- a/src/include/final/flineedit.h +++ b/src/include/final/flineedit.h @@ -65,9 +65,6 @@ class FLabel; // class FLineEdit //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FLineEdit : public FWidget { public: @@ -189,17 +186,16 @@ class FLineEdit : public FWidget FString text{""}; FString label_text{""}; FLabel* label{}; - label_o label_orientation{FLineEdit::label_left}; std::wstring input_filter{}; dragScroll drag_scroll{FLineEdit::noScroll}; - bool scroll_timer{false}; + label_o label_orientation{FLineEdit::label_left}; int scroll_repeat{100}; + bool scroll_timer{false}; bool insert_mode{true}; std::size_t cursor_pos{0}; std::size_t text_offset{0}; std::size_t max_length{std::numeric_limits::max()}; }; -#pragma pack(pop) // FLineEdit inline functions diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h index 224581dc..5385cfdf 100644 --- a/src/include/final/flistbox.h +++ b/src/include/final/flistbox.h @@ -69,9 +69,6 @@ class FString; // class FListBoxItem //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FListBoxItem { public: @@ -108,7 +105,6 @@ class FListBoxItem fc::brackets_type brackets{fc::NoBrackets}; bool selected{false}; }; -#pragma pack(pop) // FListBoxItem inline functions @@ -141,9 +137,6 @@ inline void FListBoxItem::clear() // class FListBox //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FListBox : public FWidget { public: @@ -329,27 +322,26 @@ class FListBox : public FWidget // Data members listBoxItems itemlist{}; FDataPtr source_container{nullptr}; - convert_type conv_type{FListBox::no_convert}; FScrollbarPtr vbar{nullptr}; FScrollbarPtr hbar{nullptr}; FString text{}; FString inc_search{}; - bool multi_select{false}; - bool mouse_select{false}; + convert_type conv_type{FListBox::no_convert}; fc::dragScroll drag_scroll{fc::noScroll}; - bool scroll_timer{false}; int scroll_repeat{100}; int scroll_distance{1}; - std::size_t current{0}; int last_current{-1}; int secect_from_item{-1}; int xoffset{0}; int yoffset{0}; int last_yoffset{-1}; + std::size_t current{0}; std::size_t nf_offset{0}; std::size_t max_line_width{0}; + bool multi_select{false}; + bool mouse_select{false}; + bool scroll_timer{false}; }; -#pragma pack(pop) // FListBox inline functions diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 53e94ffe..0c63f09d 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -72,9 +72,6 @@ class FString; // class FListViewItem //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FListViewItem : public FObject { public: @@ -142,7 +139,6 @@ class FListViewItem : public FObject friend class FListView; friend class FListViewIterator; }; -#pragma pack(pop) // FListViewItem inline functions @@ -187,9 +183,6 @@ inline bool FListViewItem::isCheckable() const // class FListViewIterator //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FListViewIterator { public: @@ -231,7 +224,6 @@ class FListViewIterator FObjectIterator node{}; int position{0}; }; -#pragma pack(pop) // FListViewIterator inline functions @@ -263,9 +255,6 @@ inline int FListViewIterator::getPosition() const // class FListView //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FListView : public FWidget { public: @@ -458,48 +447,46 @@ class FListView : public FWidget FTermBuffer headerline{}; FScrollbarPtr vbar{nullptr}; FScrollbarPtr hbar{nullptr}; + sortTypes sort_type{}; + FPoint clicked_expander_pos{-1, -1}; + FPoint clicked_header_pos{-1, -1}; + const FListViewItem* clicked_checkbox_item{nullptr}; + std::size_t nf_offset{0}; + std::size_t max_line_width{1}; fc::dragScroll drag_scroll{fc::noScroll}; int scroll_repeat{100}; int scroll_distance{1}; + int xoffset{0}; + int sort_column{-1}; + fc::sorting_order sort_order{fc::unsorted}; bool scroll_timer{false}; bool tree_view{false}; bool hide_sort_indicator{false}; bool has_checkable_items{false}; - FPoint clicked_expander_pos{-1, -1}; - FPoint clicked_header_pos{-1, -1}; - const FListViewItem* clicked_checkbox_item{nullptr}; - int xoffset{0}; - std::size_t nf_offset{0}; - std::size_t max_line_width{1}; - int sort_column{-1}; - sortTypes sort_type{}; - fc::sorting_order sort_order{fc::unsorted}; + + // Function Pointer bool (*user_defined_ascending) (const FObject*, const FObject*){nullptr}; bool (*user_defined_descending) (const FObject*, const FObject*){nullptr}; // Friend class friend class FListViewItem; }; -#pragma pack(pop) //---------------------------------------------------------------------- // struct FListView::Header //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) struct FListView::Header { public: Header() = default; FString name{}; + fc::text_alignment alignment{fc::alignLeft}; int width{0}; bool fixed_width{false}; - fc::text_alignment alignment{fc::alignLeft}; }; -#pragma pack(pop) // FListView inline functions diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index e1e25c33..bf1c9b06 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -73,9 +73,6 @@ class FMenuItem; // class FMenu //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMenu : public FWindow, public FMenuList { public: @@ -239,7 +236,6 @@ class FMenu : public FWindow, public FMenuList bool mouse_down{false}; bool has_checkable_items{false}; }; -#pragma pack(pop) // FMenu inline functions diff --git a/src/include/final/fmenubar.h b/src/include/final/fmenubar.h index 65a5221a..d93017db 100644 --- a/src/include/final/fmenubar.h +++ b/src/include/final/fmenubar.h @@ -72,9 +72,6 @@ class FMenu; // class FMenuBar //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMenuBar : public FWindow, public FMenuList { public: @@ -155,12 +152,11 @@ class FMenuBar : public FWindow, public FMenuList friend class FMenuItem; // Data members + std::size_t screenWidth{80}; bool mouse_down{false}; bool drop_down{false}; bool focus_changed{false}; - std::size_t screenWidth{80}; }; -#pragma pack(pop) // FMenuBar inline functions diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index 66602f4e..3ada23bd 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -70,9 +70,6 @@ class FMenuList; // class FMenuItem //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMenuItem : public FWidget { public: @@ -178,18 +175,18 @@ class FMenuItem : public FWidget // Data members FString text{}; + FMenu* menu{nullptr}; + FWidget* super_menu{nullptr}; + FDialog* associated_window{nullptr}; + std::size_t text_length{0}; + FKey accel_key{0}; + uChar hotkey{0}; bool selected{false}; bool separator{false}; bool checkable{false}; bool checked{false}; bool radio_button{false}; bool dialog_index{false}; - std::size_t text_length{0}; - uChar hotkey{0}; - FKey accel_key{0}; - FMenu* menu{nullptr}; - FWidget* super_menu{nullptr}; - FDialog* associated_window{nullptr}; // Friend classes friend class FDialogListMenu; @@ -197,7 +194,6 @@ class FMenuItem : public FWidget friend class FMenuBar; friend class FMenu; }; -#pragma pack(pop) // FMenuItem inline functions diff --git a/src/include/final/fmenulist.h b/src/include/final/fmenulist.h index c73ecafe..d727237f 100644 --- a/src/include/final/fmenulist.h +++ b/src/include/final/fmenulist.h @@ -55,9 +55,6 @@ namespace finalcut // class FMenuList //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMenuList { public: @@ -103,7 +100,6 @@ class FMenuList FMenuItem* selected_item{}; std::vector item_list{}; }; -#pragma pack(pop) // FMenuList inline functions diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index 0c6a71ef..6665832c 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -77,9 +77,6 @@ class FButton; // class FMessageBox //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMessageBox : public FDialog { public: @@ -160,15 +157,14 @@ class FMessageBox : public FDialog FString text{}; FString* text_components{nullptr}; FStringList text_split{}; + FButton* button[3]{nullptr}; std::size_t max_line_width{0}; - bool center_text{false}; FColor emphasis_color{getFWidgetColors().dialog_emphasis_fg}; + int button_digit[3]{0}; uInt num_buttons{0}; uInt text_num_lines{0}; - int button_digit[3]{0}; - FButton* button[3]{nullptr}; + bool center_text{false}; }; -#pragma pack(pop) // FMessageBox inline functions diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index c034a405..8e0d9ad4 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -81,9 +81,6 @@ namespace finalcut // class FMouse //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMouse { public: @@ -193,7 +190,6 @@ class FMouse FPoint mouse{0, 0}; // mouse click position FPoint new_mouse_position{}; }; -#pragma pack(pop) #ifdef F_HAVE_LIBGPM @@ -201,9 +197,6 @@ class FMouse // class FMouseGPM //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMouseGPM final : public FMouse { public: @@ -253,7 +246,6 @@ class FMouseGPM final : public FMouse bool gpm_mouse_enabled{false}; int stdin_no{0}; }; -#pragma pack(pop) //---------------------------------------------------------------------- inline bool FMouseGPM::enableGpmMouse() @@ -273,9 +265,6 @@ inline bool FMouseGPM::isGpmMouseEnabled() // class FMouseX11 //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMouseX11 final : public FMouse { public: @@ -329,16 +318,12 @@ class FMouseX11 final : public FMouse char x11_mouse[MOUSE_BUF_SIZE]{'\0'}; uChar x11_button_state{all_buttons_released}; }; -#pragma pack(pop) //---------------------------------------------------------------------- // class FMouseSGR //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMouseSGR final : public FMouse { public: @@ -392,16 +377,12 @@ class FMouseSGR final : public FMouse char sgr_mouse[MOUSE_BUF_SIZE]{'\0'}; uChar sgr_button_state{0x23}; }; -#pragma pack(pop) //---------------------------------------------------------------------- // class FMouseUrxvt //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMouseUrxvt final : public FMouse { public: @@ -455,15 +436,12 @@ class FMouseUrxvt final : public FMouse char urxvt_mouse[MOUSE_BUF_SIZE]{'\0'}; uChar urxvt_button_state{all_buttons_released}; }; -#pragma pack(pop) //---------------------------------------------------------------------- // class FMouseControl //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) class FMouseControl { public: @@ -531,7 +509,6 @@ class FMouseControl bool use_gpm_mouse{false}; bool use_xterm_mouse{false}; }; -#pragma pack(pop) // FMouseControl inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h index 477a31f2..d3476031 100644 --- a/src/include/final/fobject.h +++ b/src/include/final/fobject.h @@ -68,9 +68,6 @@ class FUserEvent; // class FObject //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FObject { public: @@ -158,15 +155,14 @@ class FObject virtual void performTimerAction (const FObject*, const FEvent*); // Data members - FObject* parent_obj{nullptr}; - FObjectList children_list{}; // no children yet - bool has_parent{false}; - bool widget_object{false}; - static bool timer_modify_lock; - static TimerList* timer_list; + FObject* parent_obj{nullptr}; + FObjectList children_list{}; // no children yet + bool has_parent{false}; + bool widget_object{false}; + static bool timer_modify_lock; + static TimerList* timer_list; }; -#pragma pack(pop) //---------------------------------------------------------------------- inline const char* FObject::getClassName() const diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index 39810447..c016c9d6 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -65,18 +65,12 @@ namespace finalcut // class FOptiAttr //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FOptiAttr final { public: // Typedef typedef struct { - bool ansi_default_color; - int max_color; - int attr_without_color; char* t_enter_bold_mode; char* t_exit_bold_mode; char* t_enter_dim_mode; @@ -112,6 +106,9 @@ class FOptiAttr final char* t_set_color_pair; char* t_orig_pair; char* t_orig_colors; + int max_color; + int attr_without_color; + bool ansi_default_color; } termEnv; // Constructor @@ -185,7 +182,7 @@ class FOptiAttr final private: // Typedefs and Enumerations - typedef struct alignas(alignof(char*)) + typedef struct { char* cap; bool caused_reset; @@ -327,14 +324,13 @@ class FOptiAttr final int max_color{1}; int attr_without_color{0}; + char* attr_ptr{attr_buf}; + char attr_buf[8192]{'\0'}; bool ansi_default_color{false}; bool alt_equal_pc_charset{false}; bool monochron{true}; bool fake_reverse{false}; - char attr_buf[8192]{'\0'}; - char* attr_ptr{attr_buf}; }; -#pragma pack(pop) // FOptiAttr inline functions diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index 7da5982e..fc1ac381 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -70,18 +70,12 @@ namespace finalcut // class FOptiMove //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FOptiMove final { public: // Typedef typedef struct { - bool automatic_left_margin; - bool eat_nl_glitch; - int tabstop; char* t_cursor_home; char* t_carriage_return; char* t_cursor_to_ll; @@ -102,6 +96,9 @@ class FOptiMove final char* t_repeat_char; char* t_clr_bol; char* t_clr_eol; + int tabstop; + bool automatic_left_margin; + bool eat_nl_glitch; } termEnv; // Constructor @@ -158,8 +155,8 @@ class FOptiMove final void set_repeat_char (char[]); void set_clr_bol (char[]); void set_clr_eol (char[]); - void set_auto_left_margin (const bool&); - void set_eat_newline_glitch (const bool&); + void set_auto_left_margin (bool); + void set_eat_newline_glitch (bool); // Methods void check_boundaries (int&, int&, int&, int&); @@ -230,16 +227,15 @@ class FOptiMove final capability F_clr_bol{}; capability F_clr_eol{}; - bool automatic_left_margin{false}; - bool eat_nl_glitch{false}; - char move_buf[BUF_SIZE]{'\0'}; + std::size_t screen_width{80}; + std::size_t screen_height{24}; int char_duration{1}; int baudrate{9600}; int tabstop{0}; - std::size_t screen_width{80}; - std::size_t screen_height{24}; + char move_buf[BUF_SIZE]{'\0'}; + bool automatic_left_margin{false}; + bool eat_nl_glitch{false}; }; -#pragma pack(pop) // FOptiMove inline functions @@ -328,11 +324,11 @@ inline uInt FOptiMove::getClrEolLength() const { return uInt(F_clr_eol.length); } //---------------------------------------------------------------------- -inline void FOptiMove::set_auto_left_margin (const bool& bcap) +inline void FOptiMove::set_auto_left_margin (bool bcap) { automatic_left_margin = bcap; } //---------------------------------------------------------------------- -inline void FOptiMove::set_eat_newline_glitch (const bool& bcap) +inline void FOptiMove::set_eat_newline_glitch (bool bcap) { eat_nl_glitch = bcap; } diff --git a/src/include/final/fpoint.h b/src/include/final/fpoint.h index 792923d9..16bceab5 100644 --- a/src/include/final/fpoint.h +++ b/src/include/final/fpoint.h @@ -44,9 +44,6 @@ namespace finalcut // class FPoint //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FPoint { public: @@ -94,7 +91,6 @@ class FPoint int xpos{0}; int ypos{0}; }; -#pragma pack(pop) // FPoint inline functions diff --git a/src/include/final/fprogressbar.h b/src/include/final/fprogressbar.h index d5a2f98d..96ba2e7b 100644 --- a/src/include/final/fprogressbar.h +++ b/src/include/final/fprogressbar.h @@ -61,9 +61,6 @@ namespace finalcut // class FProgressbar //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FProgressbar : public FWidget { public: @@ -110,7 +107,6 @@ class FProgressbar : public FWidget std::size_t percentage{NOT_SET}; std::size_t bar_length{getWidth()}; }; -#pragma pack(pop) // FProgressbar inline functions diff --git a/src/include/final/fradiobutton.h b/src/include/final/fradiobutton.h index f9ab0730..44241665 100644 --- a/src/include/final/fradiobutton.h +++ b/src/include/final/fradiobutton.h @@ -66,9 +66,6 @@ namespace finalcut // class FRadioButton //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FRadioButton : public FToggleButton { public: @@ -96,7 +93,6 @@ class FRadioButton : public FToggleButton void drawChecked(); void drawUnchecked(); }; -#pragma pack(pop) // FRadioButton inline functions diff --git a/src/include/final/fradiomenuitem.h b/src/include/final/fradiomenuitem.h index 78defafa..401b9dfe 100644 --- a/src/include/final/fradiomenuitem.h +++ b/src/include/final/fradiomenuitem.h @@ -66,9 +66,6 @@ namespace finalcut // class FRadioMenuItem //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FRadioMenuItem : public FMenuItem { public: @@ -94,8 +91,6 @@ class FRadioMenuItem : public FMenuItem void processToggle(); void processClicked() override; }; -#pragma pack(pop) - // FRadioMenuItem inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/frect.h b/src/include/final/frect.h index 3e7c487a..ac2c9d69 100644 --- a/src/include/final/frect.h +++ b/src/include/final/frect.h @@ -52,9 +52,6 @@ class FSize; // class FRect //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FRect { public: @@ -144,8 +141,6 @@ class FRect int X2{-1}; int Y2{-1}; }; -#pragma pack(pop) - // FRect inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index e562daa1..246b46b1 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -61,9 +61,6 @@ namespace finalcut // class FScrollbar //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FScrollbar : public FWidget { public: @@ -144,27 +141,25 @@ class FScrollbar : public FWidget void processScroll(); // Data members - sType scroll_type{FScrollbar::noScroll}; - bool threshold_reached{false}; - int threshold_time{500}; - int repeat_time{10}; - int slider_click_pos{-1}; - int slider_click_stop_pos{-1}; - int current_slider_pos{-1}; - int slider_pos{0}; - std::size_t slider_length{18}; // = bar_length - std::size_t bar_length{18}; // = length - 2 - int val{0}; - int min{0}; - int max{99}; - double steps{1}; - int pagesize{0}; - std::size_t length{20}; - fc::orientation bar_orientation{fc::vertical}; - int max_color{getMaxColor()}; + sType scroll_type{FScrollbar::noScroll}; + bool threshold_reached{false}; + int threshold_time{500}; + int repeat_time{10}; + int slider_click_pos{-1}; + int slider_click_stop_pos{-1}; + int current_slider_pos{-1}; + int slider_pos{0}; + std::size_t slider_length{18}; // = bar_length + std::size_t bar_length{18}; // = length - 2 + int val{0}; + int min{0}; + int max{99}; + int pagesize{0}; + double steps{1}; + std::size_t length{20}; + fc::orientation bar_orientation{fc::vertical}; + int max_color{getMaxColor()}; }; -#pragma pack(pop) - // FScrollbar inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index 0595a033..9a07c54b 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -65,9 +65,6 @@ namespace finalcut // class FScrollView //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FScrollView : public FWidget { public: @@ -194,8 +191,6 @@ class FScrollView : public FWidget fc::scrollBarMode vMode{fc::Auto}; // fc:Auto, fc::Hidden or fc::Scroll fc::scrollBarMode hMode{fc::Auto}; }; -#pragma pack(pop) - // FScrollView inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fsize.h b/src/include/final/fsize.h index f27c20c9..0379ac83 100644 --- a/src/include/final/fsize.h +++ b/src/include/final/fsize.h @@ -47,9 +47,6 @@ namespace finalcut // class FSize //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FSize { public: @@ -102,8 +99,6 @@ class FSize std::size_t width{0}; std::size_t height{0}; }; -#pragma pack(pop) - // FSize inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fstartoptions.h b/src/include/final/fstartoptions.h index fd600079..2961fc6e 100644 --- a/src/include/final/fstartoptions.h +++ b/src/include/final/fstartoptions.h @@ -42,9 +42,6 @@ namespace finalcut // class FStartOptions //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - struct FStartOptions { public: @@ -86,7 +83,6 @@ struct FStartOptions uInt8 : 7; // padding bits #endif }; -#pragma pack(pop) static struct FStartOptions start_options{}; diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h index 044860bf..6e6fde57 100644 --- a/src/include/final/fstatusbar.h +++ b/src/include/final/fstatusbar.h @@ -74,9 +74,6 @@ class FStatusBar; // class FStatusKey //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FStatusKey : public FWidget { public: @@ -125,13 +122,12 @@ class FStatusKey : public FWidget friend class FStatusBar; // Data members - FKey key{0}; FString text{}; + FStatusBar* bar{nullptr}; + FKey key{0}; bool active{false}; bool mouse_focus{false}; - FStatusBar* bar{nullptr}; }; -#pragma pack(pop) // FStatusKey inline functions @@ -188,9 +184,6 @@ inline void FStatusKey::setConnectedStatusbar (FStatusBar* sb) // class FStatusBar //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FStatusBar : public FWindow { public: @@ -253,13 +246,12 @@ class FStatusBar : public FWindow // Data members keyList key_list{}; FString text{""}; - bool mouse_down{}; std::size_t screenWidth{80}; int keyname_len{0}; int x{-1}; int x_msg{-1}; + bool mouse_down{}; }; -#pragma pack(pop) // FStatusBar inline functions diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index 34ff7067..f9fdc047 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -74,9 +74,6 @@ typedef std::vector FStringList; // class FString //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FString { public: @@ -280,7 +277,7 @@ class FString std::size_t bufsize{0}; mutable char* c_string{nullptr}; }; -#pragma pack(pop) + // FString inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fswitch.h b/src/include/final/fswitch.h index 80db0101..271d9624 100644 --- a/src/include/final/fswitch.h +++ b/src/include/final/fswitch.h @@ -66,9 +66,6 @@ namespace finalcut // class FSwitch //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FSwitch : public FToggleButton { public: @@ -107,8 +104,6 @@ class FSwitch : public FToggleButton std::size_t switch_offset_pos{0}; bool button_pressed{false}; }; -#pragma pack(pop) - // FSwitch inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/fsystem.h b/src/include/final/fsystem.h index 09f4163a..99c7bd7e 100644 --- a/src/include/final/fsystem.h +++ b/src/include/final/fsystem.h @@ -45,9 +45,6 @@ namespace finalcut // class FSystem //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FSystem { public: @@ -74,7 +71,6 @@ class FSystem , size_t, struct passwd**) = 0; virtual char* realpath (const char*, char*) = 0; }; -#pragma pack(pop) } // namespace finalcut diff --git a/src/include/final/fsystemimpl.h b/src/include/final/fsystemimpl.h index f5460887..53c6a14d 100644 --- a/src/include/final/fsystemimpl.h +++ b/src/include/final/fsystemimpl.h @@ -82,9 +82,6 @@ namespace finalcut // class FSystemImpl //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FSystemImpl : public FSystem { public: @@ -210,7 +207,6 @@ class FSystemImpl : public FSystem return ::realpath(path, resolved_path); } }; -#pragma pack(pop) } // namespace finalcut diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index d7e9f3a6..c2910556 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -149,9 +149,6 @@ class FTermXTerminal; // class FTerm //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTerm final { public: @@ -388,7 +385,6 @@ class FTerm final #endif }; -#pragma pack(pop) // FTerm inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermbuffer.h b/src/include/final/ftermbuffer.h index b5c667e5..cd36625e 100644 --- a/src/include/final/ftermbuffer.h +++ b/src/include/final/ftermbuffer.h @@ -49,9 +49,6 @@ class FColorPair; // class FTermBuffer //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermBuffer { public: @@ -94,7 +91,6 @@ class FTermBuffer private: charDataVector data{}; }; -#pragma pack(pop) // FTermBuffer inline functions diff --git a/src/include/final/ftermcap.h b/src/include/final/ftermcap.h index 88b0ece2..8274ee50 100644 --- a/src/include/final/ftermcap.h +++ b/src/include/final/ftermcap.h @@ -71,8 +71,6 @@ class FTermDetection; //---------------------------------------------------------------------- // class FTermcap //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) class FTermcap final { @@ -126,7 +124,7 @@ class FTermcap final static FTermData* fterm_data; static FTermDetection* term_detection; }; -#pragma pack(pop) + // FTermcap inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermcapquirks.h b/src/include/final/ftermcapquirks.h index e24f95e1..80ffd395 100644 --- a/src/include/final/ftermcapquirks.h +++ b/src/include/final/ftermcapquirks.h @@ -46,9 +46,6 @@ class FTermDetection; // class FTermcapsQuirks //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermcapQuirks final { public: @@ -85,7 +82,6 @@ class FTermcapQuirks final static FTermData* fterm_data; static FTermDetection* term_detection; }; -#pragma pack(pop) // FTermcapQuirks inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h index 6c25634e..2a04bbdb 100644 --- a/src/include/final/ftermdata.h +++ b/src/include/final/ftermdata.h @@ -50,9 +50,6 @@ namespace finalcut // class FTermData //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermData final { public: @@ -131,10 +128,19 @@ class FTermData final // Data members encodingMap encoding_list{}; charSubstitution char_substitution_map{}; - fc::encoding term_encoding{fc::UNKNOWN}; FRect term_geometry{}; // current terminal geometry + FString xterm_font{}; + FString xterm_title{}; + fc::encoding term_encoding{fc::UNKNOWN}; int fd_tty{-1}; // Teletype (tty) file descriptor is still undefined + +#if DEBUG + int framebuffer_bpp{-1}; +#endif + uInt baudrate{0}; + char termtype[256]{'\0'}; + char termfilename[256]{'\0'}; bool shadow_character{true}; bool half_block_character{true}; bool cursor_optimisation{true}; @@ -148,15 +154,7 @@ class FTermData final bool vga_font{false}; bool monochron{false}; bool resize_term{false}; - char termtype[256]{'\0'}; - char termfilename[256]{'\0'}; - FString xterm_font{}; - FString xterm_title{}; -#if DEBUG - int framebuffer_bpp{-1}; -#endif }; -#pragma pack(pop) // FTermData inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermdetection.h b/src/include/final/ftermdetection.h index b18a2cf7..6833f20f 100644 --- a/src/include/final/ftermdetection.h +++ b/src/include/final/ftermdetection.h @@ -48,9 +48,6 @@ namespace finalcut // class FTermDetection //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermDetection final { public: @@ -166,7 +163,7 @@ class FTermDetection final static bool get256colorEnvString(); static char* termtype_256color_quirks(); static char* determineMaxColor (char[]); - static const FString getXTermColorName (int); + static const FString getXTermColorName (FColor); static char* parseAnswerbackMsg (char[]); static const FString getAnswerbackMsg(); static char* parseSecDA (char[]); @@ -222,7 +219,6 @@ class FTermDetection final int terminal_id_hardware{-1}; } secondary_da; }; -#pragma pack(pop) // FTermDetection inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermfreebsd.h b/src/include/final/ftermfreebsd.h index 3be6601c..041883be 100644 --- a/src/include/final/ftermfreebsd.h +++ b/src/include/final/ftermfreebsd.h @@ -76,9 +76,6 @@ class FTermData; // class FTermFreeBSD //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermFreeBSD final { public: @@ -134,7 +131,7 @@ class FTermFreeBSD final static FSystem* fsystem; static FTermData* fterm_data; }; -#pragma pack(pop) + // FTermFreeBSD inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermios.h b/src/include/final/ftermios.h index 37f0c7ce..ea50e882 100644 --- a/src/include/final/ftermios.h +++ b/src/include/final/ftermios.h @@ -47,9 +47,6 @@ namespace finalcut // class FTermios //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermios final { public: @@ -92,7 +89,7 @@ class FTermios final static bool raw_mode; static struct termios term_init; }; -#pragma pack(pop) + // FTermios inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermlinux.h b/src/include/final/ftermlinux.h index 2df3100c..cc7107eb 100644 --- a/src/include/final/ftermlinux.h +++ b/src/include/final/ftermlinux.h @@ -66,9 +66,6 @@ class FTermDetection; // class FTermLinux //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermLinux final { public: @@ -193,7 +190,7 @@ class FTermLinux final static int framebuffer_bpp; #endif // defined(__linux__) }; -#pragma pack(pop) + // FTermLinux inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermopenbsd.h b/src/include/final/ftermopenbsd.h index 06d64c16..31a62976 100644 --- a/src/include/final/ftermopenbsd.h +++ b/src/include/final/ftermopenbsd.h @@ -71,9 +71,6 @@ class FSystem; // class FTermOpenBSD //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermOpenBSD final { public: @@ -119,7 +116,7 @@ class FTermOpenBSD final static FSystem* fsystem; #endif // defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST) }; -#pragma pack(pop) + // FTermOpenBSD inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index cd485a1c..1c1f58c0 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -47,9 +47,6 @@ class FTermDetection; // class FTermXTerminal //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermXTerminal final { public: @@ -156,7 +153,7 @@ class FTermXTerminal final static FTermDetection* term_detection; static fc::xtermCursorStyle cursor_style; }; -#pragma pack(pop) + // FTermXTerminal inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index eaa86440..afd8a328 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -67,9 +67,6 @@ class FString; // class FTextView //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTextView : public FWidget { public: @@ -167,8 +164,6 @@ class FTextView : public FWidget int nf_offset{0}; std::size_t maxLineWidth{0}; }; -#pragma pack(pop) - // FListBox inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index d5449229..4764fa58 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -64,9 +64,6 @@ class FButtonGroup; // class FToggleButton - abstract class for FRadioButton, FCheckBox, ... //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FToggleButton : public FWidget { public: @@ -167,8 +164,6 @@ class FToggleButton : public FWidget bool focus_inside_group{true}; bool checked{false}; }; -#pragma pack(pop) - // FRadioButton inline functions //---------------------------------------------------------------------- diff --git a/src/include/final/ftooltip.h b/src/include/final/ftooltip.h index 1d416f4a..624f98ce 100644 --- a/src/include/final/ftooltip.h +++ b/src/include/final/ftooltip.h @@ -68,9 +68,6 @@ namespace finalcut // class FToolTip //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FToolTip : public FWindow { public: @@ -115,7 +112,6 @@ class FToolTip : public FWindow std::size_t max_line_width{0}; std::size_t text_num_lines{0}; }; -#pragma pack(pop) // FToolTip inline functions diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h index 2b8980d6..f7194ed7 100644 --- a/src/include/final/ftypes.h +++ b/src/include/final/ftypes.h @@ -106,9 +106,6 @@ struct getPrecision typedef std::unordered_map charSubstitution; -#pragma pack(push) -#pragma pack(1) - typedef struct { wchar_t code; // character code @@ -118,7 +115,7 @@ typedef struct union attribute { - struct alignas(4) + struct { // Attribute byte #0 uInt8 bold : 1; // bold @@ -142,17 +139,17 @@ typedef struct uInt8 no_changes : 1; // no changes required uInt8 printed : 1; // is printed to VTerm uInt8 : 6; // padding bits + // Attribute byte #3 + uInt8 : 8; // padding byte } bit; - alignas(4) uInt8 byte[3]; + uInt8 byte[4]; } attr; } charData; -#pragma pack(pop) namespace fc { -#pragma pack(push) -#pragma pack(1) + typedef struct { FKey num; @@ -174,7 +171,6 @@ typedef struct char string[25]; } keyname; -#pragma pack(pop) } // namespace fc diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 4ada6717..bfee073f 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -82,9 +82,6 @@ class FWidget; // class FVTerm //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FVTerm { public: @@ -492,16 +489,12 @@ class FVTerm static uInt cursor_address_length; }; -#pragma pack(pop) //---------------------------------------------------------------------- // struct FVTerm::term_area //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - struct FVTerm::term_area // define virtual terminal character properties { public: @@ -533,7 +526,6 @@ struct FVTerm::term_area // define virtual terminal character properties bool has_changes{false}; bool visible{false}; }; -#pragma pack(pop) // FVTerm inline functions diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index 2e6dfc18..bb8d8f02 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -128,9 +128,6 @@ class FWidgetColors; // class FWidget //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FWidget : public FVTerm, public FObject { public: @@ -140,7 +137,7 @@ class FWidget : public FVTerm, public FObject struct accelerator { - FKey key; + alignas(8) FKey key; FWidget* object; }; @@ -525,7 +522,6 @@ class FWidget : public FVTerm, public FObject friend class FScrollView; }; -#pragma pack(pop) // non-member function forward declarations //---------------------------------------------------------------------- diff --git a/src/include/final/fwidgetcolors.h b/src/include/final/fwidgetcolors.h index 485401db..83427a50 100644 --- a/src/include/final/fwidgetcolors.h +++ b/src/include/final/fwidgetcolors.h @@ -44,9 +44,6 @@ namespace finalcut // class FWidgetColors //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FWidgetColors final { public: @@ -140,7 +137,6 @@ class FWidgetColors final FColor progressbar_fg{fc::Default}; FColor progressbar_bg{fc::Default}; }; -#pragma pack(pop) } // namespace finalcut diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h index 187cccf8..ef022c50 100644 --- a/src/include/final/fwindow.h +++ b/src/include/final/fwindow.h @@ -69,9 +69,6 @@ namespace finalcut // class FWindow //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FWindow : public FWidget { public: @@ -101,7 +98,7 @@ class FWindow : public FWidget bool setWindowWidget(); bool unsetWindowWidget(); static void setActiveWindow (FWindow*); - void setWindowFocusWidget (const FWidget*); + void setWindowFocusWidget (FWidget*); bool activateWindow (bool); bool activateWindow(); void unsetActiveWindow(); @@ -175,13 +172,12 @@ class FWindow : public FWidget static void processAlwaysOnTop(); // Data members - bool window_active{false}; - bool zoomed{false}; FWidget* win_focus_widget{nullptr}; FRect normalGeometry{}; static FWindow* previous_window; + bool window_active{false}; + bool zoomed{false}; }; -#pragma pack(pop) // FWindow inline functions diff --git a/test/Makefile.clang b/test/Makefile.clang index 9361b340..c2979c76 100644 --- a/test/Makefile.clang +++ b/test/Makefile.clang @@ -29,7 +29,7 @@ endif all: $(OBJS) debug: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic -Wpadded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough" check: test test: debug diff --git a/test/conemu.h b/test/conemu.h index 3c0a85cb..02171b2b 100644 --- a/test/conemu.h +++ b/test/conemu.h @@ -43,9 +43,6 @@ namespace test // class ConEmu //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class ConEmu { public: @@ -142,7 +139,6 @@ class ConEmu static bool* shared_state; static char* colorname[]; }; -#pragma pack(pop) // static class attributes bool* ConEmu::shared_state = nullptr; diff --git a/test/fcolorpair-test.cpp b/test/fcolorpair-test.cpp index 00b6be37..27f0359d 100644 --- a/test/fcolorpair-test.cpp +++ b/test/fcolorpair-test.cpp @@ -36,9 +36,6 @@ // class FColorPairTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FColorPairTest : public CPPUNIT_NS::TestFixture { public: @@ -68,7 +65,7 @@ class FColorPairTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) + //---------------------------------------------------------------------- void FColorPairTest::classNameTest() diff --git a/test/fkeyboard-test.cpp b/test/fkeyboard-test.cpp index 57a09816..1715e2d5 100644 --- a/test/fkeyboard-test.cpp +++ b/test/fkeyboard-test.cpp @@ -34,8 +34,6 @@ namespace test { -#pragma pack(push) -#pragma pack(1) typedef struct { int num; @@ -43,7 +41,6 @@ typedef struct char tname[4]; } fkeymap; -#pragma pack(pop) fkeymap Fkey[] = { @@ -227,9 +224,6 @@ fkeymap Fkey[] = // class FKeyboardTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FKeyboardTest : public CPPUNIT_NS::TestFixture { public: @@ -282,7 +276,6 @@ class FKeyboardTest : public CPPUNIT_NS::TestFixture int number_of_keys{0}; finalcut::FKeyboard* keyboard{nullptr}; }; -#pragma pack(pop) //---------------------------------------------------------------------- FKeyboardTest::FKeyboardTest() diff --git a/test/fmouse-test.cpp b/test/fmouse-test.cpp index 0f7dc1e2..7d54189d 100644 --- a/test/fmouse-test.cpp +++ b/test/fmouse-test.cpp @@ -37,9 +37,6 @@ namespace test // class FMouse_protected //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMouse_protected : public finalcut::FMouse { public: @@ -77,7 +74,6 @@ class FMouse_protected : public finalcut::FMouse return finalcut::FMouse::isDblclickTimeout(t); } }; -#pragma pack(pop) } // namespace test @@ -86,9 +82,6 @@ class FMouse_protected : public finalcut::FMouse // class finalcut::FMouseTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FMouseTest : public CPPUNIT_NS::TestFixture { public: @@ -128,7 +121,6 @@ class FMouseTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- void FMouseTest::classNameTest() diff --git a/test/fobject-test.cpp b/test/fobject-test.cpp index e2e0153f..cb46d987 100644 --- a/test/fobject-test.cpp +++ b/test/fobject-test.cpp @@ -37,9 +37,6 @@ namespace test // class FObject_protected //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FObject_protected : public finalcut::FObject { public: @@ -82,11 +79,8 @@ class FObject_protected : public finalcut::FObject // Data member uInt count; }; -#pragma pack(pop) //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) class FObject_timer : public finalcut::FObject { @@ -110,11 +104,8 @@ class FObject_timer : public finalcut::FObject // Data member int value{0}; }; -#pragma pack(pop) //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) class FObject_userEvent : public finalcut::FObject { @@ -138,7 +129,6 @@ class FObject_userEvent : public finalcut::FObject // Data member int value{0}; }; -#pragma pack(pop) } // namespace test @@ -147,9 +137,6 @@ class FObject_userEvent : public finalcut::FObject // class FObjectTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FObjectTest : public CPPUNIT_NS::TestFixture { public: @@ -191,7 +178,6 @@ class FObjectTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- void FObjectTest::classNameTest() diff --git a/test/foptiattr-test.cpp b/test/foptiattr-test.cpp index 88451dde..8270b3e7 100644 --- a/test/foptiattr-test.cpp +++ b/test/foptiattr-test.cpp @@ -58,9 +58,6 @@ void check_c_string ( const char* s1 // class FOptiAttrTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FOptiAttrTest : public CPPUNIT_NS::TestFixture { public: @@ -108,7 +105,6 @@ class FOptiAttrTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- @@ -3998,9 +3994,6 @@ void FOptiAttrTest::wyse50Test() finalcut::FOptiAttr oa; finalcut::FOptiAttr::termEnv optiattr_env = { - false, // No ANSI default color - 1, // Max color - 0, // No color video 0, // Enter bold C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD"), // Exit bold @@ -4049,7 +4042,10 @@ void FOptiAttrTest::wyse50Test() 0, // Background color 0, // Term color pair 0, // Orig pair - 0 // Orig orig colors + 0, // Orig orig colors + 1, // Max color + 0, // No color video + false // No ANSI default color }; oa.setTermEnvironment(optiattr_env); diff --git a/test/foptimove-test.cpp b/test/foptimove-test.cpp index 14a8e57b..a0d4832c 100644 --- a/test/foptimove-test.cpp +++ b/test/foptimove-test.cpp @@ -58,9 +58,6 @@ void check_c_string ( const char* s1 // class FOptiMoveTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FOptiMoveTest : public CPPUNIT_NS::TestFixture { public: @@ -106,7 +103,6 @@ class FOptiMoveTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- @@ -614,9 +610,6 @@ void FOptiMoveTest::teratermTest() finalcut::FOptiMove::termEnv optimove_env = { - false, // Automatic left margin - true, // Eat newline glitch - 8, // Tab stop C_STR(CSI "H"), // Cursor home C_STR("\r"), // Carriage return 0, // Cursor to ll @@ -636,7 +629,10 @@ void FOptiMoveTest::teratermTest() C_STR(CSI "%p1%dX"), // Erase characters 0, // Repeat character C_STR(CSI "1K"), // Clear to beginning of line - C_STR(CSI "K") // Clear to end of line + C_STR(CSI "K"), // Clear to end of line + 8, // Tab stop + false, // Automatic left margin + true // Eat newline glitch }; om.setTermEnvironment(optimove_env); @@ -702,7 +698,7 @@ void FOptiMoveTest::wyse50Test() CPPUNIT_ASSERT_CSTRING (om.moveCursor (0, 0, 5, 5), C_STR(ESC "=%%")); CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 0, 0), C_STR("\036")); CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 1), C_STR("\r")); - CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r\n")); + CPPUNIT_ASSERT_CSTRING (om.moveCursor (79, 1, 0, 2), C_STR("\r\n"));om.set_auto_left_margin (true); CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 10, 4), C_STR("\f")); CPPUNIT_ASSERT_CSTRING (om.moveCursor (10, 4, 9, 4), C_STR("\b")); CPPUNIT_ASSERT_CSTRING (om.moveCursor (9, 4, 11, 4), C_STR("\f\f")); diff --git a/test/fpoint-test.cpp b/test/fpoint-test.cpp index 15171f4f..c4c2b08f 100644 --- a/test/fpoint-test.cpp +++ b/test/fpoint-test.cpp @@ -37,9 +37,6 @@ // class FPointTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FPointTest : public CPPUNIT_NS::TestFixture { public: @@ -85,7 +82,7 @@ class FPointTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) + //---------------------------------------------------------------------- void FPointTest::classNameTest() diff --git a/test/frect-test.cpp b/test/frect-test.cpp index e0ad0a2b..e4307261 100644 --- a/test/frect-test.cpp +++ b/test/frect-test.cpp @@ -35,9 +35,6 @@ // class FRectTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FRectTest : public CPPUNIT_NS::TestFixture { public: @@ -91,7 +88,7 @@ class FRectTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) + //---------------------------------------------------------------------- void FRectTest::classNameTest() diff --git a/test/fsize-test.cpp b/test/fsize-test.cpp index c08acc37..73b45aa0 100644 --- a/test/fsize-test.cpp +++ b/test/fsize-test.cpp @@ -37,9 +37,6 @@ // class FSizeTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FSizeTest : public CPPUNIT_NS::TestFixture { public: @@ -91,7 +88,6 @@ class FSizeTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- void FSizeTest::classNameTest() diff --git a/test/fstring-test.cpp b/test/fstring-test.cpp index 9daf9d1a..99a789ef 100644 --- a/test/fstring-test.cpp +++ b/test/fstring-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2018 Markus Gans * +* Copyright 2018-2019 Markus Gans * * * * The Final Cut is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * @@ -44,9 +44,6 @@ // class FStringTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FStringTest : public CPPUNIT_NS::TestFixture { public: @@ -131,7 +128,7 @@ class FStringTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) + //---------------------------------------------------------------------- void FStringTest::setUp() diff --git a/test/ftermcapquirks-test.cpp b/test/ftermcapquirks-test.cpp index 37d2d699..28df9d66 100644 --- a/test/ftermcapquirks-test.cpp +++ b/test/ftermcapquirks-test.cpp @@ -52,15 +52,12 @@ void check_c_string ( const char* s1 namespace test { -#pragma pack(push) -#pragma pack(1) typedef struct { char* string; char tname[3]; } tcap_map; -#pragma pack(pop) static tcap_map tcap[] = { @@ -157,9 +154,6 @@ static tcap_map tcap[] = // class FTermcapQuirksTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermcapQuirksTest : public CPPUNIT_NS::TestFixture { public: @@ -207,7 +201,6 @@ class FTermcapQuirksTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- FTermcapQuirksTest::FTermcapQuirksTest() diff --git a/test/ftermdata-test.cpp b/test/ftermdata-test.cpp index 5bfa647e..659537ea 100644 --- a/test/ftermdata-test.cpp +++ b/test/ftermdata-test.cpp @@ -52,9 +52,6 @@ void check_c_string ( const char* s1 // class FTermDataTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermDataTest : public CPPUNIT_NS::TestFixture { public: @@ -78,7 +75,6 @@ class FTermDataTest : public CPPUNIT_NS::TestFixture // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- void FTermDataTest::classNameTest() diff --git a/test/ftermdetection-test.cpp b/test/ftermdetection-test.cpp index 126c08ce..528e90a4 100644 --- a/test/ftermdetection-test.cpp +++ b/test/ftermdetection-test.cpp @@ -56,9 +56,6 @@ void check_c_string ( const char* s1 // class FTermDetectionTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermDetectionTest : public CPPUNIT_NS::TestFixture, test::ConEmu { public: @@ -120,7 +117,6 @@ class FTermDetectionTest : public CPPUNIT_NS::TestFixture, test::ConEmu // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- FTermDetectionTest::FTermDetectionTest() diff --git a/test/ftermfreebsd-test.cpp b/test/ftermfreebsd-test.cpp index befb07c4..7360da54 100644 --- a/test/ftermfreebsd-test.cpp +++ b/test/ftermfreebsd-test.cpp @@ -42,9 +42,6 @@ namespace test // class FSystemTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FSystemTest : public finalcut::FSystem { public: @@ -81,7 +78,7 @@ class FSystemTest : public finalcut::FSystem static keymap_t keymap; static keymap_t terminal_keymap; }; -#pragma pack(pop) + // private data member of FSystemTest //---------------------------------------------------------------------- @@ -583,9 +580,6 @@ struct keymap_t& FSystemTest::getTerminalKeymap() // class ftermfreebsdTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class ftermfreebsdTest : public CPPUNIT_NS::TestFixture, test::ConEmu { public: @@ -607,7 +601,6 @@ class ftermfreebsdTest : public CPPUNIT_NS::TestFixture, test::ConEmu // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) //---------------------------------------------------------------------- ftermfreebsdTest::ftermfreebsdTest() diff --git a/test/ftermlinux-test.cpp b/test/ftermlinux-test.cpp index e81e7773..0f937954 100644 --- a/test/ftermlinux-test.cpp +++ b/test/ftermlinux-test.cpp @@ -64,9 +64,6 @@ namespace test // class FSystemTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FSystemTest : public finalcut::FSystem { public: @@ -155,7 +152,6 @@ class FSystemTest : public finalcut::FSystem static uChar vga8x16[]; static struct unipair unicode_cp437_pairs[]; }; -#pragma pack(pop) // private data member of FSystemTest @@ -1477,9 +1473,6 @@ void FSystemTest::initFScreenInfo() // class FTermLinuxTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FTermLinuxTest : public CPPUNIT_NS::TestFixture, test::ConEmu { public: @@ -1508,7 +1501,7 @@ class FTermLinuxTest : public CPPUNIT_NS::TestFixture, test::ConEmu // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) + //---------------------------------------------------------------------- FTermLinuxTest::FTermLinuxTest() diff --git a/test/ftermopenbsd-test.cpp b/test/ftermopenbsd-test.cpp index 2fb02867..63d01a21 100644 --- a/test/ftermopenbsd-test.cpp +++ b/test/ftermopenbsd-test.cpp @@ -60,9 +60,6 @@ namespace test // class FSystemTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class FSystemTest : public finalcut::FSystem { public: @@ -94,7 +91,6 @@ class FSystemTest : public finalcut::FSystem kbd_t kbdencoding = 512; wskbd_bell_data system_bell; }; -#pragma pack(pop) // constructors and destructor @@ -310,9 +306,6 @@ wskbd_bell_data& FSystemTest::getBell() // class ftermopenbsdTest //---------------------------------------------------------------------- -#pragma pack(push) -#pragma pack(1) - class ftermopenbsdTest : public CPPUNIT_NS::TestFixture, test::ConEmu { public: @@ -335,7 +328,7 @@ class ftermopenbsdTest : public CPPUNIT_NS::TestFixture, test::ConEmu // End of test suite definition CPPUNIT_TEST_SUITE_END(); }; -#pragma pack(pop) + //---------------------------------------------------------------------- ftermopenbsdTest::ftermopenbsdTest()