diff --git a/CMakeLists.txt b/CMakeLists.txt index 21874bf30..3430f6f58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -313,6 +313,7 @@ set(merged_compile_definitions_public ${target_specific_public_definitions} ) set(merged_compile_definitions_private + -DOSMAND_USE_HARFBUZZ ${target_specific_private_definitions} ) set(merged_include_dirs_private diff --git a/externals/freetype/CMakeLists.txt b/externals/freetype/CMakeLists.txt index 8d95c1432..50e1fc7e9 100644 --- a/externals/freetype/CMakeLists.txt +++ b/externals/freetype/CMakeLists.txt @@ -2,38 +2,87 @@ project(freetype2) prepare_upstream() +set(target_specific_sources "") +if (CMAKE_TARGET_OS STREQUAL "macosx" OR CMAKE_TARGET_OS STREQUAL "ios" OR CMAKE_TARGET_OS STREQUAL "linux" OR CMAKE_TARGET_OS STREQUAL "android") + set(target_specific_sources "${target_specific_sources}" + "upstream.patched/builds/unix/ftsystem.c" + ) +elseif (CMAKE_TARGET_OS STREQUAL "windows") + set(target_specific_sources "${target_specific_sources}" + "upstream.patched/builds/windows/ftsystem.c" + ) +else () + set(target_specific_sources "${target_specific_sources}" + "upstream.patched/src/base/ftsystem.c" + ) +endif () + add_library(freetype2_static STATIC + "upstream.patched/src/autofit/autofit.c" "upstream.patched/src/base/ftbase.c" "upstream.patched/src/base/ftbbox.c" + "upstream.patched/src/base/ftbdf.c" "upstream.patched/src/base/ftbitmap.c" + "upstream.patched/src/base/ftcid.c" "upstream.patched/src/base/ftfstype.c" "upstream.patched/src/base/ftgasp.c" "upstream.patched/src/base/ftglyph.c" + "upstream.patched/src/base/ftgxval.c" "upstream.patched/src/base/ftinit.c" - "upstream.patched/src/base/ftlcdfil.c" + "upstream.patched/src/base/ftmm.c" + "upstream.patched/src/base/ftotval.c" + "upstream.patched/src/base/ftpatent.c" + "upstream.patched/src/base/ftpfr.c" "upstream.patched/src/base/ftstroke.c" - "upstream.patched/src/base/ftsystem.c" + "upstream.patched/src/base/ftsynth.c" "upstream.patched/src/base/fttype1.c" - "upstream.patched/src/base/ftxf86.c" - "upstream.patched/src/autofit/autofit.c" + "upstream.patched/src/base/ftwinfnt.c" "upstream.patched/src/bdf/bdf.c" + "upstream.patched/src/bzip2/ftbzip2.c" + "upstream.patched/src/cache/ftcache.c" "upstream.patched/src/cff/cff.c" + "upstream.patched/src/cid/type1cid.c" + "upstream.patched/src/gzip/ftgzip.c" + "upstream.patched/src/lzw/ftlzw.c" + "upstream.patched/src/pcf/pcf.c" + "upstream.patched/src/pfr/pfr.c" + "upstream.patched/src/psaux/psaux.c" "upstream.patched/src/pshinter/pshinter.c" "upstream.patched/src/psnames/psnames.c" "upstream.patched/src/raster/raster.c" + "upstream.patched/src/sdf/sdf.c" "upstream.patched/src/sfnt/sfnt.c" "upstream.patched/src/smooth/smooth.c" "upstream.patched/src/truetype/truetype.c" + "upstream.patched/src/type1/type1.c" + "upstream.patched/src/type42/type42.c" + "upstream.patched/src/winfonts/winfnt.c" + "upstream.patched/src/base/ftdebug.c" + ${target_specific_sources} ) +add_dependencies(freetype2_static + z_static +) + +check_include_file("unistd.h" HAVE_UNISTD_H) +check_include_file("fcntl.h" HAVE_FCNTL_H) +configure_file("ftconfig.h.in" "ftconfig-override.h") target_compile_definitions(freetype2_static PRIVATE -DFT2_BUILD_LIBRARY -DFT_CONFIG_MODULES_H= + -DFT_CONFIG_OPTIONS_H= + -DFT_CONFIG_CONFIG_H= ) target_include_directories(freetype2_static PRIVATE "." + "${CMAKE_CURRENT_BINARY_DIR}" PUBLIC "upstream.patched/include" ) +target_link_libraries(freetype2_static + LINK_PUBLIC + z_static +) diff --git a/externals/freetype/configure.sh b/externals/freetype/configure.sh index 78cdc0845..7b4f16a5e 100755 --- a/externals/freetype/configure.sh +++ b/externals/freetype/configure.sh @@ -8,5 +8,5 @@ fi SRCLOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SRCLOC/../../../build/utils/functions.sh" -prepareUpstreamFromTarArchive "$SRCLOC" "http://builder.osmand.net/dependencies-mirror/freetype-2.5.0.1.tar.bz2" +prepareUpstreamFromGit "$SRCLOC" "https://github.com/freetype/freetype.git" "12ef831fc314518bff45278008a568608501a8e4" patchUpstream "$SRCLOC" diff --git a/externals/freetype/ftconfig.h.in b/externals/freetype/ftconfig.h.in new file mode 100644 index 000000000..046ffa6ae --- /dev/null +++ b/externals/freetype/ftconfig.h.in @@ -0,0 +1,15 @@ +#ifndef FTCONFIG_H_ +#define FTCONFIG_H_ + +#include +#include FT_CONFIG_OPTIONS_H +#include FT_CONFIG_STANDARD_LIBRARY_H + +#cmakedefine HAVE_UNISTD_H +#cmakedefine HAVE_FCNTL_H + +#include +#include +#include + +#endif /* FTCONFIG_H_ */ diff --git a/externals/freetype/ftmodule-override.h b/externals/freetype/ftmodule-override.h index 5f0d1b3fe..08bfb386c 100644 --- a/externals/freetype/ftmodule-override.h +++ b/externals/freetype/ftmodule-override.h @@ -6,5 +6,3 @@ FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) diff --git a/externals/freetype/ftoption-override.h b/externals/freetype/ftoption-override.h new file mode 100644 index 000000000..b7312aa94 --- /dev/null +++ b/externals/freetype/ftoption-override.h @@ -0,0 +1,1011 @@ +/**************************************************************************** + * + * ftoption.h + * + * User-selectable configuration macros (specification only). + * + * Copyright (C) 1996-2021 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + +#ifndef FTOPTION_H_ +#define FTOPTION_H_ + + +#include + + +FT_BEGIN_HEADER + + /************************************************************************** + * + * USER-SELECTABLE CONFIGURATION MACROS + * + * This file contains the default configuration macro definitions for a + * standard build of the FreeType library. There are three ways to use + * this file to build project-specific versions of the library: + * + * - You can modify this file by hand, but this is not recommended in + * cases where you would like to build several versions of the library + * from a single source directory. + * + * - You can put a copy of this file in your build directory, more + * precisely in `$BUILD/freetype/config/ftoption.h`, where `$BUILD` is + * the name of a directory that is included _before_ the FreeType include + * path during compilation. + * + * The default FreeType Makefiles use the build directory + * `builds/` by default, but you can easily change that for your + * own projects. + * + * - Copy the file to `$BUILD/ft2build.h` and modify it + * slightly to pre-define the macro `FT_CONFIG_OPTIONS_H` used to locate + * this file during the build. For example, + * + * ``` + * #define FT_CONFIG_OPTIONS_H + * #include + * ``` + * + * will use `$BUILD/myftoptions.h` instead of this file for macro + * definitions. + * + * Note also that you can similarly pre-define the macro + * `FT_CONFIG_MODULES_H` used to locate the file listing of the modules + * that are statically linked to the library at compile time. By + * default, this file is ``. + * + * We highly recommend using the third method whenever possible. + * + */ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*#************************************************************************ + * + * If you enable this configuration option, FreeType recognizes an + * environment variable called `FREETYPE_PROPERTIES`, which can be used to + * control the various font drivers and modules. The controllable + * properties are listed in the section @properties. + * + * You have to undefine this configuration option on platforms that lack + * the concept of environment variables (and thus don't have the `getenv` + * function), for example Windows CE. + * + * `FREETYPE_PROPERTIES` has the following syntax form (broken here into + * multiple lines for better readability). + * + * ``` + * + * ':' + * '=' + * + * ':' + * '=' + * ... + * ``` + * + * Example: + * + * ``` + * FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ + * cff:no-stem-darkening=1 + * ``` + * + */ +#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + + + /************************************************************************** + * + * Uncomment the line below if you want to activate LCD rendering + * technology similar to ClearType in this build of the library. This + * technology triples the resolution in the direction color subpixels. To + * mitigate color fringes inherent to this technology, you also need to + * explicitly set up LCD filtering. + * + * When this macro is not defined, FreeType offers alternative LCD + * rendering technology that produces excellent output. + */ +/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ + + + /************************************************************************** + * + * Many compilers provide a non-ANSI 64-bit data type that can be used by + * FreeType to speed up some computations. However, this will create some + * problems when compiling the library in strict ANSI mode. + * + * For this reason, the use of 64-bit integers is normally disabled when + * the `__STDC__` macro is defined. You can however disable this by + * defining the macro `FT_CONFIG_OPTION_FORCE_INT64` here. + * + * For most compilers, this will only create compilation warnings when + * building the library. + * + * ObNote: The compiler-specific 64-bit integers are detected in the + * file `ftconfig.h` either statically or through the `configure` + * script on supported platforms. + */ +#undef FT_CONFIG_OPTION_FORCE_INT64 + + + /************************************************************************** + * + * If this macro is defined, do not try to use an assembler version of + * performance-critical functions (e.g., @FT_MulFix). You should only do + * that to verify that the assembler function works properly, or to execute + * benchmark tests of the various implementations. + */ +/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ + + + /************************************************************************** + * + * If this macro is defined, try to use an inlined assembler version of the + * @FT_MulFix function, which is a 'hotspot' when loading and hinting + * glyphs, and which should be executed as fast as possible. + * + * Note that if your compiler or CPU is not supported, this will default to + * the standard and portable implementation found in `ftcalc.c`. + */ +#define FT_CONFIG_OPTION_INLINE_MULFIX + + + /************************************************************************** + * + * LZW-compressed file support. + * + * FreeType now handles font files that have been compressed with the + * `compress` program. This is mostly used to parse many of the PCF + * files that come with various X11 distributions. The implementation + * uses NetBSD's `zopen` to partially uncompress the file on the fly (see + * `src/lzw/ftgzip.c`). + * + * Define this macro if you want to enable this 'feature'. + */ +#define FT_CONFIG_OPTION_USE_LZW + + + /************************************************************************** + * + * Gzip-compressed file support. + * + * FreeType now handles font files that have been compressed with the + * `gzip` program. This is mostly used to parse many of the PCF files + * that come with XFree86. The implementation uses 'zlib' to partially + * uncompress the file on the fly (see `src/gzip/ftgzip.c`). + * + * Define this macro if you want to enable this 'feature'. See also the + * macro `FT_CONFIG_OPTION_SYSTEM_ZLIB` below. + */ +#define FT_CONFIG_OPTION_USE_ZLIB + + + /************************************************************************** + * + * ZLib library selection + * + * This macro is only used when `FT_CONFIG_OPTION_USE_ZLIB` is defined. + * It allows FreeType's 'ftgzip' component to link to the system's + * installation of the ZLib library. This is useful on systems like + * Unix or VMS where it generally is already available. + * + * If you let it undefined, the component will use its own copy of the + * zlib sources instead. These have been modified to be included + * directly within the component and **not** export external function + * names. This allows you to link any program with FreeType _and_ ZLib + * without linking conflicts. + * + * Do not `#undef` this macro here since the build system might define + * it for certain configurations only. + * + * If you use a build system like cmake or the `configure` script, + * options set by those programs have precedence, overwriting the value + * here with the configured one. + */ +#define FT_CONFIG_OPTION_SYSTEM_ZLIB + + + /************************************************************************** + * + * Bzip2-compressed file support. + * + * FreeType now handles font files that have been compressed with the + * `bzip2` program. This is mostly used to parse many of the PCF files + * that come with XFree86. The implementation uses `libbz2` to partially + * uncompress the file on the fly (see `src/bzip2/ftbzip2.c`). Contrary + * to gzip, bzip2 currently is not included and need to use the system + * available bzip2 implementation. + * + * Define this macro if you want to enable this 'feature'. + * + * If you use a build system like cmake or the `configure` script, + * options set by those programs have precedence, overwriting the value + * here with the configured one. + */ +/* #define FT_CONFIG_OPTION_USE_BZIP2 */ + + + /************************************************************************** + * + * Define to disable the use of file stream functions and types, `FILE`, + * `fopen`, etc. Enables the use of smaller system libraries on embedded + * systems that have multiple system libraries, some with or without file + * stream support, in the cases where file stream support is not necessary + * such as memory loading of font files. + */ +/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ + + + /************************************************************************** + * + * PNG bitmap support. + * + * FreeType now handles loading color bitmap glyphs in the PNG format. + * This requires help from the external libpng library. Uncompressed + * color bitmaps do not need any external libraries and will be supported + * regardless of this configuration. + * + * Define this macro if you want to enable this 'feature'. + * + * If you use a build system like cmake or the `configure` script, + * options set by those programs have precedence, overwriting the value + * here with the configured one. + */ +/* #define FT_CONFIG_OPTION_USE_PNG */ + + + /************************************************************************** + * + * HarfBuzz support. + * + * FreeType uses the HarfBuzz library to improve auto-hinting of OpenType + * fonts. If available, many glyphs not directly addressable by a font's + * character map will be hinted also. + * + * Define this macro if you want to enable this 'feature'. + * + * If you use a build system like cmake or the `configure` script, + * options set by those programs have precedence, overwriting the value + * here with the configured one. + */ +/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */ + + + /************************************************************************** + * + * Brotli support. + * + * FreeType uses the Brotli library to provide support for decompressing + * WOFF2 streams. + * + * Define this macro if you want to enable this 'feature'. + * + * If you use a build system like cmake or the `configure` script, + * options set by those programs have precedence, overwriting the value + * here with the configured one. + */ +/* #define FT_CONFIG_OPTION_USE_BROTLI */ + + + /************************************************************************** + * + * Glyph Postscript Names handling + * + * By default, FreeType 2 is compiled with the 'psnames' module. This + * module is in charge of converting a glyph name string into a Unicode + * value, or return a Macintosh standard glyph name for the use with the + * TrueType 'post' table. + * + * Undefine this macro if you do not want 'psnames' compiled in your + * build of FreeType. This has the following effects: + * + * - The TrueType driver will provide its own set of glyph names, if you + * build it to support postscript names in the TrueType 'post' table, + * but will not synthesize a missing Unicode charmap. + * + * - The Type~1 driver will not be able to synthesize a Unicode charmap + * out of the glyphs found in the fonts. + * + * You would normally undefine this configuration macro when building a + * version of FreeType that doesn't contain a Type~1 or CFF driver. + */ +#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES + + + /************************************************************************** + * + * Postscript Names to Unicode Values support + * + * By default, FreeType~2 is built with the 'psnames' module compiled in. + * Among other things, the module is used to convert a glyph name into a + * Unicode value. This is especially useful in order to synthesize on + * the fly a Unicode charmap from the CFF/Type~1 driver through a big + * table named the 'Adobe Glyph List' (AGL). + * + * Undefine this macro if you do not want the Adobe Glyph List compiled + * in your 'psnames' module. The Type~1 driver will not be able to + * synthesize a Unicode charmap out of the glyphs found in the fonts. + */ +#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + + + /************************************************************************** + * + * Support for Mac fonts + * + * Define this macro if you want support for outline fonts in Mac format + * (mac dfont, mac resource, macbinary containing a mac resource) on + * non-Mac platforms. + * + * Note that the 'FOND' resource isn't checked. + */ +#define FT_CONFIG_OPTION_MAC_FONTS + + + /************************************************************************** + * + * Guessing methods to access embedded resource forks + * + * Enable extra Mac fonts support on non-Mac platforms (e.g., GNU/Linux). + * + * Resource forks which include fonts data are stored sometimes in + * locations which users or developers don't expected. In some cases, + * resource forks start with some offset from the head of a file. In + * other cases, the actual resource fork is stored in file different from + * what the user specifies. If this option is activated, FreeType tries + * to guess whether such offsets or different file names must be used. + * + * Note that normal, direct access of resource forks is controlled via + * the `FT_CONFIG_OPTION_MAC_FONTS` option. + */ +#ifdef FT_CONFIG_OPTION_MAC_FONTS +#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK +#endif + + + /************************************************************************** + * + * Allow the use of `FT_Incremental_Interface` to load typefaces that + * contain no glyph data, but supply it via a callback function. This is + * required by clients supporting document formats which supply font data + * incrementally as the document is parsed, such as the Ghostscript + * interpreter for the PostScript language. + */ +#define FT_CONFIG_OPTION_INCREMENTAL + + + /************************************************************************** + * + * The size in bytes of the render pool used by the scan-line converter to + * do all of its work. + */ +#define FT_RENDER_POOL_SIZE 16384L + + + /************************************************************************** + * + * FT_MAX_MODULES + * + * The maximum number of modules that can be registered in a single + * FreeType library object. 32~is the default. + */ +#define FT_MAX_MODULES 32 + + + /************************************************************************** + * + * Debug level + * + * FreeType can be compiled in debug or trace mode. In debug mode, + * errors are reported through the 'ftdebug' component. In trace mode, + * additional messages are sent to the standard output during execution. + * + * Define `FT_DEBUG_LEVEL_ERROR` to build the library in debug mode. + * Define `FT_DEBUG_LEVEL_TRACE` to build it in trace mode. + * + * Don't define any of these macros to compile in 'release' mode! + * + * Do not `#undef` these macros here since the build system might define + * them for certain configurations only. + */ +/* #define FT_DEBUG_LEVEL_ERROR */ +/* #define FT_DEBUG_LEVEL_TRACE */ + + + /************************************************************************** + * + * Logging + * + * Compiling FreeType in debug or trace mode makes FreeType write error + * and trace log messages to `stderr`. Enabling this macro + * automatically forces the `FT_DEBUG_LEVEL_ERROR` and + * `FT_DEBUG_LEVEL_TRACE` macros and allows FreeType to write error and + * trace log messages to a file instead of `stderr`. For writing logs + * to a file, FreeType uses an the external `dlg` library (the source + * code is in `src/dlg`). + * + * This option needs a C99 compiler. + */ +/* #define FT_DEBUG_LOGGING */ + + + /************************************************************************** + * + * Autofitter debugging + * + * If `FT_DEBUG_AUTOFIT` is defined, FreeType provides some means to + * control the autofitter behaviour for debugging purposes with global + * boolean variables (consequently, you should **never** enable this + * while compiling in 'release' mode): + * + * ``` + * _af_debug_disable_horz_hints + * _af_debug_disable_vert_hints + * _af_debug_disable_blue_hints + * ``` + * + * Additionally, the following functions provide dumps of various + * internal autofit structures to stdout (using `printf`): + * + * ``` + * af_glyph_hints_dump_points + * af_glyph_hints_dump_segments + * af_glyph_hints_dump_edges + * af_glyph_hints_get_num_segments + * af_glyph_hints_get_segment_offset + * ``` + * + * As an argument, they use another global variable: + * + * ``` + * _af_debug_hints + * ``` + * + * Please have a look at the `ftgrid` demo program to see how those + * variables and macros should be used. + * + * Do not `#undef` these macros here since the build system might define + * them for certain configurations only. + */ +/* #define FT_DEBUG_AUTOFIT */ + + + /************************************************************************** + * + * Memory Debugging + * + * FreeType now comes with an integrated memory debugger that is capable + * of detecting simple errors like memory leaks or double deletes. To + * compile it within your build of the library, you should define + * `FT_DEBUG_MEMORY` here. + * + * Note that the memory debugger is only activated at runtime when when + * the _environment_ variable `FT2_DEBUG_MEMORY` is defined also! + * + * Do not `#undef` this macro here since the build system might define it + * for certain configurations only. + */ +/* #define FT_DEBUG_MEMORY */ + + + /************************************************************************** + * + * Module errors + * + * If this macro is set (which is _not_ the default), the higher byte of + * an error code gives the module in which the error has occurred, while + * the lower byte is the real error code. + * + * Setting this macro makes sense for debugging purposes only, since it + * would break source compatibility of certain programs that use + * FreeType~2. + * + * More details can be found in the files `ftmoderr.h` and `fterrors.h`. + */ +#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS + + + /************************************************************************** + * + * Error Strings + * + * If this macro is set, `FT_Error_String` will return meaningful + * descriptions. This is not enabled by default to reduce the overall + * size of FreeType. + * + * More details can be found in the file `fterrors.h`. + */ +/* #define FT_CONFIG_OPTION_ERROR_STRINGS */ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_EMBEDDED_BITMAPS` if you want to support + * embedded bitmaps in all formats using the 'sfnt' module (namely + * TrueType~& OpenType). + */ +#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_COLOR_LAYERS` if you want to support colored + * outlines (from the 'COLR'/'CPAL' tables) in all formats using the 'sfnt' + * module (namely TrueType~& OpenType). + */ +#define TT_CONFIG_OPTION_COLOR_LAYERS + + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_POSTSCRIPT_NAMES` if you want to be able to + * load and enumerate the glyph Postscript names in a TrueType or OpenType + * file. + * + * Note that when you do not compile the 'psnames' module by undefining the + * above `FT_CONFIG_OPTION_POSTSCRIPT_NAMES`, the 'sfnt' module will + * contain additional code used to read the PS Names table from a font. + * + * (By default, the module uses 'psnames' to extract glyph names.) + */ +#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES + + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_SFNT_NAMES` if your applications need to access + * the internal name table in a SFNT-based format like TrueType or + * OpenType. The name table contains various strings used to describe the + * font, like family name, copyright, version, etc. It does not contain + * any glyph name though. + * + * Accessing SFNT names is done through the functions declared in + * `ftsnames.h`. + */ +#define TT_CONFIG_OPTION_SFNT_NAMES + + + /************************************************************************** + * + * TrueType CMap support + * + * Here you can fine-tune which TrueType CMap table format shall be + * supported. + */ +#define TT_CONFIG_CMAP_FORMAT_0 +#define TT_CONFIG_CMAP_FORMAT_2 +#define TT_CONFIG_CMAP_FORMAT_4 +#define TT_CONFIG_CMAP_FORMAT_6 +#define TT_CONFIG_CMAP_FORMAT_8 +#define TT_CONFIG_CMAP_FORMAT_10 +#define TT_CONFIG_CMAP_FORMAT_12 +#define TT_CONFIG_CMAP_FORMAT_13 +#define TT_CONFIG_CMAP_FORMAT_14 + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_BYTECODE_INTERPRETER` if you want to compile a + * bytecode interpreter in the TrueType driver. + * + * By undefining this, you will only compile the code necessary to load + * TrueType glyphs without hinting. + * + * Do not `#undef` this macro here, since the build system might define it + * for certain configurations only. + */ +#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_SUBPIXEL_HINTING` if you want to compile + * subpixel hinting support into the TrueType driver. This modifies the + * TrueType hinting mechanism when anything but `FT_RENDER_MODE_MONO` is + * requested. + * + * In particular, it modifies the bytecode interpreter to interpret (or + * not) instructions in a certain way so that all TrueType fonts look like + * they do in a Windows ClearType (DirectWrite) environment. See [1] for a + * technical overview on what this means. See `ttinterp.h` for more + * details on the LEAN option. + * + * There are three possible values. + * + * Value 1: + * This value is associated with the 'Infinality' moniker, contributed by + * an individual nicknamed Infinality with the goal of making TrueType + * fonts render better than on Windows. A high amount of configurability + * and flexibility, down to rules for single glyphs in fonts, but also + * very slow. Its experimental and slow nature and the original + * developer losing interest meant that this option was never enabled in + * default builds. + * + * The corresponding interpreter version is v38. + * + * Value 2: + * The new default mode for the TrueType driver. The Infinality code + * base was stripped to the bare minimum and all configurability removed + * in the name of speed and simplicity. The configurability was mainly + * aimed at legacy fonts like 'Arial', 'Times New Roman', or 'Courier'. + * Legacy fonts are fonts that modify vertical stems to achieve clean + * black-and-white bitmaps. The new mode focuses on applying a minimal + * set of rules to all fonts indiscriminately so that modern and web + * fonts render well while legacy fonts render okay. + * + * The corresponding interpreter version is v40. + * + * Value 3: + * Compile both, making both v38 and v40 available (the latter is the + * default). + * + * By undefining these, you get rendering behavior like on Windows without + * ClearType, i.e., Windows XP without ClearType enabled and Win9x + * (interpreter version v35). Or not, depending on how much hinting blood + * and testing tears the font designer put into a given font. If you + * define one or both subpixel hinting options, you can switch between + * between v35 and the ones you define (using `FT_Property_Set`). + * + * This option requires `TT_CONFIG_OPTION_BYTECODE_INTERPRETER` to be + * defined. + * + * [1] + * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx + */ +/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */ +#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 +/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */ + + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED` to compile the + * TrueType glyph loader to use Apple's definition of how to handle + * component offsets in composite glyphs. + * + * Apple and MS disagree on the default behavior of component offsets in + * composites. Apple says that they should be scaled by the scaling + * factors in the transformation matrix (roughly, it's more complex) while + * MS says they should not. OpenType defines two bits in the composite + * flags array which can be used to disambiguate, but old fonts will not + * have them. + * + * https://www.microsoft.com/typography/otspec/glyf.htm + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html + */ +#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED + + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_GX_VAR_SUPPORT` if you want to include support + * for Apple's distortable font technology ('fvar', 'gvar', 'cvar', and + * 'avar' tables). Tagged 'Font Variations', this is now part of OpenType + * also. This has many similarities to Type~1 Multiple Masters support. + */ +#define TT_CONFIG_OPTION_GX_VAR_SUPPORT + + + /************************************************************************** + * + * Define `TT_CONFIG_OPTION_BDF` if you want to include support for an + * embedded 'BDF~' table within SFNT-based bitmap formats. + */ +#define TT_CONFIG_OPTION_BDF + + + /************************************************************************** + * + * Option `TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES` controls the maximum + * number of bytecode instructions executed for a single run of the + * bytecode interpreter, needed to prevent infinite loops. You don't want + * to change this except for very special situations (e.g., making a + * library fuzzer spend less time to handle broken fonts). + * + * It is not expected that this value is ever modified by a configuring + * script; instead, it gets surrounded with `#ifndef ... #endif` so that + * the value can be set as a preprocessor option on the compiler's command + * line. + */ +#ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES +#define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L +#endif + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************** + * + * `T1_MAX_DICT_DEPTH` is the maximum depth of nest dictionaries and arrays + * in the Type~1 stream (see `t1load.c`). A minimum of~4 is required. + */ +#define T1_MAX_DICT_DEPTH 5 + + + /************************************************************************** + * + * `T1_MAX_SUBRS_CALLS` details the maximum number of nested sub-routine + * calls during glyph loading. + */ +#define T1_MAX_SUBRS_CALLS 16 + + + /************************************************************************** + * + * `T1_MAX_CHARSTRING_OPERANDS` is the charstring stack's capacity. A + * minimum of~16 is required. + * + * The Chinese font 'MingTiEG-Medium' (covering the CNS 11643 character + * set) needs 256. + */ +#define T1_MAX_CHARSTRINGS_OPERANDS 256 + + + /************************************************************************** + * + * Define this configuration macro if you want to prevent the compilation + * of the 't1afm' module, which is in charge of reading Type~1 AFM files + * into an existing face. Note that if set, the Type~1 driver will be + * unable to produce kerning distances. + */ +#undef T1_CONFIG_OPTION_NO_AFM + + + /************************************************************************** + * + * Define this configuration macro if you want to prevent the compilation + * of the Multiple Masters font support in the Type~1 driver. + */ +#undef T1_CONFIG_OPTION_NO_MM_SUPPORT + + + /************************************************************************** + * + * `T1_CONFIG_OPTION_OLD_ENGINE` controls whether the pre-Adobe Type~1 + * engine gets compiled into FreeType. If defined, it is possible to + * switch between the two engines using the `hinting-engine` property of + * the 'type1' driver module. + */ +/* #define T1_CONFIG_OPTION_OLD_ENGINE */ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** C F F D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************** + * + * Using `CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4}` it is + * possible to set up the default values of the four control points that + * define the stem darkening behaviour of the (new) CFF engine. For more + * details please read the documentation of the `darkening-parameters` + * property (file `ftdriver.h`), which allows the control at run-time. + * + * Do **not** undefine these macros! + */ +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0 + + + /************************************************************************** + * + * `CFF_CONFIG_OPTION_OLD_ENGINE` controls whether the pre-Adobe CFF engine + * gets compiled into FreeType. If defined, it is possible to switch + * between the two engines using the `hinting-engine` property of the 'cff' + * driver module. + */ +/* #define CFF_CONFIG_OPTION_OLD_ENGINE */ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** P C F D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************** + * + * There are many PCF fonts just called 'Fixed' which look completely + * different, and which have nothing to do with each other. When selecting + * 'Fixed' in KDE or Gnome one gets results that appear rather random, the + * style changes often if one changes the size and one cannot select some + * fonts at all. This option makes the 'pcf' module prepend the foundry + * name (plus a space) to the family name. + * + * We also check whether we have 'wide' characters; all put together, we + * get family names like 'Sony Fixed' or 'Misc Fixed Wide'. + * + * If this option is activated, it can be controlled with the + * `no-long-family-names` property of the 'pcf' driver module. + */ +/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /************************************************************************** + * + * Compile 'autofit' module with CJK (Chinese, Japanese, Korean) script + * support. + */ +#define AF_CONFIG_OPTION_CJK + + + /************************************************************************** + * + * Compile 'autofit' module with fallback Indic script support, covering + * some scripts that the 'latin' submodule of the 'autofit' module doesn't + * (yet) handle. Currently, this needs option `AF_CONFIG_OPTION_CJK`. + */ +#ifdef AF_CONFIG_OPTION_CJK +#define AF_CONFIG_OPTION_INDIC +#endif + + + /************************************************************************** + * + * Use TrueType-like size metrics for 'light' auto-hinting. + * + * It is strongly recommended to avoid this option, which exists only to + * help some legacy applications retain its appearance and behaviour with + * respect to auto-hinted TrueType fonts. + * + * The very reason this option exists at all are GNU/Linux distributions + * like Fedora that did not un-patch the following change (which was + * present in FreeType between versions 2.4.6 and 2.7.1, inclusive). + * + * ``` + * 2011-07-16 Steven Chu + * + * [truetype] Fix metrics on size request for scalable fonts. + * ``` + * + * This problematic commit is now reverted (more or less). + */ +/* #define AF_CONFIG_OPTION_TT_SIZE_METRICS */ + + /* */ + + + /* + * This macro is obsolete. Support has been removed in FreeType version + * 2.5. + */ +/* #define FT_CONFIG_OPTION_OLD_INTERNALS */ + + + /* + * The next three macros are defined if native TrueType hinting is + * requested by the definitions above. Don't change this. + */ +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +#define TT_USE_BYTECODE_INTERPRETER + +#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING +#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1 +#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY +#endif + +#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2 +#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL +#endif +#endif +#endif + + + /* + * The TT_SUPPORT_COLRV1 macro is defined to indicate to clients that this + * version of FreeType has support for 'COLR' v1 API. This definition is + * useful to FreeType clients that want to build in support for 'COLR' v1 + * depending on a tip-of-tree checkout before it is officially released in + * FreeType, and while the feature cannot yet be tested against using + * version macros. Don't change this macro. This may be removed once the + * feature is in a FreeType release version and version macros can be used + * to test for availability. + */ +#ifdef TT_CONFIG_OPTION_COLOR_LAYERS +#define TT_SUPPORT_COLRV1 +#endif + + + /* + * Check CFF darkening parameters. The checks are the same as in function + * `cff_property_set` in file `cffdrivr.c`. + */ +#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500 +#error "Invalid CFF darkening parameters!" +#endif + +FT_END_HEADER + + +#endif /* FTOPTION_H_ */ + + +/* END */ diff --git a/externals/freetype/stamp b/externals/freetype/stamp index d44ac7b94..683d7fb07 100644 --- a/externals/freetype/stamp +++ b/externals/freetype/stamp @@ -1 +1 @@ -#1 \ No newline at end of file +#2 diff --git a/externals/gdal/CMakeLists.txt b/externals/gdal/CMakeLists.txt index 91873c538..2ff50d8e2 100644 --- a/externals/gdal/CMakeLists.txt +++ b/externals/gdal/CMakeLists.txt @@ -409,3 +409,14 @@ target_link_libraries(gdal_static z_static ${target_specific_public_libraries} ) +set_property(TARGET gdal_static + PROPERTY + CXX_STANDARD 11 +) +if (CMAKE_TARGET_BUILD_TOOL STREQUAL "xcode") + # NOTE: Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/19713 + set_property(TARGET gdal_static + PROPERTY + XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" + ) +endif() diff --git a/externals/icu4c/CMakeLists.txt b/externals/icu4c/CMakeLists.txt index 078546fe6..e999bee98 100644 --- a/externals/icu4c/CMakeLists.txt +++ b/externals/icu4c/CMakeLists.txt @@ -50,3 +50,14 @@ target_include_directories(icu4c_static "upstream.patched/icu4c/source/common" "upstream.patched/icu4c/source/i18n" ) +set_property(TARGET icu4c_static + PROPERTY + CXX_STANDARD 11 +) +if (CMAKE_TARGET_BUILD_TOOL STREQUAL "xcode") + # NOTE: Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/19713 + set_property(TARGET icu4c_static + PROPERTY + XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" + ) +endif() diff --git a/externals/qtbase-android/build.sh b/externals/qtbase-android/build.sh index d5b2d5c7f..8bfff641a 100755 --- a/externals/qtbase-android/build.sh +++ b/externals/qtbase-android/build.sh @@ -87,17 +87,17 @@ fi echo "Using ANDROID_NDK_HOST '${ANDROID_NDK_HOST}'" export ANDROID_NDK_PLATFORM=android-21 + # Prepare configuration QTBASE_CONFIGURATION=$(echo " - -release -opensource -confirm-license -c++std c++11 -sql-sqlite -qt-sqlite - -qt-zlib -no-gif -no-libpng -no-libjpeg -no-openssl -qt-pcre -no-use-gold-linker -nomake tests - -nomake examples -nomake tools -no-gui -no-widgets -no-cups -no-iconv -no-icu -no-dbus - -no-opengl -no-evdev - -no-warnings-are-errors -v + -release -opensource -confirm-license -c++std c++11 -no-accessibility -sql-sqlite -qt-sqlite + -qt-zlib -no-zstd -no-gif -no-libpng -no-libjpeg -no-openssl -no-feature-gssapi -no-feature-sspi -qt-pcre + -nomake tests -nomake examples -nomake tools -no-gui -no-widgets -no-cups -no-iconv -no-icu -no-dbus + -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms -no-opengl -no-glib + -no-use-gold-linker + -v " | tr '\n' ' ') -# -no-gcc-sysroot -qt-xcb - # Function: makeFlavor(type) makeFlavor() { diff --git a/externals/qtbase-android/configure.sh b/externals/qtbase-android/configure.sh index 4aa956e60..85ed66227 100755 --- a/externals/qtbase-android/configure.sh +++ b/externals/qtbase-android/configure.sh @@ -8,5 +8,5 @@ fi SRCLOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SRCLOC/../../../build/utils/functions.sh" -prepareUpstreamFromGit "$SRCLOC" "https://github.com/qt/qtbase" "5.12" +prepareUpstreamFromGit "$SRCLOC" "https://github.com/qt/qtbase" "v5.15.2" patchUpstream "$SRCLOC" diff --git a/externals/qtbase-android/patches/0-fix-ndk-23.patch b/externals/qtbase-android/patches/0-fix-ndk-23.patch deleted file mode 100644 index 594fb2f38..000000000 --- a/externals/qtbase-android/patches/0-fix-ndk-23.patch +++ /dev/null @@ -1,214 +0,0 @@ -diff -rupN upstream.original/configure.pri upstream.patched/configure.pri ---- upstream.original/configure.pri 2021-08-21 14:04:57.000000000 +0200 -+++ upstream.patched/configure.pri 2021-08-27 14:12:30.000000000 +0200 -@@ -554,14 +554,16 @@ defineTest(qtConfOutput_prepareOptions) - qtConfFatalError("Cannot find Android NDK." \ - "Please use -android-ndk option to specify one.") - -- ndk_tc_ver = $$eval(config.input.android-toolchain-version) -- isEmpty(ndk_tc_ver): \ -- ndk_tc_ver = 4.9 -- !exists($$ndk_root/toolchains/arm-linux-androideabi-$$ndk_tc_ver/prebuilt/*): \ -- qtConfFatalError("Cannot detect Android NDK toolchain." \ -- "Please use -android-toolchain-version to specify it.") -- -- ndk_tc_pfx = $$ndk_root/toolchains/arm-linux-androideabi-$$ndk_tc_ver/prebuilt -+ #ndk_tc_ver = $$eval(config.input.android-toolchain-version) -+ #isEmpty(ndk_tc_ver): \ -+ # ndk_tc_ver = 4.9 -+ #!exists($$ndk_root/toolchains/arm-linux-androideabi-$$ndk_tc_ver/prebuilt/*): \ -+ # qtConfFatalError("Cannot detect Android NDK toolchain." \ -+ # "Please use -android-toolchain-version to specify it.") -+ -+ # ndk_tc_pfx = $$ndk_root/toolchains/arm-linux-androideabi-$$ndk_tc_ver/prebuilt -+ ndk_tc_ver = llvm -+ ndk_tc_pfx = $$ndk_root/toolchains/llvm/prebuilt - ndk_host = $$eval(config.input.android-ndk-host) - isEmpty(ndk_host): \ - ndk_host = $$getenv(ANDROID_NDK_HOST) -@@ -611,7 +613,7 @@ defineTest(qtConfOutput_prepareOptions) - platform = android-21 - - isEmpty(platform): \ -- platform = android-16 ### the windows configure disagrees ... -+ platform = android-21 - - $${currentConfig}.output.devicePro += \ - "DEFAULT_ANDROID_SDK_ROOT = $$val_escape(sdk_root)" \ -diff -rupN upstream.original/mkspecs/android-clang/qmake.conf upstream.patched/mkspecs/android-clang/qmake.conf ---- upstream.original/mkspecs/android-clang/qmake.conf 2021-08-21 14:04:58.000000000 +0200 -+++ upstream.patched/mkspecs/android-clang/qmake.conf 2021-08-28 00:40:42.000000000 +0200 -@@ -12,33 +12,38 @@ include(../common/android-base-head.conf - - NDK_LLVM_PATH = $$NDK_ROOT/toolchains/llvm/prebuilt/$$NDK_HOST - QMAKE_CC = $$NDK_LLVM_PATH/bin/clang -+#QMAKE_CC = $$NDK_LLVM_PATH/bin/armv7a-linux-androideabi21-clang - QMAKE_CXX = $$NDK_LLVM_PATH/bin/clang++ -+#QMAKE_CXX = $$NDK_LLVM_PATH/bin/armv7a-linux-androideabi21-clang++ -+ - - equals(ANDROID_TARGET_ARCH, armeabi-v7a): \ - QMAKE_CFLAGS += -target armv7-none-linux-androideabi --else: equals(ANDROID_TARGET_ARCH, armeabi): \ -- QMAKE_CFLAGS += -target armv5te-none-linux-androideabi - else: equals(ANDROID_TARGET_ARCH, arm64-v8a): \ - QMAKE_CFLAGS += -target aarch64-none-linux-android - else: equals(ANDROID_TARGET_ARCH, x86): \ - QMAKE_CFLAGS += -target i686-none-linux-android -mstackrealign - else: equals(ANDROID_TARGET_ARCH, x86_64): \ - QMAKE_CFLAGS += -target x86_64-none-linux-android --else: equals(ANDROID_TARGET_ARCH, mips): \ -- QMAKE_CFLAGS += -target mipsel-none-linux-android --else: equals(ANDROID_TARGET_ARCH, mips64): \ -- QMAKE_CFLAGS += -target mips64el-none-linux-android -- --QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info -- --QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --equals(ANDROID_TARGET_ARCH, armeabi-v7a): QMAKE_LINK += -Wl,--exclude-libs,libunwind.a -- --QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \ -- -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \ -- -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \ -- -isystem $$NDK_ROOT/sources/android/support/include \ -- -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include -+ -+# QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info -+QMAKE_CFLAGS += -fno-limit-debug-info -+ -+QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a \ -+ -nostdlib++ -nostdlib \ -+ -L$$NDK_LLVM_PATH/lib64/clang/12.0.5/lib/linux/ -lclang_rt.builtins-$$ANDROID_ARCHITECTURE-android \ -+ -L$$NDK_LLVM_PATH/sysroot/usr/lib/$$NDK_TOOLCHAIN_PREFIX/$$ANDROID_PLATFORM_CODE -+ #-L$$NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/12.0.5/lib/linux/ -+ #-L$$NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/21/ \ -+ -+# equals(ANDROID_TARGET_ARCH, armeabi-v7a): QMAKE_LINK += -Wl,--exclude-libs,libunwind.a -+ -+# /Users/victorshcherb/programs/android-ndk-r23//toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/18/ -+# QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \ -+# -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \ -+# -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \ -+# -isystem $$NDK_ROOT/sources/android/support/include \ -+# -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include - - ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH - -@@ -47,9 +52,10 @@ ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_ - ANDROID_USE_LLVM = true - - exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so): \ -- ANDROID_CXX_STL_LIBS = -lc++ -+ ANDROID_CXX_STL_LIBS = -lc++ -lunwind - else: \ -- ANDROID_CXX_STL_LIBS = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so.$$replace(ANDROID_PLATFORM, "android-", "") -+ #ANDROID_CXX_STL_LIBS = -l $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so.$$replace(ANDROID_PLATFORM, "android-", "") -+ ANDROID_CXX_STL_LIBS = -lc++ -lunwind - - QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz - -diff -rupN upstream.original/mkspecs/common/android-base-tail.conf upstream.patched/mkspecs/common/android-base-tail.conf ---- upstream.original/mkspecs/common/android-base-tail.conf 2021-08-21 14:04:58.000000000 +0200 -+++ upstream.patched/mkspecs/common/android-base-tail.conf 2021-08-27 15:24:04.000000000 +0200 -@@ -68,8 +68,8 @@ QMAKE_INCDIR_OPENGL = - QMAKE_LIBDIR_OPENGL = - - QMAKE_LINK_SHLIB = $$QMAKE_LINK --QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH --equals(ANDROID_TARGET_ARCH, x86_64) QMAKE_LFLAGS += -L$$ANDROID_PLATFORM_ROOT_PATH/usr/lib64 -+#QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH -+#equals(ANDROID_TARGET_ARCH, x86_64) QMAKE_LFLAGS += -L$$ANDROID_PLATFORM_ROOT_PATH/usr/lib64 - QMAKE_LFLAGS_APP = -Wl,--no-undefined -Wl,-z,noexecstack -shared - QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared - QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB -diff -rupN upstream.original/mkspecs/common/android-base-head.conf upstream.patched/mkspecs/common/android-base-head.conf ---- upstream.original/mkspecs/common/android-base-head.conf 2021-08-21 14:04:58.000000000 +0200 -+++ upstream.patched/mkspecs/common/android-base-head.conf 2021-08-28 15:23:22.000000000 +0200 -@@ -11,43 +11,31 @@ isEmpty(NDK_HOST): NDK_HOST = $$DEFAULT_ - - ANDROID_PLATFORM = $$(ANDROID_NDK_PLATFORM) - isEmpty(ANDROID_PLATFORM): ANDROID_PLATFORM = $$DEFAULT_ANDROID_PLATFORM -+ANDROID_PLATFORM_CODE=$$replace(ANDROID_PLATFORM, "android-", "") -+ - - ANDROID_TARGET_ARCH = $$(ANDROID_TARGET_ARCH) - isEmpty(ANDROID_TARGET_ARCH): ANDROID_TARGET_ARCH = $$DEFAULT_ANDROID_TARGET_ARCH - - NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX) - isEmpty(NDK_TOOLCHAIN_PREFIX) { -- equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86 -- else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64 -- else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android -- else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android -+ equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = i686-linux-android -+ else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64-linux-android - else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android - else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi - } - --NDK_TOOLS_PREFIX = $$(ANDROID_NDK_TOOLS_PREFIX) --isEmpty(NDK_TOOLS_PREFIX) { -- equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLS_PREFIX = i686-linux-android -- else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLS_PREFIX = x86_64-linux-android -- else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLS_PREFIX = mipsel-linux-android -- else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLS_PREFIX = mips64el-linux-android -- else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLS_PREFIX = aarch64-linux-android -- else: NDK_TOOLS_PREFIX = arm-linux-androideabi --} -- - NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION) - isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION - --equals(ANDROID_TARGET_ARCH, x86): ANDROID_ARCHITECTURE = x86 -+equals(ANDROID_TARGET_ARCH, x86): ANDROID_ARCHITECTURE = i686 - else: equals(ANDROID_TARGET_ARCH, x86_64): ANDROID_ARCHITECTURE = x86_64 --else: equals(ANDROID_TARGET_ARCH, mips): ANDROID_ARCHITECTURE = mips --else: equals(ANDROID_TARGET_ARCH, mips64): ANDROID_ARCHITECTURE = mips64 --else: equals(ANDROID_TARGET_ARCH, arm64-v8a): ANDROID_ARCHITECTURE = arm64 -+else: equals(ANDROID_TARGET_ARCH, arm64-v8a): ANDROID_ARCHITECTURE = aarch64 - else: ANDROID_ARCHITECTURE = arm - - !equals(NDK_TOOLCHAIN_VERSION, 4.4.3): ANDROID_CXXSTL_SUFFIX = -$$NDK_TOOLCHAIN_VERSION - --NDK_TOOLCHAIN = $$NDK_TOOLCHAIN_PREFIX-$$NDK_TOOLCHAIN_VERSION -+NDK_TOOLCHAIN = llvm - NDK_TOOLCHAIN_PATH = $$NDK_ROOT/toolchains/$$NDK_TOOLCHAIN/prebuilt/$$NDK_HOST - - -@@ -64,11 +52,11 @@ isEmpty(ANDROID_SDK_BUILD_TOOLS_REVISION - } - - CONFIG += $$ANDROID_PLATFORM --QMAKE_CFLAGS = -D__ANDROID_API__=$$replace(ANDROID_PLATFORM, "android-", "") -+QMAKE_CFLAGS = -D__ANDROID_API__=$$ANDROID_PLATFORM_CODE - --ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/ -+# ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/ - --CROSS_COMPILE = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX- -+CROSS_COMPILE = $$NDK_TOOLCHAIN_PATH/bin/llvm- - - QMAKE_PCH_OUTPUT_EXT = .gch - -diff -rupN upstream.original/mkspecs/features/android/android_deployment_settings.prf upstream.patched/mkspecs/features/android/android_deployment_settings.prf ---- upstream.original/mkspecs/features/android/android_deployment_settings.prf 2021-08-21 14:04:58.000000000 +0200 -+++ upstream.patched/mkspecs/features/android/android_deployment_settings.prf 2021-08-28 15:13:36.000000000 +0200 -@@ -23,15 +23,13 @@ contains(TEMPLATE, ".*app"):!build_pass: - } else { - NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX) - isEmpty(NDK_TOOLCHAIN_PREFIX) { -- equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86 -- else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64 -- else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android -- else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android -+ equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = i686-linux-android -+ else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64-linux-android x - else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android - else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi - } - FILE_CONTENT += " \"toolchain-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX)," -- FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLS_PREFIX)," -+ FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX)," - } - - NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION) diff --git a/externals/qtbase-android/patches/0-ndk23.patch b/externals/qtbase-android/patches/0-ndk23.patch new file mode 100644 index 000000000..5499ff5de --- /dev/null +++ b/externals/qtbase-android/patches/0-ndk23.patch @@ -0,0 +1,14 @@ +--- upstream.original/mkspecs/features/android/default_pre.prf 2021-11-21 15:07:06.677868211 +0100 ++++ upstream.patched/mkspecs/features/android/default_pre.prf 2021-11-21 17:12:26.466170220 +0100 +@@ -68,10 +68,7 @@ QMAKE_STRIP = + #$${CROSS_COMPILE}strip + + +-equals(QT_ARCH, x86): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/i686-linux-android- +-else: equals(QT_ARCH, x86_64): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/x86_64-linux-android- +-else: equals(QT_ARCH, arm64-v8a): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/aarch64-linux-android- +-else: CROSS_COMPILE = $$NDK_LLVM_PATH/bin/arm-linux-androideabi- ++CROSS_COMPILE = $$NDK_LLVM_PATH/bin/llvm- + + QMAKE_RANLIB = $${CROSS_COMPILE}ranlib + QMAKE_LINK_SHLIB = $$QMAKE_LINK diff --git a/externals/qtbase-android/patches/1-fix-android-target-24.patch b/externals/qtbase-android/patches/1-fix-android-target-24.patch deleted file mode 100644 index 8daac54ce..000000000 --- a/externals/qtbase-android/patches/1-fix-android-target-24.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -rupN upstream.original/mkspecs/features/android/sdk.prf upstream.patched/mkspecs/features/android/sdk.prf ---- upstream.original/mkspecs/features/android/sdk.prf 2021-08-21 14:04:58.000000000 +0200 -+++ upstream.patched/mkspecs/features/android/sdk.prf 2021-08-28 11:49:55.000000000 +0200 -@@ -1,6 +1,6 @@ - API_VERSION_TO_USE = $$(ANDROID_API_VERSION) - isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = $$API_VERSION --isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-16 -+isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-24 - - ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar - !exists($$ANDROID_JAR_FILE) { - -diff -rupN upstream.original/src/android/jar/jar.pro upstream.patched/src/android/jar/jar.pro ---- upstream.original/src/android/jar/jar.pro 2021-08-21 14:04:59.000000000 +0200 -+++ upstream.patched/src/android/jar/jar.pro 2021-08-28 12:19:07.000000000 +0200 -@@ -2,7 +2,7 @@ TARGET = QtAndroid - - CONFIG += java - DESTDIR = $$[QT_INSTALL_PREFIX/get]/jar --API_VERSION = android-16 -+API_VERSION = android-24 - - PATHPREFIX = $$PWD/src/org/qtproject/qt5/android/ - diff --git a/externals/qtbase-android/patches/1-no-suffix.patch b/externals/qtbase-android/patches/1-no-suffix.patch new file mode 100644 index 000000000..6444849d6 --- /dev/null +++ b/externals/qtbase-android/patches/1-no-suffix.patch @@ -0,0 +1,10 @@ +--- upstream.original/mkspecs/features/qt_functions.prf 2021-11-21 15:07:06.709868827 +0100 ++++ upstream.patched/mkspecs/features/qt_functions.prf 2021-11-22 07:12:43.942265898 +0100 +@@ -1,7 +1,6 @@ + + defineReplace(qtPlatformTargetSuffix) { + suffix = +- android: return($${suffix}_$${QT_ARCH}) + win32 { + CONFIG(debug, debug|release) { + mingw { diff --git a/externals/qtbase-android/stamp b/externals/qtbase-android/stamp index e78279868..81606ee95 100644 --- a/externals/qtbase-android/stamp +++ b/externals/qtbase-android/stamp @@ -1 +1 @@ -#4 +#5 diff --git a/externals/qtbase-desktop/build.sh b/externals/qtbase-desktop/build.sh index bf351ba76..0ac0ca026 100755 --- a/externals/qtbase-desktop/build.sh +++ b/externals/qtbase-desktop/build.sh @@ -71,7 +71,7 @@ makeStaticAndSharedFlavor() if [[ "$targetOS" == "linux" ]]; then QTBASE_CONFIGURATION=$(echo " -release -opensource -confirm-license -c++std c++11 -no-accessibility -sql-sqlite -qt-sqlite - -system-zlib -no-gif -no-libpng -no-libjpeg -no-openssl -qt-pcre + -system-zlib -no-zstd -no-gif -no-libpng -no-libjpeg -no-openssl -no-feature-gssapi -no-feature-sspi -qt-pcre -nomake tests -nomake examples -nomake tools -no-gui -no-widgets -no-cups -no-iconv -no-icu -no-dbus -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms -no-opengl -no-glib -v @@ -106,7 +106,7 @@ if [[ "$targetOS" == "linux" ]]; then elif [[ "$targetOS" == "macosx" ]]; then QTBASE_CONFIGURATION=$(echo " -debug-and-release -opensource -confirm-license -c++std c++11 -no-accessibility -sql-sqlite -qt-sqlite - -system-zlib -no-gif -no-libpng -no-libjpeg -no-openssl -qt-pcre + -system-zlib -no-zstd -no-gif -no-libpng -no-libjpeg -no-openssl -no-feature-gssapi -no-feature-sspi -qt-pcre -nomake tests -nomake examples -nomake tools -no-gui -no-widgets -no-cups -no-iconv -no-icu -no-dbus -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms -no-opengl -no-glib -no-framework -v @@ -131,7 +131,7 @@ elif [[ "$targetOS" == "cygwin" ]]; then # cygwin-g++ mkspec does not specify C++ standard to allow -c++std c++11 usage QTBASE_CONFIGURATION=$(echo " -release -opensource -confirm-license -no-accessibility -sql-sqlite -qt-sqlite - -system-zlib -no-gif -no-libpng -no-libjpeg -no-openssl -qt-pcre + -system-zlib -no-zstd -no-gif -no-libpng -no-libjpeg -no-openssl -no-feature-gssapi -no-feature-sspi -qt-pcre -nomake tests -nomake examples -nomake tools -no-gui -no-widgets -no-cups -no-iconv -no-icu -no-dbus -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms -no-opengl -no-glib -v @@ -152,7 +152,7 @@ elif [[ "$targetOS" == "cygwin" ]]; then elif [[ "$targetOS" == "windows" ]]; then QTBASE_CONFIGURATION=$(echo " -release -opensource -confirm-license -c++std c++11 -no-accessibility -sql-sqlite -qt-sqlite - -system-zlib -no-gif -no-libpng -no-libjpeg -no-openssl -qt-pcre + -system-zlib -no-zstd -no-gif -no-libpng -no-libjpeg -no-openssl -no-feature-gssapi -no-feature-sspi -qt-pcre -nomake tests -nomake examples -nomake tools -no-gui -no-widgets -no-cups -no-iconv -no-icu -no-dbus -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms -no-opengl -no-glib -v diff --git a/externals/qtbase-desktop/configure.sh b/externals/qtbase-desktop/configure.sh index ffe234473..342a90e33 100755 --- a/externals/qtbase-desktop/configure.sh +++ b/externals/qtbase-desktop/configure.sh @@ -8,8 +8,7 @@ fi SRCLOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$SRCLOC/../../../build/utils/functions.sh" -prepareUpstreamFromGit "$SRCLOC" "https://github.com/qt/qtbase" "5.12" -#"https://github.com/osmandapp/OsmAnd-external-qtbase.git" "qt-v5.7.1" +prepareUpstreamFromGit "$SRCLOC" "https://github.com/qt/qtbase" "v5.15.2" patchUpstream "$SRCLOC" # Check if tools are present diff --git a/externals/qtbase-desktop/stamp b/externals/qtbase-desktop/stamp index 49189f28e..5f0ade801 100644 --- a/externals/qtbase-desktop/stamp +++ b/externals/qtbase-desktop/stamp @@ -1 +1 @@ -#9 +#10 diff --git a/include/OsmAndCore/ArchiveReader.h b/include/OsmAndCore/ArchiveReader.h index d41c223a1..dbe90bed9 100644 --- a/include/OsmAndCore/ArchiveReader.h +++ b/include/OsmAndCore/ArchiveReader.h @@ -32,7 +32,7 @@ namespace OsmAnd bool isValid() const; - QString name; + QString name = {}; uint64_t size; QDateTime creationTime; QDateTime modificationTime; diff --git a/include/OsmAndCore/Data/ObfMapSectionReader_Metrics.h b/include/OsmAndCore/Data/ObfMapSectionReader_Metrics.h index 570cc9890..cab613ce4 100644 --- a/include/OsmAndCore/Data/ObfMapSectionReader_Metrics.h +++ b/include/OsmAndCore/Data/ObfMapSectionReader_Metrics.h @@ -83,7 +83,7 @@ namespace OsmAnd OsmAnd__ObfMapSectionReader_Metrics__Metric_loadMapObjects__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/Data/ObfRoutingSectionReader_Metrics.h b/include/OsmAndCore/Data/ObfRoutingSectionReader_Metrics.h index bcad828d5..96f017797 100644 --- a/include/OsmAndCore/Data/ObfRoutingSectionReader_Metrics.h +++ b/include/OsmAndCore/Data/ObfRoutingSectionReader_Metrics.h @@ -68,7 +68,7 @@ namespace OsmAnd OsmAnd__ObfRoutingSectionReader_Metrics__Metric_loadRoads__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/FavoriteLocationsCollection.h b/include/OsmAndCore/FavoriteLocationsCollection.h index b58575e65..d5383fa67 100644 --- a/include/OsmAndCore/FavoriteLocationsCollection.h +++ b/include/OsmAndCore/FavoriteLocationsCollection.h @@ -32,27 +32,27 @@ namespace OsmAnd virtual std::shared_ptr createFavoriteLocation( const PointI position31, - const QString& elevation = QString::null, - const QString& time = QString::null, - const QString& creationTime = QString::null, - const QString& title = QString::null, - const QString& description = QString::null, - const QString& address = QString::null, - const QString& group = QString::null, - const QString& icon = QString::null, - const QString& background = QString::null, + const QString& elevation = {}, + const QString& time = {}, + const QString& creationTime = {}, + const QString& title = {}, + const QString& description = {}, + const QString& address = {}, + const QString& group = {}, + const QString& icon = {}, + const QString& background = {}, const ColorRGB color = ColorRGB()); virtual std::shared_ptr createFavoriteLocation( const LatLon latLon, - const QString& elevation = QString::null, - const QString& time = QString::null, - const QString& creationTime = QString::null, - const QString& title = QString::null, - const QString& description = QString::null, - const QString& address = QString::null, - const QString& group = QString::null, - const QString& icon = QString::null, - const QString& background = QString::null, + const QString& elevation = {}, + const QString& time = {}, + const QString& creationTime = {}, + const QString& title = {}, + const QString& description = {}, + const QString& address = {}, + const QString& group = {}, + const QString& icon = {}, + const QString& background = {}, const ColorRGB color = ColorRGB()); virtual std::shared_ptr copyFavoriteLocation(const std::shared_ptr& other); diff --git a/include/OsmAndCore/IFavoriteLocationsCollection.h b/include/OsmAndCore/IFavoriteLocationsCollection.h index 6846c8425..c0a5d1fc4 100644 --- a/include/OsmAndCore/IFavoriteLocationsCollection.h +++ b/include/OsmAndCore/IFavoriteLocationsCollection.h @@ -32,27 +32,27 @@ namespace OsmAnd virtual std::shared_ptr createFavoriteLocation( const PointI position31, - const QString& elevation = QString::null, - const QString& time = QString::null, - const QString& creationTime = QString::null, - const QString& title = QString::null, - const QString& description = QString::null, - const QString& address = QString::null, - const QString& group = QString::null, - const QString& icon = QString::null, - const QString& background = QString::null, + const QString& elevation = {}, + const QString& time = {}, + const QString& creationTime = {}, + const QString& title = {}, + const QString& description = {}, + const QString& address = {}, + const QString& group = {}, + const QString& icon = {}, + const QString& background = {}, const ColorRGB color = ColorRGB()) = 0; virtual std::shared_ptr createFavoriteLocation( const LatLon latLon, - const QString& elevation = QString::null, - const QString& time = QString::null, - const QString& creationTime = QString::null, - const QString& title = QString::null, - const QString& description = QString::null, - const QString& address = QString::null, - const QString& group = QString::null, - const QString& icon = QString::null, - const QString& background = QString::null, + const QString& elevation = {}, + const QString& time = {}, + const QString& creationTime = {}, + const QString& title = {}, + const QString& description = {}, + const QString& address = {}, + const QString& group = {}, + const QString& icon = {}, + const QString& background = {}, const ColorRGB color = ColorRGB()) = 0; virtual std::shared_ptr copyFavoriteLocation(const std::shared_ptr& other) = 0; diff --git a/include/OsmAndCore/Map/AmenitySymbolsProvider.h b/include/OsmAndCore/Map/AmenitySymbolsProvider.h index 45c0a8a65..d27af060e 100644 --- a/include/OsmAndCore/Map/AmenitySymbolsProvider.h +++ b/include/OsmAndCore/Map/AmenitySymbolsProvider.h @@ -82,8 +82,8 @@ namespace OsmAnd const std::shared_ptr amenityIconProvider; const int baseOrder; - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( diff --git a/include/OsmAndCore/Map/AtlasMapRenderer_Metrics.h b/include/OsmAndCore/Map/AtlasMapRenderer_Metrics.h index ac089def9..05c3a7212 100644 --- a/include/OsmAndCore/Map/AtlasMapRenderer_Metrics.h +++ b/include/OsmAndCore/Map/AtlasMapRenderer_Metrics.h @@ -78,7 +78,7 @@ namespace OsmAnd OsmAnd__AtlasMapRenderer_Metrics__Metric_renderFrame__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/Map/FavoriteLocationsPresenter.h b/include/OsmAndCore/Map/FavoriteLocationsPresenter.h index e492aad18..5c897db20 100644 --- a/include/OsmAndCore/Map/FavoriteLocationsPresenter.h +++ b/include/OsmAndCore/Map/FavoriteLocationsPresenter.h @@ -45,7 +45,7 @@ namespace OsmAnd static MapMarker::PinIconVerticalAlignment getDefaultFavoriteLocationPinIconVerticalAlignment(); static MapMarker::PinIconHorisontalAlignment getDefaultFavoriteLocationPinIconHorisontalAlignment(); - virtual QList getProvidedDataKeys() const; + virtual QList getProvidedDataKeys() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( diff --git a/include/OsmAndCore/Map/HeightmapTileProvider.h b/include/OsmAndCore/Map/HeightmapTileProvider.h index 281fb1214..a9750cf1c 100644 --- a/include/OsmAndCore/Map/HeightmapTileProvider.h +++ b/include/OsmAndCore/Map/HeightmapTileProvider.h @@ -23,7 +23,7 @@ namespace OsmAnd PrivateImplementation _p; protected: public: - HeightmapTileProvider(const QString& dataPath, const QString& indexFilename = QString::null); + HeightmapTileProvider(const QString& dataPath, const QString& indexFilename = {}); virtual ~HeightmapTileProvider(); const QString dataPath; @@ -31,9 +31,9 @@ namespace OsmAnd void rebuildTileDbIndex(); - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; - virtual uint32_t getTileSize() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; + virtual uint32_t getTileSize() const Q_DECL_OVERRIDE; virtual bool obtainData( const IMapDataProvider::Request& request, diff --git a/include/OsmAndCore/Map/IMapRenderer_Metrics.h b/include/OsmAndCore/Map/IMapRenderer_Metrics.h index c745141a4..6711e7703 100644 --- a/include/OsmAndCore/Map/IMapRenderer_Metrics.h +++ b/include/OsmAndCore/Map/IMapRenderer_Metrics.h @@ -31,7 +31,7 @@ namespace OsmAnd OsmAnd__IMapRenderer_Metrics__Metric_update__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; #define OsmAnd__IMapRenderer_Metrics__Metric_prepareFrame__FIELDS(FIELD_ACTION) \ @@ -45,7 +45,7 @@ namespace OsmAnd OsmAnd__IMapRenderer_Metrics__Metric_prepareFrame__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; #define OsmAnd__IMapRenderer_Metrics__Metric_renderFrame__FIELDS(FIELD_ACTION) \ @@ -59,7 +59,7 @@ namespace OsmAnd OsmAnd__IMapRenderer_Metrics__Metric_renderFrame__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/Map/MapMarkersCollection.h b/include/OsmAndCore/Map/MapMarkersCollection.h index 72cd8773c..5eb2ffe49 100644 --- a/include/OsmAndCore/Map/MapMarkersCollection.h +++ b/include/OsmAndCore/Map/MapMarkersCollection.h @@ -36,7 +36,7 @@ namespace OsmAnd bool removeMarker(const std::shared_ptr& marker); void removeAllMarkers(); - virtual QList getProvidedDataKeys() const; + virtual QList getProvidedDataKeys() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( diff --git a/include/OsmAndCore/Map/MapObjectsProvider.h b/include/OsmAndCore/Map/MapObjectsProvider.h index 6e827d8c0..007eb244b 100644 --- a/include/OsmAndCore/Map/MapObjectsProvider.h +++ b/include/OsmAndCore/Map/MapObjectsProvider.h @@ -28,8 +28,8 @@ namespace OsmAnd const QList< std::shared_ptr > mapObjects; - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( diff --git a/include/OsmAndCore/Map/MapObjectsSymbolsProvider.h b/include/OsmAndCore/Map/MapObjectsSymbolsProvider.h index 530e3abd9..fdacf39fc 100644 --- a/include/OsmAndCore/Map/MapObjectsSymbolsProvider.h +++ b/include/OsmAndCore/Map/MapObjectsSymbolsProvider.h @@ -72,8 +72,8 @@ namespace OsmAnd const float referenceTileSizeOnScreenInPixels; const std::shared_ptr symbolRasterizer; - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( diff --git a/include/OsmAndCore/Map/MapPrimitivesMetricsLayerProvider.h b/include/OsmAndCore/Map/MapPrimitivesMetricsLayerProvider.h index 384aacc3d..f3116a2c9 100644 --- a/include/OsmAndCore/Map/MapPrimitivesMetricsLayerProvider.h +++ b/include/OsmAndCore/Map/MapPrimitivesMetricsLayerProvider.h @@ -55,10 +55,10 @@ namespace OsmAnd const uint32_t tileSize; const float densityFactor; - virtual MapStubStyle getDesiredStubsStyle() const; + virtual MapStubStyle getDesiredStubsStyle() const Q_DECL_OVERRIDE; - virtual float getTileDensityFactor() const; - virtual uint32_t getTileSize() const; + virtual float getTileDensityFactor() const Q_DECL_OVERRIDE; + virtual uint32_t getTileSize() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( @@ -77,8 +77,8 @@ namespace OsmAnd std::shared_ptr& outData, std::shared_ptr* const pOutMetric = nullptr); - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; }; } diff --git a/include/OsmAndCore/Map/MapPrimitivesProvider.h b/include/OsmAndCore/Map/MapPrimitivesProvider.h index 72ef9e776..843a73e53 100644 --- a/include/OsmAndCore/Map/MapPrimitivesProvider.h +++ b/include/OsmAndCore/Map/MapPrimitivesProvider.h @@ -65,8 +65,8 @@ namespace OsmAnd const unsigned int tileSize; const Mode mode; - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; virtual bool obtainTiledPrimitives( const Request& request, diff --git a/include/OsmAndCore/Map/MapPrimitivesProvider_Metrics.h b/include/OsmAndCore/Map/MapPrimitivesProvider_Metrics.h index 3a6c2cda9..ddf830776 100644 --- a/include/OsmAndCore/Map/MapPrimitivesProvider_Metrics.h +++ b/include/OsmAndCore/Map/MapPrimitivesProvider_Metrics.h @@ -25,7 +25,7 @@ namespace OsmAnd OsmAnd__MapPrimitivesProvider_Metrics__Metric_obtainData__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/Map/MapPrimitiviser.h b/include/OsmAndCore/Map/MapPrimitiviser.h index 9a8a4e403..3b133282c 100644 --- a/include/OsmAndCore/Map/MapPrimitiviser.h +++ b/include/OsmAndCore/Map/MapPrimitiviser.h @@ -248,15 +248,15 @@ namespace OsmAnd Cache(); virtual ~Cache(); - virtual SharedPrimitivesGroupsContainer& getPrimitivesGroups(const ZoomLevel zoom); - virtual const SharedPrimitivesGroupsContainer& getPrimitivesGroups(const ZoomLevel zoom) const; - virtual SharedSymbolsGroupsContainer& getSymbolsGroups(const ZoomLevel zoom); - virtual const SharedSymbolsGroupsContainer& getSymbolsGroups(const ZoomLevel zoom) const; + virtual SharedPrimitivesGroupsContainer& getPrimitivesGroups(ZoomLevel zoom); + virtual const SharedPrimitivesGroupsContainer& getPrimitivesGroups(ZoomLevel zoom) const; + virtual SharedSymbolsGroupsContainer& getSymbolsGroups(ZoomLevel zoom); + virtual const SharedSymbolsGroupsContainer& getSymbolsGroups(ZoomLevel zoom) const; - SharedPrimitivesGroupsContainer* getPrimitivesGroupsPtr(const ZoomLevel zoom); - const SharedPrimitivesGroupsContainer* getPrimitivesGroupsPtr(const ZoomLevel zoom) const; - SharedSymbolsGroupsContainer* getSymbolsGroupsPtr(const ZoomLevel zoom); - const SharedSymbolsGroupsContainer* getSymbolsGroupsPtr(const ZoomLevel zoom) const; + SharedPrimitivesGroupsContainer* getPrimitivesGroupsPtr(ZoomLevel zoom); + const SharedPrimitivesGroupsContainer* getPrimitivesGroupsPtr(ZoomLevel zoom) const; + SharedSymbolsGroupsContainer* getSymbolsGroupsPtr(ZoomLevel zoom); + const SharedSymbolsGroupsContainer* getSymbolsGroupsPtr(ZoomLevel zoom) const; }; class OSMAND_CORE_API PrimitivisedObjects Q_DECL_FINAL diff --git a/include/OsmAndCore/Map/MapPrimitiviser_Metrics.h b/include/OsmAndCore/Map/MapPrimitiviser_Metrics.h index 846bbd34c..b39b5a72c 100644 --- a/include/OsmAndCore/Map/MapPrimitiviser_Metrics.h +++ b/include/OsmAndCore/Map/MapPrimitiviser_Metrics.h @@ -136,7 +136,7 @@ namespace OsmAnd OsmAnd__MapPrimitiviser_Metrics__Metric_primitivise__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; @@ -152,7 +152,7 @@ namespace OsmAnd OsmAnd__MapPrimitiviser_Metrics__Metric_primitiviseAllMapObjects__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; #define OsmAnd__MapPrimitiviser_Metrics__Metric_primitiviseWithoutSurface__FIELDS(FIELD_ACTION) \ @@ -173,7 +173,7 @@ namespace OsmAnd OsmAnd__MapPrimitiviser_Metrics__Metric_primitiviseWithoutSurface__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; #define OsmAnd__MapPrimitiviser_Metrics__Metric_primitiviseWithSurface__FIELDS(FIELD_ACTION) \ @@ -194,7 +194,7 @@ namespace OsmAnd OsmAnd__MapPrimitiviser_Metrics__Metric_primitiviseWithSurface__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/Map/MapRasterLayerProvider.h b/include/OsmAndCore/Map/MapRasterLayerProvider.h index a7ce5f0c6..a2e005741 100644 --- a/include/OsmAndCore/Map/MapRasterLayerProvider.h +++ b/include/OsmAndCore/Map/MapRasterLayerProvider.h @@ -55,10 +55,10 @@ namespace OsmAnd const std::shared_ptr primitivesProvider; const bool fillBackground; - virtual MapStubStyle getDesiredStubsStyle() const; + virtual MapStubStyle getDesiredStubsStyle() const Q_DECL_OVERRIDE; - virtual float getTileDensityFactor() const; - virtual uint32_t getTileSize() const; + virtual float getTileDensityFactor() const Q_DECL_OVERRIDE; + virtual uint32_t getTileSize() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( @@ -77,8 +77,8 @@ namespace OsmAnd std::shared_ptr& outData, MapRasterLayerProvider_Metrics::Metric_obtainData* const metric = nullptr); - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; }; } diff --git a/include/OsmAndCore/Map/MapRasterLayerProvider_Metrics.h b/include/OsmAndCore/Map/MapRasterLayerProvider_Metrics.h index ed32e372f..8918c4d34 100644 --- a/include/OsmAndCore/Map/MapRasterLayerProvider_Metrics.h +++ b/include/OsmAndCore/Map/MapRasterLayerProvider_Metrics.h @@ -25,7 +25,7 @@ namespace OsmAnd OsmAnd__MapRasterLayerProvider_Metrics__Metric_obtainData__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/Map/MapRasterMetricsLayerProvider.h b/include/OsmAndCore/Map/MapRasterMetricsLayerProvider.h index ef2a7eefc..5fb56d03b 100644 --- a/include/OsmAndCore/Map/MapRasterMetricsLayerProvider.h +++ b/include/OsmAndCore/Map/MapRasterMetricsLayerProvider.h @@ -56,10 +56,10 @@ namespace OsmAnd const uint32_t tileSize; const float densityFactor; - virtual MapStubStyle getDesiredStubsStyle() const; + virtual MapStubStyle getDesiredStubsStyle() const Q_DECL_OVERRIDE; - virtual float getTileDensityFactor() const; - virtual uint32_t getTileSize() const; + virtual float getTileDensityFactor() const Q_DECL_OVERRIDE; + virtual uint32_t getTileSize() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( @@ -78,8 +78,8 @@ namespace OsmAnd std::shared_ptr& outData, std::shared_ptr* const pOutMetric = nullptr); - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; }; } diff --git a/include/OsmAndCore/Map/MapRasterizer_Metrics.h b/include/OsmAndCore/Map/MapRasterizer_Metrics.h index a29915694..c07c84cff 100644 --- a/include/OsmAndCore/Map/MapRasterizer_Metrics.h +++ b/include/OsmAndCore/Map/MapRasterizer_Metrics.h @@ -25,7 +25,7 @@ namespace OsmAnd OsmAnd__MapRasterizer_Metrics__Metric_rasterize__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/Map/ObfMapObjectsMetricsLayerProvider.h b/include/OsmAndCore/Map/ObfMapObjectsMetricsLayerProvider.h index 5d307b357..f005eb446 100644 --- a/include/OsmAndCore/Map/ObfMapObjectsMetricsLayerProvider.h +++ b/include/OsmAndCore/Map/ObfMapObjectsMetricsLayerProvider.h @@ -55,10 +55,10 @@ namespace OsmAnd const uint32_t tileSize; const float densityFactor; - virtual MapStubStyle getDesiredStubsStyle() const; + virtual MapStubStyle getDesiredStubsStyle() const Q_DECL_OVERRIDE; - virtual float getTileDensityFactor() const; - virtual uint32_t getTileSize() const; + virtual float getTileDensityFactor() const Q_DECL_OVERRIDE; + virtual uint32_t getTileSize() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( @@ -77,8 +77,8 @@ namespace OsmAnd std::shared_ptr& outData, std::shared_ptr* const pOutMetric = nullptr); - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; }; } diff --git a/include/OsmAndCore/Map/ObfMapObjectsProvider.h b/include/OsmAndCore/Map/ObfMapObjectsProvider.h index fc05eba2a..941815635 100644 --- a/include/OsmAndCore/Map/ObfMapObjectsProvider.h +++ b/include/OsmAndCore/Map/ObfMapObjectsProvider.h @@ -43,8 +43,8 @@ namespace OsmAnd const std::shared_ptr obfsCollection; const Mode mode; - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( diff --git a/include/OsmAndCore/Map/ObfMapObjectsProvider_Metrics.h b/include/OsmAndCore/Map/ObfMapObjectsProvider_Metrics.h index bac9bdfaf..c9716a24f 100644 --- a/include/OsmAndCore/Map/ObfMapObjectsProvider_Metrics.h +++ b/include/OsmAndCore/Map/ObfMapObjectsProvider_Metrics.h @@ -43,7 +43,7 @@ namespace OsmAnd OsmAnd__ObfMapObjectsProvider_Metrics__Metric_obtainData__FIELDS(EMIT_METRIC_FIELD); - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } } diff --git a/include/OsmAndCore/Map/OnlineRasterMapLayerProvider.h b/include/OsmAndCore/Map/OnlineRasterMapLayerProvider.h index 3df5c787c..e2677bf4c 100644 --- a/include/OsmAndCore/Map/OnlineRasterMapLayerProvider.h +++ b/include/OsmAndCore/Map/OnlineRasterMapLayerProvider.h @@ -61,10 +61,10 @@ namespace OsmAnd void setNetworkAccessPermission(bool allowed); const bool& networkAccessAllowed; - virtual MapStubStyle getDesiredStubsStyle() const; + virtual MapStubStyle getDesiredStubsStyle() const Q_DECL_OVERRIDE; - virtual float getTileDensityFactor() const; - virtual uint32_t getTileSize() const; + virtual float getTileDensityFactor() const Q_DECL_OVERRIDE; + virtual uint32_t getTileSize() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( @@ -78,8 +78,8 @@ namespace OsmAnd const IMapDataProvider::ObtainDataAsyncCallback callback, const bool collectMetric = false) Q_DECL_OVERRIDE; - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; static const QString buildUrlToLoad(const QString& urlToLoad, const QList randomsArray, int32_t x, int32_t y, const ZoomLevel zoom); }; diff --git a/include/OsmAndCore/Map/PolygonsCollection.h b/include/OsmAndCore/Map/PolygonsCollection.h index fac35cbc7..77056e399 100644 --- a/include/OsmAndCore/Map/PolygonsCollection.h +++ b/include/OsmAndCore/Map/PolygonsCollection.h @@ -35,7 +35,7 @@ namespace OsmAnd bool removePolygon(const std::shared_ptr& polygon); void removeAllPolygons(); - QList getProvidedDataKeys() const; + QList getProvidedDataKeys() const Q_DECL_OVERRIDE; virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; diff --git a/include/OsmAndCore/Map/TransportStopSymbolsProvider.h b/include/OsmAndCore/Map/TransportStopSymbolsProvider.h index 24fec3d21..194d0b2dd 100644 --- a/include/OsmAndCore/Map/TransportStopSymbolsProvider.h +++ b/include/OsmAndCore/Map/TransportStopSymbolsProvider.h @@ -74,8 +74,8 @@ namespace OsmAnd const std::shared_ptr obfsCollection; - virtual ZoomLevel getMinZoom() const; - virtual ZoomLevel getMaxZoom() const; + virtual ZoomLevel getMinZoom() const Q_DECL_OVERRIDE; + virtual ZoomLevel getMaxZoom() const Q_DECL_OVERRIDE; const int symbolsOrder; diff --git a/include/OsmAndCore/Map/UnresolvedMapStyle.h b/include/OsmAndCore/Map/UnresolvedMapStyle.h index e0c2de4ef..ad02d0c8b 100644 --- a/include/OsmAndCore/Map/UnresolvedMapStyle.h +++ b/include/OsmAndCore/Map/UnresolvedMapStyle.h @@ -113,7 +113,7 @@ namespace OsmAnd protected: public: UnresolvedMapStyle(const std::shared_ptr& source, const QString& name); - UnresolvedMapStyle(const QString& fileName, const QString& name = QString::null); + UnresolvedMapStyle(const QString& fileName, const QString& name = {}); virtual ~UnresolvedMapStyle(); bool isMetadataLoaded() const; diff --git a/include/OsmAndCore/Map/VectorLinesCollection.h b/include/OsmAndCore/Map/VectorLinesCollection.h index eb1ec8124..894a78621 100644 --- a/include/OsmAndCore/Map/VectorLinesCollection.h +++ b/include/OsmAndCore/Map/VectorLinesCollection.h @@ -35,7 +35,7 @@ namespace OsmAnd bool removeLine(const std::shared_ptr& line); void removeAllLines(); - virtual QList getProvidedDataKeys() const; + virtual QList getProvidedDataKeys() const Q_DECL_OVERRIDE; virtual bool supportsNaturalObtainData() const Q_DECL_OVERRIDE; virtual bool obtainData( diff --git a/include/OsmAndCore/MemoryCommon.h b/include/OsmAndCore/MemoryCommon.h index 795eedbe2..ee08786c1 100644 --- a/include/OsmAndCore/MemoryCommon.h +++ b/include/OsmAndCore/MemoryCommon.h @@ -12,44 +12,44 @@ #define OSMAND_USE_MEMORY_MANAGER(class_name) \ public: \ - static void* operator new(std::size_t count) throw(std::bad_alloc) \ + static void* operator new(std::size_t count) Q_DECL_NOEXCEPT_EXPR(false) \ { \ const auto ptr = OsmAnd::MemoryManagerSelector::get()->allocate(count, #class_name); \ if (!ptr) \ throw std::bad_alloc(); \ return ptr; \ } \ - static void* operator new[](std::size_t count) throw(std::bad_alloc) \ + static void* operator new[](std::size_t count) Q_DECL_NOEXCEPT_EXPR(false) \ { \ const auto ptr = OsmAnd::MemoryManagerSelector::get()->allocate(count, #class_name); \ if (!ptr) \ throw std::bad_alloc(); \ return ptr; \ } \ - static void* operator new(std::size_t count, const std::nothrow_t& tag) Q_DECL_NOTHROW \ + static void* operator new(std::size_t count, const std::nothrow_t& tag) Q_DECL_NOEXCEPT \ { \ Q_UNUSED(tag); \ return OsmAnd::MemoryManagerSelector::get()->allocate(count, #class_name); \ } \ - static void* operator new[](std::size_t count, const std::nothrow_t& tag) Q_DECL_NOTHROW \ + static void* operator new[](std::size_t count, const std::nothrow_t& tag) Q_DECL_NOEXCEPT \ { \ Q_UNUSED(tag); \ return OsmAnd::MemoryManagerSelector::get()->allocate(count, #class_name); \ } \ - /*virtual*/ void operator delete(void* ptr) Q_DECL_NOTHROW \ + /*virtual*/ void operator delete(void* ptr) Q_DECL_NOEXCEPT \ { \ OsmAnd::MemoryManagerSelector::get()->free(ptr, #class_name); \ } \ - /*virtual*/ void operator delete[](void* ptr) Q_DECL_NOTHROW \ + /*virtual*/ void operator delete[](void* ptr) Q_DECL_NOEXCEPT \ { \ OsmAnd::MemoryManagerSelector::get()->free(ptr, #class_name); \ } \ - /*virtual*/ void operator delete(void* ptr, const std::nothrow_t& tag) Q_DECL_NOTHROW \ + /*virtual*/ void operator delete(void* ptr, const std::nothrow_t& tag) Q_DECL_NOEXCEPT \ { \ Q_UNUSED(tag); \ OsmAnd::MemoryManagerSelector::get()->free(ptr, #class_name); \ } \ - /*virtual*/ void operator delete[](void* ptr, const std::nothrow_t& tag) Q_DECL_NOTHROW \ + /*virtual*/ void operator delete[](void* ptr, const std::nothrow_t& tag) Q_DECL_NOEXCEPT \ { \ Q_UNUSED(tag); \ OsmAnd::MemoryManagerSelector::get()->free(ptr, #class_name); \ diff --git a/include/OsmAndCore/Metrics.h b/include/OsmAndCore/Metrics.h index a566a2404..599e691ac 100644 --- a/include/OsmAndCore/Metrics.h +++ b/include/OsmAndCore/Metrics.h @@ -111,7 +111,7 @@ namespace OsmAnd return addSubmetricOfType(); } - virtual QString toString(const bool shortFormat = false, const QString& prefix = QString::null) const; + virtual QString toString(const bool shortFormat = false, const QString& prefix = {}) const; }; } diff --git a/include/OsmAndCore/ResourcesManager.h b/include/OsmAndCore/ResourcesManager.h index dc35a71be..853ef404d 100644 --- a/include/OsmAndCore/ResourcesManager.h +++ b/include/OsmAndCore/ResourcesManager.h @@ -231,12 +231,12 @@ namespace OsmAnd public: ResourcesManager( const QString& localStoragePath, - const QString& userStoragePath = QString::null, + const QString& userStoragePath = {}, const QList& readonlyExternalStoragePaths = QList(), - const QString& miniBasemapFilename = QString::null, - const QString& localTemporaryPath = QString::null, - const QString& localCachePath = QString::null, - const QString& appVersion = QString::null, + const QString& miniBasemapFilename = {}, + const QString& localTemporaryPath = {}, + const QString& localCachePath = {}, + const QString& appVersion = {}, const QString& repositoryBaseUrl = QLatin1String("http://download.osmand.net"), const std::shared_ptr& webClient = std::shared_ptr(new WebClient())); virtual ~ResourcesManager(); diff --git a/include/OsmAndCore/Routing/RoutePlannerContext.h b/include/OsmAndCore/Routing/RoutePlannerContext.h index 8ac2f60c4..9eb4c3a5b 100644 --- a/include/OsmAndCore/Routing/RoutePlannerContext.h +++ b/include/OsmAndCore/Routing/RoutePlannerContext.h @@ -72,7 +72,7 @@ namespace OsmAnd { RouteCalculationSegment(const std::shared_ptr& road, uint32_t pointIndex); - void dump(const QString& prefix = QString::null) const; + void dump(const QString& prefix = {}) const; public: virtual ~RouteCalculationSegment(); diff --git a/include/OsmAndCore/Routing/RouteSegment.h b/include/OsmAndCore/Routing/RouteSegment.h index 54d141848..db00f42da 100644 --- a/include/OsmAndCore/Routing/RouteSegment.h +++ b/include/OsmAndCore/Routing/RouteSegment.h @@ -37,7 +37,7 @@ namespace OsmAnd { // this make not possible to make turns in between segment result for now TurnInfo _turnType; - void dump(const QString& prefix = QString::null) const; + void dump(const QString& prefix = {}) const; public: virtual ~RouteSegment(); diff --git a/include/OsmAndCore/TileDB.h b/include/OsmAndCore/TileDB.h index 315f57811..6c2a5f5ac 100644 --- a/include/OsmAndCore/TileDB.h +++ b/include/OsmAndCore/TileDB.h @@ -27,7 +27,7 @@ namespace OsmAnd { bool openIndex(); public: - TileDB(const QDir& dataPath, const QString& indexFilename = QString::null); + TileDB(const QDir& dataPath, const QString& indexFilename = {}); virtual ~TileDB(); const QDir dataPath; diff --git a/src/AccessLockCounter_P.cpp b/src/AccessLockCounter_P.cpp index 6985d045b..a6d9c2520 100644 --- a/src/AccessLockCounter_P.cpp +++ b/src/AccessLockCounter_P.cpp @@ -2,9 +2,9 @@ #include "AccessLockCounter.h" OsmAnd::AccessLockCounter_P::AccessLockCounter_P(AccessLockCounter* const owner_) - : owner(owner_) - , _lockCounter(0) + : _lockCounter(0) , _isBeingDestroyed(false) + , owner(owner_) { } diff --git a/src/ArchiveReader.cpp b/src/ArchiveReader.cpp index eb2f9c82a..b4454f320 100644 --- a/src/ArchiveReader.cpp +++ b/src/ArchiveReader.cpp @@ -32,7 +32,6 @@ bool OsmAnd::ArchiveReader::extractAllItemsTo(const QString& destinationPath, ui } OsmAnd::ArchiveReader::Item::Item() - : name(QString::null) { } diff --git a/src/CachedOsmandIndexes_P.cpp b/src/CachedOsmandIndexes_P.cpp index 75b6e8bd7..d9e3805fd 100644 --- a/src/CachedOsmandIndexes_P.cpp +++ b/src/CachedOsmandIndexes_P.cpp @@ -339,7 +339,7 @@ std::shared_ptr OsmAnd::CachedOsmandIndexes_P::initFileIn mi->nameIndexInnerOffset = index.indexnameoffset(); for (int m = 0; m < index.cities_size(); m++) { auto mr = index.cities(m); - auto cblock = std::make_shared(QString::null, mr.offset(), mr.size(), mr.type()); + auto cblock = std::make_shared(QString(), mr.offset(), mr.size(), mr.type()); mi->cities.push_back(cblock); } for (int m = 0; m < index.additionaltags_size(); m++) { diff --git a/src/CachingRoadLocator_P.cpp b/src/CachingRoadLocator_P.cpp index 2fd12034f..77d809fe6 100644 --- a/src/CachingRoadLocator_P.cpp +++ b/src/CachingRoadLocator_P.cpp @@ -69,7 +69,7 @@ QVector, std::shared_ptr> * const outReferencedCacheEntries) const { - + return {}; } QList< std::shared_ptr > OsmAnd::CachingRoadLocator_P::findRoadsInArea( diff --git a/src/CoreResourcesEmbeddedBundle_P.cpp b/src/CoreResourcesEmbeddedBundle_P.cpp index dc4ab134c..664848f17 100644 --- a/src/CoreResourcesEmbeddedBundle_P.cpp +++ b/src/CoreResourcesEmbeddedBundle_P.cpp @@ -130,8 +130,8 @@ void* OsmAnd::CoreResourcesEmbeddedBundle_P::loadSymbol(const char* const symbol bool OsmAnd::CoreResourcesEmbeddedBundle_P::loadResources() { typedef const void* (*GetPointerFunctionPtr)(); - typedef const char* NamePtr; - typedef const uint8_t* DataPtr; + // typedef const char* NamePtr; + // typedef const uint8_t* DataPtr; // Regular expressions to extract pure resource name or qualifiers const QRegularExpression resourceNameWithQualifiersRegExp("(?:\\[(.*)\\])(.*)"); @@ -182,7 +182,7 @@ bool OsmAnd::CoreResourcesEmbeddedBundle_P::loadResources() const auto resourceNameComponents = resourceNameWithQualifiersRegExp.match(QLatin1String(resourceName)); if (resourceNameComponents.hasMatch()) { - qualifiers = resourceNameComponents.captured(1).split(QLatin1Char(';'), QString::SkipEmptyParts); + qualifiers = resourceNameComponents.captured(1).split(QLatin1Char(';'), Qt::SkipEmptyParts); pureResourceName = resourceNameComponents.captured(2); } else @@ -200,7 +200,7 @@ bool OsmAnd::CoreResourcesEmbeddedBundle_P::loadResources() { for (const auto& qualifier : constOf(qualifiers)) { - const auto qualifierComponents = qualifier.trimmed().split(QLatin1Char('='), QString::SkipEmptyParts); + const auto qualifierComponents = qualifier.trimmed().split(QLatin1Char('='), Qt::SkipEmptyParts); bool ok = false; if (qualifierComponents.size() == 2 && qualifierComponents.first() == QLatin1String("ddf")) diff --git a/src/Data/MapObject.cpp b/src/Data/MapObject.cpp index 834aef967..c5a2efc73 100644 --- a/src/Data/MapObject.cpp +++ b/src/Data/MapObject.cpp @@ -207,7 +207,7 @@ QString OsmAnd::MapObject::getCaptionInNativeLanguage() const { const auto citName = captions.constFind(attributeMapping->nativeNameAttributeId); if (citName == captions.cend()) - return QString::null; + return {}; return *citName; } @@ -215,11 +215,11 @@ QString OsmAnd::MapObject::getCaptionInLanguage(const QString& lang) const { const auto citNameAttributeId = attributeMapping->localizedNameAttributes.constFind(&lang); if (citNameAttributeId == attributeMapping->localizedNameAttributes.cend()) - return QString::null; + return {}; const auto citCaption = captions.constFind(*citNameAttributeId); if (citCaption == captions.cend()) - return QString::null; + return {}; return *citCaption; } @@ -316,13 +316,13 @@ void OsmAnd::MapObject::AttributeMapping::registerRequiredMapping(uint32_t& last if (nativeNameAttributeId == std::numeric_limits::max()) { registerMapping(++lastUsedEntryId, - QLatin1String("name"), QString::null); + QLatin1String("name"), {}); } if (refAttributeId == std::numeric_limits::max()) { registerMapping(++lastUsedEntryId, - QLatin1String("ref"), QString::null); + QLatin1String("ref"), {}); } if (naturalCoastlineAttributeId == std::numeric_limits::max()) diff --git a/src/Data/ObfAddressSectionReader_P.cpp b/src/Data/ObfAddressSectionReader_P.cpp index bc26cea27..ff9e3930c 100644 --- a/src/Data/ObfAddressSectionReader_P.cpp +++ b/src/Data/ObfAddressSectionReader_P.cpp @@ -94,7 +94,7 @@ void OsmAnd::ObfAddressSectionReader_P::read( } case OBF::OsmAndAddressIndex::kCitiesFieldNumber: { - auto name = QString::null; + auto name = QString(); auto length = ObfReaderUtilities::readBigEndianInt(cis); auto offset = cis->CurrentPosition(); uint32_t type = 1; @@ -490,7 +490,7 @@ void OsmAnd::ObfAddressSectionReader_P::readBuildingsFromStreet( for (;;) { - const auto tagPos = cis->CurrentPosition(); + //const auto tagPos = cis->CurrentPosition(); const auto tag = cis->ReadTag(); switch (gpb::internal::WireFormatLite::GetTagFieldNumber(tag)) { @@ -728,7 +728,7 @@ void OsmAnd::ObfAddressSectionReader_P::readIntersectionsFromStreet( for (;;) { - const auto tagPos = cis->CurrentPosition(); + //const auto tagPos = cis->CurrentPosition(); const auto tag = cis->ReadTag(); switch (gpb::internal::WireFormatLite::GetTagFieldNumber(tag)) { @@ -881,7 +881,7 @@ void OsmAnd::ObfAddressSectionReader_P::readAddressesByName( for (;;) { - const auto tagPos = cis->CurrentPosition(); + //const auto tagPos = cis->CurrentPosition(); const auto tag = cis->ReadTag(); switch (gpb::internal::WireFormatLite::GetTagFieldNumber(tag)) { diff --git a/src/Data/ObfInfo.cpp b/src/Data/ObfInfo.cpp index e0ca2568d..d8acf6fe8 100644 --- a/src/Data/ObfInfo.cpp +++ b/src/Data/ObfInfo.cpp @@ -166,7 +166,7 @@ bool OsmAnd::ObfInfo::containsDataFor( const OsmAnd::Nullable OsmAnd::ObfInfo::getRegionCenter() const { Nullable result; - for (const auto r : mapSections) + for (const auto& r : mapSections) { if (r->calculatedCenter.isSet()) return result = r->calculatedCenter; @@ -178,7 +178,7 @@ void OsmAnd::ObfInfo::calculateCenterPointForRegions() const { for (auto reg : addressSections) { - for (auto map : mapSections) + for (const auto& map : mapSections) { if (reg->name == map->name) { @@ -191,7 +191,7 @@ void OsmAnd::ObfInfo::calculateCenterPointForRegions() const } if (!reg->calculatedCenter.isSet()) { - for (auto map : routingSections) + for (const auto& map : routingSections) { if (reg->name == map->name) { @@ -206,7 +206,7 @@ void OsmAnd::ObfInfo::calculateCenterPointForRegions() const const QStringList OsmAnd::ObfInfo::getRegionNames() const { QStringList rg; - for (const auto r : addressSections) + for (const auto& r : addressSections) rg << r->name; return rg; diff --git a/src/Data/ObfMapSectionReader_P.cpp b/src/Data/ObfMapSectionReader_P.cpp index 7c47f4efa..f91667c21 100644 --- a/src/Data/ObfMapSectionReader_P.cpp +++ b/src/Data/ObfMapSectionReader_P.cpp @@ -104,7 +104,7 @@ void OsmAnd::ObfMapSectionReader_P::readAttributeMapping( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); auto oldLimit = cis->PushLimit(length); readAttributeMappingEntry(reader, naturalId++, attributeMapping); @@ -556,7 +556,7 @@ void OsmAnd::ObfMapSectionReader_P::readMapObjectsBlock( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); // Read map object content const Stopwatch readMapObjectStopwatch(metric != nullptr); @@ -615,7 +615,7 @@ void OsmAnd::ObfMapSectionReader_P::readMapObjectsBlock( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); auto oldLimit = cis->PushLimit(length); if (intermediateResult.isEmpty()) { diff --git a/src/Data/ObfPoiSectionReader_P.cpp b/src/Data/ObfPoiSectionReader_P.cpp index e3335ef33..e1595b52e 100644 --- a/src/Data/ObfPoiSectionReader_P.cpp +++ b/src/Data/ObfPoiSectionReader_P.cpp @@ -59,7 +59,7 @@ void OsmAnd::ObfPoiSectionReader_P::read( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); auto oldLimit = cis->PushLimit(length); ObfReaderUtilities::readTileBox(cis, section->area31); @@ -116,7 +116,7 @@ void OsmAnd::ObfPoiSectionReader_P::readCategories( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); QString mainCategory; @@ -224,7 +224,7 @@ void OsmAnd::ObfPoiSectionReader_P::readSubtypes( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); readSubtypesStructure(reader, subtypes); @@ -264,7 +264,7 @@ void OsmAnd::ObfPoiSectionReader_P::readSubtypesStructure( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); const std::shared_ptr subtype(new ObfPoiSectionSubtype()); @@ -420,7 +420,7 @@ void OsmAnd::ObfPoiSectionReader_P::readAmenities( case OBF::OsmAndPoiIndex::kBoxesFieldNumber: { const auto length = ObfReaderUtilities::readBigEndianInt(cis); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); scanTiles( @@ -466,14 +466,14 @@ void OsmAnd::ObfPoiSectionReader_P::readAmenities( cis->Seek(section->offset + dataOffset); const auto length = ObfReaderUtilities::readBigEndianInt(cis); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); const auto atLeastOneAccepted = readAmenitiesDataBox( reader, section, outAmenities, - QString::null, + QString(), bbox31, tileFilter, zoomToSkip, @@ -583,7 +583,7 @@ bool OsmAnd::ObfPoiSectionReader_P::scanTiles( cis->Skip(length); break; } - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); const auto hasMatchingContent = scanTileForMatchingCategories(reader, *categoriesFilter); @@ -600,7 +600,7 @@ bool OsmAnd::ObfPoiSectionReader_P::scanTiles( case OBF::OsmAndPoiBox::kSubBoxesFieldNumber: { const auto length = ObfReaderUtilities::readBigEndianInt(cis); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); const auto wasAccepted = scanTiles( @@ -784,7 +784,7 @@ bool OsmAnd::ObfPoiSectionReader_P::readAmenitiesDataBox( gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); std::shared_ptr amenity; @@ -936,9 +936,10 @@ void OsmAnd::ObfPoiSectionReader_P::readAmenity( return; } + auto categoriesSet = QSet(categories.begin(), categories.end()); if (!categoriesFilterChecked && categoriesFilter && - categories.toSet().intersect(*categoriesFilter).isEmpty()) + categoriesSet.intersect(*categoriesFilter).isEmpty()) { return; } @@ -1004,9 +1005,10 @@ void OsmAnd::ObfPoiSectionReader_P::readAmenity( } case OBF::OsmAndPoiBoxDataAtom::kSubcategoriesFieldNumber: { + auto categoriesSet = QSet(categories.begin(), categories.end()); if (!categoriesFilterChecked && categoriesFilter && - categories.toSet().intersect(*categoriesFilter).isEmpty()) + categoriesSet.intersect(*categoriesFilter).isEmpty()) { cis->Skip(cis->BytesUntilLimit()); return; @@ -1158,7 +1160,7 @@ void OsmAnd::ObfPoiSectionReader_P::readAmenitiesByName( case OBF::OsmAndPoiIndex::kNameIndexFieldNumber: { const auto length = ObfReaderUtilities::readBigEndianInt(cis); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); scanNameIndex( @@ -1208,7 +1210,7 @@ void OsmAnd::ObfPoiSectionReader_P::readAmenitiesByName( { cis->Seek(section->offset + dataOffset); const auto length = ObfReaderUtilities::readBigEndianInt(cis); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); readAmenitiesDataBox( diff --git a/src/Data/ObfReaderUtilities.cpp b/src/Data/ObfReaderUtilities.cpp index 9df490717..896f191ea 100644 --- a/src/Data/ObfReaderUtilities.cpp +++ b/src/Data/ObfReaderUtilities.cpp @@ -135,7 +135,7 @@ int OsmAnd::ObfReaderUtilities::scanIndexedStringTable( } else if (query.length() < matchedCharactersCount) { - key = QString::null; + key = QString(); } } else if (matchesBackward) @@ -147,12 +147,12 @@ int OsmAnd::ObfReaderUtilities::scanIndexedStringTable( } else if (key.length() < matchedCharactersCount) { - key = QString::null; + key = QString(); } } else { - key = QString::null; + key = QString(); } break; } diff --git a/src/Data/ObfReaderUtilities.h b/src/Data/ObfReaderUtilities.h index 711e23ba5..c570ef7dc 100644 --- a/src/Data/ObfReaderUtilities.h +++ b/src/Data/ObfReaderUtilities.h @@ -37,7 +37,7 @@ namespace OsmAnd const QString& query, QVector& outValues, const bool strictMatch = false, - const QString& keysPrefix = QString::null, + const QString& keysPrefix = {}, const int matchedCharactersCount = 0); static void readTileBox(gpb::io::CodedInputStream* cis, AreaI& outArea); diff --git a/src/Data/ObfRoutingSectionReader_P.cpp b/src/Data/ObfRoutingSectionReader_P.cpp index fdbfe10f5..73b9f4fea 100644 --- a/src/Data/ObfRoutingSectionReader_P.cpp +++ b/src/Data/ObfRoutingSectionReader_P.cpp @@ -93,7 +93,7 @@ void OsmAnd::ObfRoutingSectionReader_P::readLevelTreeNodeBbox31( for (;;) { - const auto tagPos = cis->CurrentPosition(); + //const auto tagPos = cis->CurrentPosition(); const auto tag = cis->ReadTag(); const auto tgn = gpb::internal::WireFormatLite::GetTagFieldNumber(tag); switch (tgn) @@ -150,7 +150,7 @@ void OsmAnd::ObfRoutingSectionReader_P::readAttributeMapping( case OBF::OsmAndRoutingIndex::kRulesFieldNumber: { const auto length = ObfReaderUtilities::readLength(cis); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); readAttributeMappingEntry(reader, naturalId++, attributeMapping); @@ -382,7 +382,7 @@ void OsmAnd::ObfRoutingSectionReader_P::readLevelTreeNodeChildren( for (;;) { - const auto lastPos = cis->CurrentPosition(); + //const auto lastPos = cis->CurrentPosition(); const auto tag = cis->ReadTag(); switch (gpb::internal::WireFormatLite::GetTagFieldNumber(tag)) { @@ -503,7 +503,7 @@ void OsmAnd::ObfRoutingSectionReader_P::readRoadsBlock( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); const auto oldLimit = cis->PushLimit(length); readRoadsBlockIdsTable(reader, roadsIdsTable); @@ -520,7 +520,7 @@ void OsmAnd::ObfRoutingSectionReader_P::readRoadsBlock( gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); auto oldLimit = cis->PushLimit(length); readRoad(reader, section, treeNode, bbox31, filterById, roadsIdsTable, internalId, road, metric); @@ -557,7 +557,7 @@ void OsmAnd::ObfRoutingSectionReader_P::readRoadsBlock( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); auto oldLimit = cis->PushLimit(length); readRoadsBlockRestrictions(reader, resultsByInternalId, roadsIdsTable); @@ -570,7 +570,7 @@ void OsmAnd::ObfRoutingSectionReader_P::readRoadsBlock( { gpb::uint32 length; cis->ReadVarint32(&length); - const auto offset = cis->CurrentPosition(); + //const auto offset = cis->CurrentPosition(); auto oldLimit = cis->PushLimit(length); ObfReaderUtilities::readStringTable(cis, roadsCaptionsTable); diff --git a/src/Data/Road.cpp b/src/Data/Road.cpp index 62824901a..c9ded951f 100644 --- a/src/Data/Road.cpp +++ b/src/Data/Road.cpp @@ -71,7 +71,7 @@ QString OsmAnd::Road::getRefInNativeLanguage() const { const auto citName = captions.constFind(section->getAttributeMapping()->refAttributeId); if (citName == captions.cend()) - return QString::null; + return {}; return *citName; } @@ -79,11 +79,11 @@ QString OsmAnd::Road::getRefInLanguage(const QString& lang) const { const auto citNameAttributeId = section->getAttributeMapping()->localizedRefAttributes.constFind(&lang); if (citNameAttributeId == section->getAttributeMapping()->localizedRefAttributes.cend()) - return QString::null; + return {}; const auto citCaption = captions.constFind(*citNameAttributeId); if (citCaption == captions.cend()) - return QString::null; + return {}; return *citCaption; } diff --git a/src/GlobalMemoryManagerOverride.cpp b/src/GlobalMemoryManagerOverride.cpp index 4eeddcc7b..08243ed7d 100644 --- a/src/GlobalMemoryManagerOverride.cpp +++ b/src/GlobalMemoryManagerOverride.cpp @@ -2,7 +2,7 @@ #include -void* operator new(std::size_t count) throw(std::bad_alloc) +void* operator new(std::size_t count) Q_DECL_NOEXCEPT_EXPR(false) { const auto ptr = OsmAnd::getMemoryManager()->allocate(count, "global"); if (!ptr) @@ -10,7 +10,7 @@ void* operator new(std::size_t count) throw(std::bad_alloc) return ptr; } -void* operator new[](std::size_t count) throw(std::bad_alloc) +void* operator new[](std::size_t count) Q_DECL_NOEXCEPT_EXPR(false) { const auto ptr = OsmAnd::getMemoryManager()->allocate(count, "global"); if (!ptr) @@ -18,35 +18,35 @@ void* operator new[](std::size_t count) throw(std::bad_alloc) return ptr; } -void* operator new(std::size_t count, const std::nothrow_t& tag) Q_DECL_NOTHROW +void* operator new(std::size_t count, const std::nothrow_t& tag) Q_DECL_NOEXCEPT { Q_UNUSED(tag); return OsmAnd::getMemoryManager()->allocate(count, "global"); } -void* operator new[](std::size_t count, const std::nothrow_t& tag) Q_DECL_NOTHROW +void* operator new[](std::size_t count, const std::nothrow_t& tag) Q_DECL_NOEXCEPT { Q_UNUSED(tag); return OsmAnd::getMemoryManager()->allocate(count, "global"); } -void operator delete(void* ptr) Q_DECL_NOTHROW +void operator delete(void* ptr) Q_DECL_NOEXCEPT { OsmAnd::getMemoryManager()->free(ptr, "global"); } -void operator delete[](void* ptr) Q_DECL_NOTHROW +void operator delete[](void* ptr) Q_DECL_NOEXCEPT { OsmAnd::getMemoryManager()->free(ptr, "global"); } -void operator delete(void* ptr, const std::nothrow_t& tag) Q_DECL_NOTHROW +void operator delete(void* ptr, const std::nothrow_t& tag) Q_DECL_NOEXCEPT { Q_UNUSED(tag); OsmAnd::getMemoryManager()->free(ptr, "global"); } -void operator delete[](void* ptr, const std::nothrow_t& tag) Q_DECL_NOTHROW +void operator delete[](void* ptr, const std::nothrow_t& tag) Q_DECL_NOEXCEPT { Q_UNUSED(tag); OsmAnd::getMemoryManager()->free(ptr, "global"); diff --git a/src/GpxDocument.cpp b/src/GpxDocument.cpp index 0c1316ca5..2b1578e2b 100644 --- a/src/GpxDocument.cpp +++ b/src/GpxDocument.cpp @@ -2170,11 +2170,11 @@ std::shared_ptr OsmAnd::GpxDocument::loadFrom(QXmlStreamRea } QString points = xmlReader.readElementText(); - QStringList list = points.split(QStringLiteral("\n"), QString::SkipEmptyParts); + QStringList list = points.split(QStringLiteral("\n"), Qt::SkipEmptyParts); for (int i = 0; i < list.count(); i++) { - QStringList coords = list[i].split(QStringLiteral(","), QString::SkipEmptyParts); + QStringList coords = list[i].split(QStringLiteral(","), Qt::SkipEmptyParts); int arrLength = coords.count(); if (arrLength > 1) { @@ -2723,7 +2723,7 @@ QHash OsmAnd::GpxDocument::GpxExtensions::getValues(const boo QHash values; if (!value.isEmpty()) - values.insert(QString::null, value); + values.insert({}, value); for (const auto attributeEntry : rangeOf(constOf(attributes))) values.insert(attributeEntry.key(), attributeEntry.value()); diff --git a/src/Map/AmenitySymbolsProvider.cpp b/src/Map/AmenitySymbolsProvider.cpp index 4eb68b1f7..9b9e34b0c 100644 --- a/src/Map/AmenitySymbolsProvider.cpp +++ b/src/Map/AmenitySymbolsProvider.cpp @@ -100,5 +100,5 @@ bool OsmAnd::AmenitySymbolsProvider::AmenitySymbolsGroup::obtainSortingKey(Sorti QString OsmAnd::AmenitySymbolsProvider::AmenitySymbolsGroup::toString() const { - return QString::null; + return {}; } diff --git a/src/Map/AmenitySymbolsProvider_P.cpp b/src/Map/AmenitySymbolsProvider_P.cpp index e619715f1..714230666 100644 --- a/src/Map/AmenitySymbolsProvider_P.cpp +++ b/src/Map/AmenitySymbolsProvider_P.cpp @@ -17,8 +17,8 @@ static const int kSkipTilesZoom = 13; static const int kSkipTileDivider = 16; OsmAnd::AmenitySymbolsProvider_P::AmenitySymbolsProvider_P(AmenitySymbolsProvider* owner_) -: owner(owner_) -, textRasterizer(TextRasterizer::getDefault()) + : textRasterizer(TextRasterizer::getDefault()) + , owner(owner_) { } diff --git a/src/Map/AtlasMapRenderer.cpp b/src/Map/AtlasMapRenderer.cpp index 7ee2b26d5..4950853c2 100644 --- a/src/Map/AtlasMapRenderer.cpp +++ b/src/Map/AtlasMapRenderer.cpp @@ -52,7 +52,7 @@ bool OsmAnd::AtlasMapRenderer::updateInternalState( bool OsmAnd::AtlasMapRenderer::prePrepareFrame() { - const auto internalState = static_cast(getInternalStateRef()); + // const auto internalState = static_cast(getInternalStateRef()); if (!MapRenderer::prePrepareFrame()) return false; diff --git a/src/Map/AtlasMapRendererSymbolsStage.cpp b/src/Map/AtlasMapRendererSymbolsStage.cpp index 6bb01fd39..ec8e03c8a 100644 --- a/src/Map/AtlasMapRendererSymbolsStage.cpp +++ b/src/Map/AtlasMapRendererSymbolsStage.cpp @@ -888,7 +888,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage::plotBillboardRasterSymbol( const auto& internalState = getInternalState(); const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); - const auto& symbolGroupPtr = symbol->groupPtr; + // const auto& symbolGroupPtr = symbol->groupPtr; const auto& offsetOnScreen = (renderable->instanceParameters && renderable->instanceParameters->overridesOffset) @@ -1057,10 +1057,10 @@ bool OsmAnd::AtlasMapRendererSymbolsStage::plotOnSurfaceRasterSymbol( ScreenQuadTree& intersections, AtlasMapRenderer_Metrics::Metric_renderFrame* const metric) const { - const auto& internalState = getInternalState(); + // const auto& internalState = getInternalState(); - const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); - const auto& symbolGroupPtr = symbol->groupPtr; + // const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); + // const auto& symbolGroupPtr = symbol->groupPtr; return true; } @@ -1070,10 +1070,10 @@ bool OsmAnd::AtlasMapRendererSymbolsStage::plotOnSurfaceVectorSymbol( ScreenQuadTree& intersections, AtlasMapRenderer_Metrics::Metric_renderFrame* const metric) const { - const auto& internalState = getInternalState(); + // const auto& internalState = getInternalState(); - const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); - const auto& symbolGroupPtr = symbol->groupPtr; + // const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); + // const auto& symbolGroupPtr = symbol->groupPtr; return true; } @@ -1394,7 +1394,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage::plotOnPathSymbol( const auto& internalState = getInternalState(); const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); - const auto& symbolGroupPtr = symbol->groupPtr; + // const auto& symbolGroupPtr = symbol->groupPtr; // Draw the glyphs if (renderable->is2D) diff --git a/src/Map/CoreResourcesAmenityIconProvider.cpp b/src/Map/CoreResourcesAmenityIconProvider.cpp index d1863bfcf..cb8d5712b 100644 --- a/src/Map/CoreResourcesAmenityIconProvider.cpp +++ b/src/Map/CoreResourcesAmenityIconProvider.cpp @@ -61,5 +61,5 @@ QString OsmAnd::CoreResourcesAmenityIconProvider::getCaption( const std::shared_ptr& amenity, const ZoomLevel zoomLevel) const { - return QString::null; + return {}; } diff --git a/src/Map/FavoriteLocationsPresenter_P.cpp b/src/Map/FavoriteLocationsPresenter_P.cpp index 05cb9a1f0..5de17d9ae 100644 --- a/src/Map/FavoriteLocationsPresenter_P.cpp +++ b/src/Map/FavoriteLocationsPresenter_P.cpp @@ -8,8 +8,8 @@ #include "IFavoriteLocationsCollection.h" OsmAnd::FavoriteLocationsPresenter_P::FavoriteLocationsPresenter_P(FavoriteLocationsPresenter* const owner_) - : owner(owner_) - , _markersCollection(new MapMarkersCollection()) + : _markersCollection(new MapMarkersCollection()) + , owner(owner_) { } diff --git a/src/Map/HeightmapTileProvider_P.cpp b/src/Map/HeightmapTileProvider_P.cpp index a13bc66bd..44c5a686a 100644 --- a/src/Map/HeightmapTileProvider_P.cpp +++ b/src/Map/HeightmapTileProvider_P.cpp @@ -16,8 +16,8 @@ OsmAnd::HeightmapTileProvider_P::HeightmapTileProvider_P( HeightmapTileProvider* const owner_, const QString& dataPath, const QString& indexFilename) - : owner(owner_) - , _tileDb(dataPath, indexFilename) + : _tileDb(dataPath, indexFilename) + , owner(owner_) { } @@ -68,8 +68,7 @@ bool OsmAnd::HeightmapTileProvider_P::obtainData( // We have the data, use GDAL to decode this GeoTIFF const auto tileSize = getTileSize(); bool success = false; - QString vmemFilename; - vmemFilename.sprintf("/vsimem/heightmapTile@%p", data.data()); + auto vmemFilename = QString::asprintf("/vsimem/heightmapTile@%p", data.data()); VSIFileFromMemBuffer(qPrintable(vmemFilename), reinterpret_cast(data.data()), data.length(), FALSE); auto dataset = reinterpret_cast(GDALOpen(qPrintable(vmemFilename), GA_ReadOnly)); if (dataset != nullptr) diff --git a/src/Map/MapAnimator_P.cpp b/src/Map/MapAnimator_P.cpp index f834b86cc..ada92ecbf 100644 --- a/src/Map/MapAnimator_P.cpp +++ b/src/Map/MapAnimator_P.cpp @@ -728,7 +728,7 @@ void OsmAnd::MapAnimator_P::constructParabolicTargetAnimationByDelta_Zoom( std::shared_ptr zoomInAnimation(new MapAnimator_P::Animation( key, AnimatedValue::Zoom, - [this] + [] (AnimationContext& context, const std::shared_ptr& sharedContext) -> float { // If shared context contains no data it means that parabolic effect was disabled @@ -808,7 +808,7 @@ void OsmAnd::MapAnimator_P::constructParabolicTargetAnimationToValue_Zoom( std::shared_ptr zoomInAnimation(new MapAnimator_P::Animation( key, AnimatedValue::Zoom, - [this] + [] (AnimationContext& context, const std::shared_ptr& sharedContext) -> float { // If shared context contains no data it means that parabolic effect was disabled @@ -982,8 +982,8 @@ OsmAnd::MapAnimator_P::GenericAnimation::GenericAnimation( , _sharedContext(sharedContext_) , key(key_) , animatedValue(animatedValue_) - , duration(duration_) , delay(delay_) + , duration(duration_) , timingFunction(timingFunction_) { } diff --git a/src/Map/MapMarker.cpp b/src/Map/MapMarker.cpp index ec6ab72fa..c5597c556 100644 --- a/src/Map/MapMarker.cpp +++ b/src/Map/MapMarker.cpp @@ -19,12 +19,12 @@ OsmAnd::MapMarker::MapMarker( , pinIcon(pinIcon_) , pinIconVerticalAlignment(pinIconVerticalAlignment_) , pinIconHorisontalAlignment(pinIconHorisontalAlignment_) - , caption(caption_) - , captionStyle(captionStyle_) - , captionTopSpace(captionTopSpace_) , onMapSurfaceIcons(onMapSurfaceIcons_) , isAccuracyCircleSupported(isAccuracyCircleSupported_) , accuracyCircleBaseColor(accuracyCircleBaseColor_) + , caption(caption_) + , captionStyle(captionStyle_) + , captionTopSpace(captionTopSpace_) { } diff --git a/src/Map/MapMarker_P.cpp b/src/Map/MapMarker_P.cpp index 71af7d103..907ad2662 100644 --- a/src/Map/MapMarker_P.cpp +++ b/src/Map/MapMarker_P.cpp @@ -14,8 +14,8 @@ #include "MapSymbolIntersectionClassesRegistry.h" OsmAnd::MapMarker_P::MapMarker_P(MapMarker* const owner_) - : owner(owner_) - , textRasterizer(TextRasterizer::getDefault()) + : textRasterizer(TextRasterizer::getDefault()) + , owner(owner_) { } @@ -301,11 +301,11 @@ std::shared_ptr OsmAnd::MapMarker_P::inflateSym onMapSurfaceIconSymbol->bitmap = iconClone; onMapSurfaceIconSymbol->size = PointI(iconClone->width(), iconClone->height()); - onMapSurfaceIconSymbol->content = QString().sprintf( - "markerGroup(%p:%p)->onMapSurfaceIconBitmap:%p", - this, - symbolsGroup.get(), - iconClone->getPixels()); + onMapSurfaceIconSymbol->content = QObject::tr( + "markerGroup(0x%1:0x%2)->onMapSurfaceIcon:0x%3") + .arg((quintptr)this, QT_POINTER_SIZE * 2, 16, QChar('0')) + .arg((quintptr)symbolsGroup.get(), QT_POINTER_SIZE * 2, 16, QChar('0')) + .arg((quintptr)iconClone->getPixels(), QT_POINTER_SIZE * 2, 16, QChar('0')); onMapSurfaceIconSymbol->languageId = LanguageId::Invariant; onMapSurfaceIconSymbol->position31 = _position; onMapSurfaceIconSymbol->direction = direction; diff --git a/src/Map/MapPrimitivesMetricsLayerProvider_P.cpp b/src/Map/MapPrimitivesMetricsLayerProvider_P.cpp index b1abf84a7..f9fd556fd 100644 --- a/src/Map/MapPrimitivesMetricsLayerProvider_P.cpp +++ b/src/Map/MapPrimitivesMetricsLayerProvider_P.cpp @@ -172,7 +172,7 @@ bool OsmAnd::MapPrimitivesMetricsLayerProvider_P::obtainData( textPaint.setColor(SK_ColorGREEN); auto topOffset = fontSize; - const auto lines = text.split(QLatin1Char('\n'), QString::SkipEmptyParts); + const auto lines = text.split(QLatin1Char('\n'), Qt::SkipEmptyParts); for (const auto& line : lines) { canvas.drawText( diff --git a/src/Map/MapPrimitiviser.cpp b/src/Map/MapPrimitiviser.cpp index 04acec6f7..b0d1d0b94 100644 --- a/src/Map/MapPrimitiviser.cpp +++ b/src/Map/MapPrimitiviser.cpp @@ -335,42 +335,42 @@ OsmAnd::MapPrimitiviser::Cache::~Cache() { } -OsmAnd::MapPrimitiviser::Cache::SharedPrimitivesGroupsContainer& OsmAnd::MapPrimitiviser::Cache::getPrimitivesGroups(const ZoomLevel zoom) +OsmAnd::MapPrimitiviser::Cache::SharedPrimitivesGroupsContainer& OsmAnd::MapPrimitiviser::Cache::getPrimitivesGroups(ZoomLevel zoom) { return _sharedPrimitivesGroups[zoom]; } -const OsmAnd::MapPrimitiviser::Cache::SharedPrimitivesGroupsContainer& OsmAnd::MapPrimitiviser::Cache::getPrimitivesGroups(const ZoomLevel zoom) const +const OsmAnd::MapPrimitiviser::Cache::SharedPrimitivesGroupsContainer& OsmAnd::MapPrimitiviser::Cache::getPrimitivesGroups(ZoomLevel zoom) const { return _sharedPrimitivesGroups[zoom]; } -OsmAnd::MapPrimitiviser::Cache::SharedSymbolsGroupsContainer& OsmAnd::MapPrimitiviser::Cache::getSymbolsGroups(const ZoomLevel zoom) +OsmAnd::MapPrimitiviser::Cache::SharedSymbolsGroupsContainer& OsmAnd::MapPrimitiviser::Cache::getSymbolsGroups(ZoomLevel zoom) { return _sharedSymbolsGroups[zoom]; } -const OsmAnd::MapPrimitiviser::Cache::SharedSymbolsGroupsContainer& OsmAnd::MapPrimitiviser::Cache::getSymbolsGroups(const ZoomLevel zoom) const +const OsmAnd::MapPrimitiviser::Cache::SharedSymbolsGroupsContainer& OsmAnd::MapPrimitiviser::Cache::getSymbolsGroups(ZoomLevel zoom) const { return _sharedSymbolsGroups[zoom]; } -OsmAnd::MapPrimitiviser::Cache::SharedPrimitivesGroupsContainer* OsmAnd::MapPrimitiviser::Cache::getPrimitivesGroupsPtr(const ZoomLevel zoom) +OsmAnd::MapPrimitiviser::Cache::SharedPrimitivesGroupsContainer* OsmAnd::MapPrimitiviser::Cache::getPrimitivesGroupsPtr(ZoomLevel zoom) { return &getPrimitivesGroups(zoom); } -const OsmAnd::MapPrimitiviser::Cache::SharedPrimitivesGroupsContainer* OsmAnd::MapPrimitiviser::Cache::getPrimitivesGroupsPtr(const ZoomLevel zoom) const +const OsmAnd::MapPrimitiviser::Cache::SharedPrimitivesGroupsContainer* OsmAnd::MapPrimitiviser::Cache::getPrimitivesGroupsPtr(ZoomLevel zoom) const { return &getPrimitivesGroups(zoom); } -OsmAnd::MapPrimitiviser::Cache::SharedSymbolsGroupsContainer* OsmAnd::MapPrimitiviser::Cache::getSymbolsGroupsPtr(const ZoomLevel zoom) +OsmAnd::MapPrimitiviser::Cache::SharedSymbolsGroupsContainer* OsmAnd::MapPrimitiviser::Cache::getSymbolsGroupsPtr(ZoomLevel zoom) { return &getSymbolsGroups(zoom); } -const OsmAnd::MapPrimitiviser::Cache::SharedSymbolsGroupsContainer* OsmAnd::MapPrimitiviser::Cache::getSymbolsGroupsPtr(const ZoomLevel zoom) const +const OsmAnd::MapPrimitiviser::Cache::SharedSymbolsGroupsContainer* OsmAnd::MapPrimitiviser::Cache::getSymbolsGroupsPtr(ZoomLevel zoom) const { return &getSymbolsGroups(zoom); } diff --git a/src/Map/MapPrimitiviser_P.cpp b/src/Map/MapPrimitiviser_P.cpp index 6df96089a..ad590e5ae 100644 --- a/src/Map/MapPrimitiviser_P.cpp +++ b/src/Map/MapPrimitiviser_P.cpp @@ -2634,7 +2634,7 @@ void OsmAnd::MapPrimitiviser_P::obtainPrimitiveTexts( intersectsWith); if (!ok) intersectsWith = QLatin1String("text"); // To simulate original behavior, texts should intersect only other texts - text->intersectsWith = intersectsWith.split(QLatin1Char(','), QString::SkipEmptyParts).toSet(); + text->intersectsWith = intersectsWith.split(QLatin1Char(','), Qt::SkipEmptyParts).toSet(); float intersectionSizeFactor = std::numeric_limits::quiet_NaN(); ok = evaluationResult.getFloatValue( @@ -2788,7 +2788,7 @@ void OsmAnd::MapPrimitiviser_P::obtainPrimitiveIcon( intersectsWith); if (!ok) intersectsWith = QLatin1String("icon"); // To simulate original behavior, icons should intersect only other icons - icon->intersectsWith = intersectsWith.split(QLatin1Char(','), QString::SkipEmptyParts).toSet(); + icon->intersectsWith = intersectsWith.split(QLatin1Char(','), Qt::SkipEmptyParts).toSet(); float intersectionSizeFactor = std::numeric_limits::quiet_NaN(); ok = primitive->evaluationResult.getFloatValue( diff --git a/src/Map/MapRasterMetricsLayerProvider_P.cpp b/src/Map/MapRasterMetricsLayerProvider_P.cpp index d4aceef12..c4675f8ad 100644 --- a/src/Map/MapRasterMetricsLayerProvider_P.cpp +++ b/src/Map/MapRasterMetricsLayerProvider_P.cpp @@ -102,7 +102,7 @@ bool OsmAnd::MapRasterMetricsLayerProvider_P::obtainData( textPaint.setColor(SK_ColorGREEN); auto topOffset = fontSize; - const auto lines = text.split(QLatin1Char('\n'), QString::SkipEmptyParts); + const auto lines = text.split(QLatin1Char('\n'), Qt::SkipEmptyParts); for (const auto& line : lines) { canvas.drawText( diff --git a/src/Map/MapRasterizer_P.cpp b/src/Map/MapRasterizer_P.cpp index 89729f8d3..ce52b0121 100644 --- a/src/Map/MapRasterizer_P.cpp +++ b/src/Map/MapRasterizer_P.cpp @@ -715,7 +715,7 @@ bool OsmAnd::MapRasterizer_P::obtainPathEffect(const QString& encodedPathEffect, auto itPathEffects = _pathEffects.constFind(encodedPathEffect); if (itPathEffects == _pathEffects.cend()) { - const auto& strIntervals = encodedPathEffect.split(QLatin1Char('_'), QString::SkipEmptyParts); + const auto& strIntervals = encodedPathEffect.split(QLatin1Char('_'), Qt::SkipEmptyParts); const auto intervalsCount = strIntervals.size(); const auto intervals = new SkScalar[intervalsCount]; @@ -731,7 +731,7 @@ bool OsmAnd::MapRasterizer_P::obtainPathEffect(const QString& encodedPathEffect, else { // "pt:px" format - const auto& complexValue = strInterval.split(QLatin1Char(':'), QString::KeepEmptyParts); + const auto& complexValue = strInterval.split(QLatin1Char(':'), Qt::KeepEmptyParts); computedValue = complexValue[0].toFloat()*owner->mapPresentationEnvironment->displayDensityFactor + complexValue[1].toFloat(); } diff --git a/src/Map/MapRenderer.cpp b/src/Map/MapRenderer.cpp index d5a47a111..f8ede1d11 100644 --- a/src/Map/MapRenderer.cpp +++ b/src/Map/MapRenderer.cpp @@ -48,13 +48,13 @@ OsmAnd::MapRenderer::MapRenderer( , _currentDebugSettings(baseDebugSettings_->createCopy()) , _currentDebugSettingsAsConst(_currentDebugSettings) , _requestedDebugSettings(baseDebugSettings_->createCopy()) + , gpuAPI(gpuAPI_) , setupOptions(_setupOptions) , currentConfiguration(_currentConfigurationAsConst) , currentState(_currentState) , publishedMapSymbolsByOrderLock(_publishedMapSymbolsByOrderLock) , publishedMapSymbolsByOrder(_publishedMapSymbolsByOrder) , currentDebugSettings(_currentDebugSettingsAsConst) - , gpuAPI(gpuAPI_) { } @@ -1023,7 +1023,7 @@ bool OsmAnd::MapRenderer::validatePublishedMapSymbolsIntegrity() for (const auto& publishedMapSymbolsEntry : rangeOf(constOf(publishedMapSymbolsByOrder))) { - const auto order = publishedMapSymbolsEntry.key(); + //const auto order = publishedMapSymbolsEntry.key(); const auto& publishedMapSymbols = publishedMapSymbolsEntry.value(); for (const auto& publishedMapSymbolsEntry : constOf(publishedMapSymbols)) diff --git a/src/Map/MapRendererKeyedSymbolsResource.cpp b/src/Map/MapRendererKeyedSymbolsResource.cpp index 39a86434e..3f6c400e8 100644 --- a/src/Map/MapRendererKeyedSymbolsResource.cpp +++ b/src/Map/MapRendererKeyedSymbolsResource.cpp @@ -169,7 +169,7 @@ bool OsmAnd::MapRendererKeyedSymbolsResource::uploadToGPU() bool anyUploadFailed = false; const auto link_ = link.lock(); - const auto collection = static_cast(&link_->collection); + // const auto collection = static_cast(&link_->collection); QHash< std::shared_ptr, std::shared_ptr > uploaded; for (const auto& symbol : constOf(_sourceData->symbolsGroup->symbols)) diff --git a/src/Map/MapRendererResourcesManager.cpp b/src/Map/MapRendererResourcesManager.cpp index 9b7fb9bf7..a97ede5dc 100644 --- a/src/Map/MapRendererResourcesManager.cpp +++ b/src/Map/MapRendererResourcesManager.cpp @@ -65,8 +65,8 @@ OsmAnd::MapRendererResourcesManager::MapRendererResourcesManager(MapRenderer* co : _taskHostBridge(this) , _resourcesRequestWorkerPool(Concurrent::WorkerPool::Order::LIFO) , _workerThreadIsAlive(false) - , _workerThreadId(nullptr) , _workerThread(new Concurrent::Thread(std::bind(&MapRendererResourcesManager::workerThreadProcedure, this))) + , _workerThreadId(nullptr) , renderer(owner_) , processingTileStubs(_processingTileStubs) , unavailableTileStubs(_unavailableTileStubs) diff --git a/src/Map/MapRendererTiledSymbolsResource.cpp b/src/Map/MapRendererTiledSymbolsResource.cpp index ef8a04162..1ad5ccb6a 100644 --- a/src/Map/MapRendererTiledSymbolsResource.cpp +++ b/src/Map/MapRendererTiledSymbolsResource.cpp @@ -284,7 +284,7 @@ bool OsmAnd::MapRendererTiledSymbolsResource::uploadToGPU() bool anyUploadFailed = false; const auto link_ = link.lock(); - const auto collection = static_cast(&link_->collection); + // const auto collection = static_cast(&link_->collection); // Unique QMultiHash< std::shared_ptr, SymbolResourceEntry > uniqueUploaded; @@ -418,7 +418,7 @@ bool OsmAnd::MapRendererTiledSymbolsResource::uploadToGPU() // Shared (referenced) for (const auto& entry : rangeOf(constOf(sharedReferenced))) { - const auto& groupResources = entry.key(); + // const auto& groupResources = entry.key(); auto symbol = entry.value().first; auto& resource = entry.value().second; @@ -575,7 +575,7 @@ void OsmAnd::MapRendererTiledSymbolsResource::releaseData() // Otherwise, groupResources->resourcesInGPU array is empty for unique group resources for (const auto& entryResourceInGPU : rangeOf(groupResources->resourcesInGPU)) { - const auto& symbol = entryResourceInGPU.key(); + // const auto& symbol = entryResourceInGPU.key(); auto& resourceInGPU = entryResourceInGPU.value(); // Unload symbol from GPU thread (using dispatcher) @@ -631,7 +631,7 @@ void OsmAnd::MapRendererTiledSymbolsResource::releaseData() // by anyone anywhere for (const auto& entryResourceInGPU : rangeOf(groupResources->resourcesInGPU)) { - const auto& symbol = entryResourceInGPU.key(); + // const auto& symbol = entryResourceInGPU.key(); auto& resourceInGPU = entryResourceInGPU.value(); // Unload symbol from GPU thread (using dispatcher) diff --git a/src/Map/MapStyleConstantValue.cpp b/src/Map/MapStyleConstantValue.cpp index 172990932..a33e66ca8 100644 --- a/src/Map/MapStyleConstantValue.cpp +++ b/src/Map/MapStyleConstantValue.cpp @@ -40,7 +40,7 @@ bool OsmAnd::MapStyleConstantValue::parse( else { // "pt:px" format - const auto& complexValue = input.split(QLatin1Char(':'), QString::KeepEmptyParts); + const auto& complexValue = input.split(QLatin1Char(':'), Qt::KeepEmptyParts); output.asComplex.asInt.pt = Utilities::parseArbitraryInt(complexValue[0], 0); output.asComplex.asInt.px = Utilities::parseArbitraryInt(complexValue[1], 0); @@ -67,7 +67,7 @@ bool OsmAnd::MapStyleConstantValue::parse( else { // 'pt:px' format - const auto& complexValue = input.split(':', QString::KeepEmptyParts); + const auto& complexValue = input.split(':', Qt::KeepEmptyParts); output.asComplex.asFloat.pt = Utilities::parseArbitraryFloat(complexValue[0], 0); output.asComplex.asFloat.px = Utilities::parseArbitraryFloat(complexValue[1], 0); @@ -155,5 +155,5 @@ QString OsmAnd::MapStyleConstantValue::toString(const MapStyleValueDataType data } } - return QString::null; + return {}; } diff --git a/src/Map/MapStyleEvaluationResult.cpp b/src/Map/MapStyleEvaluationResult.cpp index 7349a0b5d..96ced949f 100644 --- a/src/Map/MapStyleEvaluationResult.cpp +++ b/src/Map/MapStyleEvaluationResult.cpp @@ -175,7 +175,7 @@ QHash OsmAnd::MapStyleEvaluation const auto size = _storage.size(); auto pValue = _storage.constData(); - int valuesCount = 0; + // int valuesCount = 0; for (int index = 0; index < size; index++) { const auto& value = *(pValue++); @@ -213,7 +213,7 @@ bool OsmAnd::MapStyleEvaluationResult::isEmpty() const { const auto size = _storage.size(); auto pValue = _storage.constData(); - int valuesCount = 0; + // int valuesCount = 0; for (int index = 0; index < size; index++) { if ((pValue++)->isValid()) diff --git a/src/Map/MapStylesCollection_P.cpp b/src/Map/MapStylesCollection_P.cpp index f1406fd2e..26be75e7b 100644 --- a/src/Map/MapStylesCollection_P.cpp +++ b/src/Map/MapStylesCollection_P.cpp @@ -15,8 +15,8 @@ #include "Logging.h" OsmAnd::MapStylesCollection_P::MapStylesCollection_P(MapStylesCollection* owner_) - : owner(owner_) - , _stylesLock(QReadWriteLock::Recursive) + : _stylesLock(QReadWriteLock::Recursive) + , owner(owner_) { bool ok = true; ok = ok && addStyleFromCoreResource(QLatin1String("map/styles/default.render.xml")); diff --git a/src/Map/MapSymbolIntersectionClassesRegistry_P.cpp b/src/Map/MapSymbolIntersectionClassesRegistry_P.cpp index 1b13230f6..2d10afc31 100644 --- a/src/Map/MapSymbolIntersectionClassesRegistry_P.cpp +++ b/src/Map/MapSymbolIntersectionClassesRegistry_P.cpp @@ -16,7 +16,7 @@ QString OsmAnd::MapSymbolIntersectionClassesRegistry_P::getClassNameById(const C QReadLocker scopedLocker(&_lock); if (_nameById.size() <= classId) - return QString::null; + return {}; return _nameById[classId]; } diff --git a/src/Map/MapSymbolsGroup.cpp b/src/Map/MapSymbolsGroup.cpp index b74d31574..6cb0dbd87 100644 --- a/src/Map/MapSymbolsGroup.cpp +++ b/src/Map/MapSymbolsGroup.cpp @@ -26,7 +26,7 @@ bool OsmAnd::MapSymbolsGroup::obtainSortingKey(SortingKey& outKey) const QString OsmAnd::MapSymbolsGroup::toString() const { - return QString().sprintf("(@%p)", this); + return QString::asprintf("(@%p)", this); } std::shared_ptr OsmAnd::MapSymbolsGroup::getFirstSymbolWithContentClass(const MapSymbol::ContentClass contentClass) const diff --git a/src/Map/ObfMapObjectsMetricsLayerProvider_P.cpp b/src/Map/ObfMapObjectsMetricsLayerProvider_P.cpp index 813374f42..4790258a2 100644 --- a/src/Map/ObfMapObjectsMetricsLayerProvider_P.cpp +++ b/src/Map/ObfMapObjectsMetricsLayerProvider_P.cpp @@ -102,7 +102,7 @@ bool OsmAnd::ObfMapObjectsMetricsLayerProvider_P::obtainData( textPaint.setColor(SK_ColorGREEN); auto topOffset = fontSize; - const auto lines = text.split(QLatin1Char('\n'), QString::SkipEmptyParts); + const auto lines = text.split(QLatin1Char('\n'), Qt::SkipEmptyParts); for (const auto& line : lines) { canvas.drawText( diff --git a/src/Map/OnlineRasterMapLayerProvider.cpp b/src/Map/OnlineRasterMapLayerProvider.cpp index b9ecc00e3..595a1a963 100644 --- a/src/Map/OnlineRasterMapLayerProvider.cpp +++ b/src/Map/OnlineRasterMapLayerProvider.cpp @@ -16,16 +16,16 @@ OsmAnd::OnlineRasterMapLayerProvider::OnlineRasterMapLayerProvider( const std::shared_ptr& webClient /*= std::shared_ptr(new WebClient())*/) : _p(new OnlineRasterMapLayerProvider_P(this, webClient)) , _threadPool(new QThreadPool()) - , _tileSource(tileSource) , _lastRequestedZoom(ZoomLevel0) , _priority(0) - , localCachePath(_p->_localCachePath) - , networkAccessAllowed(_p->_networkAccessAllowed) , name(tileSource->name) , pathSuffix(QString(name)) + , _tileSource(tileSource) , maxConcurrentDownloads(0) , alphaChannelPresence(AlphaChannelPresence::NotPresent) , tileDensityFactor(tileSource->bitDensity / 16.0) + , localCachePath(_p->_localCachePath) + , networkAccessAllowed(_p->_networkAccessAllowed) { _p->_localCachePath = QDir(QStandardPaths::writableLocation(QStandardPaths::TempLocation)).absoluteFilePath(pathSuffix); if (_p->_localCachePath.isEmpty()) diff --git a/src/Map/OnlineRasterMapLayerProvider_P.cpp b/src/Map/OnlineRasterMapLayerProvider_P.cpp index 52ea8241e..9703992e4 100644 --- a/src/Map/OnlineRasterMapLayerProvider_P.cpp +++ b/src/Map/OnlineRasterMapLayerProvider_P.cpp @@ -23,9 +23,9 @@ OsmAnd::OnlineRasterMapLayerProvider_P::OnlineRasterMapLayerProvider_P( OnlineRasterMapLayerProvider* owner_, const std::shared_ptr& downloadManager_) - : owner(owner_) - , _downloadManager(downloadManager_) + : _downloadManager(downloadManager_) , _networkAccessAllowed(true) + , owner(owner_) { } @@ -297,7 +297,7 @@ const QString OsmAnd::OnlineRasterMapLayerProvider_P::getUrlToLoad(int32_t x, in { const auto& source = owner->_tileSource; if (source->urlToLoad.isNull() || source->urlToLoad.isEmpty()) { - return QString::null; + return {}; } if (source->invertedYTile) y = (1 << zoom) - 1 - y; @@ -323,7 +323,7 @@ const QString OsmAnd::OnlineRasterMapLayerProvider_P::buildUrlToLoad(const QStri LogPrintf(LogSeverityLevel::Error, "Failed to resolve randoms for url '%s'", qPrintable(urlToLoad)); - return QString::null; + return {}; } int bingQuadKeyParamIndex = urlToLoad.indexOf(QStringLiteral("{q}")); diff --git a/src/Map/OnlineTileSources_P.cpp b/src/Map/OnlineTileSources_P.cpp index 057e74957..a4fb38b54 100644 --- a/src/Map/OnlineTileSources_P.cpp +++ b/src/Map/OnlineTileSources_P.cpp @@ -367,7 +367,7 @@ void OsmAnd::OnlineTileSources_P::installTileSource(const std::shared_ptr(metric_); + // const auto metric = dynamic_cast(metric_); bool ok = true; const auto& internalState = getInternalState(); @@ -642,7 +642,7 @@ bool OsmAnd::AtlasMapRendererMapLayersStage_OpenGL::renderRasterLayersBatch( GL_CHECK_PRESENT(glVertexAttribPointer); GL_CHECK_PRESENT(glDisableVertexAttribArray); - const auto& currentConfiguration = getCurrentConfiguration(); + // const auto& currentConfiguration = getCurrentConfiguration(); const auto& internalState = getInternalState(); const auto batchedLayersCount = batch->layers.size(); @@ -657,7 +657,7 @@ bool OsmAnd::AtlasMapRendererMapLayersStage_OpenGL::renderRasterLayersBatch( lastUsedProgram, activeElevationVertexAttribArray); const auto& program = _rasterLayerTilePrograms[batchedLayersCount]; - const auto& vao = _rasterTileVAOs[batchedLayersCount]; + // const auto& vao = _rasterTileVAOs[batchedLayersCount]; // Set tile coordinates offset glUniform2f(program.vs.param.tileCoordsOffset, @@ -879,6 +879,9 @@ bool OsmAnd::AtlasMapRendererMapLayersStage_OpenGL::activateRasterLayersProgram( case TextureFilteringQuality::Best: bitmapTileSamplerType = GPUAPI_OpenGL::SamplerType::BitmapTile_TrilinearMipmap; break; + case TextureFilteringQuality::Normal: + default: + break; } } for (auto layerIndexInBatch = 0u; layerIndexInBatch < numberOfLayersInBatch; layerIndexInBatch++) diff --git a/src/Map/OpenGL/AtlasMapRendererSkyStage_OpenGL.cpp b/src/Map/OpenGL/AtlasMapRendererSkyStage_OpenGL.cpp index 619be0051..4645b14c7 100644 --- a/src/Map/OpenGL/AtlasMapRendererSkyStage_OpenGL.cpp +++ b/src/Map/OpenGL/AtlasMapRendererSkyStage_OpenGL.cpp @@ -161,7 +161,7 @@ bool OsmAnd::AtlasMapRendererSkyStage_OpenGL::initialize() bool OsmAnd::AtlasMapRendererSkyStage_OpenGL::render(IMapRenderer_Metrics::Metric_renderFrame* const metric_) { - const auto metric = dynamic_cast(metric_); + // const auto metric = dynamic_cast(metric_); const auto gpuAPI = getGPUAPI(); const auto& internalState = getInternalState(); diff --git a/src/Map/OpenGL/AtlasMapRendererSymbolsStage_OpenGL.cpp b/src/Map/OpenGL/AtlasMapRendererSymbolsStage_OpenGL.cpp index acd427236..3a2fb99e7 100644 --- a/src/Map/OpenGL/AtlasMapRendererSymbolsStage_OpenGL.cpp +++ b/src/Map/OpenGL/AtlasMapRendererSymbolsStage_OpenGL.cpp @@ -55,7 +55,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::render(IMapRenderer_Metrics::M GL_CHECK_PRESENT(glDrawElements); const auto gpuAPI = getGPUAPI(); - const auto& internalState = getInternalState(); + //const auto& internalState = getInternalState(); prepare(metric); @@ -442,7 +442,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderBillboardRasterSymbol( const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); const auto& gpuResource = std::static_pointer_cast(renderable->gpuResource); - const auto& symbolGroupPtr = symbol->groupPtr; + //const auto& symbolGroupPtr = symbol->groupPtr; // Check if correct program is being used if (lastUsedProgram != _billboardRasterProgram.id) @@ -485,7 +485,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderBillboardRasterSymbol( } GL_PUSH_GROUP_MARKER(QString("[%1(%2) billboard raster \"%3\"]") - .arg(QString().sprintf("%p", symbol->groupPtr)) + .arg(QString::asprintf("%p", symbol->groupPtr)) .arg(symbol->group.lock()->toString()) .arg(qPrintable(symbol->content))); @@ -1238,7 +1238,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnPath2dSymbol( const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); const auto& gpuResource = std::static_pointer_cast(renderable->gpuResource); - const auto& symbolGroupPtr = symbol->groupPtr; + //const auto& symbolGroupPtr = symbol->groupPtr; // Check if correct program is being used if (lastUsedProgram != _onPath2dProgram.id) @@ -1273,7 +1273,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnPath2dSymbol( } GL_PUSH_GROUP_MARKER(QString("[%1(%2) SOP-2D \"%3\"]") - .arg(QString().sprintf("%p", symbol->groupPtr)) + .arg(QString::asprintf("%p", symbol->groupPtr)) .arg(symbol->group.lock()->toString()) .arg(qPrintable(symbol->content))); @@ -1381,7 +1381,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnPath3dSymbol( const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); const auto& gpuResource = std::static_pointer_cast(renderable->gpuResource); - const auto& symbolGroupPtr = symbol->groupPtr; + //const auto& symbolGroupPtr = symbol->groupPtr; // Check if correct program is being used if (lastUsedProgram != _onPath3dProgram.id) @@ -1416,7 +1416,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnPath3dSymbol( } GL_PUSH_GROUP_MARKER(QString("[%1(%2) SOP-3D \"%3\"]") - .arg(QString().sprintf("%p", symbol->groupPtr)) + .arg(QString::asprintf("%p", symbol->groupPtr)) .arg(symbol->group.lock()->toString()) .arg(qPrintable(symbol->content))); @@ -1812,7 +1812,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnSurfaceRasterSymbol( const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); const auto& gpuResource = std::static_pointer_cast(renderable->gpuResource); - const auto& symbolGroupPtr = symbol->groupPtr; + //const auto& symbolGroupPtr = symbol->groupPtr; // Check if correct program is being used if (lastUsedProgram != _onSurfaceRasterProgram.id) @@ -1847,7 +1847,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnSurfaceRasterSymbol( } GL_PUSH_GROUP_MARKER(QString("[%1(%2) on-surface raster \"%3\"]") - .arg(QString().sprintf("%p", symbol->groupPtr)) + .arg(QString::asprintf("%p", symbol->groupPtr)) .arg(symbol->group.lock()->toString()) .arg(qPrintable(symbol->content))); @@ -2072,7 +2072,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnSurfaceVectorSymbol( const auto& symbol = std::static_pointer_cast(renderable->mapSymbol); const auto& gpuResource = std::static_pointer_cast(renderable->gpuResource); - const auto& symbolGroupPtr = symbol->groupPtr; + //const auto& symbolGroupPtr = symbol->groupPtr; // Check if correct program is being used if (lastUsedProgram != _onSurfaceVectorProgram.id) @@ -2092,7 +2092,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnSurfaceVectorSymbol( } GL_PUSH_GROUP_MARKER(QString("[%1(%2) on-surface vector]") - .arg(QString().sprintf("%p", symbol->groupPtr)) + .arg(QString::asprintf("%p", symbol->groupPtr)) .arg(symbol->group.lock()->toString())); if (currentAlphaChannelType != AlphaChannelType::Straight) @@ -2217,6 +2217,9 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnSurfaceVectorSymbol( primitivesType = GL_LINE_LOOP; count = gpuResource->vertexBuffer->itemsCount; break; + case VectorMapSymbol::PrimitiveType::Invalid: + default: + break; } if (gpuResource->indexBuffer) { @@ -2243,7 +2246,7 @@ bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::renderOnSurfaceVectorSymbol( bool OsmAnd::AtlasMapRendererSymbolsStage_OpenGL::releaseOnSurfaceVector(const bool gpuContextLost) { - const auto gpuAPI = getGPUAPI(); + //const auto gpuAPI = getGPUAPI(); GL_CHECK_PRESENT(glDeleteProgram); diff --git a/src/Map/OpenGL/AtlasMapRenderer_OpenGL.cpp b/src/Map/OpenGL/AtlasMapRenderer_OpenGL.cpp index 8bc57eeda..c31e4935e 100644 --- a/src/Map/OpenGL/AtlasMapRenderer_OpenGL.cpp +++ b/src/Map/OpenGL/AtlasMapRenderer_OpenGL.cpp @@ -351,7 +351,7 @@ void OsmAnd::AtlasMapRenderer_OpenGL::updateFrustum(InternalState* internalState const glm::vec4 fBR_c(zFarK * nBR_c.x, zFarK * nBR_c.y, zFarK * nBR_c.z, 1.0f); // Transform 8 frustum vertices + camera center to global space - const auto eye_g = internalState->mCameraViewInv * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); + // const auto eye_g = internalState->mCameraViewInv * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); const auto fTL_g = internalState->mCameraViewInv * fTL_c; const auto fTR_g = internalState->mCameraViewInv * fTR_c; const auto fBL_g = internalState->mCameraViewInv * fBL_c; diff --git a/src/Map/OpenGL/GPUAPI_OpenGL.cpp b/src/Map/OpenGL/GPUAPI_OpenGL.cpp index 099364368..3a68c82c3 100644 --- a/src/Map/OpenGL/GPUAPI_OpenGL.cpp +++ b/src/Map/OpenGL/GPUAPI_OpenGL.cpp @@ -840,6 +840,10 @@ bool OsmAnd::GPUAPI_OpenGL::releaseResourceInGPU(const ResourceInGPU::Type type, return true; } + case ResourceInGPU::Type::SlotOnAtlasTexture: + case ResourceInGPU::Type::Mesh: + default: + break; } return false; diff --git a/src/Map/OpenGL/OpenGL2plus/GPUAPI_OpenGL2plus.cpp b/src/Map/OpenGL/OpenGL2plus/GPUAPI_OpenGL2plus.cpp index 06fefe5f8..b7c41ae5d 100644 --- a/src/Map/OpenGL/OpenGL2plus/GPUAPI_OpenGL2plus.cpp +++ b/src/Map/OpenGL/OpenGL2plus/GPUAPI_OpenGL2plus.cpp @@ -143,7 +143,7 @@ bool OsmAnd::GPUAPI_OpenGL2plus::initialize() { const auto& extensionsString = QString::fromLatin1(reinterpret_cast(glGetString(GL_EXTENSIONS))); GL_CHECK_RESULT; - _extensions = extensionsString.split(QRegExp("\\s+"), QString::SkipEmptyParts); + _extensions = extensionsString.split(QRegExp("\\s+"), Qt::SkipEmptyParts); } LogPrintf(LogSeverityLevel::Info, "OpenGL extensions: %s", qPrintable(extensions.join(' '))); diff --git a/src/Map/OpenGL/OpenGLES2/GPUAPI_OpenGLES2.cpp b/src/Map/OpenGL/OpenGLES2/GPUAPI_OpenGLES2.cpp index 676da480c..f7e4ac33b 100644 --- a/src/Map/OpenGL/OpenGLES2/GPUAPI_OpenGLES2.cpp +++ b/src/Map/OpenGL/OpenGLES2/GPUAPI_OpenGLES2.cpp @@ -204,7 +204,7 @@ bool OsmAnd::GPUAPI_OpenGLES2::initialize() const auto& extensionsString = QString::fromLatin1(reinterpret_cast(glGetString(GL_EXTENSIONS))); GL_CHECK_RESULT; - _extensions = extensionsString.split(QRegExp("\\s+"), QString::SkipEmptyParts); + _extensions = extensionsString.split(QRegExp("\\s+"), Qt::SkipEmptyParts); LogPrintf(LogSeverityLevel::Info, "OpenGLES2 extensions: %s", qPrintable(extensions.join(' '))); GLboolean shaderCompilerPresent = GL_FALSE; diff --git a/src/Map/OpenGL/Utilities_OpenGL.cpp b/src/Map/OpenGL/Utilities_OpenGL.cpp index 536d214c2..cf236233d 100644 --- a/src/Map/OpenGL/Utilities_OpenGL.cpp +++ b/src/Map/OpenGL/Utilities_OpenGL.cpp @@ -3,7 +3,7 @@ float OsmAnd::Utilities_OpenGL_Common::calculateCameraDistance(const glm::mat4& P, const AreaI& viewport, const float Ax, const float Sx, const float k) { const float w = viewport.width(); - const float x = viewport.left(); + // const float x = viewport.left(); const float fw = (Sx*k) / (0.5f * w); diff --git a/src/Map/ResolvedMapStyle_P.cpp b/src/Map/ResolvedMapStyle_P.cpp index 41ccd52ff..dc8d870f9 100644 --- a/src/Map/ResolvedMapStyle_P.cpp +++ b/src/Map/ResolvedMapStyle_P.cpp @@ -515,6 +515,6 @@ QHash< OsmAnd::TagValueId, std::shared_ptr > Osm QString OsmAnd::ResolvedMapStyle_P::getStringById(const StringId id) const { if (id >= _stringsForwardLUT.size()) - return QString::null; + return {}; return _stringsForwardLUT[id]; } diff --git a/src/Map/TransportStopSymbolsProvider.cpp b/src/Map/TransportStopSymbolsProvider.cpp index ed3582a21..cfa8b93fa 100644 --- a/src/Map/TransportStopSymbolsProvider.cpp +++ b/src/Map/TransportStopSymbolsProvider.cpp @@ -94,5 +94,5 @@ bool OsmAnd::TransportStopSymbolsProvider::TransportStopSymbolsGroup::obtainSort QString OsmAnd::TransportStopSymbolsProvider::TransportStopSymbolsGroup::toString() const { - return QString::null; + return {}; } diff --git a/src/Map/UnresolvedMapStyle_P.cpp b/src/Map/UnresolvedMapStyle_P.cpp index b0ced75e2..858c0d05d 100644 --- a/src/Map/UnresolvedMapStyle_P.cpp +++ b/src/Map/UnresolvedMapStyle_P.cpp @@ -121,7 +121,7 @@ bool OsmAnd::UnresolvedMapStyle_P::processStartElement(OsmAnd::MapStyleRulesetTy const auto name = attribs.value(QStringLiteral("attr")).toString(); const auto valueType = attribs.value(QStringLiteral("type")).toString(); const auto possibleValues = attribs.value(QStringLiteral("possibleValues")).toString() - .split(QLatin1Char(','), QString::SkipEmptyParts); + .split(QLatin1Char(','), Qt::SkipEmptyParts); const auto defaultValueDescription = attribs.value(QStringLiteral("defaultValueDescription")).toString(); MapStyleValueDataType dataType; diff --git a/src/Metrics.cpp b/src/Metrics.cpp index 8ad75a050..adfcc4aa4 100644 --- a/src/Metrics.cpp +++ b/src/Metrics.cpp @@ -31,11 +31,13 @@ void OsmAnd::Metric::addSubmetric(const std::shared_ptr& submetric) void OsmAnd::Metric::addOrReplaceSubmetric(const std::shared_ptr& submetric) { - const auto& submetricType = typeid(*submetric); + auto barePtrSubmetric = submetric.get(); + const auto& submetricType = typeid(*barePtrSubmetric); for (auto& otherSubmetric : submetrics) { - if (submetricType == typeid(*otherSubmetric)) + auto barePtrOtherSubmetric = otherSubmetric.get(); + if (submetricType == typeid(*barePtrOtherSubmetric)) { otherSubmetric = submetric; return; @@ -49,7 +51,8 @@ std::shared_ptr OsmAnd::Metric::findSubmetricOfExactType(const s { for (auto& submetric : submetrics) { - if (typeid(*submetric) == requestedType) + auto barePtrSubmetric = submetric.get(); + if (typeid(*barePtrSubmetric) == requestedType) return submetric.shared_ptr(); } @@ -60,7 +63,8 @@ std::shared_ptr OsmAnd::Metric::findSubmetricOfExactType(c { for (auto& submetric : submetrics) { - if (typeid(*submetric) == requestedType) + auto barePtrSubmetric = submetric.get(); + if (typeid(*barePtrSubmetric) == requestedType) return submetric.shared_ptr(); } diff --git a/src/MvtReader.cpp b/src/MvtReader.cpp index 35a5822f2..95fe07d06 100644 --- a/src/MvtReader.cpp +++ b/src/MvtReader.cpp @@ -159,12 +159,12 @@ int OsmAnd::MvtReader::Tile::addSequenceKey(const QString& sequenceKey) QString OsmAnd::MvtReader::Tile::getUserKey(const uint32_t userKeyId) const { - return userKeyId < _userKeys.size() ? _userKeys.at(userKeyId) : QString::null; + return userKeyId < _userKeys.size() ? _userKeys.at(userKeyId) : QString(); } QString OsmAnd::MvtReader::Tile::getSequenceKey(const uint32_t sequenceKeyId) const { - return sequenceKeyId < _sequenceKeys.size() ? _sequenceKeys.at(sequenceKeyId) : QString::null; + return sequenceKeyId < _sequenceKeys.size() ? _sequenceKeys.at(sequenceKeyId) : QString(); } void OsmAnd::MvtReader::Tile::addGeometry(const std::shared_ptr geometry) diff --git a/src/ObfDataInterface.cpp b/src/ObfDataInterface.cpp index 8dea471c1..866036d07 100644 --- a/src/ObfDataInterface.cpp +++ b/src/ObfDataInterface.cpp @@ -1222,7 +1222,7 @@ bool OsmAnd::ObfDataInterface::getTransportRoutes( auto reader = readers[sectionId]; auto section = sections[sectionId]; auto pointers = entry.value(); - qSort(pointers); + std::sort(pointers.begin(), pointers.end()); auto stringTable = std::make_shared(); for (const auto& filePointer : pointers) { @@ -1234,7 +1234,7 @@ bool OsmAnd::ObfDataInterface::getTransportRoutes( OsmAnd::ObfTransportSectionReader::initializeNames(false, stringTable.get(), r); } - for (const auto transportRoute : result.values()) + for (const auto& transportRoute : result.values()) { if (!visitor || visitor(transportRoute)) { diff --git a/src/ObfsCollection_P.cpp b/src/ObfsCollection_P.cpp index 02d5a97a7..f785c6fcb 100644 --- a/src/ObfsCollection_P.cpp +++ b/src/ObfsCollection_P.cpp @@ -17,10 +17,10 @@ #include "CachedOsmandIndexes.h" OsmAnd::ObfsCollection_P::ObfsCollection_P(ObfsCollection* owner_) - : owner(owner_) - , _fileSystemWatcher(new QFileSystemWatcher()) + : _fileSystemWatcher(new QFileSystemWatcher()) , _lastUnusedSourceOriginId(0) , _collectedSourcesInvalidated(1) + , owner(owner_) { _fileSystemWatcher->moveToThread(gMainThread); @@ -267,7 +267,7 @@ bool OsmAnd::ObfsCollection_P::remove(const ObfsCollection::SourceOriginId entry { const auto& directoryAsSourceOrigin = std::static_pointer_cast(sourceOrigin); - for(const auto watchedSubdirectory : constOf(directoryAsSourceOrigin->watchedSubdirectories)) + for(const auto& watchedSubdirectory : constOf(directoryAsSourceOrigin->watchedSubdirectories)) _fileSystemWatcher->removePath(watchedSubdirectory); _fileSystemWatcher->removePath(directoryAsSourceOrigin->directory.canonicalPath()); } diff --git a/src/QIODeviceLogSink.cpp b/src/QIODeviceLogSink.cpp index a6cf8df1d..bfff13905 100644 --- a/src/QIODeviceLogSink.cpp +++ b/src/QIODeviceLogSink.cpp @@ -22,8 +22,7 @@ OsmAnd::QIODeviceLogSink::~QIODeviceLogSink() void OsmAnd::QIODeviceLogSink::log(const LogSeverityLevel level, const char* format, va_list args) { - QString line; - line.vsprintf(format, args); + auto line = QString::vasprintf(format, args); switch (level) { case LogSeverityLevel::Verbose: diff --git a/src/ResourcesManager_P.cpp b/src/ResourcesManager_P.cpp index e2b5c56f1..48cf8e034 100644 --- a/src/ResourcesManager_P.cpp +++ b/src/ResourcesManager_P.cpp @@ -28,11 +28,11 @@ OsmAnd::ResourcesManager_P::ResourcesManager_P( ResourcesManager* owner_, const std::shared_ptr& webClient_) - : owner(owner_) - , _fileSystemWatcher(new QFileSystemWatcher()) + : _fileSystemWatcher(new QFileSystemWatcher()) , _localResourcesLock(QReadWriteLock::Recursive) , _resourcesInRepositoryLoaded(false) , _webClient(webClient_) + , owner(owner_) , changesManager(new IncrementalChangesManager(webClient_, owner_)) , onlineTileSources(new OnlineTileSourcesProxy(this)) , mapStylesCollection(new MapStylesCollectionProxy(this)) @@ -1428,6 +1428,11 @@ bool OsmAnd::ResourcesManager_P::installFromFile(const QString& id, const QStrin case ResourceType::VoicePack: ok = installVoicePackFromFile(id, filePath, resource); break; + case ResourceType::MapStyle: + case ResourceType::MapStylesPresets: + case ResourceType::Unknown: + default: + break; } scopedLocker.unlock(); @@ -1778,6 +1783,11 @@ bool OsmAnd::ResourcesManager_P::updateFromFile( case ResourceType::VoicePack: ok = updateVoicePackFromFile(installedResource, filePath); break; + case ResourceType::MapStyle: + case ResourceType::MapStylesPresets: + case ResourceType::Unknown: + default: + break; } if (!ok) return false; diff --git a/src/ResourcesManager_P.h b/src/ResourcesManager_P.h index 0dd4d1ac3..f176b8ef7 100644 --- a/src/ResourcesManager_P.h +++ b/src/ResourcesManager_P.h @@ -124,24 +124,24 @@ namespace OsmAnd const QString& filePath, const ResourceType resourceType, std::shared_ptr& outResource, - const QString& localPath_ = QString::null); + const QString& localPath_ = {}); bool installObfFromFile( const QString& id, const QString& filePath, const ResourceType resourceType, std::shared_ptr& outResource, - const QString& localPath = QString::null); + const QString& localPath = {}); bool installSQLiteDBFromFile( const QString& id, const QString& filePath, const ResourceType resourceType, std::shared_ptr& outResource, - const QString& localPath = QString::null); + const QString& localPath = {}); bool installVoicePackFromFile( const QString& id, const QString& filePath, std::shared_ptr& outResource, - const QString& localPath = QString::null); + const QString& localPath = {}); bool updateObfFromFile(std::shared_ptr& resource, const QString& filePath); bool updateSQLiteDBFromFile(std::shared_ptr& resource, const QString& filePath); diff --git a/src/Search/AddressesByNameSearch.cpp b/src/Search/AddressesByNameSearch.cpp index df0c5faf1..2272b8af3 100644 --- a/src/Search/AddressesByNameSearch.cpp +++ b/src/Search/AddressesByNameSearch.cpp @@ -35,7 +35,7 @@ void OsmAnd::AddressesByNameSearch::performSearch( case AddressType::StreetGroup: { const ObfAddressSectionReader::StreetVisitorFunction visitorFunction = - [this, newResultEntryCallback, criteria_, criteria, &stringMatcher] + [newResultEntryCallback, criteria_, criteria, &stringMatcher] (const std::shared_ptr& street) -> bool { bool accept = criteria.name.isEmpty(); @@ -74,7 +74,7 @@ void OsmAnd::AddressesByNameSearch::performSearch( case AddressType::Street: { const ObfAddressSectionReader::BuildingVisitorFunction visitorFunction = - [this, newResultEntryCallback, criteria_, criteria, &stringMatcher] + [newResultEntryCallback, criteria_, criteria, &stringMatcher] (const std::shared_ptr& building) -> bool { bool accept = true; @@ -117,7 +117,7 @@ void OsmAnd::AddressesByNameSearch::performSearch( const ObfAddressSectionReader::IntersectionVisitorFunction intersectionVisitorFunction = - [this, newResultEntryCallback, criteria_, criteria, &stringMatcher] + [newResultEntryCallback, criteria_, criteria, &stringMatcher] (const std::shared_ptr& intersection) -> bool { bool accept = criteria.name.isEmpty(); @@ -151,6 +151,10 @@ void OsmAnd::AddressesByNameSearch::performSearch( break; } + case AddressType::Building: + case AddressType::StreetIntersection: + default: + break; } } else diff --git a/src/Search/ReverseGeocoder_P.cpp b/src/Search/ReverseGeocoder_P.cpp index eae8b5c75..54dd84ba0 100644 --- a/src/Search/ReverseGeocoder_P.cpp +++ b/src/Search/ReverseGeocoder_P.cpp @@ -31,9 +31,9 @@ const float DISTANCE_BUILDING_PROXIMITY = 100; OsmAnd::ReverseGeocoder_P::ReverseGeocoder_P( OsmAnd::ReverseGeocoder* owner_, const std::shared_ptr &roadLocator_) - : owner(owner_) - , roadLocator(roadLocator_) + : roadLocator(roadLocator_) , addressByNameSearch(std::make_shared(owner_->obfsCollection)) + , owner(owner_) { } @@ -180,7 +180,7 @@ QVector> OsmAnd::Rev { std::sort(streetList.begin(), streetList.end(), DISTANCE_COMPARATOR); double streetDistance = 0; - for (const std::shared_ptr street : streetList) + for (const std::shared_ptr& street : streetList) { if (streetDistance == 0) streetDistance = street->getDistance(); @@ -221,7 +221,7 @@ QVector> OsmAnd::Rev QHash, QList>> buildingsForStreet{}; dataInterface->loadBuildingsFromStreets(streets, &buildingsForStreet); auto const& buildings = buildingsForStreet[street->street]; - for (const std::shared_ptr b : buildings) + for (const std::shared_ptr& b : buildings) { auto makeResult = [b, street, &result](){ auto bld = std::make_shared(); @@ -264,14 +264,14 @@ QVector> OsmAnd::Rev QVector> result{}; auto searchPoint31 = Utilities::convertLatLonTo31(searchPoint); auto roads = roadLocator->findNearestRoads(searchPoint31, STOP_SEARCHING_STREET_WITHOUT_MULTIPLIER_RADIUS * 2, OsmAnd::RoutingDataLevel::Detailed, - [this] + [] (const std::shared_ptr& road) -> bool { return !road->captions.isEmpty(); }); if (roads.isEmpty()) roads = roadLocator->findNearestRoads(searchPoint31, STOP_SEARCHING_STREET_WITHOUT_MULTIPLIER_RADIUS * 10, OsmAnd::RoutingDataLevel::Detailed, - [this] + [] (const std::shared_ptr& road) -> bool { return !road->captions.isEmpty(); diff --git a/src/WebClient_P.cpp b/src/WebClient_P.cpp index 4e17595bd..d01429e21 100644 --- a/src/WebClient_P.cpp +++ b/src/WebClient_P.cpp @@ -17,10 +17,10 @@ OsmAnd::WebClient_P::WebClient_P( const unsigned int concurrentRequestsLimit_, const unsigned int retriesLimit_, const bool followRedirects_) - : owner(owner_) - , _userAgent(userAgent_) + : _userAgent(userAgent_) , _retriesLimit(retriesLimit_) , _followRedirects(followRedirects_ ? 1 : 0) + , owner(owner_) { _threadPool.setMaxThreadCount(concurrentRequestsLimit_); } @@ -151,10 +151,10 @@ QString OsmAnd::WebClient_P::downloadString( _threadPool.start(&request); request.waitUntilFinished(); - QString charset = QString::null; + QString charset = {}; if (request._lastNetworkReply->hasRawHeader("Content-Type")) { - const auto contentTypeParameters = QString(request._lastNetworkReply->rawHeader("Content-Type")).split(';', QString::SkipEmptyParts); + const auto contentTypeParameters = QString(request._lastNetworkReply->rawHeader("Content-Type")).split(';', Qt::SkipEmptyParts); for(const auto& contentTypeParam : constOf(contentTypeParameters)) { const auto trimmed = contentTypeParam.trimmed(); @@ -170,7 +170,7 @@ QString OsmAnd::WebClient_P::downloadString( { if (requestResult != nullptr) requestResult->reset(request._lastNetworkReply != nullptr ? new HttpRequestResult(request._lastNetworkReply) : nullptr); - return QString::null; + return {}; } if (requestResult != nullptr) diff --git a/tools/src/CStyle.cpp b/tools/src/CStyle.cpp index 32094fe04..ef68ac02e 100644 --- a/tools/src/CStyle.cpp +++ b/tools/src/CStyle.cpp @@ -269,7 +269,7 @@ bool OsmAndTools::CStyle::DebugEmitter::emitStyle(const std::shared_ptrgetDataType())); dump += QString(QLatin1String("param %1 %2 = (%3);\n")) @@ -545,7 +545,7 @@ QString OsmAndTools::CStyle::DebugEmitter::dumpResolvedValue( return QString(QLatin1String("color(%1)")).arg(attributeName); } - return QString::null; + return {}; } return dumpConstantValue(mapStyle, value.asConstantValue, dataType); diff --git a/tools/src/EyePiece.cpp b/tools/src/EyePiece.cpp index 9e9c60a11..a90fd48cd 100644 --- a/tools/src/EyePiece.cpp +++ b/tools/src/EyePiece.cpp @@ -244,7 +244,7 @@ bool OsmAndTools::EyePiece::rasterize(std::ostream& output) output << xT("WGL_EXT_extensions_string or WGL_ARB_extensions_string has to be supported") << std::endl; return false; } - const auto wglExtensions = QString::fromLatin1(wglExtensionsString).split(QRegExp("\\s+"), QString::SkipEmptyParts); + const auto wglExtensions = QString::fromLatin1(wglExtensionsString).split(QRegExp("\\s+"), Qt::SkipEmptyParts); if (configuration.verbose) output << xT("WGL extensions: ") << QStringToStlString(wglExtensions.join(' ')) << std::endl; @@ -438,19 +438,19 @@ bool OsmAndTools::EyePiece::rasterize(std::ostream& output) // Get the default screen's GLX extension list const auto glxExtensionsString = glXQueryExtensionsString(xDisplay, DefaultScreen(xDisplay)); - const auto glxExtensions = QString::fromLatin1(glxExtensionsString).split(QRegExp("\\s+"), QString::SkipEmptyParts); + const auto glxExtensions = QString::fromLatin1(glxExtensionsString).split(QRegExp("\\s+"), Qt::SkipEmptyParts); if (configuration.verbose) output << xT("GLX extensions: ") << QStringToStlString(glxExtensions.join(' ')) << std::endl; // GLX client extensions const auto glxClientExtensionsString = glXGetClientString(xDisplay, GLX_EXTENSIONS); - const auto glxClientExtensions = QString::fromLatin1(glxClientExtensionsString).split(QRegExp("\\s+"), QString::SkipEmptyParts); + const auto glxClientExtensions = QString::fromLatin1(glxClientExtensionsString).split(QRegExp("\\s+"), Qt::SkipEmptyParts); if (configuration.verbose) output << xT("GLX client extensions: ") << QStringToStlString(glxClientExtensions.join(' ')) << std::endl; // GLX server extensions const auto glxServerExtensionsString = glXQueryServerString(xDisplay, DefaultScreen(xDisplay), GLX_EXTENSIONS); - const auto glxServerExtensions = QString::fromLatin1(glxServerExtensionsString).split(QRegExp("\\s+"), QString::SkipEmptyParts); + const auto glxServerExtensions = QString::fromLatin1(glxServerExtensionsString).split(QRegExp("\\s+"), Qt::SkipEmptyParts); if (configuration.verbose) output << xT("GLX server extensions: ") << QStringToStlString(glxServerExtensions.join(' ')) << std::endl; diff --git a/tools/src/Inspector.cpp b/tools/src/Inspector.cpp index 0a922231c..a8c418d1a 100644 --- a/tools/src/Inspector.cpp +++ b/tools/src/Inspector.cpp @@ -345,7 +345,7 @@ void printAddressDetailedInfo(std::ostream& output, const OsmAndTools::Inspector for (int typeIdx = 0; typeIdx < sizeof(types) / sizeof(types[0]); typeIdx++) { - auto type = types[typeIdx]; + // auto type = types[typeIdx]; QList< std::shared_ptr > streetGroups; OsmAnd::ObfAddressStreetGroupTypesMask typesMask; diff --git a/tools/src/Styler.cpp b/tools/src/Styler.cpp index 75da36c47..4658f2104 100644 --- a/tools/src/Styler.cpp +++ b/tools/src/Styler.cpp @@ -451,7 +451,7 @@ bool OsmAndTools::Styler::evaluate(EvaluatedMapObjects& outEvaluatedMapObjects, output << xT("\t\tDraw along path: ") << (symbol->drawAlongPath ? xT("yes") : xT("no")) << std::endl; output << xT("\t\tIntersects with: ") - << QStringToStlString(QStringList(symbol->intersectsWith.toList()).join(QLatin1String(", "))) + << QStringToStlString(QStringList(symbol->intersectsWith.values()).join(QLatin1String(", "))) << std::endl; output << xT("\t\tMinDistance: ") << symbol->minDistance << std::endl; if (textSymbol)