Add some includes

This commit is contained in:
Markus Gans 2020-10-08 16:28:29 +02:00
parent 9f1bd87151
commit 97f1dea7b8
16 changed files with 51 additions and 16 deletions

View File

@ -261,10 +261,10 @@ Window::Window (finalcut::FWidget* parent)
Statusbar.setMessage("Status bar message"); Statusbar.setMessage("Status bar message");
// Generate data vector for the windows // Generate data vector for the windows
for (int n{1}; n <= 6; n++) for (uInt n{1}; n < 7; n++)
{ {
auto win_dat = new win_data; auto win_dat = new win_data;
win_dat->title.sprintf("Window %1d", n); win_dat->title.sprintf("Window %1u", n);
windows.push_back(win_dat); windows.push_back(win_dat);
} }
} }

View File

@ -97,7 +97,7 @@ FApplication::FApplication (const int& _argc, char* _argv[])
if ( ! (_argc && _argv) ) if ( ! (_argc && _argv) )
{ {
typedef char* CString; typedef char* CString;
static std::array<CString, 1> empty{CString("")}; static std::array<CString, 1> empty{{CString("")}};
app_argc = 0; app_argc = 0;
app_argv = empty.data(); app_argv = empty.data();
} }

View File

@ -27,6 +27,7 @@
#endif #endif
#include <algorithm> #include <algorithm>
#include <array>
#include <string> #include <string>
#include "final/fkeyboard.h" #include "final/fkeyboard.h"

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include <regex> #include <regex>
#include "final/fapplication.h" #include "final/fapplication.h"

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include <string> #include <string>
#include "final/flogger.h" #include "final/flogger.h"

View File

@ -207,8 +207,8 @@ void FMessageBox::init()
{ {
calculateDimensions(); calculateDimensions();
if ( (button_digit[2] && ! button_digit[1]) if ( (button_digit[2] != Reject && button_digit[1] == Reject)
|| (button_digit[1] && ! button_digit[0]) ) || (button_digit[1] != Reject && button_digit[0] == Reject) )
{ {
button_digit[0] = button_digit[1] \ button_digit[0] = button_digit[1] \
= button_digit[2] \ = button_digit[2] \

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include <cstring> #include <cstring>
#include "final/fc.h" #include "final/fc.h"

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include <cstring> #include <cstring>
#include "final/fapplication.h" #include "final/fapplication.h"

View File

@ -24,6 +24,8 @@
#include "final/fconfig.h" // includes _GNU_SOURCE for fd_set #include "final/fconfig.h" // includes _GNU_SOURCE for fd_set
#endif #endif
#include <array>
#include "final/emptyfstring.h" #include "final/emptyfstring.h"
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fc.h" #include "final/fc.h"

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include <vector> #include <vector>
#include "final/fapplication.h" #include "final/fapplication.h"

View File

@ -24,6 +24,8 @@
#include "final/fconfig.h" // includes _GNU_SOURCE for fd_set #include "final/fconfig.h" // includes _GNU_SOURCE for fd_set
#endif #endif
#include <array>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fc.h" #include "final/fc.h"
#include "final/flog.h" #include "final/flog.h"

View File

@ -535,7 +535,7 @@ void FTextView::adjustSize()
if ( width < 3 ) if ( width < 3 )
return; return;
const int hmax = ( max_width > int(width) - nf_offset - 2 ) const int hmax = ( max_width >= int(width) - nf_offset - 1 )
? max_width - int(width) + nf_offset + 2 ? max_width - int(width) + nf_offset + 2
: 0; : 0;
hbar->setMaximum (hmax); hbar->setMaximum (hmax);

View File

@ -1798,21 +1798,23 @@ inline void FWidget::insufficientSpaceAdjust()
// move left if not enough space // move left if not enough space
while ( getTermX() + int(getWidth()) - padding.right > woffset.getX2() + 2 ) while ( getTermX() + int(getWidth()) - padding.right > woffset.getX2() + 2 )
{ {
adjust_wsize.x1_ref()--; if ( adjust_wsize.x1_ref() < 2 )
adjust_wsize.x2_ref()--;
if ( adjust_wsize.x1_ref() < 1 )
adjust_wsize.x1_ref() = 1; adjust_wsize.x1_ref() = 1;
else
adjust_wsize.x1_ref()--;
adjust_wsize.x2_ref()--;
} }
// move up if not enough space // move up if not enough space
while ( getTermY() + int(getHeight()) - padding.bottom > woffset.getY2() + 2 ) while ( getTermY() + int(getHeight()) - padding.bottom > woffset.getY2() + 2 )
{ {
adjust_wsize.y1_ref()--; if ( adjust_wsize.y1_ref() < 2 )
adjust_wsize.y2_ref()--;
if ( adjust_wsize.y1_ref() < 1 )
adjust_wsize.y1_ref() = 1; adjust_wsize.y1_ref() = 1;
else
adjust_wsize.y1_ref()--;
adjust_wsize.y2_ref()--;
} }
// reduce the width if not enough space // reduce the width if not enough space

View File

@ -202,14 +202,14 @@ inline int FRect::getY() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FRect::getWidth() const inline std::size_t FRect::getWidth() const
{ {
const int w = X2 - X1 + 1; const int w = X2 - (X1 - 1); // overflow save
return ( w < 0 ) ? 0 : std::size_t(w); return ( w < 0 ) ? 0 : std::size_t(w);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FRect::getHeight() const inline std::size_t FRect::getHeight() const
{ {
const int h = Y2 - Y1 + 1; const int h = Y2 - (Y1 - 1); // overflow save
return ( h < 0 ) ? 0 : std::size_t(h); return ( h < 0 ) ? 0 : std::size_t(h);
} }

View File

@ -49,6 +49,7 @@
#include <cwchar> #include <cwchar>
#include <cwctype> #include <cwctype>
#include <array>
#include <limits> #include <limits>
#include <iostream> #include <iostream>
#include <new> #include <new>

View File

@ -32,6 +32,23 @@
#include <final/final.h> #include <final/final.h>
#define CPPUNIT_ASSERT_CSTRING(expected, actual) \
check_c_string (expected, actual, CPPUNIT_SOURCELINE())
//----------------------------------------------------------------------
void check_c_string ( const char* s1
, const char* s2
, CppUnit::SourceLine sourceLine )
{
if ( s1 == 0 && s2 == 0 ) // Strings are equal
return;
if ( s1 && s2 && std::strcmp (s1, s2) == 0 ) // Strings are equal
return;
::CppUnit::Asserter::fail ("Strings are not equal", sourceLine);
}
namespace test namespace test
{ {
@ -379,6 +396,11 @@ void FKeyboardTest::noArgumentTest()
keyboard->setReadBlockingTime(100000); // 100 ms keyboard->setReadBlockingTime(100000); // 100 ms
CPPUNIT_ASSERT ( keyboard->getReadBlockingTime() == 100 * 1000 ); CPPUNIT_ASSERT ( keyboard->getReadBlockingTime() == 100 * 1000 );
// Check key map
CPPUNIT_ASSERT ( test::fkey[0].num == finalcut::fc::Fkey_backspace );
CPPUNIT_ASSERT_CSTRING ( test::fkey[0].string, "\177" );
CPPUNIT_ASSERT_CSTRING ( test::fkey[0].tname, "kb" );
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------