diff --git a/.travis.yml b/.travis.yml index ddd981091..e1c711f18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,17 +12,9 @@ env: #- lt_branch=dist gui=false - lt_branch=RC_1_0 qt=5 gui=true - lt_branch=RC_1_0 qt=5 gui=false - - lt_branch=RC_1_0 qt=4 gui=true - - lt_branch=RC_1_0 qt=4 gui=false global: - secure: "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8=" - coverity_branch: coverity_scan -matrix: - allow_failures: - - os: osx - env: lt_branch=RC_1_0 qt=4 gui=true - - os: osx - env: lt_branch=RC_1_0 qt=4 gui=false branches: except: @@ -79,7 +71,7 @@ before_install: #- libt_path="$HOME/libt_install" #- ltconf="$ltconf --prefix="$libt_path" --disable-geoip" - qbt_path="$HOME/qbt_install" - - qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH="$libt_path/lib/pkgconfig":$PKG_CONFIG_PATH" + - qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH="$libt_path/lib/pkgconfig":/opt/qt55/lib/pkgconfig:$PKG_CONFIG_PATH" # options for specific branches - if [ "$qt" = 4 ]; then qbtconf="$qbtconf --with-qt4" ; fi @@ -88,6 +80,9 @@ before_install: if [ "$TRAVIS_OS_NAME" = "linux" ]; then # setup virtual display for after_success target if [ "$gui" = true ]; then export "DISPLAY=:99.0" && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 ; fi ; + + # Qt 5 + PATH=/opt/qt55/bin:${PATH} fi - | if [ "$TRAVIS_OS_NAME" = "osx" ]; then @@ -103,21 +98,23 @@ before_install: install: - | if [ "$TRAVIS_OS_NAME" = "linux" ]; then - # libtorrent + # repositories sudo add-apt-repository --yes ppa:qbittorrent-team/qbittorrent-stable ; + sudo add-apt-repository --yes ppa:beineri/opt-qt551-trusty ; sudo apt-get update -qq ; + + # libtorrent sudo apt-get install -qq libtorrent-rasterbar-dev ; + # Qt 5.5.1 + sudo apt-get install -qq qt55base qt55tools ; + # build libtorrent from source #if [ "$lt_branch" != "dist" ]; then #cd "$HOME" && pwd && git clone --depth 1 https://github.com/arvidn/libtorrent.git --branch $lt_branch ; #cd libtorrent && ./autotool.sh && ./configure $ltconf && make install ; #fi ; - # Qt - if [ "$qt" = 4 ]; then sudo apt-get -qq install qt4-default libqt4-dev ; fi ; - if [ "$qt" = 5 ]; then sudo apt-get -qq install qt5-default qtbase5-dev qttools5-dev-tools ; fi ; - # ccache if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then dpkg-query -L ccache && export use_ccache=true ; @@ -151,15 +148,12 @@ install: brew install "$HOME/hombebrew_cache/libtorrent-rasterbar.rb" ; # Qt - if [ "$qt" = 4 ]; then brew install qt && ln -s /usr/local/Cellar/qt/4.8.7_2/plugins /usr/local ; fi ; - if [ "$qt" = 5 ]; then - # Copy custom qt5 bottle to homebrew's cache so it can find and install it - # Also install our custom qt5 formula by passing the local path to it - # These 2 files are restored from Travis' cache. - cp "$HOME/hombebrew_cache/qt5-5.7.1_1.el_capitan.bottle.tar.gz" "$(brew --cache)" ; - brew install "$HOME/hombebrew_cache/qt5.rb" ; - brew link --force qt5 ; - fi + # Copy custom qt5 bottle to homebrew's cache so it can find and install it + # Also install our custom qt5 formula by passing the local path to it + # These 2 files are restored from Travis' cache. + cp "$HOME/hombebrew_cache/qt5-5.7.1_1.el_capitan.bottle.tar.gz" "$(brew --cache)" ; + brew install "$HOME/hombebrew_cache/qt5.rb" ; + brew link --force qt5 ; # ccache if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then diff --git a/CMakeLists.txt b/CMakeLists.txt index 2501e4f07..86178e05a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,11 +40,8 @@ endif(WIN32) # we need options here, because they are used not only in "src" subdir, but in the "dist" dir too include(CMakeDependentOption) -option(QT5 "Compile using Qt5" ON) option(SYSTEM_QTSINGLEAPPLICATION "Use the system qtsingleapplication library or shipped one otherwise") -cmake_dependent_option(SYSTEM_QJSON - "Use the shipped qjson library or the system one (Qt4 only)" OFF "NOT QT5" OFF) option(GUI "Allows to disable GUI for headless running. Disables QtDBus and the GeoIP Database" ON) diff --git a/configure b/configure index 5c30b5233..e6afa717d 100755 --- a/configure +++ b/configure @@ -603,8 +603,6 @@ zlib_LIBS zlib_CFLAGS libtorrent_LIBS libtorrent_CFLAGS -qjson_LIBS -qjson_CFLAGS BOOST_SYSTEM_LIB BOOST_LDFLAGS BOOST_CPPFLAGS @@ -690,7 +688,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -715,9 +712,7 @@ ac_user_opts=' enable_option_checking enable_dependency_tracking enable_silent_rules -with_qt4 with_qtsingleapplication -with_qjson enable_debug enable_gui enable_systemd @@ -742,8 +737,6 @@ PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR QT_QMAKE -qjson_CFLAGS -qjson_LIBS libtorrent_CFLAGS libtorrent_LIBS zlib_CFLAGS @@ -786,7 +779,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1039,15 +1031,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1185,7 +1168,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1338,7 +1321,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1393,13 +1375,9 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-qt4 Compile using Qt4 (default=no) --with-qtsingleapplication=[system|shipped] Use the shipped qtsingleapplication library or the system one (default=shipped) - --with-qjson=[system|shipped] - Use the shipped qjson library or the system one - (default=shipped) (Qt4 only) --with-boost[=ARG] use Boost library from a standard location (ARG=yes), from the specified location (ARG=), or disable it (ARG=no) [ARG=yes] @@ -1430,9 +1408,6 @@ Some influential environment variables: PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path QT_QMAKE value of host_bins for Qt5Core >= 5.2.0, overriding pkg-config - qjson_CFLAGS - C compiler flags for qjson, overriding pkg-config - qjson_LIBS linker flags for qjson, overriding pkg-config libtorrent_CFLAGS C compiler flags for libtorrent, overriding pkg-config libtorrent_LIBS @@ -4179,15 +4154,6 @@ fi # Define --wth-* and --enable-* arguments -# Check whether --with-qt4 was given. -if test "${with_qt4+set}" = set; then : - withval=$with_qt4; -else - with_qt4=no -fi - - - # Check whether --with-qtsingleapplication was given. if test "${with_qtsingleapplication+set}" = set; then : withval=$with_qtsingleapplication; @@ -4196,15 +4162,6 @@ else fi - -# Check whether --with-qjson was given. -if test "${with_qjson+set}" = set; then : - withval=$with_qjson; -else - with_qjson=shipped -fi - - # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; @@ -4466,13 +4423,7 @@ $as_echo "$enable_webui" >&6; } as_fn_error $? "Unknown option \"$enable_webui\". Use either \"yes\" or \"no\"." "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Qt4 should be enabled" >&5 -$as_echo_n "checking whether Qt4 should be enabled... " >&6; } -case "x$with_qt4" in #( - "xno") : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.2.0") 2>&5 ac_status=$? @@ -4524,97 +4475,6 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } -fi - ;; #( - "xyes") : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QtCore >= 4.8.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "QtCore >= 4.8.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - -if test -n "$QT_QMAKE"; then - pkg_cv_QT_QMAKE="$QT_QMAKE" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QtCore >= 4.8.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "QtCore >= 4.8.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_QT_QMAKE=`$PKG_CONFIG --variable="moc_location" "QtCore >= 4.8.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -QT_QMAKE=$pkg_cv_QT_QMAKE - -if test "x$QT_QMAKE" = x""; then : - -else - QT_QMAKE=`$as_dirname -- "$QT_QMAKE" || -$as_expr X"$QT_QMAKE" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$QT_QMAKE" : 'X\(//\)[^/]' \| \ - X"$QT_QMAKE" : 'X\(//\)$' \| \ - X"$QT_QMAKE" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$QT_QMAKE" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` -fi - -fi - -if test -f "$QT_QMAKE/qmake"; then : - QT_QMAKE="$QT_QMAKE/qmake" -else - if test -f "$QT_QMAKE/qmake-qt4"; then : - QT_QMAKE="$QT_QMAKE/qmake-qt4" -else - QT_QMAKE="" -fi - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt4 qmake >= 4.8.0" >&5 -$as_echo_n "checking for Qt4 qmake >= 4.8.0... " >&6; } -if test "x$QT_QMAKE" != "x"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT_QMAKE" >&5 -$as_echo "$QT_QMAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - -fi - ;; #( - *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_qt4" >&5 -$as_echo "$with_qt4" >&6; } - as_fn_error $? "Unknown option \"$with_qt4\". Use either \"yes\" or \"no\"." "$LINENO" 5 ;; -esac -if test "x$QT_QMAKE" = "x"; then : - as_fn_error $? "Could not find qmake" "$LINENO" 5 - fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether QtDBus should be enabled" >&5 @@ -4623,8 +4483,7 @@ case "x$enable_qt_dbus" in #( "xyes") : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - if test "x$with_qt4" = "xno"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5DBus >= 5.2.0" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5DBus >= 5.2.0" >&5 $as_echo_n "checking for Qt5DBus >= 5.2.0... " >&6; } if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5DBus >= 5.2.0\""; } >&5 @@ -4639,26 +4498,6 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } HAVE_QTDBUS=false -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for QtDBus >= 4.8.0" >&5 -$as_echo_n "checking for QtDBus >= 4.8.0... " >&6; } - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QtDBus >= 4.8.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "QtDBus >= 4.8.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - HAVE_QTDBUS=true -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - HAVE_QTDBUS=false -fi - fi if test "x$HAVE_QTDBUS" = "xfalse"; then : @@ -5247,118 +5086,6 @@ $as_echo "$with_qtsingleapplication" >&6; } as_fn_error $? "Unknown option \"$with_qtsingleapplication\". Use either \"system\" or \"shipped\"." "$LINENO" 5 ;; esac -if test "x$with_qt4" = "xyes"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which qjson to use" >&5 -$as_echo_n "checking which qjson to use... " >&6; } - case "x$with_qjson" in #( - "xshipped") : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: shipped" >&5 -$as_echo "shipped" >&6; } - QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG usesystemqjson" ;; #( - "xsystem") : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 -$as_echo "system" >&6; } - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for qjson" >&5 -$as_echo_n "checking for qjson... " >&6; } - -if test -n "$qjson_CFLAGS"; then - pkg_cv_qjson_CFLAGS="$qjson_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QJson >= 0.8.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "QJson >= 0.8.1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_qjson_CFLAGS=`$PKG_CONFIG --cflags "QJson >= 0.8.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$qjson_LIBS"; then - pkg_cv_qjson_LIBS="$qjson_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QJson >= 0.8.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "QJson >= 0.8.1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_qjson_LIBS=`$PKG_CONFIG --libs "QJson >= 0.8.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - qjson_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "QJson >= 0.8.1" 2>&1` - else - qjson_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "QJson >= 0.8.1" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$qjson_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (QJson >= 0.8.1) were not met: - -$qjson_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables qjson_CFLAGS -and qjson_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables qjson_CFLAGS -and qjson_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - qjson_CFLAGS=$pkg_cv_qjson_CFLAGS - qjson_LIBS=$pkg_cv_qjson_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CPPFLAGS="$qjson_CFLAGS $CPPFLAGS" - LIBS="$qjson_LIBS $LIBS" -fi - QBT_ADD_CONFIG="$QBT_ADD_CONFIG usesystemqjson" ;; #( - *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_qjson" >&5 -$as_echo "$with_qjson" >&6; } - as_fn_error $? "Unknown option \"$with_qjson\". Use either \"system\" or \"shipped\"." "$LINENO" 5 ;; -esac - -fi - pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libtorrent" >&5 diff --git a/configure.ac b/configure.ac index d36b7cd5a..cc1347241 100644 --- a/configure.ac +++ b/configure.ac @@ -12,24 +12,12 @@ AM_INIT_AUTOMAKE # Define --wth-* and --enable-* arguments -AC_ARG_WITH(qt4, - [AS_HELP_STRING([--with-qt4], - [Compile using Qt4 (default=no)])], - [], - [with_qt4=no]) - AC_ARG_WITH(qtsingleapplication, [AS_HELP_STRING([--with-qtsingleapplication=@<:@system|shipped@:>@], [Use the shipped qtsingleapplication library or the system one (default=shipped)])], [], [with_qtsingleapplication=shipped]) -AC_ARG_WITH(qjson, - [AS_HELP_STRING([--with-qjson=@<:@system|shipped@:>@], - [Use the shipped qjson library or the system one (default=shipped) (Qt4 only)])], - [], - [with_qjson=shipped]) - AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Enable debug build])], @@ -127,20 +115,7 @@ AS_CASE(["x$enable_webui"], [AC_MSG_RESULT([$enable_webui]) AC_MSG_ERROR([Unknown option "$enable_webui". Use either "yes" or "no".])]) -AC_MSG_CHECKING([whether Qt4 should be enabled]) -AS_CASE(["x$with_qt4"], - ["xno"], - [AC_MSG_RESULT([no]) - FIND_QT5()], - ["xyes"], - [AC_MSG_RESULT([yes]) - FIND_QT4()], - [AC_MSG_RESULT([$with_qt4]) - AC_MSG_ERROR([Unknown option "$with_qt4". Use either "yes" or "no".])]) -AS_IF([test "x$QT_QMAKE" = "x"], - [AC_MSG_ERROR([Could not find qmake]) - ]) - +FIND_QT5() AC_MSG_CHECKING([whether QtDBus should be enabled]) AS_CASE(["x$enable_qt_dbus"], ["xyes"], @@ -185,23 +160,6 @@ AS_CASE(["x$with_qtsingleapplication"], [AC_MSG_RESULT([$with_qtsingleapplication]) AC_MSG_ERROR([Unknown option "$with_qtsingleapplication". Use either "system" or "shipped".])]) -AS_IF([test "x$with_qt4" = "xyes"], - [AC_MSG_CHECKING([which qjson to use]) - AS_CASE(["x$with_qjson"], - ["xshipped"], - [AC_MSG_RESULT([shipped]) - QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG usesystemqjson"], - ["xsystem"], - [AC_MSG_RESULT([system]) - PKG_CHECK_MODULES(qjson, - [QJson >= 0.8.1], - [CPPFLAGS="$qjson_CFLAGS $CPPFLAGS" - LIBS="$qjson_LIBS $LIBS"]) - QBT_ADD_CONFIG="$QBT_ADD_CONFIG usesystemqjson"], - [AC_MSG_RESULT([$with_qjson]) - AC_MSG_ERROR([Unknown option "$with_qjson". Use either "system" or "shipped".])]) - ]) - PKG_CHECK_MODULES(libtorrent, [libtorrent-rasterbar >= 1.0.6], [CPPFLAGS="$libtorrent_CFLAGS $CPPFLAGS" diff --git a/m4/qbittorrent.m4 b/m4/qbittorrent.m4 index cba94d629..e74441894 100644 --- a/m4/qbittorrent.m4 +++ b/m4/qbittorrent.m4 @@ -1,31 +1,6 @@ # Checking for pkg-config. If found, check for QtCore and query pkg-config # for its exec-prefix variable. -# FIND_QT4() -# Sets the QT_QMAKE variable to the path of Qt4 qmake if found. -# -------------------------------------- -AC_DEFUN([FIND_QT4], -[PKG_CHECK_EXISTS([QtCore >= 4.8.0], - [PKG_CHECK_VAR(QT_QMAKE, - [QtCore >= 4.8.0], - [moc_location], - [QT_QMAKE=`AS_DIRNAME(["$QT_QMAKE"])`]) - ]) - -AS_IF([test -f "$QT_QMAKE/qmake"], - [QT_QMAKE="$QT_QMAKE/qmake"], - [AS_IF([test -f "$QT_QMAKE/qmake-qt4"], - [QT_QMAKE="$QT_QMAKE/qmake-qt4"], - [QT_QMAKE=""]) - ]) - -AC_MSG_CHECKING([for Qt4 qmake >= 4.8.0]) -AS_IF([test "x$QT_QMAKE" != "x"], - [AC_MSG_RESULT([$QT_QMAKE])], - [AC_MSG_RESULT([not found])] - ) -]) - # FIND_QT5() # Sets the QT_QMAKE variable to the path of Qt5 qmake if found. # -------------------------------------- @@ -54,19 +29,10 @@ AS_IF([test "x$QT_QMAKE" != "x"], # Sets the HAVE_QTDBUS variable to true or false. # -------------------------------------- AC_DEFUN([FIND_QTDBUS], -[AS_IF([test "x$with_qt4" = "xno"], [AC_MSG_CHECKING([for Qt5DBus >= 5.2.0]) PKG_CHECK_EXISTS([Qt5DBus >= 5.2.0], [AC_MSG_RESULT([found]) HAVE_QTDBUS=[true]], [AC_MSG_RESULT([not found]) HAVE_QTDBUS=[false]]) - ], - [AC_MSG_CHECKING([for QtDBus >= 4.8.0]) - PKG_CHECK_EXISTS([QtDBus >= 4.8.0], - [AC_MSG_RESULT([found]) - HAVE_QTDBUS=[true]], - [AC_MSG_RESULT([not found]) - HAVE_QTDBUS=[false]]) - ]) ]) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bf3922325..482724777 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,27 +8,15 @@ include(QbtTargetSources) find_package(LibtorrentRasterbar REQUIRED) # Qt -if (QT5) - add_definitions(-DQBT_USES_QT5) - list(APPEND QBT_QT_COMPONENTS Core Network Xml) - if (GUI) - list (APPEND QBT_QT_COMPONENTS Concurrent Gui Widgets) - endif (GUI) - if (DBUS) - list (APPEND QBT_QT_COMPONENTS DBus) - endif (DBUS) - find_package(Qt5 5.2.0 COMPONENTS ${QBT_QT_COMPONENTS} REQUIRED) -else (QT5) - list(APPEND QBT_QT_COMPONENTS QtCore QtNetwork QtXml) - if (GUI) - list (APPEND QBT_QT_COMPONENTS QtGui) - endif (GUI) - if (DBUS) - list (APPEND QBT_QT_COMPONENTS QtDBus) - endif (DBUS) - find_package(Qt4 4.8.0 COMPONENTS ${QBT_QT_COMPONENTS} REQUIRED) - include(${QT_USE_FILE}) -endif (QT5) +list(APPEND QBT_QT_COMPONENTS Core Network Xml) +if (GUI) + list (APPEND QBT_QT_COMPONENTS Concurrent Gui Widgets) +endif (GUI) +if (DBUS) + list (APPEND QBT_QT_COMPONENTS DBus) +endif (DBUS) +find_package(Qt5 5.2.0 COMPONENTS ${QBT_QT_COMPONENTS} REQUIRED) + set(CMAKE_AUTOMOC True) list(APPEND CMAKE_AUTORCC_OPTIONS -compress 9 -threshold 5) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 3e6228986..9ab4dc9ac 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -17,12 +17,8 @@ file(GLOB QBT_TS_FILES ../lang/*.ts) get_filename_component(QBT_QM_FILES_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/../lang" ABSOLUTE) set_source_files_properties(${QBT_TS_FILES} PROPERTIES OUTPUT_LOCATION "${QBT_QM_FILES_BINARY_DIR}") -if (QT5) - find_package(Qt5 COMPONENTS LinguistTools REQUIRED) - qt5_add_translation(QBT_QM_FILES ${QBT_TS_FILES}) -else (QT5) - qt4_add_translation(QBT_QM_FILES ${QBT_TS_FILES}) -endif (QT5) +find_package(Qt5 COMPONENTS LinguistTools REQUIRED) +qt5_add_translation(QBT_QM_FILES ${QBT_TS_FILES}) get_filename_component(_lang_qrc_src "${CMAKE_CURRENT_SOURCE_DIR}/../lang.qrc" ABSOLUTE) get_filename_component(_lang_qrc_dst "${CMAKE_CURRENT_BINARY_DIR}/../lang.qrc" ABSOLUTE) diff --git a/src/app/application.cpp b/src/app/application.cpp index 34b69c680..032d05792 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -114,9 +114,7 @@ Application::Application(const QString &id, int &argc, char **argv) setApplicationName("qBittorrent"); initializeTranslation(); #ifndef DISABLE_GUI -#ifdef QBT_USES_QT5 setAttribute(Qt::AA_UseHighDpiPixmaps, true); // opt-in to the high DPI pixmap support -#endif // QBT_USES_QT5 setQuitOnLastWindowClosed(false); #ifdef Q_OS_WIN connect(this, SIGNAL(commitDataRequest(QSessionManager &)), this, SLOT(shutdownCleanup(QSessionManager &)), Qt::DirectConnection); @@ -514,14 +512,12 @@ void Application::initializeTranslation() QString localeStr = pref->getLocale(); QLocale::setDefault(QLocale(localeStr)); - if ( -#ifdef QBT_USES_QT5 - m_qtTranslator.load(QString::fromUtf8("qtbase_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) || -#endif + if (m_qtTranslator.load(QString::fromUtf8("qtbase_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) || m_qtTranslator.load(QString::fromUtf8("qt_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) qDebug("Qt %s locale recognized, using translation.", qPrintable(localeStr)); else qDebug("Qt %s locale unrecognized, using default (en).", qPrintable(localeStr)); + installTranslator(&m_qtTranslator); if (m_translator.load(QString::fromUtf8(":/lang/qbittorrent_") + localeStr)) diff --git a/src/app/main.cpp b/src/app/main.cpp index 3591b271b..d1cd65a9e 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -42,11 +42,7 @@ #include #ifdef QBT_STATIC_QT #include -#ifdef QBT_USES_QT5 Q_IMPORT_PLUGIN(QICOPlugin) -#else -Q_IMPORT_PLUGIN(qico) -#endif #endif // QBT_STATIC_QT #else @@ -225,7 +221,7 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } -#if defined(Q_OS_WIN) && defined(QBT_USES_QT5) +#if defined(Q_OS_WIN) // This affects only Windows apparently and Qt5. // When QNetworkAccessManager is instantiated it regularly starts polling // the network interfaces to see what's available and their status. diff --git a/src/app/qtsingleapplication/CMakeLists.txt b/src/app/qtsingleapplication/CMakeLists.txt index 72001d671..30f7fabfd 100644 --- a/src/app/qtsingleapplication/CMakeLists.txt +++ b/src/app/qtsingleapplication/CMakeLists.txt @@ -18,19 +18,10 @@ endif (GUI) add_library(qtsingleapplication ${QBT_QTSINGLEAPPLICATION_HEADERS} ${QBT_QTSINGLEAPPLICATION_SOURCES}) target_include_directories(qtsingleapplication INTERFACE "${qtsingleapplication_SOURCE_DIR}") - -if (QT4_FOUND) - target_link_libraries(qtsingleapplication Qt4::QtNetwork) -else (QT4_FOUND) - target_link_libraries(qtsingleapplication Qt5::Network) -endif (QT4_FOUND) +target_link_qt_components(qtsingleapplication Network) if (GUI) - if (QT4_FOUND) - target_link_libraries(qtsingleapplication Qt4::QtGui) - else (QT4_FOUND) - target_link_libraries(qtsingleapplication Qt5::Widgets) - endif(QT4_FOUND) + target_link_qt_components(qtsingleapplication Widgets) endif (GUI) add_library(QtSingleApplication::QtSingleApplication ALIAS qtsingleapplication) diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index 68b19dfca..30e49ea52 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -121,15 +121,10 @@ tristatebool.cpp add_library(qbt_base STATIC ${QBT_BASE_HEADERS} ${QBT_BASE_SOURCES}) target_link_libraries(qbt_base PRIVATE ZLIB::ZLIB PUBLIC LibtorrentRasterbar::LibTorrent) target_link_qt_components(qbt_base PUBLIC Core Network Xml) -if (QT4_FOUND) - if (GUI) - target_link_libraries(qbt_base PUBLIC Qt4::QtGui) - endif (GUI) -else (QT4_FOUND) - if (GUI) - target_link_libraries(qbt_base PUBLIC Qt5::Gui Qt5::Widgets) - endif (GUI) -endif (QT4_FOUND) + +if (GUI) + target_link_libraries(qbt_base PUBLIC Qt5::Gui Qt5::Widgets) +endif (GUI) if (DBUS) target_link_qt_components(qbt_base PRIVATE DBus) diff --git a/src/base/bittorrent/private/resumedatasavingmanager.cpp b/src/base/bittorrent/private/resumedatasavingmanager.cpp index d17225cb2..bb86b9958 100644 --- a/src/base/bittorrent/private/resumedatasavingmanager.cpp +++ b/src/base/bittorrent/private/resumedatasavingmanager.cpp @@ -27,11 +27,7 @@ */ #include -#ifdef QBT_USES_QT5 #include -#else -#include -#endif #include "base/logger.h" #include "base/utils/fs.h" @@ -48,18 +44,12 @@ void ResumeDataSavingManager::saveResumeData(QString infoHash, QByteArray data) QString filepath = m_resumeDataDir.absoluteFilePath(filename); qDebug() << "Saving resume data in" << filepath; -#ifdef QBT_USES_QT5 QSaveFile resumeFile(filepath); -#else - QFile resumeFile(filepath); -#endif if (resumeFile.open(QIODevice::WriteOnly)) { resumeFile.write(data); -#ifdef QBT_USES_QT5 if (!resumeFile.commit()) { Logger::instance()->addMessage(QString("Couldn't save resume data in %1. Error: %2") .arg(filepath).arg(resumeFile.errorString()), Log::WARNING); } -#endif } } diff --git a/src/base/http/requestparser.cpp b/src/base/http/requestparser.cpp index 7f3ab1be7..e01eaaed1 100644 --- a/src/base/http/requestparser.cpp +++ b/src/base/http/requestparser.cpp @@ -31,9 +31,7 @@ #include #include -#ifdef QBT_USES_QT5 #include -#endif #include #include #include "requestparser.h" @@ -121,11 +119,7 @@ bool RequestParser::parseStartingLine(const QString &line) m_request.path = url.path(); // Path // Parse GET parameters -#ifndef QBT_USES_QT5 - QListIterator > i(url.queryItems()); -#else QListIterator > i(QUrlQuery(url).queryItems()); -#endif while (i.hasNext()) { QPair pair = i.next(); m_request.gets[pair.first] = pair.second; @@ -220,13 +214,8 @@ bool RequestParser::parseContent(const QByteArray& data) // Parse url-encoded POST data if (m_request.headers["content-type"].startsWith("application/x-www-form-urlencoded")) { QUrl url; -#ifndef QBT_USES_QT5 - url.setEncodedQuery(data); - QListIterator > i(url.queryItems()); -#else url.setQuery(data); QListIterator > i(QUrlQuery(url).queryItems(QUrl::FullyDecoded)); -#endif while (i.hasNext()) { QPair pair = i.next(); m_request.posts[pair.first.toLower()] = pair.second; diff --git a/src/base/http/server.cpp b/src/base/http/server.cpp index dd5759444..be1877d38 100644 --- a/src/base/http/server.cpp +++ b/src/base/http/server.cpp @@ -76,11 +76,7 @@ void Server::disableHttps() } #endif -#ifdef QBT_USES_QT5 void Server::incomingConnection(qintptr socketDescriptor) -#else -void Server::incomingConnection(int socketDescriptor) -#endif { QTcpSocket *serverSocket; #ifndef QT_NO_OPENSSL @@ -95,11 +91,7 @@ void Server::incomingConnection(int socketDescriptor) if (m_https) { static_cast(serverSocket)->setProtocol(QSsl::SecureProtocols); static_cast(serverSocket)->setPrivateKey(m_key); -#ifdef QBT_USES_QT5 static_cast(serverSocket)->setLocalCertificateChain(m_certificates); -#else - static_cast(serverSocket)->setLocalCertificate(m_certificates.first()); -#endif static_cast(serverSocket)->setPeerVerifyMode(QSslSocket::VerifyNone); static_cast(serverSocket)->startServerEncryption(); } diff --git a/src/base/http/server.h b/src/base/http/server.h index 7da8b5775..7f8f3af7c 100644 --- a/src/base/http/server.h +++ b/src/base/http/server.h @@ -62,15 +62,10 @@ namespace Http private: IRequestHandler *m_requestHandler; -#ifdef QBT_USES_QT5 void incomingConnection(qintptr socketDescriptor); -#else - void incomingConnection(int socketDescriptor); -#endif #ifndef QT_NO_OPENSSL QList safeCipherList() const; - bool m_https; QList m_certificates; QSslKey m_key; diff --git a/src/base/net/dnsupdater.cpp b/src/base/net/dnsupdater.cpp index a61ebaa2b..c437ce782 100644 --- a/src/base/net/dnsupdater.cpp +++ b/src/base/net/dnsupdater.cpp @@ -31,9 +31,7 @@ #include #include #include -#ifdef QBT_USES_QT5 #include -#endif #include "base/logger.h" #include "base/net/downloadmanager.h" @@ -158,15 +156,10 @@ QString DNSUpdater::getUpdateUrl() const } url.setPath("/nic/update"); -#ifndef QBT_USES_QT5 - url.addQueryItem("hostname", m_domain); - url.addQueryItem("myip", m_lastIP.toString()); -#else QUrlQuery urlQuery(url); urlQuery.addQueryItem("hostname", m_domain); urlQuery.addQueryItem("myip", m_lastIP.toString()); url.setQuery(urlQuery); -#endif Q_ASSERT(url.isValid()); qDebug() << Q_FUNC_INFO << url.toString(); diff --git a/src/base/net/downloadmanager.cpp b/src/base/net/downloadmanager.cpp index 6311cfd3a..02b5929d9 100644 --- a/src/base/net/downloadmanager.cpp +++ b/src/base/net/downloadmanager.cpp @@ -79,26 +79,6 @@ namespace using QNetworkCookieJar::allCookies; using QNetworkCookieJar::setAllCookies; -#ifndef QBT_USES_QT5 - virtual bool deleteCookie(const QNetworkCookie &cookie) - { - auto myCookies = allCookies(); - - QList::Iterator it; - for (it = myCookies.begin(); it != myCookies.end(); ++it) { - if ((it->name() == cookie.name()) - && (it->domain() == cookie.domain()) - && (it->path() == cookie.path())) { - myCookies.erase(it); - setAllCookies(myCookies); - return true; - } - } - - return false; - } -#endif - QList cookiesForUrl(const QUrl &url) const override { QDateTime now = QDateTime::currentDateTime(); diff --git a/src/base/net/private/geoipdatabase.cpp b/src/base/net/private/geoipdatabase.cpp index 0cbe72832..8dec63742 100644 --- a/src/base/net/private/geoipdatabase.cpp +++ b/src/base/net/private/geoipdatabase.cpp @@ -65,10 +65,6 @@ namespace Boolean = 14, Float = 15 }; - -#ifndef QBT_USES_QT5 - Q_IPV6ADDR createMappedAddress(quint32 ip4); -#endif } struct DataFieldDescriptor @@ -166,13 +162,7 @@ QDateTime GeoIPDatabase::buildEpoch() const QString GeoIPDatabase::lookup(const QHostAddress &hostAddr) const { -#ifndef QBT_USES_QT5 - Q_IPV6ADDR addr = hostAddr.protocol() == QAbstractSocket::IPv4Protocol - ? createMappedAddress(hostAddr.toIPv4Address()) - : hostAddr.toIPv6Address(); -#else Q_IPV6ADDR addr = hostAddr.toIPv6Address(); -#endif const uchar *ptr = m_data; @@ -496,25 +486,3 @@ QVariant GeoIPDatabase::readArrayValue(quint32 &offset, quint32 count) const return array; } - -namespace -{ -#ifndef QBT_USES_QT5 - Q_IPV6ADDR createMappedAddress(quint32 ip4) - { - Q_IPV6ADDR ip6; - memset(&ip6, 0, sizeof(ip6)); - - int i; - for (i = 15; ip4 != 0; i--) { - ip6[i] = ip4 & 0xFF; - ip4 >>= 8; - } - - ip6[11] = 0xFF; - ip6[10] = 0xFF; - - return ip6; - } -#endif -} diff --git a/src/base/net/smtp.h b/src/base/net/smtp.h index da0d5a4e6..b6a37749f 100644 --- a/src/base/net/smtp.h +++ b/src/base/net/smtp.h @@ -126,8 +126,4 @@ namespace Net }; } -#ifndef QBT_USES_QT5 -Q_DECLARE_METATYPE(QAbstractSocket::SocketError) -#endif - #endif diff --git a/src/base/preferences.cpp b/src/base/preferences.cpp index 618c259bf..6f9b67c74 100644 --- a/src/base/preferences.cpp +++ b/src/base/preferences.cpp @@ -1109,20 +1109,12 @@ void Preferences::setMainGeometry(const QByteArray &geometry) QByteArray Preferences::getMainVSplitterState() const { -#ifdef QBT_USES_QT5 return value("MainWindow/qt5/vsplitterState").toByteArray(); -#else - return value("MainWindow/vsplitterState").toByteArray(); -#endif } void Preferences::setMainVSplitterState(const QByteArray &state) { -#ifdef QBT_USES_QT5 setValue("MainWindow/qt5/vsplitterState", state); -#else - setValue("MainWindow/vsplitterState", state); -#endif } QString Preferences::getMainLastDir() const @@ -1169,20 +1161,12 @@ void Preferences::setPrefHSplitterSizes(const QStringList &sizes) QByteArray Preferences::getPeerListState() const { -#ifdef QBT_USES_QT5 return value("TorrentProperties/Peers/qt5/PeerListState").toByteArray(); -#else - return value("TorrentProperties/Peers/PeerListState").toByteArray(); -#endif } void Preferences::setPeerListState(const QByteArray &state) { -#ifdef QBT_USES_QT5 setValue("TorrentProperties/Peers/qt5/PeerListState", state); -#else - setValue("TorrentProperties/Peers/PeerListState", state); -#endif } QString Preferences::getPropSplitterSizes() const @@ -1197,20 +1181,12 @@ void Preferences::setPropSplitterSizes(const QString &sizes) QByteArray Preferences::getPropFileListState() const { -#ifdef QBT_USES_QT5 return value("TorrentProperties/qt5/FilesListState").toByteArray(); -#else - return value("TorrentProperties/FilesListState").toByteArray(); -#endif } void Preferences::setPropFileListState(const QByteArray &state) { -#ifdef QBT_USES_QT5 setValue("TorrentProperties/qt5/FilesListState", state); -#else - setValue("TorrentProperties/FilesListState", state); -#endif } int Preferences::getPropCurTab() const @@ -1235,20 +1211,12 @@ void Preferences::setPropVisible(const bool visible) QByteArray Preferences::getPropTrackerListState() const { -#ifdef QBT_USES_QT5 return value("TorrentProperties/Trackers/qt5/TrackerListState").toByteArray(); -#else - return value("TorrentProperties/Trackers/TrackerListState").toByteArray(); -#endif } void Preferences::setPropTrackerListState(const QByteArray &state) { -#ifdef QBT_USES_QT5 setValue("TorrentProperties/Trackers/qt5/TrackerListState", state); -#else - setValue("TorrentProperties/Trackers/TrackerListState", state); -#endif } QByteArray Preferences::getRssGeometry() const @@ -1263,20 +1231,12 @@ void Preferences::setRssGeometry(const QByteArray &geometry) QByteArray Preferences::getRssHSplitterSizes() const { -#ifdef QBT_USES_QT5 return value("RssFeedDownloader/qt5/hsplitterSizes").toByteArray(); -#else - return value("RssFeedDownloader/hsplitterSizes").toByteArray(); -#endif } void Preferences::setRssHSplitterSizes(const QByteArray &sizes) { -#ifdef QBT_USES_QT5 setValue("RssFeedDownloader/qt5/hsplitterSizes", sizes); -#else - setValue("RssFeedDownloader/hsplitterSizes", sizes); -#endif } QStringList Preferences::getRssOpenFolders() const @@ -1291,38 +1251,22 @@ void Preferences::setRssOpenFolders(const QStringList &folders) QByteArray Preferences::getRssSideSplitterState() const { -#ifdef QBT_USES_QT5 return value("Rss/qt5/splitter_h").toByteArray(); -#else - return value("Rss/splitter_h").toByteArray(); -#endif } void Preferences::setRssSideSplitterState(const QByteArray &state) { -#ifdef QBT_USES_QT5 setValue("Rss/qt5/splitter_h", state); -#else - setValue("Rss/splitter_h", state); -#endif } QByteArray Preferences::getRssMainSplitterState() const { -#ifdef QBT_USES_QT5 return value("Rss/qt5/splitterMain").toByteArray(); -#else - return value("Rss/splitterMain").toByteArray(); -#endif } void Preferences::setRssMainSplitterState(const QByteArray &state) { -#ifdef QBT_USES_QT5 setValue("Rss/qt5/splitterMain", state); -#else - setValue("Rss/splitterMain", state); -#endif } QByteArray Preferences::getSearchTabHeaderState() const @@ -1465,20 +1409,12 @@ void Preferences::setTransSelFilter(const int &index) QByteArray Preferences::getTransHeaderState() const { -#ifdef QBT_USES_QT5 return value("TransferList/qt5/HeaderState").toByteArray(); -#else - return value("TransferList/HeaderState").toByteArray(); -#endif } void Preferences::setTransHeaderState(const QByteArray &state) { -#ifdef QBT_USES_QT5 setValue("TransferList/qt5/HeaderState", state); -#else - setValue("TransferList/HeaderState", state); -#endif } //From old RssSettings class diff --git a/src/base/settingsstorage.cpp b/src/base/settingsstorage.cpp index 101e61dcb..99b5341ec 100644 --- a/src/base/settingsstorage.cpp +++ b/src/base/settingsstorage.cpp @@ -75,20 +75,7 @@ namespace QString m_name; }; -#ifdef QBT_USES_QT5 typedef QHash MappingTable; -#else - class MappingTable: public QHash - { - public: - MappingTable(std::initializer_list> list) - { - reserve(static_cast(list.size())); - for (const auto &i : list) - insert(i.first, i.second); - } - }; -#endif QString mapKey(const QString &key) { @@ -161,11 +148,7 @@ namespace {"Network/Proxy/IP", "Preferences/Connection/Proxy/IP"}, {"Network/Proxy/Port", "Preferences/Connection/Proxy/Port"}, {"Network/PortForwardingEnabled", "Preferences/Connection/UPnP"}, -#ifdef QBT_USES_QT5 {"AddNewTorrentDialog/TreeHeaderState", "AddNewTorrentDialog/qt5/treeHeaderState"}, -#else - {"AddNewTorrentDialog/TreeHeaderState", "AddNewTorrentDialog/treeHeaderState"}, -#endif {"AddNewTorrentDialog/Width", "AddNewTorrentDialog/width"}, {"AddNewTorrentDialog/Position", "AddNewTorrentDialog/y"}, {"AddNewTorrentDialog/Expanded", "AddNewTorrentDialog/expanded"}, diff --git a/src/base/utils/fs.cpp b/src/base/utils/fs.cpp index a3733c2b5..372048e4d 100644 --- a/src/base/utils/fs.cpp +++ b/src/base/utils/fs.cpp @@ -55,15 +55,7 @@ #include #endif -#ifndef QBT_USES_QT5 - -#ifndef DISABLE_GUI -#include -#endif - -#else #include -#endif #include "misc.h" @@ -182,24 +174,7 @@ bool Utils::Fs::forceRemove(const QString& file_path) */ void Utils::Fs::removeDirRecursive(const QString& dirName) { -#ifdef QBT_USES_QT5 QDir(dirName).removeRecursively(); -#else - QDir dir(dirName); - - if (!dir.exists()) return; - - Q_FOREACH(QFileInfo info, dir.entryInfoList(QDir::NoDotAndDotDot | - QDir::System | - QDir::Hidden | - QDir::AllDirs | - QDir::Files, QDir::DirsFirst)) { - if (info.isDir()) removeDirRecursive(info.absoluteFilePath()); - else forceRemove(info.absoluteFilePath()); - } - - dir.rmdir(dirName); -#endif } /** @@ -413,74 +388,12 @@ QString Utils::Fs::QDesktopServicesCacheLocation() QString Utils::Fs::QDesktopServicesDownloadLocation() { -#ifdef QBT_USES_QT5 #if defined(Q_OS_WIN) if (QSysInfo::windowsVersion() <= QSysInfo::WV_XP) // Windows XP return QDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).absoluteFilePath( QCoreApplication::translate("fsutils", "Downloads")); #endif return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); -#else - -#if defined(Q_OS_OS2) - return QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).absoluteFilePath( - QCoreApplication::translate("fsutils", "Downloads")); -#endif - -#if defined(Q_OS_WIN) - // as long as it stays WinXP like we do the same on OS/2 - // TODO: Use IKnownFolderManager to get path of FOLDERID_Downloads - // instead of hardcoding "Downloads" - // Unfortunately, this would break compatibility with WinXP - if (QSysInfo::windowsVersion() <= QSysInfo::WV_XP) // Windows XP - return QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).absoluteFilePath( - QCoreApplication::translate("fsutils", "Downloads")); - else - return QDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation)).absoluteFilePath("Downloads"); -#endif - -#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) - QString save_path; - // Default save path on Linux - QString config_path = QString::fromLocal8Bit(qgetenv("XDG_CONFIG_HOME").constData()); - if (config_path.isEmpty()) - config_path = QDir::home().absoluteFilePath(".config"); - - QString user_dirs_file = config_path + "/user-dirs.dirs"; - if (QFile::exists(user_dirs_file)) { - QSettings settings(user_dirs_file, QSettings::IniFormat); - // We need to force UTF-8 encoding here since this is not - // the default for Ini files. - settings.setIniCodec("UTF-8"); - QString xdg_download_dir = settings.value("XDG_DOWNLOAD_DIR").toString(); - if (!xdg_download_dir.isEmpty()) { - // Resolve $HOME environment variables - xdg_download_dir.replace("$HOME", QDir::homePath()); - save_path = xdg_download_dir; - qDebug() << Q_FUNC_INFO << "SUCCESS: Using XDG path for downloads: " << save_path; - } - } - - // Fallback - if (!save_path.isEmpty() && !QFile::exists(save_path)) { - QDir().mkpath(save_path); - } - - if (save_path.isEmpty() || !QFile::exists(save_path)) { - save_path = QDir::home().absoluteFilePath(QCoreApplication::translate("fsutils", "Downloads")); - qDebug() << Q_FUNC_INFO << "using" << save_path << "as fallback since the XDG detection did not work"; - } - - return save_path; -#endif - -#if defined(Q_OS_MAC) - // TODO: How to support this on Mac OS? -#endif - - // Fallback - return QDir::home().absoluteFilePath(QCoreApplication::translate("fsutils", "Downloads")); -#endif } QString Utils::Fs::cacheLocation() diff --git a/src/base/utils/string.cpp b/src/base/utils/string.cpp index 6c713b10d..801f510d7 100644 --- a/src/base/utils/string.cpp +++ b/src/base/utils/string.cpp @@ -32,12 +32,9 @@ #include #include +#include #include #include - -#ifdef QBT_USES_QT5 -#include -#endif #ifdef Q_OS_MAC #include #endif @@ -50,7 +47,6 @@ namespace explicit NaturalCompare(const bool caseSensitive = true) : m_caseSensitive(caseSensitive) { -#ifdef QBT_USES_QT5 #if defined(Q_OS_WIN) // Without ICU library, QCollator uses the native API on Windows 7+. But that API // sorts older versions of μTorrent differently than the newer ones because the @@ -63,12 +59,10 @@ namespace #endif m_collator.setNumericMode(true); m_collator.setCaseSensitivity(caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive); -#endif } bool operator()(const QString &left, const QString &right) const { -#ifdef QBT_USES_QT5 #if defined(Q_OS_WIN) // Without ICU library, QCollator uses the native API on Windows 7+. But that API // sorts older versions of μTorrent differently than the newer ones because the @@ -80,9 +74,6 @@ namespace return lessThan(left, right); #endif return (m_collator.compare(left, right) < 0); -#else - return lessThan(left, right); -#endif } bool lessThan(const QString &left, const QString &right) const @@ -111,20 +102,12 @@ namespace int startL = posL; while ((posL < left.size()) && left[posL].isDigit()) ++posL; -#ifdef QBT_USES_QT5 int numL = left.midRef(startL, posL - startL).toInt(); -#else - int numL = left.mid(startL, posL - startL).toInt(); -#endif int startR = posR; while ((posR < right.size()) && right[posR].isDigit()) ++posR; -#ifdef QBT_USES_QT5 int numR = right.midRef(startR, posR - startR).toInt(); -#else - int numR = right.mid(startR, posR - startR).toInt(); -#endif if (numL != numR) return (numL < numR); @@ -136,9 +119,7 @@ namespace } private: -#ifdef QBT_USES_QT5 QCollator m_collator; -#endif const bool m_caseSensitive; }; } diff --git a/src/config.h.cmakein b/src/config.h.cmakein index 036002e37..5d6a30c32 100644 --- a/src/config.h.cmakein +++ b/src/config.h.cmakein @@ -1,4 +1,3 @@ -#cmakedefine QBT_USES_QT5 #cmakedefine QBT_USE_GUI #ifndef QBT_USE_GUI diff --git a/src/gui/ico.cpp b/src/gui/ico.cpp index 1d4c43b33..5f30204bc 100644 --- a/src/gui/ico.cpp +++ b/src/gui/ico.cpp @@ -424,9 +424,7 @@ bool ICOHandler::canRead(QIODevice *device) class ICOPlugin : public QImageIOPlugin { -#ifdef QBT_USES_QT5 Q_PLUGIN_METADATA(IID "org.qbittorrent.ICOPlugin") -#endif public: QStringList keys() const; Capabilities capabilities(QIODevice *device, const QByteArray &format) const; @@ -460,8 +458,3 @@ QImageIOHandler *ICOPlugin::create(QIODevice *device, const QByteArray &format) handler->setFormat(format); return handler; } - -#ifndef QBT_USES_QT5 -Q_EXPORT_STATIC_PLUGIN(ICOPlugin) -Q_EXPORT_PLUGIN2(ico, ICOPlugin) -#endif diff --git a/src/gui/lineedit/CMakeLists.txt b/src/gui/lineedit/CMakeLists.txt index ced27991e..ee1f46c2f 100644 --- a/src/gui/lineedit/CMakeLists.txt +++ b/src/gui/lineedit/CMakeLists.txt @@ -11,10 +11,6 @@ resources/lineeditimages.qrc ) add_library(qbt_lineedit STATIC ${QBT_LINEEDIT_SOURCES} ${QBT_LINEEDIT_HEADERS}) -if (QT4_FOUND) - target_link_libraries(qbt_lineedit Qt4::QtGui) -else (QT4_FOUND) - target_link_libraries(qbt_lineedit Qt5::Widgets) -endif (QT4_FOUND) +target_link_libraries(qbt_lineedit Qt5::Widgets) qbt_target_sources(${QBT_LINEEDIT_RESOURCES}) diff --git a/src/gui/lineedit/src/lineedit.cpp b/src/gui/lineedit/src/lineedit.cpp index 2552c03af..f3f978e26 100644 --- a/src/gui/lineedit/src/lineedit.cpp +++ b/src/gui/lineedit/src/lineedit.cpp @@ -25,24 +25,8 @@ LineEdit::LineEdit(QWidget *parent) QSize searchButtonHint = searchButton->sizeHint(); QSize clearButtonHint(0, 0); -#ifndef QBT_USES_QT5 - QPixmap pixmap2(":/lineeditimages/clear_left.png"); - clearButton = new QToolButton(this); - clearButton->setIcon(QIcon(pixmap2)); - clearButton->setIconSize(pixmap2.size()); - clearButton->setCursor(Qt::ArrowCursor); - clearButton->setStyleSheet("QToolButton { border: none; padding: 2px; }"); - clearButton->setToolTip(tr("Clear the text")); - clearButton->hide(); - connect(clearButton, SIGNAL(clicked()), this, SLOT(clear())); - connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(updateCloseButton(const QString &))); - - clearButtonHint = clearButton->sizeHint(); - setStyleSheet(QString("QLineEdit { padding-left: %1px; padding-right: %2px; }").arg(searchButtonHint.width()).arg(clearButtonHint.width())); -#else setClearButtonEnabled(true); setStyleSheet(QString("QLineEdit { padding-left: %1px; }").arg(searchButtonHint.width())); // padding between text and widget borders -#endif QSize widgetHint = sizeHint(); int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); @@ -56,15 +40,5 @@ void LineEdit::resizeEvent(QResizeEvent *e) QSize sz = searchButton->sizeHint(); searchButton->move(frameWidth, (e->size().height() - sz.height()) / 2); -#ifndef QBT_USES_QT5 - QSize cz = clearButton->sizeHint(); - clearButton->move((e->size().width() - frameWidth - cz.width()), (e->size().height() - sz.height()) / 2); -#endif } -#ifndef QBT_USES_QT5 -void LineEdit::updateCloseButton(const QString &text) -{ - clearButton->setVisible(!text.isEmpty()); -} -#endif diff --git a/src/gui/lineedit/src/lineedit.h b/src/gui/lineedit/src/lineedit.h index 6b39d9088..5922ce209 100644 --- a/src/gui/lineedit/src/lineedit.h +++ b/src/gui/lineedit/src/lineedit.h @@ -24,16 +24,8 @@ public: protected: void resizeEvent(QResizeEvent *e); -#ifndef QBT_USES_QT5 -private slots: - void updateCloseButton(const QString &text); -#endif - private: QToolButton *searchButton; -#ifndef QBT_USES_QT5 - QToolButton *clearButton; -#endif }; #endif // LIENEDIT_H diff --git a/src/gui/optionsdlg.cpp b/src/gui/optionsdlg.cpp index 10e3c62ca..bff5f2e9e 100644 --- a/src/gui/optionsdlg.cpp +++ b/src/gui/optionsdlg.cpp @@ -122,11 +122,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) } } -#ifndef QBT_USES_QT5 - m_ui->scanFoldersView->header()->setResizeMode(QHeaderView::ResizeToContents); -#else m_ui->scanFoldersView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); -#endif m_ui->scanFoldersView->setModel(ScanFoldersModel::instance()); m_ui->scanFoldersView->setItemDelegate(new ScanFoldersDelegate(this, m_ui->scanFoldersView)); connect(ScanFoldersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(enableApplyButton())); diff --git a/src/gui/previewlistdelegate.h b/src/gui/previewlistdelegate.h index 08563a167..7a42653c3 100644 --- a/src/gui/previewlistdelegate.h +++ b/src/gui/previewlistdelegate.h @@ -42,12 +42,8 @@ #include "previewselect.h" #ifdef Q_OS_WIN -#ifndef QBT_USES_QT5 -#include -#else #include #endif -#endif class PreviewListDelegate: public QItemDelegate { Q_OBJECT @@ -80,11 +76,7 @@ class PreviewListDelegate: public QItemDelegate { QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter); #else // XXX: To avoid having the progress text on the right of the bar -#ifndef QBT_USES_QT5 - QPlastiqueStyle st; -#else QProxyStyle st("fusion"); -#endif st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0); #endif break; diff --git a/src/gui/previewselect.cpp b/src/gui/previewselect.cpp index 0ae6b5232..b880550b7 100644 --- a/src/gui/previewselect.cpp +++ b/src/gui/previewselect.cpp @@ -32,9 +32,7 @@ #include #include #include -#ifdef QBT_USES_QT5 #include -#endif #include "base/utils/misc.h" #include "previewlistdelegate.h" @@ -54,14 +52,12 @@ PreviewSelect::PreviewSelect(QWidget* parent, BitTorrent::TorrentHandle *const t previewListModel->setHeaderData(NAME, Qt::Horizontal, tr("Name")); previewListModel->setHeaderData(SIZE, Qt::Horizontal, tr("Size")); previewListModel->setHeaderData(PROGRESS, Qt::Horizontal, tr("Progress")); -#ifdef QBT_USES_QT5 // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 QTableView unused; unused.setVerticalHeader(previewList->header()); previewList->header()->setParent(previewList); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); -#endif previewList->setModel(previewListModel); previewList->hideColumn(FILE_INDEX); listDelegate = new PreviewListDelegate(this); diff --git a/src/gui/properties/CMakeLists.txt b/src/gui/properties/CMakeLists.txt index c172ee54f..0a39e026a 100644 --- a/src/gui/properties/CMakeLists.txt +++ b/src/gui/properties/CMakeLists.txt @@ -44,6 +44,4 @@ speedplotview.cpp add_library(qbt_properties STATIC ${QBT_PROPERTIES_HEADERS} ${QBT_PROPERTIES_SOURCES}) target_link_libraries(qbt_properties qbt_base) -if (NOT QT4_FOUND) - target_link_libraries(qbt_properties Qt5::Widgets Qt5::Concurrent) -endif (NOT QT4_FOUND) +target_link_libraries(qbt_properties Qt5::Widgets Qt5::Concurrent) diff --git a/src/gui/properties/peerlistwidget.cpp b/src/gui/properties/peerlistwidget.cpp index 01551e12c..457bf2a1c 100644 --- a/src/gui/properties/peerlistwidget.cpp +++ b/src/gui/properties/peerlistwidget.cpp @@ -36,9 +36,7 @@ #include #include #include -#ifdef QBT_USES_QT5 #include -#endif #include "base/net/reverseresolution.h" #include "base/bittorrent/torrenthandle.h" @@ -135,14 +133,12 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent) handleSortColumnChanged(header()->sortIndicatorSection()); m_copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copySelectedPeers()), 0, Qt::WidgetShortcut); -#ifdef QBT_USES_QT5 // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 QTableView unused; unused.setVerticalHeader(this->header()); this->header()->setParent(this); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); -#endif } PeerListWidget::~PeerListWidget() diff --git a/src/gui/properties/peersadditiondlg.cpp b/src/gui/properties/peersadditiondlg.cpp index 77444935a..f14af68d2 100644 --- a/src/gui/properties/peersadditiondlg.cpp +++ b/src/gui/properties/peersadditiondlg.cpp @@ -39,10 +39,8 @@ PeersAdditionDlg::PeersAdditionDlg(QWidget *parent) setupUi(this); connect(buttonBox, SIGNAL(accepted()), this, SLOT(validateInput())); -#ifdef QBT_USES_QT5 label_format->hide(); peers_txt->setPlaceholderText("Format: IPv4:port / [IPv6]:port"); -#endif } QList PeersAdditionDlg::askForPeers() diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index 0e27c1c04..2147af49e 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -102,15 +102,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *main_window, Tra connect(filesList->header(), SIGNAL(sectionResized(int,int,int)), this, SLOT(saveSettings())); connect(filesList->header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(saveSettings())); -#ifdef QBT_USES_QT5 // set bar height relative to screen dpi int barHeight = devicePixelRatio() * 18; -#else - // set bar height relative to font height - QFont defFont; - QFontMetrics fMetrics(defFont, 0); // need to be device-dependent - int barHeight = fMetrics.height() * 5 / 4; -#endif // Downloaded pieces progress bar tempProgressBarArea->setVisible(false); diff --git a/src/gui/properties/proplistdelegate.cpp b/src/gui/properties/proplistdelegate.cpp index 50e342717..607e0f522 100644 --- a/src/gui/properties/proplistdelegate.cpp +++ b/src/gui/properties/proplistdelegate.cpp @@ -36,12 +36,8 @@ #include #ifdef Q_OS_WIN -#ifndef QBT_USES_QT5 -#include -#else #include #endif -#endif #include "base/utils/misc.h" #include "base/utils/string.h" @@ -106,11 +102,7 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter); #else // XXX: To avoid having the progress text on the right of the bar -#ifndef QBT_USES_QT5 - QPlastiqueStyle st; -#else QProxyStyle st("fusion"); -#endif st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0); #endif } diff --git a/src/gui/properties/trackerlist.cpp b/src/gui/properties/trackerlist.cpp index 6abf0eee2..165fdfa43 100644 --- a/src/gui/properties/trackerlist.cpp +++ b/src/gui/properties/trackerlist.cpp @@ -37,10 +37,8 @@ #include #include #include -#ifdef QBT_USES_QT5 #include #include -#endif #include "base/bittorrent/session.h" #include "base/bittorrent/torrenthandle.h" @@ -88,14 +86,12 @@ TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), propertie deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(deleteSelectedTrackers()), 0, Qt::WidgetShortcut); copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copyTrackerUrl()), 0, Qt::WidgetShortcut); -#ifdef QBT_USES_QT5 // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 QTableView unused; unused.setVerticalHeader(this->header()); this->header()->setParent(this); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); -#endif loadSettings(); } diff --git a/src/gui/rss/CMakeLists.txt b/src/gui/rss/CMakeLists.txt index 30ec743c8..439432b09 100644 --- a/src/gui/rss/CMakeLists.txt +++ b/src/gui/rss/CMakeLists.txt @@ -24,8 +24,4 @@ rsssettingsdlg.ui add_library(qbt_rss STATIC ${QBT_RSS_HEADERS} ${QBT_RSS_SOURCE} ${QBT_RSS_FORMS}) target_link_libraries(qbt_rss qbt_base) -if (QT4_FOUND) - target_link_libraries(qbt_rss Qt4::QtGui Qt4::QtNetwork) -else (QT4_FOUND) - target_link_libraries(qbt_rss Qt5::Gui Qt5::Widgets Qt5::Network) -endif (QT4_FOUND) +target_link_libraries(qbt_rss Qt5::Gui Qt5::Widgets Qt5::Network) diff --git a/src/gui/search/pluginselectdlg.cpp b/src/gui/search/pluginselectdlg.cpp index 97b3cb08a..03c7f32b7 100644 --- a/src/gui/search/pluginselectdlg.cpp +++ b/src/gui/search/pluginselectdlg.cpp @@ -36,9 +36,7 @@ #include #include #include -#ifdef QBT_USES_QT5 #include -#endif #include "base/utils/fs.h" #include "base/utils/misc.h" @@ -69,14 +67,13 @@ PluginSelectDlg::PluginSelectDlg(SearchEngine *pluginManager, QWidget *parent) setupUi(this); setAttribute(Qt::WA_DeleteOnClose); -#ifdef QBT_USES_QT5 // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 QTableView unused; unused.setVerticalHeader(pluginsTree->header()); pluginsTree->header()->setParent(pluginsTree); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); -#endif + pluginsTree->setRootIsDecorated(false); pluginsTree->header()->resizeSection(0, 160); pluginsTree->header()->resizeSection(1, 80); diff --git a/src/gui/search/searchtab.cpp b/src/gui/search/searchtab.cpp index db4c0e2b3..f52150ec0 100644 --- a/src/gui/search/searchtab.cpp +++ b/src/gui/search/searchtab.cpp @@ -39,9 +39,7 @@ #include #include #include -#ifdef QBT_USES_QT5 #include -#endif #include "base/utils/misc.h" #include "base/preferences.h" @@ -67,14 +65,13 @@ SearchTab::SearchTab(SearchWidget *parent) { m_ui->setupUi(this); -#ifdef QBT_USES_QT5 // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 QTableView unused; unused.setVerticalHeader(m_ui->resultsBrowser->header()); m_ui->resultsBrowser->header()->setParent(m_ui->resultsBrowser); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); -#endif + loadSettings(); m_ui->resultsBrowser->setSelectionMode(QAbstractItemView::ExtendedSelection); header()->setStretchLastSection(false); diff --git a/src/gui/torrentcontenttreeview.cpp b/src/gui/torrentcontenttreeview.cpp index 9c0ce06a8..3d18a8136 100644 --- a/src/gui/torrentcontenttreeview.cpp +++ b/src/gui/torrentcontenttreeview.cpp @@ -32,24 +32,20 @@ #include #include -#ifdef QBT_USES_QT5 #include #include -#endif #include "torrentcontentmodelitem.h" TorrentContentTreeView::TorrentContentTreeView(QWidget* parent) : QTreeView(parent) { -#ifdef QBT_USES_QT5 // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 QTableView unused; unused.setVerticalHeader(header()); header()->setParent(this); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); -#endif } void TorrentContentTreeView::keyPressEvent(QKeyEvent *event) { diff --git a/src/gui/transferlistdelegate.cpp b/src/gui/transferlistdelegate.cpp index be5b0bd1c..fc5d404d8 100644 --- a/src/gui/transferlistdelegate.cpp +++ b/src/gui/transferlistdelegate.cpp @@ -44,12 +44,8 @@ #include "base/unicodestrings.h" #ifdef Q_OS_WIN -#ifndef QBT_USES_QT5 -#include -#else #include #endif -#endif TransferListDelegate::TransferListDelegate(QObject *parent) : QItemDelegate(parent) @@ -175,11 +171,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter); #else // XXX: To avoid having the progress text on the right of the bar -#ifndef QBT_USES_QT5 - QPlastiqueStyle st; -#else QProxyStyle st("fusion"); -#endif st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0); #endif break; diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 80b96d171..7bc8a5f51 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -41,9 +41,7 @@ #include #include #include -#ifdef QBT_USES_QT5 #include -#endif #include "transferlistwidget.h" #include "base/bittorrent/session.h" @@ -161,14 +159,12 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window) doubleClickHotkey = new QShortcut(Qt::Key_Return, this, SLOT(torrentDoubleClicked()), 0, Qt::WidgetShortcut); recheckHotkey = new QShortcut(Qt::CTRL + Qt::Key_R, this, SLOT(recheckSelectedTorrents()), 0, Qt::WidgetShortcut); -#ifdef QBT_USES_QT5 // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 QTableView unused; unused.setVerticalHeader(header()); header()->setParent(this); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); -#endif } TransferListWidget::~TransferListWidget() diff --git a/src/src.pro b/src/src.pro index 8c516a599..8cf3b594e 100644 --- a/src/src.pro +++ b/src/src.pro @@ -5,7 +5,6 @@ CONFIG += qt thread silent # C++11 support CONFIG += c++11 DEFINES += BOOST_NO_CXX11_RVALUE_REFERENCES -greaterThan(QT_MAJOR_VERSION, 4): greaterThan(QT_MINOR_VERSION, 1): DEFINES += QBT_USES_QT5 lessThan(QT_MAJOR_VERSION, 5): DEFINES += QStringLiteral=QLatin1String diff --git a/src/webui/CMakeLists.txt b/src/webui/CMakeLists.txt index d3b5670f9..b959d5abd 100644 --- a/src/webui/CMakeLists.txt +++ b/src/webui/CMakeLists.txt @@ -17,20 +17,8 @@ webapplication.cpp webui.cpp ) -if (QT4_FOUND) - if (NOT SYSTEM_QJSON) - add_subdirectory(qjson) - else (NOT SYSTEM_QJSON) - find_package(QJSON REQUIRED) - add_definitions(-DUSE_SYSTEM_QJSON) - endif(NOT SYSTEM_QJSON) -endif (QT4_FOUND) - qbt_target_sources(webui.qrc) add_library(qbt_webui STATIC ${QBT_WEBUI_HEADERS} ${QBT_WEBUI_SOURCES}) target_link_libraries(qbt_webui qbt_base) -if (QT4_FOUND) - target_link_libraries(qbt_webui qjson) -endif (QT4_FOUND) diff --git a/src/webui/abstractwebapplication.cpp b/src/webui/abstractwebapplication.cpp index 4bb5315d7..9c4d8c090 100644 --- a/src/webui/abstractwebapplication.cpp +++ b/src/webui/abstractwebapplication.cpp @@ -271,20 +271,12 @@ void AbstractWebApplication::translateDocument(QString& data) if (isTranslationNeeded) { QString context = regex.cap(4); if (context.length() > 0) { -#ifndef QBT_USES_QT5 - translation = qApp->translate(context.toUtf8().constData(), word.constData(), 0, QCoreApplication::UnicodeUTF8, 1); -#else translation = qApp->translate(context.toUtf8().constData(), word.constData(), 0, 1); -#endif } else { size_t context_index = 0; while ((context_index < context_count) && (translation == word)) { -#ifndef QBT_USES_QT5 - translation = qApp->translate(contexts[context_index].c_str(), word.constData(), 0, QCoreApplication::UnicodeUTF8, 1); -#else translation = qApp->translate(contexts[context_index].c_str(), word.constData(), 0, 1); -#endif ++context_index; } } diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index cd58ea6b9..fd8b59fa8 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -33,10 +33,6 @@ #include #include -#ifndef QBT_USES_QT5 -#include -#endif - #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) #include #endif @@ -54,8 +50,6 @@ #include "base/utils/misc.h" #include "jsonutils.h" -#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) - #define CACHED_VARIABLE(VARTYPE, VAR, DUR) \ static VARTYPE VAR; \ static QElapsedTimer cacheTimer; \ @@ -76,15 +70,6 @@ cacheTimer.start(); \ VAR = VARTYPE() -#else -// We don't support caching for Qt < 4.7 at the moment -#define CACHED_VARIABLE(VARTYPE, VAR, DUR) \ - VARTYPE VAR - -#define CACHED_VARIABLE_FOR_HASH(VARTYPE, VAR, DUR, HASH) \ - VARTYPE VAR - -#endif // Numerical constants static const int CACHE_DURATION_MS = 1500; // 1500ms @@ -238,50 +223,18 @@ public: QTorrentCompare(QString key, bool greaterThan = false) : key_(key) , greaterThan_(greaterThan) -#ifndef QBT_USES_QT5 - , type_(QVariant::Invalid) -#endif { } bool operator()(QVariant torrent1, QVariant torrent2) { -#ifndef QBT_USES_QT5 - if (type_ == QVariant::Invalid) - type_ = torrent1.toMap().value(key_).type(); - - switch (static_cast(type_)) { - case QMetaType::Int: - return greaterThan_ ? torrent1.toMap().value(key_).toInt() > torrent2.toMap().value(key_).toInt() - : torrent1.toMap().value(key_).toInt() < torrent2.toMap().value(key_).toInt(); - case QMetaType::LongLong: - return greaterThan_ ? torrent1.toMap().value(key_).toLongLong() > torrent2.toMap().value(key_).toLongLong() - : torrent1.toMap().value(key_).toLongLong() < torrent2.toMap().value(key_).toLongLong(); - case QMetaType::ULongLong: - return greaterThan_ ? torrent1.toMap().value(key_).toULongLong() > torrent2.toMap().value(key_).toULongLong() - : torrent1.toMap().value(key_).toULongLong() < torrent2.toMap().value(key_).toULongLong(); - case QMetaType::Float: - return greaterThan_ ? torrent1.toMap().value(key_).toFloat() > torrent2.toMap().value(key_).toFloat() - : torrent1.toMap().value(key_).toFloat() < torrent2.toMap().value(key_).toFloat(); - case QMetaType::Double: - return greaterThan_ ? torrent1.toMap().value(key_).toDouble() > torrent2.toMap().value(key_).toDouble() - : torrent1.toMap().value(key_).toDouble() < torrent2.toMap().value(key_).toDouble(); - default: - return greaterThan_ ? torrent1.toMap().value(key_).toString() > torrent2.toMap().value(key_).toString() - : torrent1.toMap().value(key_).toString() < torrent2.toMap().value(key_).toString(); - } -#else return greaterThan_ ? torrent1.toMap().value(key_) > torrent2.toMap().value(key_) : torrent1.toMap().value(key_) < torrent2.toMap().value(key_); -#endif } private: QString key_; bool greaterThan_; -#ifndef QBT_USES_QT5 - QVariant::Type type_; -#endif }; /** @@ -947,7 +900,7 @@ QVariantMap generateSyncData(int acceptedResponseId, QVariantMap data, QVariantM lastAcceptedData.clear(); syncData = data; -#if (QBT_USES_QT5 && QT_VERSION < QT_VERSION_CHECK(5, 5, 0)) +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) // QJsonDocument::fromVariant() supports QVariantHash only // since Qt5.5, so manually convert data["torrents"] QVariantMap torrentsMap; diff --git a/src/webui/jsonutils.h b/src/webui/jsonutils.h index a8375c3b7..dcd3327da 100644 --- a/src/webui/jsonutils.h +++ b/src/webui/jsonutils.h @@ -30,41 +30,20 @@ #define JSONUTILS_H #include -#ifdef QBT_USES_QT5 #include #include #include -#else -#include -#ifndef USE_SYSTEM_QJSON -#include "qjson/parser.h" -#include "qjson/serializer.h" -#else // USE_SYSTEM_QJSON -#include -#include -#endif // USE_SYSTEM_QJSON -#endif namespace json { inline QByteArray toJson(const QVariant& var) { -#ifdef QBT_USES_QT5 return QJsonDocument::fromVariant(var).toJson(QJsonDocument::Compact); -#else - QJson::Serializer serializer; - serializer.setIndentMode(QJson::IndentCompact); - return serializer.serialize(var); -#endif } inline QVariant fromJson(const QString& json) { -#ifdef QBT_USES_QT5 return QJsonDocument::fromJson(json.toUtf8()).toVariant(); -#else - return QJson::Parser().parse(json.toUtf8()); -#endif } } diff --git a/src/webui/qjson/CMakeLists.txt b/src/webui/qjson/CMakeLists.txt deleted file mode 100644 index 444073562..000000000 --- a/src/webui/qjson/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -include_directories("${CMAKE_CURRENT_SOURCE_DIR}") -set(QJSON_HEADERS -FlexLexer.h -stack.hh -position.hh -location.hh -json_parser.hh -json_scanner.h -parser.h -parser_p.h -qjson_debug.h -qjson_export.h -serializer.h -) - -set(QJSON_SOURCES -json_parser.cc -json_scanner.cc -json_scanner.cpp -parser.cpp -serializer.cpp -) - -add_library(qjson STATIC ${QJSON_HEADERS} ${QJSON_SOURCES}) - diff --git a/src/webui/qjson/FlexLexer.h b/src/webui/qjson/FlexLexer.h deleted file mode 100644 index bad4ce03f..000000000 --- a/src/webui/qjson/FlexLexer.h +++ /dev/null @@ -1,206 +0,0 @@ -// -*-C++-*- -// FlexLexer.h -- define interfaces for lexical analyzer classes generated -// by flex - -// Copyright (c) 1993 The Regents of the University of California. -// All rights reserved. -// -// This code is derived from software contributed to Berkeley by -// Kent Williams and Tom Epperly. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: - -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. - -// Neither the name of the University nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. - -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE. - -// This file defines FlexLexer, an abstract class which specifies the -// external interface provided to flex C++ lexer objects, and yyFlexLexer, -// which defines a particular lexer class. -// -// If you want to create multiple lexer classes, you use the -P flag -// to rename each yyFlexLexer to some other xxFlexLexer. You then -// include in your other sources once per lexer class: -// -// #undef yyFlexLexer -// #define yyFlexLexer xxFlexLexer -// #include -// -// #undef yyFlexLexer -// #define yyFlexLexer zzFlexLexer -// #include -// ... - -#ifndef __FLEX_LEXER_H -// Never included before - need to define base class. -#define __FLEX_LEXER_H - -#include -# ifndef FLEX_STD -# define FLEX_STD std:: -# endif - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -class FlexLexer { -public: - virtual ~FlexLexer() { } - - const char* YYText() const { return yytext; } - int YYLeng() const { return yyleng; } - - virtual void - yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; - virtual struct yy_buffer_state* - yy_create_buffer( FLEX_STD istream* s, int size ) = 0; - virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( FLEX_STD istream* s ) = 0; - - virtual int yylex() = 0; - - // Call yylex with new input/output sources. - int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ) - { - switch_streams( new_in, new_out ); - return yylex(); - } - - // Switch to new input/output streams. A nil stream pointer - // indicates "keep the current one". - virtual void switch_streams( FLEX_STD istream* new_in = 0, - FLEX_STD ostream* new_out = 0 ) = 0; - - int lineno() const { return yylineno; } - - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" -}; - -} -#endif // FLEXLEXER_H - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex manual. -#define yyFlexLexerOnce - -extern "C++" { - -class yyFlexLexer : public FlexLexer { -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( FLEX_STD istream* s ); - - void yypush_buffer_state( struct yy_buffer_state* new_buffer ); - void yypop_buffer_state(); - - virtual int yylex(); - virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ); - virtual int yywrap(); - -protected: - virtual int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - FLEX_STD istream* yyin; // input source for default LexerInput - FLEX_STD ostream* yyout; // output sink for default LexerOutput - - // yy_hold_char holds the character lost when yytext is formed. - char yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - char* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - struct yy_buffer_state ** yy_buffer_stack; /**< Stack as an array. */ - void yyensure_buffer_stack(void); - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - char* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; -}; - -} - -#endif // yyFlexLexer || ! yyFlexLexerOnce - diff --git a/src/webui/qjson/json_parser.cc b/src/webui/qjson/json_parser.cc deleted file mode 100644 index 5c1788f2e..000000000 --- a/src/webui/qjson/json_parser.cc +++ /dev/null @@ -1,1099 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Skeleton implementation for Bison LALR(1) parsers in C++ - - Copyright (C) 2002-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - - -/* First part of user declarations. */ - -/* Line 279 of lalr1.cc */ -#line 38 "json_parser.cc" - - -#include "json_parser.hh" - -/* User implementation prologue. */ - -/* Line 285 of lalr1.cc */ -#line 46 "json_parser.cc" - - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* FIXME: INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -# ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).begin = YYRHSLOC (Rhs, 1).begin; \ - (Current).end = YYRHSLOC (Rhs, N).end; \ - } \ - else \ - { \ - (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ - } \ - while (/*CONSTCOND*/ false) -# endif - - -/* Suppress unused-variable warnings by "using" E. */ -#define YYUSE(e) ((void) (e)) - -/* Enable debugging if requested. */ -#if YYDEBUG - -/* A pseudo ostream that takes yydebug_ into account. */ -# define YYCDEBUG if (yydebug_) (*yycdebug_) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug_) \ - { \ - *yycdebug_ << Title << ' '; \ - yy_symbol_print_ ((Type), (Value), (Location)); \ - *yycdebug_ << std::endl; \ - } \ -} while (false) - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug_) \ - yy_reduce_print_ (Rule); \ -} while (false) - -# define YY_STACK_PRINT() \ -do { \ - if (yydebug_) \ - yystack_print_ (); \ -} while (false) - -#else /* !YYDEBUG */ - -# define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type) -# define YY_REDUCE_PRINT(Rule) static_cast(0) -# define YY_STACK_PRINT() static_cast(0) - -#endif /* !YYDEBUG */ - -#define yyerrok (yyerrstatus_ = 0) -#define yyclearin (yychar = yyempty_) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYRECOVERING() (!!yyerrstatus_) - - -namespace yy { -/* Line 353 of lalr1.cc */ -#line 141 "json_parser.cc" - - /* Return YYSTR after stripping away unnecessary quotes and - backslashes, so that it's suitable for yyerror. The heuristic is - that double-quoting is unnecessary unless the string contains an - apostrophe, a comma, or backslash (other than backslash-backslash). - YYSTR is taken from yytname. */ - std::string - json_parser::yytnamerr_ (const char *yystr) - { - if (*yystr == '"') - { - std::string yyr; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - yyr += *yyp; - break; - - case '"': - return yyr; - } - do_not_strip_quotes: ; - } - - return yystr; - } - - - /// Build a parser object. - json_parser::json_parser (QJson::ParserPrivate* driver_yyarg) - : -#if YYDEBUG - yydebug_ (false), - yycdebug_ (&std::cerr), -#endif - driver (driver_yyarg) - { - } - - json_parser::~json_parser () - { - } - -#if YYDEBUG - /*--------------------------------. - | Print this symbol on YYOUTPUT. | - `--------------------------------*/ - - inline void - json_parser::yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, const location_type* yylocationp) - { - YYUSE (yylocationp); - YYUSE (yyvaluep); - std::ostream& yyo = debug_stream (); - std::ostream& yyoutput = yyo; - YYUSE (yyoutput); - switch (yytype) - { - default: - break; - } - } - - - void - json_parser::yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, const location_type* yylocationp) - { - *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") - << ' ' << yytname_[yytype] << " (" - << *yylocationp << ": "; - yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); - *yycdebug_ << ')'; - } -#endif - - void - json_parser::yydestruct_ (const char* yymsg, - int yytype, semantic_type* yyvaluep, location_type* yylocationp) - { - YYUSE (yylocationp); - YYUSE (yymsg); - YYUSE (yyvaluep); - - if (yymsg) - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } - } - - void - json_parser::yypop_ (unsigned int n) - { - yystate_stack_.pop (n); - yysemantic_stack_.pop (n); - yylocation_stack_.pop (n); - } - -#if YYDEBUG - std::ostream& - json_parser::debug_stream () const - { - return *yycdebug_; - } - - void - json_parser::set_debug_stream (std::ostream& o) - { - yycdebug_ = &o; - } - - - json_parser::debug_level_type - json_parser::debug_level () const - { - return yydebug_; - } - - void - json_parser::set_debug_level (debug_level_type l) - { - yydebug_ = l; - } -#endif - - inline bool - json_parser::yy_pact_value_is_default_ (int yyvalue) - { - return yyvalue == yypact_ninf_; - } - - inline bool - json_parser::yy_table_value_is_error_ (int yyvalue) - { - return yyvalue == yytable_ninf_; - } - - int - json_parser::parse () - { - /// Lookahead and lookahead in internal form. - int yychar = yyempty_; - int yytoken = 0; - - // State. - int yyn; - int yylen = 0; - int yystate = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// Semantic value of the lookahead. - static semantic_type yyval_default; - semantic_type yylval = yyval_default; - /// Location of the lookahead. - location_type yylloc; - /// The locations where the error started and ended. - location_type yyerror_range[3]; - - /// $$. - semantic_type yyval; - /// @$. - location_type yyloc; - - int yyresult; - - // FIXME: This shoud be completely indented. It is not yet to - // avoid gratuitous conflicts when merging into the master branch. - try - { - YYCDEBUG << "Starting parse" << std::endl; - - - /* Initialize the stacks. The initial state will be pushed in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystate_stack_ = state_stack_type (0); - yysemantic_stack_ = semantic_stack_type (0); - yylocation_stack_ = location_stack_type (0); - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yylloc); - - /* New state. */ - yynewstate: - yystate_stack_.push (yystate); - YYCDEBUG << "Entering state " << yystate << std::endl; - - /* Accept? */ - if (yystate == yyfinal_) - goto yyacceptlab; - - goto yybackup; - - /* Backup. */ - yybackup: - - /* Try to take a decision without lookahead. */ - yyn = yypact_[yystate]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - /* Read a lookahead token. */ - if (yychar == yyempty_) - { - YYCDEBUG << "Reading a token: "; - yychar = yylex (&yylval, &yylloc, driver); - } - - /* Convert token to internal form. */ - if (yychar <= yyeof_) - { - yychar = yytoken = yyeof_; - YYCDEBUG << "Now at end of input." << std::endl; - } - else - { - yytoken = yytranslate_ (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) - goto yydefault; - - /* Reduce or error. */ - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted. */ - yychar = yyempty_; - - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yylloc); - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus_) - --yyerrstatus_; - - yystate = yyn; - goto yynewstate; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. Otherwise, use the top of the stack. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. */ - if (yylen) - yyval = yysemantic_stack_[yylen - 1]; - else - yyval = yysemantic_stack_[0]; - - // Compute the default @$. - { - slice slice (yylocation_stack_, yylen); - YYLLOC_DEFAULT (yyloc, slice, yylen); - } - - // Perform the reduction. - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -/* Line 670 of lalr1.cc */ -#line 82 "json_parser.yy" - { - driver->m_result = (yysemantic_stack_[(1) - (1)]); - qjsonDebug() << "json_parser - parsing finished"; - } - break; - - case 3: -/* Line 670 of lalr1.cc */ -#line 87 "json_parser.yy" - { (yyval) = (yysemantic_stack_[(1) - (1)]); } - break; - - case 4: -/* Line 670 of lalr1.cc */ -#line 89 "json_parser.yy" - { - qCritical()<< "json_parser - syntax error found, " - << "forcing abort, Line" << (yyloc).begin.line << "Column" << (yyloc).begin.column; - YYABORT; - } - break; - - case 5: -/* Line 670 of lalr1.cc */ -#line 95 "json_parser.yy" - { - (yyval) = QVariant(QVariantMap()); - } - break; - - case 6: -/* Line 670 of lalr1.cc */ -#line 98 "json_parser.yy" - { - QVariantMap* map = (yysemantic_stack_[(3) - (2)]).value(); - (yyval) = QVariant(*map); - delete map; - } - break; - - case 7: -/* Line 670 of lalr1.cc */ -#line 104 "json_parser.yy" - { - QVariantMap* pair = new QVariantMap(); - pair->insert((yysemantic_stack_[(3) - (1)]).toString(), (yysemantic_stack_[(3) - (3)])); - (yyval).setValue(pair); - } - break; - - case 8: -/* Line 670 of lalr1.cc */ -#line 109 "json_parser.yy" - { - (yyval).value()->insert((yysemantic_stack_[(5) - (3)]).toString(), (yysemantic_stack_[(5) - (5)])); - } - break; - - case 9: -/* Line 670 of lalr1.cc */ -#line 113 "json_parser.yy" - { - (yyval) = QVariant(QVariantList()); - } - break; - - case 10: -/* Line 670 of lalr1.cc */ -#line 116 "json_parser.yy" - { - QVector* list = (yysemantic_stack_[(3) - (2)]).value* >(); - (yyval) = QVariant(list->toList()); - delete list; - } - break; - - case 11: -/* Line 670 of lalr1.cc */ -#line 122 "json_parser.yy" - { - QVector* list = new QVector(1); - list->replace(0, (yysemantic_stack_[(1) - (1)])); - (yyval).setValue(list); - } - break; - - case 12: -/* Line 670 of lalr1.cc */ -#line 127 "json_parser.yy" - { - (yyval).value* >()->append((yysemantic_stack_[(3) - (3)])); - } - break; - - -/* Line 670 of lalr1.cc */ -#line 549 "json_parser.cc" - default: - break; - } - - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action - invokes YYABORT, YYACCEPT, or YYERROR immediately after altering - yychar. In the case of YYABORT or YYACCEPT, an incorrect - destructor might then be invoked immediately. In the case of - YYERROR, subsequent parser actions might lead to an incorrect - destructor call or verbose syntax error message before the - lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); - - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - - yysemantic_stack_.push (yyval); - yylocation_stack_.push (yyloc); - - /* Shift the result of the reduction. */ - yyn = yyr1_[yyn]; - yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; - if (0 <= yystate && yystate <= yylast_ - && yycheck_[yystate] == yystate_stack_[0]) - yystate = yytable_[yystate]; - else - yystate = yydefgoto_[yyn - yyntokens_]; - goto yynewstate; - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ - yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus_) - { - ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; - error (yylloc, yysyntax_error_ (yystate, yytoken)); - } - - yyerror_range[1] = yylloc; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - if (yychar <= yyeof_) - { - /* Return failure if at end of input. */ - if (yychar == yyeof_) - YYABORT; - } - else - { - yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); - yychar = yyempty_; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (false) - goto yyerrorlab; - - yyerror_range[1] = yylocation_stack_[yylen - 1]; - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - yystate = yystate_stack_[0]; - goto yyerrlab1; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yystate_stack_.height () == 1) - YYABORT; - - yyerror_range[1] = yylocation_stack_[0]; - yydestruct_ ("Error: popping", - yystos_[yystate], - &yysemantic_stack_[0], &yylocation_stack_[0]); - yypop_ (); - yystate = yystate_stack_[0]; - YY_STACK_PRINT (); - } - - yyerror_range[2] = yylloc; - // Using YYLLOC is tempting, but would change the location of - // the lookahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yyloc); - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], - &yysemantic_stack_[0], &yylocation_stack_[0]); - - yystate = yyn; - goto yynewstate; - - /* Accept. */ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - /* Abort. */ - yyabortlab: - yyresult = 1; - goto yyreturn; - - yyreturn: - if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See comments - at user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, - &yylloc); - } - - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - while (1 < yystate_stack_.height ()) - { - yydestruct_ ("Cleanup: popping", - yystos_[yystate_stack_[0]], - &yysemantic_stack_[0], - &yylocation_stack_[0]); - yypop_ (); - } - - return yyresult; - } - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack" - << std::endl; - // Do not try to display the values of the reclaimed symbols, - // as their printer might throw an exception. - if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See - comments at user semantic actions for why this is - necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ (YY_NULL, yytoken, &yylval, &yylloc); - } - - while (1 < yystate_stack_.height ()) - { - yydestruct_ (YY_NULL, - yystos_[yystate_stack_[0]], - &yysemantic_stack_[0], - &yylocation_stack_[0]); - yypop_ (); - } - throw; - } - } - - // Generate an error message. - std::string - json_parser::yysyntax_error_ (int yystate, int yytoken) - { - std::string yyres; - // Number of reported tokens (one for the "unexpected", one per - // "expected"). - size_t yycount = 0; - // Its maximum. - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - // Arguments of yyformat. - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yytoken) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state - merging (from LALR or IELR) and default reductions corrupt the - expected token list. However, the list is correct for - canonical LR with one exception: it will still contain any - token that will not be accepted due to an error action in a - later state. - */ - if (yytoken != yyempty_) - { - yyarg[yycount++] = yytname_[yytoken]; - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - for (int yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ - && !yy_table_value_is_error_ (yytable_[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - break; - } - else - yyarg[yycount++] = yytname_[yyx]; - } - } - } - - char const* yyformat = YY_NULL; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - // Argument number. - size_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += yytnamerr_ (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ - const signed char json_parser::yypact_ninf_ = -5; - const signed char - json_parser::yypact_[] = - { - 0, -5, 2, 18, -5, -5, -5, -5, -5, 7, - -5, -5, -5, -5, -5, 1, 12, -5, -4, -5, - -5, 29, -5, 4, -5, 29, -5, 26, -5, 29, - -5 - }; - - /* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the - default is an error. */ - const unsigned char - json_parser::yydefact_[] = - { - 0, 4, 0, 0, 14, 15, 16, 17, 13, 0, - 2, 18, 19, 3, 5, 0, 0, 9, 0, 11, - 1, 0, 6, 0, 10, 0, 7, 0, 12, 0, - 8 - }; - - /* YYPGOTO[NTERM-NUM]. */ - const signed char - json_parser::yypgoto_[] = - { - -5, -5, -5, -5, -5, -5, -5, -3 - }; - - /* YYDEFGOTO[NTERM-NUM]. */ - const signed char - json_parser::yydefgoto_[] = - { - -1, 9, 10, 11, 16, 12, 18, 13 - }; - - /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF_, syntax error. */ - const signed char json_parser::yytable_ninf_ = -1; - const unsigned char - json_parser::yytable_[] = - { - 19, 1, 24, 2, 25, 3, 14, 20, 21, 4, - 5, 6, 7, 8, 0, 15, 22, 27, 26, 0, - 23, 2, 28, 3, 17, 0, 30, 4, 5, 6, - 7, 8, 2, 29, 3, 0, 0, 0, 4, 5, - 6, 7, 8 - }; - - /* YYCHECK. */ - const signed char - json_parser::yycheck_[] = - { - 3, 1, 6, 3, 8, 5, 4, 0, 7, 9, - 10, 11, 12, 13, -1, 13, 4, 13, 21, -1, - 8, 3, 25, 5, 6, -1, 29, 9, 10, 11, - 12, 13, 3, 7, 5, -1, -1, -1, 9, 10, - 11, 12, 13 - }; - - /* STOS_[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ - const unsigned char - json_parser::yystos_[] = - { - 0, 1, 3, 5, 9, 10, 11, 12, 13, 16, - 17, 18, 20, 22, 4, 13, 19, 6, 21, 22, - 0, 7, 4, 8, 6, 8, 22, 13, 22, 7, - 22 - }; - -#if YYDEBUG - /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding - to YYLEX-NUM. */ - const unsigned short int - json_parser::yytoken_number_[] = - { - 0, 256, 257, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12 - }; -#endif - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ - const unsigned char - json_parser::yyr1_[] = - { - 0, 15, 16, 17, 17, 18, 18, 19, 19, 20, - 20, 21, 21, 22, 22, 22, 22, 22, 22, 22 - }; - - /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ - const unsigned char - json_parser::yyr2_[] = - { - 0, 2, 1, 1, 1, 2, 3, 3, 5, 2, - 3, 1, 3, 1, 1, 1, 1, 1, 1, 1 - }; - - - /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at \a yyntokens_, nonterminals. */ - const char* - const json_parser::yytname_[] = - { - "\"end of file\"", "error", "$undefined", "\"{\"", "\"}\"", "\"[\"", - "\"]\"", "\":\"", "\",\"", "\"number\"", "\"true\"", "\"false\"", - "\"null\"", "\"string\"", "\"invalid\"", "$accept", "start", "data", - "object", "members", "array", "values", "value", YY_NULL - }; - -#if YYDEBUG - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ - const json_parser::rhs_number_type - json_parser::yyrhs_[] = - { - 16, 0, -1, 17, -1, 22, -1, 1, -1, 3, - 4, -1, 3, 19, 4, -1, 13, 7, 22, -1, - 19, 8, 13, 7, 22, -1, 5, 6, -1, 5, - 21, 6, -1, 22, -1, 21, 8, 22, -1, 13, - -1, 9, -1, 10, -1, 11, -1, 12, -1, 18, - -1, 20, -1 - }; - - /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ - const unsigned char - json_parser::yyprhs_[] = - { - 0, 0, 3, 5, 7, 9, 12, 16, 20, 26, - 29, 33, 35, 39, 41, 43, 45, 47, 49, 51 - }; - - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ - const unsigned char - json_parser::yyrline_[] = - { - 0, 82, 82, 87, 88, 95, 98, 104, 109, 113, - 116, 122, 127, 131, 132, 133, 134, 135, 136, 137 - }; - - // Print the state stack on the debug stream. - void - json_parser::yystack_print_ () - { - *yycdebug_ << "Stack now"; - for (state_stack_type::const_iterator i = yystate_stack_.begin (); - i != yystate_stack_.end (); ++i) - *yycdebug_ << ' ' << *i; - *yycdebug_ << std::endl; - } - - // Report on the debug stream that the rule \a yyrule is going to be reduced. - void - json_parser::yy_reduce_print_ (int yyrule) - { - unsigned int yylno = yyrline_[yyrule]; - int yynrhs = yyr2_[yyrule]; - /* Print the symbols being reduced, and their result. */ - *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "):" << std::endl; - /* The symbols being reduced. */ - for (int yyi = 0; yyi < yynrhs; yyi++) - YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", - yyrhs_[yyprhs_[yyrule] + yyi], - &(yysemantic_stack_[(yynrhs) - (yyi + 1)]), - &(yylocation_stack_[(yynrhs) - (yyi + 1)])); - } -#endif // YYDEBUG - - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ - json_parser::token_number_type - json_parser::yytranslate_ (int t) - { - static - const token_number_type - translate_table[] = - { - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2 - }; - if ((unsigned int) t <= yyuser_token_number_max_) - return translate_table[t]; - else - return yyundef_token_; - } - - const int json_parser::yyeof_ = 0; - const int json_parser::yylast_ = 42; - const int json_parser::yynnts_ = 8; - const int json_parser::yyempty_ = -2; - const int json_parser::yyfinal_ = 20; - const int json_parser::yyterror_ = 1; - const int json_parser::yyerrcode_ = 256; - const int json_parser::yyntokens_ = 15; - - const unsigned int json_parser::yyuser_token_number_max_ = 257; - const json_parser::token_number_type json_parser::yyundef_token_ = 2; - - -} // yy -/* Line 1141 of lalr1.cc */ -#line 1075 "json_parser.cc" -/* Line 1142 of lalr1.cc */ -#line 139 "json_parser.yy" - - -int yy::yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver) -{ - JSonScanner* scanner = driver->m_scanner; - yylval->clear(); - int ret = scanner->yylex(yylval, yylloc); - - qjsonDebug() << "json_parser::yylex - calling scanner yylval==|" - << yylval->toByteArray() << "|, ret==|" << QString::number(ret) << "|"; - - return ret; -} - -void yy::json_parser::error (const yy::location& yyloc, const std::string& error) -{ - /*qjsonDebug() << yyloc.begin.line; - qjsonDebug() << yyloc.begin.column; - qjsonDebug() << yyloc.end.line; - qjsonDebug() << yyloc.end.column;*/ - qjsonDebug() << "json_parser::error [line" << yyloc.end.line << "] -" << error.c_str() ; - driver->setError(QString::fromLatin1(error.c_str()), yyloc.end.line); -} diff --git a/src/webui/qjson/json_parser.hh b/src/webui/qjson/json_parser.hh deleted file mode 100644 index 25e00fa1b..000000000 --- a/src/webui/qjson/json_parser.hh +++ /dev/null @@ -1,300 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Skeleton interface for Bison LALR(1) parsers in C++ - - Copyright (C) 2002-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/** - ** \file json_parser.hh - ** Define the yy::parser class. - */ - -/* C++ LALR(1) parser skeleton written by Akim Demaille. */ - -#ifndef YY_YY_JSON_PARSER_HH_INCLUDED -# define YY_YY_JSON_PARSER_HH_INCLUDED - -/* "%code requires" blocks. */ -/* Line 33 of lalr1.cc */ -#line 26 "json_parser.yy" - - #include "parser_p.h" - #include "json_scanner.h" - #include "qjson_debug.h" - - #include - #include - #include - #include - - #include - - class JSonScanner; - - namespace QJson { - class Parser; - } - - #define YYERROR_VERBOSE 1 - - Q_DECLARE_METATYPE(QVector*) - Q_DECLARE_METATYPE(QVariantMap*) - - -/* Line 33 of lalr1.cc */ -#line 72 "json_parser.hh" - - -#include -#include -#include "stack.hh" -#include "location.hh" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif - - -namespace yy { -/* Line 33 of lalr1.cc */ -#line 88 "json_parser.hh" - - /// A Bison parser. - class json_parser - { - public: - /// Symbol semantic values. -#ifndef YYSTYPE - typedef int semantic_type; -#else - typedef YYSTYPE semantic_type; -#endif - /// Symbol locations. - typedef location location_type; - /// Tokens. - struct token - { - /* Tokens. */ - enum yytokentype { - END = 0, - CURLY_BRACKET_OPEN = 1, - CURLY_BRACKET_CLOSE = 2, - SQUARE_BRACKET_OPEN = 3, - SQUARE_BRACKET_CLOSE = 4, - COLON = 5, - COMMA = 6, - NUMBER = 7, - TRUE_VAL = 8, - FALSE_VAL = 9, - NULL_VAL = 10, - STRING = 11, - INVALID = 12 - }; - - }; - /// Token type. - typedef token::yytokentype token_type; - - /// Build a parser object. - json_parser (QJson::ParserPrivate* driver_yyarg); - virtual ~json_parser (); - - /// Parse. - /// \returns 0 iff parsing succeeded. - virtual int parse (); - -#if YYDEBUG - /// The current debugging stream. - std::ostream& debug_stream () const; - /// Set the current debugging stream. - void set_debug_stream (std::ostream &); - - /// Type for debugging levels. - typedef int debug_level_type; - /// The current debugging level. - debug_level_type debug_level () const; - /// Set the current debugging level. - void set_debug_level (debug_level_type l); -#endif - - private: - /// Report a syntax error. - /// \param loc where the syntax error is found. - /// \param msg a description of the syntax error. - virtual void error (const location_type& loc, const std::string& msg); - - /// Generate an error message. - /// \param state the state where the error occurred. - /// \param tok the lookahead token. - virtual std::string yysyntax_error_ (int yystate, int tok); - -#if YYDEBUG - /// \brief Report a symbol value on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); - /// \brief Report a symbol on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); -#endif - - - /// State numbers. - typedef int state_type; - /// State stack type. - typedef stack state_stack_type; - /// Semantic value stack type. - typedef stack semantic_stack_type; - /// location stack type. - typedef stack location_stack_type; - - /// The state stack. - state_stack_type yystate_stack_; - /// The semantic value stack. - semantic_stack_type yysemantic_stack_; - /// The location stack. - location_stack_type yylocation_stack_; - - /// Whether the given \c yypact_ value indicates a defaulted state. - /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); - - /// Whether the given \c yytable_ value indicates a syntax error. - /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); - - /// Internal symbol numbers. - typedef unsigned char token_number_type; - /* Tables. */ - /// For a state, the index in \a yytable_ of its portion. - static const signed char yypact_[]; - static const signed char yypact_ninf_; - - /// For a state, default reduction number. - /// Unless\a yytable_ specifies something else to do. - /// Zero means the default is an error. - static const unsigned char yydefact_[]; - - static const signed char yypgoto_[]; - static const signed char yydefgoto_[]; - - /// What to do in a state. - /// \a yytable_[yypact_[s]]: what to do in state \a s. - /// - if positive, shift that token. - /// - if negative, reduce the rule which number is the opposite. - /// - if zero, do what YYDEFACT says. - static const unsigned char yytable_[]; - static const signed char yytable_ninf_; - - static const signed char yycheck_[]; - - /// For a state, its accessing symbol. - static const unsigned char yystos_[]; - - /// For a rule, its LHS. - static const unsigned char yyr1_[]; - /// For a rule, its RHS length. - static const unsigned char yyr2_[]; - - /// Convert the symbol name \a n to a form suitable for a diagnostic. - static std::string yytnamerr_ (const char *n); - - - /// For a symbol, its name in clear. - static const char* const yytname_[]; -#if YYDEBUG - /// A type to store symbol numbers and -1. - typedef signed char rhs_number_type; - /// A `-1'-separated list of the rules' RHS. - static const rhs_number_type yyrhs_[]; - /// For each rule, the index of the first RHS symbol in \a yyrhs_. - static const unsigned char yyprhs_[]; - /// For each rule, its source line number. - static const unsigned char yyrline_[]; - /// For each scanner token number, its symbol number. - static const unsigned short int yytoken_number_[]; - /// Report on the debug stream that the rule \a r is going to be reduced. - virtual void yy_reduce_print_ (int r); - /// Print the state stack on the debug stream. - virtual void yystack_print_ (); - - /* Debugging. */ - int yydebug_; - std::ostream* yycdebug_; -#endif - - /// Convert a scanner token number \a t to a symbol number. - token_number_type yytranslate_ (int t); - - /// \brief Reclaim the memory associated to a symbol. - /// \param yymsg Why this token is reclaimed. - /// If null, do not display the symbol, just free it. - /// \param yytype The symbol type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - inline void yydestruct_ (const char* yymsg, - int yytype, - semantic_type* yyvaluep, - location_type* yylocationp); - - /// Pop \a n symbols the three stacks. - inline void yypop_ (unsigned int n = 1); - - /* Constants. */ - static const int yyeof_; - /* LAST_ -- Last index in TABLE_. */ - static const int yylast_; - static const int yynnts_; - static const int yyempty_; - static const int yyfinal_; - static const int yyterror_; - static const int yyerrcode_; - static const int yyntokens_; - static const unsigned int yyuser_token_number_max_; - static const token_number_type yyundef_token_; - - /* User arguments. */ - QJson::ParserPrivate* driver; - }; - -} // yy -/* Line 33 of lalr1.cc */ -#line 297 "json_parser.hh" - - - -#endif /* !YY_YY_JSON_PARSER_HH_INCLUDED */ diff --git a/src/webui/qjson/json_scanner.cc b/src/webui/qjson/json_scanner.cc deleted file mode 100644 index 58f7d000b..000000000 --- a/src/webui/qjson/json_scanner.cc +++ /dev/null @@ -1,4520 +0,0 @@ -#line 2 "json_scanner.cc" - -#line 4 "json_scanner.cc" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - - /* The c++ scanner is a mess. The FlexLexer.h header file relies on the - * following macro. This is required in order to pass the c++-multiple-scanners - * test in the regression suite. We get reports that it breaks inheritance. - * We will address this in a future release of flex, or omit the C++ scanner - * altogether. - */ - #define yyFlexLexer yyFlexLexer - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ -#include -#include -#include -#include -#include -/* end standard C++ headers. */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern yy_size_t yyleng; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - - std::istream* yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -#define yytext_ptr yytext - -#include - -int yyFlexLexer::yywrap() { return 1; } -int yyFlexLexer::yylex() - { - LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" ); - return 0; - } - -#define YY_DECL int JSonScanner::yylex() -static yyconst flex_int16_t yy_nxt[][256] = - { - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 - }, - - { - 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, - 12, 11, 11, 13, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 14, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 15, 16, 10, 10, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 20, 10, 21, 10, 10, 10, 10, 10, 10, - 10, 10, 22, 10, 10, 10, 10, 10, 10, 10, - 23, 10, 10, 10, 10, 10, 24, 10, 10, 10, - 10, 10, 10, 25, 10, 26, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 - }, - - { - 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, - 12, 11, 11, 13, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 14, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 15, 16, 10, 10, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 20, 10, 21, 10, 10, 10, 10, 10, 10, - 10, 10, 22, 10, 10, 10, 10, 10, 10, 10, - 23, 10, 10, 10, 10, 10, 24, 10, 10, 10, - 10, 10, 10, 25, 10, 26, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 - }, - - { - 9, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 29, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27 - }, - - { - 9, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 29, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27 - - }, - - { - 9, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 30, 30, - 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, - 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, - - 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30 - }, - - { - 9, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - - 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 30, 30, - 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, - 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, - 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30 - }, - - { - 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, - 12, 11, 11, 13, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 14, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 15, 32, 10, 10, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 33, 10, 10, 10, 10, 34, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 20, 10, 21, 10, 10, 10, 10, 10, 10, - 10, 10, 22, 10, 10, 33, 10, 10, 10, 10, - 35, 10, 10, 10, 10, 10, 24, 10, 10, 10, - 10, 10, 10, 25, 10, 26, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 - }, - - { - 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, - 12, 11, 11, 13, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 14, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 15, 32, 10, 10, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 33, 10, 10, 10, 10, 34, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 20, 10, 21, 10, 10, 10, 10, 10, 10, - 10, 10, 22, 10, 10, 33, 10, 10, 10, 10, - 35, 10, 10, 10, 10, 10, 24, 10, 10, 10, - - 10, 10, 10, 25, 10, 26, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 - }, - - { - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9 - - }, - - { - 9, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10 - }, - - { - 9, -11, -11, -11, -11, -11, -11, -11, -11, 36, - -11, 36, 36, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, 36, -11, -11, -11, -11, -11, -11, -11, - - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11 - }, - - { - 9, -12, -12, -12, -12, -12, -12, -12, -12, -12, - 37, -12, -12, 37, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12 - }, - - { - 9, -13, -13, -13, -13, -13, -13, -13, -13, -13, - 37, -13, -13, 37, -13, -13, -13, -13, -13, -13, - - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13 - }, - - { - 9, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14 - - }, - - { - 9, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15 - }, - - { - 9, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - - -16, -16, -16, -16, -16, -16, -16, -16, 38, 39, - 39, 39, 39, 39, 39, 39, 39, 39, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16 - }, - - { - 9, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, 40, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, 41, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, 41, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17 - }, - - { - 9, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, 40, -18, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, 41, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, 41, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18 - }, - - { - 9, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19 - - }, - - { - 9, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20 - }, - - { - 9, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21 - }, - - { - 9, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, 43, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22 - }, - - { - 9, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, 44, -23, -23, - - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23 - }, - - { - 9, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, 45, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24 - - }, - - { - 9, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25 - }, - - { - 9, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26 - }, - - { - 9, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, -27, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, -27, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46 - }, - - { - 9, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28 - }, - - { - 9, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, 47, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, 48, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, 49, -29, -29, -29, -29, -29, 50, -29, - -29, -29, 51, -29, -29, -29, -29, -29, -29, -29, - 52, -29, -29, -29, 53, -29, 54, 55, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29 - - }, - - { - 9, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30 - }, - - { - 9, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - - -31, -31, -31, -31, -31, -31, -31, -31, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, -31, -31, - -31, -31, -31, -31, -31, 56, 56, 56, 56, 56, - 56, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, 56, 56, 56, - 56, 56, 56, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31 - }, - - { - 9, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, 38, 39, - 39, 39, 39, 39, 39, 39, 39, 39, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, 57, -32, -32, -32, -32, -32, -32, - - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, 57, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32 - }, - - { - 9, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - 58, -33, -33, -33, -33, -33, -33, -33, -33, -33, - - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33 - }, - - { - 9, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - - -34, -34, -34, -34, -34, 59, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, 59, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34 - - }, - - { - 9, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, 59, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, 59, -35, -35, - - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, 44, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35 - }, - - { - 9, -36, -36, -36, -36, -36, -36, -36, -36, 36, - -36, 36, 36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, 36, -36, -36, -36, -36, -36, -36, -36, - - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36 - }, - - { - 9, -37, -37, -37, -37, -37, -37, -37, -37, -37, - 37, -37, -37, 37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37 - }, - - { - 9, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, 40, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, 41, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, 41, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38 - }, - - { - 9, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, 40, -39, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, -39, -39, - - -39, -39, -39, -39, -39, -39, -39, -39, -39, 41, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, 41, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39 - - }, - - { - 9, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40 - }, - - { - 9, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - - -41, -41, -41, 62, -41, 62, -41, -41, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41 - }, - - { - 9, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, 40, -42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, 41, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, 41, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42 - }, - - { - 9, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, 64, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43 - }, - - { - 9, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, 65, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44 - - }, - - { - 9, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, 66, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45 - }, - - { - 9, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, -46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, -46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46 - }, - - { - 9, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47 - }, - - { - 9, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48 - }, - - { - 9, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49 - - }, - - { - 9, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50 - }, - - { - 9, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51 - }, - - { - 9, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52 - }, - - { - 9, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53 - }, - - { - 9, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54 - - }, - - { - 9, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55 - }, - - { - 9, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - - -56, -56, -56, -56, -56, -56, -56, -56, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, -56, -56, - -56, -56, -56, -56, -56, 67, 67, 67, 67, 67, - 67, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, 67, 67, 67, - 67, 67, 67, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56 - }, - - { - 9, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - 68, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57 - }, - - { - 9, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, 69, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58 - }, - - { - 9, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, 70, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - 70, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59 - - }, - - { - 9, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, 40, -60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, 41, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - - -60, 41, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60 - }, - - { - 9, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - - -61, -61, -61, -61, -61, -61, -61, -61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, 41, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, 41, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61 - }, - - { - 9, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62 - }, - - { - 9, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63 - }, - - { - 9, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, 71, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64 - - }, - - { - 9, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - - -65, -65, -65, -65, -65, -65, -65, -65, 72, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65 - }, - - { - 9, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, 73, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66 - }, - - { - 9, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, -67, -67, - -67, -67, -67, -67, -67, 74, 74, 74, 74, 74, - 74, -67, -67, -67, -67, -67, -67, -67, -67, -67, - - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, 74, 74, 74, - 74, 74, 74, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67 - }, - - { - 9, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, 75, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68 - }, - - { - 9, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, 76, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69 - - }, - - { - 9, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70 - }, - - { - 9, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, 77, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71 - }, - - { - 9, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72 - }, - - { - 9, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73 - }, - - { - 9, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74 - - }, - - { - 9, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - - -75, -75, -75, -75, -75, 78, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75 - }, - - { - 9, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - 79, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76 - }, - - { - 9, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77 - }, - - { - 9, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - 80, -78, -78, -78, -78, -78, -78, -78, -78, -78, - - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78 - }, - - { - 9, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, 81, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79 - - }, - - { - 9, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - - -80, -80, -80, -80, -80, 82, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80 - }, - - { - 9, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, 83, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81 - }, - - { - 9, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, 84, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82 - }, - - { - 9, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - - -83, 85, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83 - }, - - { - 9, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, 86, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84 - - }, - - { - 9, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85 - }, - - { - 9, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86 - }, - - } ; - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 36 -#define YY_END_OF_BUFFER 37 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[87] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 37, 35, - 1, 2, 2, 11, 27, 35, 6, 6, 26, 28, - 29, 35, 35, 35, 30, 31, 21, 23, 22, 25, - 25, 35, 35, 35, 35, 1, 2, 8, 8, 0, - 0, 7, 0, 0, 0, 21, 12, 14, 13, 15, - 16, 17, 18, 19, 20, 0, 0, 0, 0, 9, - 10, 0, 10, 0, 0, 0, 0, 0, 0, 32, - 0, 5, 3, 24, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 33, 34 - } ; - -static yyconst yy_state_type yy_NUL_trans[87] = - { 0, - 10, 10, 27, 27, 30, 30, 10, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 - } ; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#line 1 "json_scanner.yy" -/* This file is part of QJson - * - * Copyright (C) 2013 Silvio Moioli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110yy::json_parser::token::INVALID301, USA. - */ -/* Flex output settings */ -#define YY_NO_UNISTD_H 1 -#define YY_NO_INPUT 1 -#line 29 "json_scanner.yy" - #include "json_scanner.h" - #include "json_parser.hh" - - #if defined(_WIN32) && !defined(__MINGW32__) - #define strtoll _strtoi64 - #define strtoull _strtoui64 - #endif - - #define YY_USER_INIT if(m_allowSpecialNumbers) { \ - BEGIN(ALLOW_SPECIAL_NUMBERS); \ - } -/* Exclusive subscanners for strings and escaped hex sequences */ - -/* Extra-JSON rules active iff m_allowSpecialNumbers is true */ - -#line 3168 "json_scanner.cc" - -#define INITIAL 0 -#define QUOTMARK_OPEN 1 -#define HEX_OPEN 2 -#define ALLOW_SPECIAL_NUMBERS 3 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -#define ECHO LexerOutput( yytext, yyleng ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ -\ - if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) LexerError( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 -#define YY_DECL int yyFlexLexer::yylex() -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 48 "json_scanner.yy" - - - /* Whitespace */ -#line 3275 "json_scanner.cc" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = & std::cin; - - if ( ! yyout ) - yyout = & std::cout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 ) - { - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - - ++yy_cp; - } - - yy_current_state = -yy_current_state; - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos) + 1; - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 51 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - } - YY_BREAK -case 2: -/* rule 2 can match eol */ -YY_RULE_SETUP -#line 55 "json_scanner.yy" -{ - m_yylloc->lines(yyleng); - } - YY_BREAK -/* Special values */ -case 3: -YY_RULE_SETUP -#line 61 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(true); - return yy::json_parser::token::TRUE_VAL; - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 67 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(false); - return yy::json_parser::token::FALSE_VAL; - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 73 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(); - return yy::json_parser::token::NULL_VAL; - } - YY_BREAK -/* Numbers */ -case 6: -#line 82 "json_scanner.yy" -case 7: -YY_RULE_SETUP -#line 82 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(strtoull(yytext, NULL, 10)); - if (errno == ERANGE) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - YY_BREAK -case 8: -#line 93 "json_scanner.yy" -case 9: -YY_RULE_SETUP -#line 93 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(strtoll(yytext, NULL, 10)); - if (errno == ERANGE) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 103 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - bool ok; - *m_yylval = QVariant(m_C_locale.toDouble(QLatin1String(yytext),&ok)); - if (!ok) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - YY_BREAK -/* Strings */ -case 11: -YY_RULE_SETUP -#line 115 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - BEGIN(QUOTMARK_OPEN); - } - YY_BREAK - -case 12: -YY_RULE_SETUP -#line 121 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\"")); - } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 125 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\\")); - } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 129 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("/")); - } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 133 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\b")); - } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 137 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\f")); - } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 141 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\n")); - } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 145 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\r")); - } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 149 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\t")); - } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 153 "json_scanner.yy" -{ - BEGIN(HEX_OPEN); - } - YY_BREAK -case 21: -/* rule 21 can match eol */ -YY_RULE_SETUP -#line 157 "json_scanner.yy" -{ - m_currentString.append(QString::fromUtf8(yytext)); - } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 161 "json_scanner.yy" -{ - // ignore - } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 165 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(m_currentString); - m_currentString.clear(); - BEGIN(INITIAL); - return yy::json_parser::token::STRING; - } - YY_BREAK -case YY_STATE_EOF(QUOTMARK_OPEN): -#line 173 "json_scanner.yy" -{ - qCritical() << "Unterminated string"; - m_yylloc->columns(yyleng); - return yy::json_parser::token::INVALID; - } - YY_BREAK - - -case 24: -YY_RULE_SETUP -#line 182 "json_scanner.yy" -{ - QString hexDigits = QString::fromUtf8(yytext, yyleng); - bool ok; - ushort hexDigit1 = hexDigits.left(2).toShort(&ok, 16); - ushort hexDigit2 = hexDigits.right(2).toShort(&ok, 16); - m_currentString.append(QChar(hexDigit2, hexDigit1)); - BEGIN(QUOTMARK_OPEN); - } - YY_BREAK -case 25: -/* rule 25 can match eol */ -YY_RULE_SETUP -#line 191 "json_scanner.yy" -{ - qCritical() << "Invalid hex string"; - m_yylloc->columns(yyleng); - *m_yylval = QVariant(QLatin1String("")); - BEGIN(QUOTMARK_OPEN); - return yy::json_parser::token::INVALID; - } - YY_BREAK - -/* "Compound type" related tokens */ -case 26: -YY_RULE_SETUP -#line 203 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::COLON; - } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 208 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::COMMA; - } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 213 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::SQUARE_BRACKET_OPEN; - } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 218 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::SQUARE_BRACKET_CLOSE; - } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 223 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::CURLY_BRACKET_OPEN; - } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 228 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::CURLY_BRACKET_CLOSE; - } - YY_BREAK -/* Extra-JSON numbers */ - -case 32: -YY_RULE_SETUP -#line 236 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(std::numeric_limits::quiet_NaN()); - return yy::json_parser::token::NUMBER; - } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 242 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(std::numeric_limits::infinity()); - return yy::json_parser::token::NUMBER; - } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 248 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(-std::numeric_limits::infinity()); - return yy::json_parser::token::NUMBER; - } - YY_BREAK - -/* If all else fails */ -case 35: -YY_RULE_SETUP -#line 256 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::INVALID; - } - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(HEX_OPEN): -case YY_STATE_EOF(ALLOW_SPECIAL_NUMBERS): -#line 261 "json_scanner.yy" -return yy::json_parser::token::END; - YY_BREAK -case 36: -YY_RULE_SETUP -#line 262 "json_scanner.yy" -ECHO; - YY_BREAK -#line 3667 "json_scanner.cc" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* The contents of this function are C++ specific, so the () macro is not used. - */ -yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ) -{ - yyin = arg_yyin; - yyout = arg_yyout; - yy_c_buf_p = 0; - yy_init = 0; - yy_start = 0; - yy_flex_debug = 0; - yylineno = 1; // this will only get updated if %option yylineno - - yy_did_buffer_switch_on_eof = 0; - - yy_looking_for_trail_begin = 0; - yy_more_flag = 0; - yy_more_len = 0; - yy_more_offset = yy_prev_more_offset = 0; - - yy_start_stack_ptr = yy_start_stack_depth = 0; - yy_start_stack = NULL; - - yy_buffer_stack = 0; - yy_buffer_stack_top = 0; - yy_buffer_stack_max = 0; - - yy_state_buf = 0; - -} - -/* The contents of this function are C++ specific, so the () macro is not used. - */ -yyFlexLexer::~yyFlexLexer() -{ - delete [] yy_state_buf; - yyfree(yy_start_stack ); - yy_delete_buffer( YY_CURRENT_BUFFER ); - yyfree(yy_buffer_stack ); -} - -/* The contents of this function are C++ specific, so the () macro is not used. - */ -void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out ) -{ - if ( new_in ) - { - yy_delete_buffer( YY_CURRENT_BUFFER ); - yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); - } - - if ( new_out ) - yyout = new_out; -} - -#ifdef YY_INTERACTIVE -int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) -#else -int yyFlexLexer::LexerInput( char* buf, int max_size ) -#endif -{ - if ( yyin->eof() || yyin->fail() ) - return 0; - -#ifdef YY_INTERACTIVE - yyin->get( buf[0] ); - - if ( yyin->eof() ) - return 0; - - if ( yyin->bad() ) - return -1; - - return 1; - -#else - (void) yyin->read( buf, max_size ); - - if ( yyin->bad() ) - return -1; - else - return yyin->gcount(); -#endif -} - -void yyFlexLexer::LexerOutput( const char* buf, int size ) -{ - (void) yyout->write( buf, size ); -} - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -int yyFlexLexer::yy_get_next_buffer() -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - yy_state_type yyFlexLexer::yy_get_previous_state() -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - if ( *yy_cp ) - { - yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; - } - else - yy_current_state = yy_NUL_trans[yy_current_state]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - yy_current_state = yy_NUL_trans[yy_current_state]; - yy_is_jam = (yy_current_state == 0); - - if ( ! yy_is_jam ) - { - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - } - - return yy_is_jam ? 0 : yy_current_state; -} - - void yyFlexLexer::yyunput( int c, register char* yy_bp) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - - int yyFlexLexer::yyinput() -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyFlexLexer::yyrestart( std::istream* input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - - void yyFlexLexer::yy_load_buffer_state() -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); - - yyfree((void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yyFlexLexer::yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -void yyFlexLexer::yyensure_buffer_stack(void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -void yyFlexLexer::LexerError( yyconst char msg[] ) -{ - std::cerr << msg << std::endl; - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 262 "json_scanner.yy" diff --git a/src/webui/qjson/json_scanner.cpp b/src/webui/qjson/json_scanner.cpp deleted file mode 100644 index eb4ec8357..000000000 --- a/src/webui/qjson/json_scanner.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * Copyright (C) 2013 Silvio Moioli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#include "json_scanner.cc" - -#include "qjson_debug.h" -#include "json_scanner.h" -#include "json_parser.hh" - -#include - -#include -#include - -#include - - -JSonScanner::JSonScanner(QIODevice* io) - : m_allowSpecialNumbers(false), - m_io (io), - m_criticalError(false), - m_C_locale(QLocale::C) -{ - -} - -JSonScanner::~JSonScanner() -{ -} - -void JSonScanner::allowSpecialNumbers(bool allow) { - m_allowSpecialNumbers = allow; -} - -int JSonScanner::yylex(YYSTYPE* yylval, yy::location *yylloc) { - m_yylval = yylval; - m_yylloc = yylloc; - m_yylloc->step(); - int result = yylex(); - - if (m_criticalError) { - return -1; - } - - return result; -} - -int JSonScanner::LexerInput(char* buf, int max_size) { - if (!m_io->isOpen()) { - qCritical() << "JSonScanner::yylex - io device is not open"; - m_criticalError = true; - return 0; - } - - int readBytes = m_io->read(buf, max_size); - if(readBytes < 0) { - qCritical() << "JSonScanner::yylex - error while reading from io device"; - m_criticalError = true; - return 0; - } - - return readBytes; -} - - diff --git a/src/webui/qjson/json_scanner.h b/src/webui/qjson/json_scanner.h deleted file mode 100644 index 6a0e97b6f..000000000 --- a/src/webui/qjson/json_scanner.h +++ /dev/null @@ -1,66 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _JSON_SCANNER -#define _JSON_SCANNER - -#include -#include -#include - -#define YYSTYPE QVariant - -// Only include FlexLexer.h if it hasn't been already included -#if ! defined(yyFlexLexerOnce) -#include -#endif - -#include "parser_p.h" - - - -namespace yy { - class location; - int yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver); -} - -class JSonScanner : public yyFlexLexer -{ - public: - explicit JSonScanner(QIODevice* io); - ~JSonScanner(); - - void allowSpecialNumbers(bool allow); - - int yylex(YYSTYPE* yylval, yy::location *yylloc); - int yylex(); - int LexerInput(char* buf, int max_size); - protected: - bool m_allowSpecialNumbers; - QIODevice* m_io; - - YYSTYPE* m_yylval; - yy::location* m_yylloc; - bool m_criticalError; - QString m_currentString; - QLocale m_C_locale; -}; - -#endif diff --git a/src/webui/qjson/location.hh b/src/webui/qjson/location.hh deleted file mode 100644 index 0bf1a74e8..000000000 --- a/src/webui/qjson/location.hh +++ /dev/null @@ -1,181 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Locations for Bison parsers in C++ - - Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/** - ** \file location.hh - ** Define the yy::location class. - */ - -#ifndef YY_YY_LOCATION_HH_INCLUDED -# define YY_YY_LOCATION_HH_INCLUDED - -# include "position.hh" - - -namespace yy { -/* Line 166 of location.cc */ -#line 47 "location.hh" - - /// Abstract a location. - class location - { - public: - - /// Construct a location from \a b to \a e. - location (const position& b, const position& e) - : begin (b) - , end (e) - { - } - - /// Construct a 0-width location in \a p. - explicit location (const position& p = position ()) - : begin (p) - , end (p) - { - } - - /// Construct a 0-width location in \a f, \a l, \a c. - explicit location (std::string* f, - unsigned int l = 1u, - unsigned int c = 1u) - : begin (f, l, c) - , end (f, l, c) - { - } - - - /// Initialization. - void initialize (std::string* f = YY_NULL, - unsigned int l = 1u, - unsigned int c = 1u) - { - begin.initialize (f, l, c); - end = begin; - } - - /** \name Line and Column related manipulators - ** \{ */ - public: - /// Reset initial location to final location. - void step () - { - begin = end; - } - - /// Extend the current location to the COUNT next columns. - void columns (unsigned int count = 1) - { - end += count; - } - - /// Extend the current location to the COUNT next lines. - void lines (unsigned int count = 1) - { - end.lines (count); - } - /** \} */ - - - public: - /// Beginning of the located region. - position begin; - /// End of the located region. - position end; - }; - - /// Join two location objects to create a location. - inline const location operator+ (const location& begin, const location& end) - { - location res = begin; - res.end = end.end; - return res; - } - - /// Add two location objects. - inline const location operator+ (const location& begin, unsigned int width) - { - location res = begin; - res.columns (width); - return res; - } - - /// Add and assign a location. - inline location& operator+= (location& res, unsigned int width) - { - res.columns (width); - return res; - } - - /// Compare two location objects. - inline bool - operator== (const location& loc1, const location& loc2) - { - return loc1.begin == loc2.begin && loc1.end == loc2.end; - } - - /// Compare two location objects. - inline bool - operator!= (const location& loc1, const location& loc2) - { - return !(loc1 == loc2); - } - - /** \brief Intercept output stream redirection. - ** \param ostr the destination output stream - ** \param loc a reference to the location to redirect - ** - ** Avoid duplicate information. - */ - template - inline std::basic_ostream& - operator<< (std::basic_ostream& ostr, const location& loc) - { - position last = loc.end - 1; - ostr << loc.begin; - if (last.filename - && (!loc.begin.filename - || *loc.begin.filename != *last.filename)) - ostr << '-' << last; - else if (loc.begin.line != last.line) - ostr << '-' << last.line << '.' << last.column; - else if (loc.begin.column != last.column) - ostr << '-' << last.column; - return ostr; - } - - -} // yy -/* Line 296 of location.cc */ -#line 180 "location.hh" - -#endif /* !YY_YY_LOCATION_HH_INCLUDED */ diff --git a/src/webui/qjson/parser.cpp b/src/webui/qjson/parser.cpp deleted file mode 100644 index 723406697..000000000 --- a/src/webui/qjson/parser.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * Copyright (C) 2016 Anton Kudryavtsev - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "parser.h" -#include "parser_p.h" -#include "json_parser.hh" -#include "json_scanner.h" - -#include -#include -#include -#include - -using namespace QJson; - -ParserPrivate::ParserPrivate() : - m_scanner(0), - m_specialNumbersAllowed(false) -{ - reset(); -} - -ParserPrivate::~ParserPrivate() -{ - if (m_scanner) - delete m_scanner; -} - -void ParserPrivate::setError(const QString &errorMsg, int errorLine) { - m_error = true; - m_errorMsg = errorMsg; - m_errorLine = errorLine; -} - -void ParserPrivate::reset() -{ - m_error = false; - m_errorLine = 0; - m_errorMsg.clear(); - if (m_scanner) { - delete m_scanner; - m_scanner = 0; - } -} - -Parser::Parser() : - d(new ParserPrivate) -{ -} - -Parser::~Parser() -{ - delete d; -} - -QVariant Parser::parse (QIODevice* io, bool* ok) -{ - d->reset(); - - if (!io->isOpen()) { - if (!io->open(QIODevice::ReadOnly)) { - if (ok != 0) - *ok = false; - qCritical ("Error opening device"); - return QVariant(); - } - } - - if (!io->isReadable()) { - if (ok != 0) - *ok = false; - qCritical ("Device is not readable"); - io->close(); - return QVariant(); - } - - if (io->atEnd()) { - if (ok != 0) - *ok = false; - d->setError(QLatin1String("No data"), 0); - io->close(); - return QVariant(); - } - - d->m_scanner = new JSonScanner (io); - d->m_scanner->allowSpecialNumbers(d->m_specialNumbersAllowed); - yy::json_parser parser(d); - parser.parse(); - - delete d->m_scanner; - d->m_scanner = 0; - - if (ok != 0) - *ok = !d->m_error; - - io->close(); - return d->m_result; -} - -QVariant Parser::parse(const QByteArray& jsonString, bool* ok) { - QBuffer buffer; - buffer.open(QBuffer::ReadWrite | QBuffer::Text); - buffer.write(jsonString); - buffer.seek(0); - return parse (&buffer, ok); -} - -QString Parser::errorString() const -{ - return d->m_errorMsg; -} - -int Parser::errorLine() const -{ - return d->m_errorLine; -} - -void QJson::Parser::allowSpecialNumbers(bool allowSpecialNumbers) { - d->m_specialNumbersAllowed = allowSpecialNumbers; -} - -bool Parser::specialNumbersAllowed() const { - return d->m_specialNumbersAllowed; -} diff --git a/src/webui/qjson/parser.h b/src/webui/qjson/parser.h deleted file mode 100644 index c3132f506..000000000 --- a/src/webui/qjson/parser.h +++ /dev/null @@ -1,99 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QJSON_PARSER_H -#define QJSON_PARSER_H - -#include "qjson_export.h" - -QT_BEGIN_NAMESPACE -class QIODevice; -class QVariant; -QT_END_NAMESPACE - -/** - * Namespace used by QJson - */ -namespace QJson { - - class ParserPrivate; - - /** - * @brief Main class used to convert JSON data to QVariant objects - */ - class QJSON_EXPORT Parser - { - public: - Parser(); - ~Parser(); - - /** - * Read JSON string from the I/O Device and converts it to a QVariant object - * @param io Input output device - * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. - * @returns a QVariant object generated from the JSON string - */ - QVariant parse(QIODevice* io, bool* ok = 0); - - /** - * This is a method provided for convenience. - * @param jsonData data containing the JSON object representation - * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. - * @returns a QVariant object generated from the JSON string - * @sa errorString - * @sa errorLine - */ - QVariant parse(const QByteArray& jsonData, bool* ok = 0); - - /** - * This method returns the error message - * @returns a QString object containing the error message of the last parse operation - * @sa errorLine - */ - QString errorString() const; - - /** - * This method returns line number where the error occurred - * @returns the line number where the error occurred - * @sa errorString - */ - int errorLine() const; - - /** - * Sets whether special numbers (Infinity, -Infinity, NaN) are allowed as an extension to - * the standard - * @param allowSpecialNumbers new value of whether special numbers are allowed - * @sa specialNumbersAllowed - */ - void allowSpecialNumbers(bool allowSpecialNumbers); - - /** - * @returns whether special numbers (Infinity, -Infinity, NaN) are allowed - * @sa allowSpecialNumbers - */ - bool specialNumbersAllowed() const; - - private: - Q_DISABLE_COPY(Parser) - ParserPrivate* const d; - }; -} - -#endif // QJSON_PARSER_H diff --git a/src/webui/qjson/parser_p.h b/src/webui/qjson/parser_p.h deleted file mode 100644 index 5589a3897..000000000 --- a/src/webui/qjson/parser_p.h +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * Copyright (C) 2009 Michael Leupold - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QJSON_PARSER_P_H -#define QJSON_PARSER_P_H - -#include "parser.h" - -#include -#include - -class JSonScanner; - -namespace yy { - class json_parser; -} - -namespace QJson { - - class ParserPrivate - { - public: - ParserPrivate(); - ~ParserPrivate(); - - void reset(); - - void setError(const QString &errorMsg, int line); - - JSonScanner* m_scanner; - bool m_error; - int m_errorLine; - QString m_errorMsg; - QVariant m_result; - bool m_specialNumbersAllowed; - }; -} - -#endif // QJSON_PARSER_H diff --git a/src/webui/qjson/position.hh b/src/webui/qjson/position.hh deleted file mode 100644 index 3b33c2734..000000000 --- a/src/webui/qjson/position.hh +++ /dev/null @@ -1,172 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Positions for Bison parsers in C++ - - Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/** - ** \file position.hh - ** Define the yy::position class. - */ - -#ifndef YY_YY_POSITION_HH_INCLUDED -# define YY_YY_POSITION_HH_INCLUDED - -# include // std::max -# include -# include - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - - -namespace yy { -/* Line 36 of location.cc */ -#line 57 "position.hh" - /// Abstract a position. - class position - { - public: - - /// Construct a position. - explicit position (std::string* f = YY_NULL, - unsigned int l = 1u, - unsigned int c = 1u) - : filename (f) - , line (l) - , column (c) - { - } - - - /// Initialization. - void initialize (std::string* fn = YY_NULL, - unsigned int l = 1u, - unsigned int c = 1u) - { - filename = fn; - line = l; - column = c; - } - - /** \name Line and Column related manipulators - ** \{ */ - /// (line related) Advance to the COUNT next lines. - void lines (int count = 1) - { - column = 1u; - line += count; - } - - /// (column related) Advance to the COUNT next columns. - void columns (int count = 1) - { - column = std::max (1u, column + count); - } - /** \} */ - - /// File name to which this position refers. - std::string* filename; - /// Current line number. - unsigned int line; - /// Current column number. - unsigned int column; - }; - - /// Add and assign a position. - inline position& - operator+= (position& res, const int width) - { - res.columns (width); - return res; - } - - /// Add two position objects. - inline const position - operator+ (const position& begin, const int width) - { - position res = begin; - return res += width; - } - - /// Add and assign a position. - inline position& - operator-= (position& res, const int width) - { - return res += -width; - } - - /// Add two position objects. - inline const position - operator- (const position& begin, const int width) - { - return begin + -width; - } - - /// Compare two position objects. - inline bool - operator== (const position& pos1, const position& pos2) - { - return (pos1.line == pos2.line - && pos1.column == pos2.column - && (pos1.filename == pos2.filename - || (pos1.filename && pos2.filename - && *pos1.filename == *pos2.filename))); - } - - /// Compare two position objects. - inline bool - operator!= (const position& pos1, const position& pos2) - { - return !(pos1 == pos2); - } - - /** \brief Intercept output stream redirection. - ** \param ostr the destination output stream - ** \param pos a reference to the position to redirect - */ - template - inline std::basic_ostream& - operator<< (std::basic_ostream& ostr, const position& pos) - { - if (pos.filename) - ostr << *pos.filename << ':'; - return ostr << pos.line << '.' << pos.column; - } - - -} // yy -/* Line 148 of location.cc */ -#line 172 "position.hh" -#endif /* !YY_YY_POSITION_HH_INCLUDED */ diff --git a/src/webui/qjson/qjson.pri b/src/webui/qjson/qjson.pri deleted file mode 100644 index 79736d78e..000000000 --- a/src/webui/qjson/qjson.pri +++ /dev/null @@ -1,19 +0,0 @@ -INCLUDEPATH += $$PWD - -HEADERS += $$PWD/FlexLexer.h \ - $$PWD/stack.hh \ - $$PWD/position.hh \ - $$PWD/location.hh \ - $$PWD/json_parser.hh \ - $$PWD/json_scanner.h \ - $$PWD/parser.h \ - $$PWD/parser_p.h \ - $$PWD_debug.h \ - $$PWD_export.h \ - $$PWD/serializer.h - -SOURCES += $$PWD/json_parser.cc \ - $$PWD/json_scanner.cc \ - $$PWD/json_scanner.cpp \ - $$PWD/parser.cpp \ - $$PWD/serializer.cpp diff --git a/src/webui/qjson/qjson_debug.h b/src/webui/qjson/qjson_debug.h deleted file mode 100644 index 6036b2268..000000000 --- a/src/webui/qjson/qjson_debug.h +++ /dev/null @@ -1,34 +0,0 @@ -/* This file is part of qjson - * - * Copyright (C) 2009 Michael Leupold - * Copyright (C) 2013 Silvio Moioli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QJSON_DEBUG_H -#define QJSON_DEBUG_H - -#include - -// define qjsonDebug() -#ifdef QJSON_VERBOSE_DEBUG_OUTPUT - inline QDebug qjsonDebug() { return QDebug(QtDebugMsg); } -#else - #define qjsonDebug() if(false) QDebug(QtDebugMsg) -#endif - -#endif diff --git a/src/webui/qjson/qjson_export.h b/src/webui/qjson/qjson_export.h deleted file mode 100644 index 8feafbdf3..000000000 --- a/src/webui/qjson/qjson_export.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Bittorrent Client using Qt and libtorrent. - * Copyright (C) 2014 Vladimir Golovnev - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * In addition, as a special exception, the copyright holders give permission to - * link this program with the OpenSSL project's "OpenSSL" library (or with - * modified versions of it that use the same license as the "OpenSSL" library), - * and distribute the linked executables. You must obey the GNU General Public - * License in all respects for all of the code used other than "OpenSSL". If you - * modify file(s), you may extend this exception to your version of the file(s), - * but you are not obligated to do so. If you do not wish to do so, delete this - * exception statement from your version. - * - * Contact : glassez@yandex.ru - */ - -#ifndef QJSON_EXPORT_H -#define QJSON_EXPORT_H - -#include -#define QJSON_EXPORT - -#endif diff --git a/src/webui/qjson/serializer.cpp b/src/webui/qjson/serializer.cpp deleted file mode 100644 index ede97bd93..000000000 --- a/src/webui/qjson/serializer.cpp +++ /dev/null @@ -1,469 +0,0 @@ -/* This file is part of qjson - * - * Copyright (C) 2009 Till Adam - * Copyright (C) 2009 Flavio Castelli - * Copyright (C) 2016 Anton Kudryavtsev - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "serializer.h" - -#include -#include -#include - -// cmath does #undef for isnan and isinf macroses what can be defined in math.h -#if defined(Q_OS_SYMBIAN) || defined(Q_OS_ANDROID) || defined(Q_OS_BLACKBERRY) || defined(Q_OS_SOLARIS) -# include -#else -# include -#endif - -#ifdef Q_OS_SOLARIS -# ifndef isinf -# include -# define isinf(x) (!finite((x)) && (x)==(x)) -# endif -#endif - -#ifdef _MSC_VER // using MSVC compiler -#include -#endif - -using namespace QJson; - -class Serializer::SerializerPrivate { - public: - SerializerPrivate() : - specialNumbersAllowed(false), - indentMode(QJson::IndentNone), - doublePrecision(6) { - errorMessage.clear(); - } - QString errorMessage; - bool specialNumbersAllowed; - IndentMode indentMode; - int doublePrecision; - - QByteArray serialize( const QVariant &v, bool *ok, int indentLevel = 0); - - static QByteArray buildIndent(int spaces); - static QByteArray escapeString( const QString& str ); - static QByteArray join( const QList& list, const QByteArray& sep ); - static QByteArray join( const QList& list, char sep ); -}; - -QByteArray Serializer::SerializerPrivate::join( const QList& list, const QByteArray& sep ) { - QByteArray res; - Q_FOREACH( const QByteArray& i, list ) { - if ( !res.isEmpty() ) - res += sep; - res += i; - } - return res; -} - -QByteArray Serializer::SerializerPrivate::join( const QList& list, char sep ) { - QByteArray res; - Q_FOREACH( const QByteArray& i, list ) { - if ( !res.isEmpty() ) - res += sep; - res += i; - } - return res; -} - -QByteArray Serializer::SerializerPrivate::serialize( const QVariant &v, bool *ok, int indentLevel) -{ - QByteArray str; - const QVariant::Type type = v.type(); - - if ( ! v.isValid() ) { // invalid or null? - str = "null"; - } else if (( type == QVariant::List ) || ( type == QVariant::StringList )) { // an array or a stringlist? - const QVariantList list = v.toList(); - QList values; - Q_FOREACH( const QVariant& var, list ) - { - QByteArray serializedValue; - - serializedValue = serialize( var, ok, indentLevel+1); - - if ( !*ok ) { - break; - } - switch(indentMode) { - case QJson::IndentFull : - case QJson::IndentMedium : - case QJson::IndentMinimum : - values << serializedValue; - break; - case QJson::IndentCompact : - case QJson::IndentNone : - default: - values << serializedValue.trimmed(); - break; - } - } - - if (indentMode == QJson::IndentMedium || indentMode == QJson::IndentFull ) { - QByteArray indent = buildIndent(indentLevel); - str = indent + "[\n" + join( values, ",\n" ) + '\n' + indent + ']'; - } - else if (indentMode == QJson::IndentMinimum) { - QByteArray indent = buildIndent(indentLevel); - str = indent + "[\n" + join( values, ",\n" ) + '\n' + indent + ']'; - } - else if (indentMode == QJson::IndentCompact) { - str = '[' + join( values, "," ) + ']'; - } - else { - str = "[ " + join( values, ", " ) + " ]"; - } - - } else if ( type == QVariant::Map ) { // variant is a map? - const QVariantMap vmap = v.toMap(); - - if (indentMode == QJson::IndentMinimum) { - QByteArray indent = buildIndent(indentLevel); - str = indent + "{ "; - } - else if (indentMode == QJson::IndentMedium || indentMode == QJson::IndentFull) { - QByteArray indent = buildIndent(indentLevel); - QByteArray nextindent = buildIndent(indentLevel + 1); - str = indent + "{\n" + nextindent; - } - else if (indentMode == QJson::IndentCompact) { - str = "{"; - } - else { - str = "{ "; - } - - QList pairs; - for (QVariantMap::const_iterator it = vmap.begin(), end = vmap.end(); it != end; ++it) { - indentLevel++; - QByteArray serializedValue = serialize( it.value(), ok, indentLevel); - indentLevel--; - if ( !*ok ) { - break; - } - QByteArray key = escapeString( it.key() ); - QByteArray value = serializedValue.trimmed(); - if (indentMode == QJson::IndentCompact) { - pairs << key + ':' + value; - } else { - pairs << key + " : " + value; - } - } - - if (indentMode == QJson::IndentFull) { - QByteArray indent = buildIndent(indentLevel + 1); - str += join( pairs, ",\n" + indent); - } - else if (indentMode == QJson::IndentCompact) { - str += join( pairs, ',' ); - } - else { - str += join( pairs, ", " ); - } - - if (indentMode == QJson::IndentMedium || indentMode == QJson::IndentFull) { - QByteArray indent = buildIndent(indentLevel); - str += '\n' + indent + '}'; - } - else if (indentMode == QJson::IndentCompact) { - str += '}'; - } - else { - str += " }"; - } - - } else if ( type == QVariant::Hash ) { // variant is a hash? - const QVariantHash vhash = v.toHash(); - - if (indentMode == QJson::IndentMinimum) { - QByteArray indent = buildIndent(indentLevel); - str = indent + "{ "; - } - else if (indentMode == QJson::IndentMedium || indentMode == QJson::IndentFull) { - QByteArray indent = buildIndent(indentLevel); - QByteArray nextindent = buildIndent(indentLevel + 1); - str = indent + "{\n" + nextindent; - } - else if (indentMode == QJson::IndentCompact) { - str = "{"; - } - else { - str = "{ "; - } - - QList pairs; - for (QVariantHash::const_iterator it = vhash.begin(), end = vhash.end(); it != end; ++it) { - QByteArray serializedValue = serialize( it.value(), ok, indentLevel + 1); - - if ( !*ok ) { - break; - } - QByteArray key = escapeString( it.key() ); - QByteArray value = serializedValue.trimmed(); - if (indentMode == QJson::IndentCompact) { - pairs << key + ':' + value; - } else { - pairs << key + " : " + value; - } - } - - if (indentMode == QJson::IndentFull) { - QByteArray indent = buildIndent(indentLevel + 1); - str += join( pairs, ",\n" + indent); - } - else if (indentMode == QJson::IndentCompact) { - str += join( pairs, ',' ); - } - else { - str += join( pairs, ", " ); - } - - if (indentMode == QJson::IndentMedium || indentMode == QJson::IndentFull) { - QByteArray indent = buildIndent(indentLevel); - str += '\n' + indent + '}'; - } - else if (indentMode == QJson::IndentCompact) { - str += '}'; - } - else { - str += " }"; - } - - } else { - // Add indent, we may need to remove it later for some layouts - switch(indentMode) { - case QJson::IndentFull : - case QJson::IndentMedium : - case QJson::IndentMinimum : - str += buildIndent(indentLevel); - break; - case QJson::IndentCompact : - case QJson::IndentNone : - default: - break; - } - - if (( type == QVariant::String ) || ( type == QVariant::ByteArray )) { // a string or a byte array? - str += escapeString( v.toString() ); - } else if (( type == QVariant::Double) || ((QMetaType::Type)type == QMetaType::Float)) { // a double or a float? - const double value = v.toDouble(); - #if defined _WIN32 && !defined(Q_OS_SYMBIAN) - const bool special = _isnan(value) || !_finite(value); - #elif defined(Q_OS_SYMBIAN) || defined(Q_OS_ANDROID) || defined(Q_OS_BLACKBERRY) || defined(Q_OS_SOLARIS) - const bool special = isnan(value) || isinf(value); - #else - const bool special = std::isnan(value) || std::isinf(value); - #endif - if (special) { - if (specialNumbersAllowed) { - #if defined _WIN32 && !defined(Q_OS_SYMBIAN) - if (_isnan(value)) { - #elif defined(Q_OS_SYMBIAN) || defined(Q_OS_ANDROID) || defined(Q_OS_BLACKBERRY) || defined(Q_OS_SOLARIS) - if (isnan(value)) { - #else - if (std::isnan(value)) { - #endif - str += "NaN"; - } else { - if (value<0) { - str += '-'; - } - str += "Infinity"; - } - } else { - errorMessage += QLatin1String("Attempt to write NaN or infinity, which is not supported by json\n"); - *ok = false; - } - } else { - str = QByteArray::number( value , 'g', doublePrecision); - if( !str.contains( '.' ) && !str.contains( 'e' ) ) { - str += ".0"; - } - } - } else if ( type == QVariant::Bool ) { // boolean value? - str += ( v.toBool() ? "true" : "false" ); - } else if ( type == QVariant::ULongLong ) { // large unsigned number? - str += QByteArray::number( v.value() ); - } else if ( type == QVariant::UInt ) { // unsigned int number? - str += QByteArray::number( v.value() ); - } else if ( v.canConvert() ) { // any signed number? - str += QByteArray::number( v.value() ); - } else if ( v.canConvert() ) { // unsigned short number? - str += QByteArray::number( v.value() ); - } else if ( v.canConvert() ){ // can value be converted to string? - // this will catch QDate, QDateTime, QUrl, ... - str += escapeString( v.toString() ); - //TODO: catch other values like QImage, QRect, ... - } else { - *ok = false; - errorMessage += QLatin1String("Cannot serialize "); - errorMessage += v.toString(); - errorMessage += QLatin1String(" because type "); - errorMessage += QLatin1String(v.typeName()); - errorMessage += QLatin1String(" is not supported by QJson\n"); - } - } - if ( *ok ) - { - return str; - } - else - return QByteArray(); -} - -QByteArray Serializer::SerializerPrivate::buildIndent(int spaces) -{ - QByteArray indent; - if (spaces < 0) { - spaces = 0; - } - for (int i = 0; i < spaces; i++ ) { - indent += ' '; - } - return indent; -} - -QByteArray Serializer::SerializerPrivate::escapeString( const QString& str ) -{ - QByteArray result; - result.reserve(str.size() + 2); - result.append('\"'); - for (QString::const_iterator it = str.begin(), end = str.end(); it != end; ++it) { - ushort unicode = it->unicode(); - switch ( unicode ) { - case '\"': - result.append("\\\""); - break; - case '\\': - result.append("\\\\"); - break; - case '\b': - result.append("\\b"); - break; - case '\f': - result.append("\\f"); - break; - case '\n': - result.append("\\n"); - break; - case '\r': - result.append("\\r"); - break; - case '\t': - result.append("\\t"); - break; - default: - if ( unicode > 0x1F && unicode < 128 ) { - result.append(static_cast(unicode)); - } else { - char escaped[7]; - qsnprintf(escaped, sizeof(escaped)/sizeof(char), "\\u%04x", unicode); - result.append(escaped); - } - } - } - result.append('\"'); - return result; -} - -Serializer::Serializer() - : d( new SerializerPrivate ) -{ -} - -Serializer::~Serializer() { - delete d; -} - -void Serializer::serialize( const QVariant& v, QIODevice* io, bool* ok) -{ - Q_ASSERT( io ); - *ok = true; - - if (!io->isOpen()) { - if (!io->open(QIODevice::WriteOnly)) { - d->errorMessage = QLatin1String("Error opening device"); - *ok = false; - return; - } - } - - if (!io->isWritable()) { - d->errorMessage = QLatin1String("Device is not readable"); - io->close(); - *ok = false; - return; - } - - const QByteArray str = serialize( v, ok); - if (*ok && (io->write(str) != str.count())) { - *ok = false; - d->errorMessage = QLatin1String("Something went wrong while writing to IO device"); - } -} - -QByteArray Serializer::serialize( const QVariant &v) -{ - bool ok; - - return serialize(v, &ok); -} - -QByteArray Serializer::serialize( const QVariant &v, bool *ok) -{ - bool _ok = true; - d->errorMessage.clear(); - - if (ok) { - *ok = true; - } else { - ok = &_ok; - } - - return d->serialize(v, ok); -} - -void QJson::Serializer::allowSpecialNumbers(bool allow) { - d->specialNumbersAllowed = allow; -} - -bool QJson::Serializer::specialNumbersAllowed() const { - return d->specialNumbersAllowed; -} - -void QJson::Serializer::setIndentMode(IndentMode mode) { - d->indentMode = mode; -} - -void QJson::Serializer::setDoublePrecision(int precision) { - d->doublePrecision = precision; -} - -IndentMode QJson::Serializer::indentMode() const { - return d->indentMode; -} - -QString QJson::Serializer::errorMessage() const { - return d->errorMessage; -} - diff --git a/src/webui/qjson/serializer.h b/src/webui/qjson/serializer.h deleted file mode 100644 index 48dc9ae98..000000000 --- a/src/webui/qjson/serializer.h +++ /dev/null @@ -1,230 +0,0 @@ -/* This file is part of qjson - * - * Copyright (C) 2009 Till Adam - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QJSON_SERIALIZER_H -#define QJSON_SERIALIZER_H - -#include "qjson_export.h" - -QT_BEGIN_NAMESPACE -class QIODevice; -class QString; -class QVariant; -QT_END_NAMESPACE - -namespace QJson { - /** - @brief How the indentation should work. - \verbatim - none (default) : - { "foo" : 0, "foo1" : 1, "foo2" : [ { "bar" : 1, "foo" : 0, "foobar" : 0 }, { "bar" : 1, "foo" : 1, "foobar" : 1 } ], "foo3" : [ 1, 2, 3, 4, 5, 6 ] } - - compact : - {"foo":0,"foo1":1,"foo2":[{"bar":1,"foo":0,"foobar":0},{"bar":1,"foo":1,"foobar":1}],"foo3":[1,2,3,4,5,6]} - - minimum : - { "foo" : 0, "foo1" : 1, "foo2" : [ - { "bar" : 1, "foo" : 0, "foobar" : 0 }, - { "bar" : 1, "foo" : 1, "foobar" : 1 } - ], "foo3" : [ - 1, - 2, - 3, - 4, - 5, - 6 - ] } - - medium : - { - "foo" : 0, "foo1" : 1, "foo2" : [ - { - "bar" : 1, "foo" : 0, "foobar" : 0 - }, - { - "bar" : 1, "foo" : 1, "foobar" : 1 - } - ], "foo3" : [ - 1, - 2, - 3, - 4, - 5, - 6 - ] - } - - full : - { - "foo" : 0, - "foo1" : 1, - "foo2" : [ - { - "bar" : 1, - "foo" : 0, - "foobar" : 0 - }, - { - "bar" : 1, - "foo" : 1, - "foobar" : 1 - } - ], - "foo3" : [ - 1, - 2, - 3, - 4, - 5, - 6 - ] - } - - - \endverbatim - */ - enum IndentMode { - IndentNone, - IndentCompact, - IndentMinimum, - IndentMedium, - IndentFull - }; - /** - * @brief Main class used to convert QVariant objects to JSON data. - * - * QVariant objects are converted to a string containing the JSON data. - * - * - * Usage: - * - * \code - * QVariantList people; - * - * QVariantMap bob; - * bob.insert("Name", "Bob"); - * bob.insert("Phonenumber", 123); - * - * QVariantMap alice; - * alice.insert("Name", "Alice"); - * alice.insert("Phonenumber", 321); - * - * people << bob << alice; - * - * QJson::Serializer serializer; - * bool ok; - * QByteArray json = serializer.serialize(people, &ok); - * - * if (ok) { - * qDebug() << json; - * } else { - * qCritical() << "Something went wrong:" << serializer.errorMessage(); - * } - * \endcode - * - * The output will be: - * - * \code - * "[ { "Name" : "Bob", "Phonenumber" : 123 }, - * { "Name" : "Alice", "Phonenumber" : 321 } ]" - * \endcode - * - * It's possible to tune the indentation level of the resulting string. \sa setIndentMode - */ - class QJSON_EXPORT Serializer { - public: - Serializer(); - ~Serializer(); - - /** - * This method generates a textual JSON representation and outputs it to the - * passed in I/O Device. - * @param variant The JSON document in its in-memory representation as generated by the - * parser. - * @param out Input output device - * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true - */ - void serialize( const QVariant& variant, QIODevice* out, bool* ok); - - /** - * This is a method provided for convenience. It turns the passed in in-memory - * representation of the JSON document into a textual one, which is returned. - * If the returned string is empty, the document was empty. If it was null, there - * was a parsing error. - * - * @param variant The JSON document in its in-memory representation as generated by the - * parser. - * - * \deprecated This method is going to be removed with the next major release of QJson. - */ - QByteArray serialize( const QVariant& variant); - - /** - * This is a method provided for convenience. It turns the passed in in-memory - * representation of the JSON document into a textual one, which is returned. - * If the returned string is empty, the document was empty. If it was null, there - * was a parsing error. - * - * @param variant The JSON document in its in-memory representation as generated by the - * parser. - * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true - */ - QByteArray serialize( const QVariant& variant, bool *ok); - - /** - * Allow or disallow writing of NaN and/or Infinity (as an extension to QJson) - */ - void allowSpecialNumbers(bool allow); - - /** - * Is Nan and/or Infinity allowed? - */ - bool specialNumbersAllowed() const; - - /** - * set output indentation mode as defined in QJson::IndentMode - */ - void setIndentMode(IndentMode mode = QJson::IndentNone); - - - /** - * set double precision used while converting Double - * \sa QByteArray::number - */ - void setDoublePrecision(int precision); - - /** - * Returns one of the indentation modes defined in QJson::IndentMode - */ - IndentMode indentMode() const; - - /** - * Returns the error message - */ - QString errorMessage() const; - - private: - Q_DISABLE_COPY(Serializer) - class SerializerPrivate; - SerializerPrivate* const d; - }; -} - -#endif // QJSON_SERIALIZER_H diff --git a/src/webui/qjson/stack.hh b/src/webui/qjson/stack.hh deleted file mode 100644 index 590accbaf..000000000 --- a/src/webui/qjson/stack.hh +++ /dev/null @@ -1,133 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Stack handling for Bison parsers in C++ - - Copyright (C) 2002-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/** - ** \file stack.hh - ** Define the yy::stack class. - */ - -#ifndef YY_YY_STACK_HH_INCLUDED -# define YY_YY_STACK_HH_INCLUDED - -# include - - -namespace yy { -/* Line 34 of stack.hh */ -#line 47 "stack.hh" - template > - class stack - { - public: - // Hide our reversed order. - typedef typename S::reverse_iterator iterator; - typedef typename S::const_reverse_iterator const_iterator; - - stack () : seq_ () - { - } - - stack (unsigned int n) : seq_ (n) - { - } - - inline - T& - operator [] (unsigned int i) - { - return seq_[i]; - } - - inline - const T& - operator [] (unsigned int i) const - { - return seq_[i]; - } - - inline - void - push (const T& t) - { - seq_.push_front (t); - } - - inline - void - pop (unsigned int n = 1) - { - for (; n; --n) - seq_.pop_front (); - } - - inline - unsigned int - height () const - { - return seq_.size (); - } - - inline const_iterator begin () const { return seq_.rbegin (); } - inline const_iterator end () const { return seq_.rend (); } - - private: - S seq_; - }; - - /// Present a slice of the top of a stack. - template > - class slice - { - public: - slice (const S& stack, unsigned int range) - : stack_ (stack) - , range_ (range) - { - } - - inline - const T& - operator [] (unsigned int i) const - { - return stack_[range_ - i]; - } - - private: - const S& stack_; - unsigned int range_; - }; - -} // yy -/* Line 116 of stack.hh */ -#line 132 "stack.hh" - -#endif /* !YY_YY_STACK_HH_INCLUDED */ diff --git a/src/webui/webui.pri b/src/webui/webui.pri index b6e207e45..e257d1fc1 100644 --- a/src/webui/webui.pri +++ b/src/webui/webui.pri @@ -15,10 +15,4 @@ SOURCES += \ $$PWD/webapplication.cpp \ $$PWD/abstractwebapplication.cpp -# QJson JSON parser/serializer for using with Qt4 -lessThan(QT_MAJOR_VERSION, 5) { - !usesystemqjson: include(qjson/qjson.pri) - else: DEFINES += USE_SYSTEM_QJSON -} - RESOURCES += $$PWD/webui.qrc