diff options
author | Bastian Koppelmann <kbastian@mail.uni-paderborn.de> | 2022-08-30 13:26:40 +0200 |
---|---|---|
committer | Bastian Koppelmann <kbastian@mail.uni-paderborn.de> | 2022-08-30 15:14:20 +0200 |
commit | 691760ef01179348bd0df1e7ee6da38e6f88d3de (patch) | |
tree | 4a87f35a6f255076ce32f5a86330d0e79739f56b /navit/gui/qt5_qml/backend.cpp | |
parent | eb0fe23700304dd564bee5b8851dd6affc776ef2 (diff) | |
download | navit-691760ef01179348bd0df1e7ee6da38e6f88d3de.tar.gz |
Fix:gui:qt5_qml: Fix -Wwrite-strings warning
We assign string constants to a char* which will lead to an error if
anyone tries to write that pointer, as constant data is mapped
read-only. This patch makes these const char* pointers.
Fixes the warning:
backend.cpp:588:27: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
588 | _current_street = "Enter Street";
| ^~~~~~~~~~~~~~
Diffstat (limited to 'navit/gui/qt5_qml/backend.cpp')
-rw-r--r-- | navit/gui/qt5_qml/backend.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/navit/gui/qt5_qml/backend.cpp b/navit/gui/qt5_qml/backend.cpp index c9733b173..11057c76c 100644 --- a/navit/gui/qt5_qml/backend.cpp +++ b/navit/gui/qt5_qml/backend.cpp @@ -78,9 +78,9 @@ void Backend::get_maps() { label = g_strdup(description.u.str); } else { if (!map_get_attr(attr.u.map, attr_type, &type, NULL)) - type.u.str = ""; + type.u.str = (char*)""; if (!map_get_attr(attr.u.map, attr_data, &data, NULL)) - data.u.str = ""; + data.u.str = (char*)""; label = g_strdup_printf("%s:%s", type.u.str, data.u.str); } is_active = false; @@ -501,7 +501,7 @@ void Backend::updateSearch(QString text) { search->partial = 1; dbg(lvl_debug,"attempting to use country '%s'", _country_iso2); search_attr.type=attr_country_iso2; - search_attr.u.str=_country_iso2; + search_attr.u.str=(char*)_country_iso2; search_list_search(search->sl, &search_attr, 0); while((res=search_list_get_result(search->sl))); |