diff options
author | Stefan Wildemann <metalstrolch@users.noreply.github.com> | 2022-09-21 21:58:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-21 21:58:42 +0200 |
commit | 4e37073c324172918ebdaa65bb073318e8e33b3c (patch) | |
tree | 5d4760cd6dd40fcdac1efadb721090f9273eff58 | |
parent | 0338c1f696e01cd89c26ea7854cfc110c283f069 (diff) | |
parent | 69d870e276b4511aba56d4a13b998a4040b1d1eb (diff) | |
download | navit-4e37073c324172918ebdaa65bb073318e8e33b3c.tar.gz |
Merge pull request #1198 from bkoppelmann/warnings
Fix some of the many compiler warning
-rw-r--r-- | navit/graphics/qt5/QNavitQuick.cpp | 1 | ||||
-rw-r--r-- | navit/graphics/qt5/QNavitWidget.cpp | 1 | ||||
-rw-r--r-- | navit/graphics/svg_debug/graphics_svg_debug.c | 2 | ||||
-rw-r--r-- | navit/gui/qt5_qml/backend.cpp | 13 | ||||
-rw-r--r-- | navit/gui/qt5_qml/backend.h | 8 | ||||
-rw-r--r-- | navit/gui/qt5_qml/proxy.c | 2 | ||||
-rw-r--r-- | navit/gui/qt5_qml/qml_bookmark.cpp | 2 | ||||
-rw-r--r-- | navit/gui/qt5_qml/qml_poi.cpp | 2 | ||||
-rw-r--r-- | navit/navit.c | 4 | ||||
-rw-r--r-- | navit/vehicle/demo/vehicle_demo.c | 2 |
10 files changed, 16 insertions, 21 deletions
diff --git a/navit/graphics/qt5/QNavitQuick.cpp b/navit/graphics/qt5/QNavitQuick.cpp index 966072852..ec734c7de 100644 --- a/navit/graphics/qt5/QNavitQuick.cpp +++ b/navit/graphics/qt5/QNavitQuick.cpp @@ -167,7 +167,6 @@ void QNavitQuick::keyReleaseEvent(QKeyEvent* event) { void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry) { dbg(lvl_debug, "enter"); QQuickPaintedItem::geometryChanged(newGeometry, oldGeometry); - QPainter* painter = NULL; if (graphics_priv == NULL) { dbg(lvl_debug, "Context not set, aborting"); return; diff --git a/navit/graphics/qt5/QNavitWidget.cpp b/navit/graphics/qt5/QNavitWidget.cpp index 43c04d87f..74dddf1db 100644 --- a/navit/graphics/qt5/QNavitWidget.cpp +++ b/navit/graphics/qt5/QNavitWidget.cpp @@ -95,7 +95,6 @@ void QNavitWidget::paintEvent(QPaintEvent* event) { } void QNavitWidget::resizeEvent(QResizeEvent* event) { - QPainter* painter = NULL; if (graphics_priv->pixmap != NULL) { if((width() != graphics_priv->pixmap->width()) || (height() != graphics_priv->pixmap->height())) { delete graphics_priv->pixmap; diff --git a/navit/graphics/svg_debug/graphics_svg_debug.c b/navit/graphics/svg_debug/graphics_svg_debug.c index 348906ad8..23ce4a297 100644 --- a/navit/graphics/svg_debug/graphics_svg_debug.c +++ b/navit/graphics/svg_debug/graphics_svg_debug.c @@ -170,7 +170,7 @@ static void svg_debug_gc_set_linewidth(struct graphics_gc_priv *gc, int w) { static void svg_debug_gc_set_dashes(struct graphics_gc_priv *gc, int w, int offset, unsigned char *dash_list, int n) { - gc->dashed = dash_list; + gc->dashed = (unsigned int*)dash_list; gc->is_dashed = TRUE; if (gc->graphics_gc_methods_proxy->gc_set_dashes) { gc->graphics_gc_methods_proxy->gc_set_dashes(gc->graphics_gc_priv_proxy, diff --git a/navit/gui/qt5_qml/backend.cpp b/navit/gui/qt5_qml/backend.cpp index c9733b173..af1b42aa5 100644 --- a/navit/gui/qt5_qml/backend.cpp +++ b/navit/gui/qt5_qml/backend.cpp @@ -63,24 +63,21 @@ void Backend::showMenu(struct point *p) { * @returns nothing */ void Backend::get_maps() { - struct attr attr, on, off, description, type, data, active; + struct attr attr, description, type, data, active; char * label; bool is_active; struct attr_iter * iter; _maps.clear(); iter = navit_attr_iter_new(NULL); - on.type = off.type = attr_active; - on.u.num = 1; - off.u.num = 0; while (navit_get_attr(this->nav, attr_map, &attr, iter)) { if (map_get_attr(attr.u.map, attr_description, &description, NULL)) { 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; @@ -159,7 +156,6 @@ void Backend::set_engine(QQmlApplicationEngine * engine) { * @returns 0 if the item should be discarded, 1 otherwise */ int Backend::filter_pois(struct item *item) { - enum item_type *types; enum item_type type=item->type; if (type >= type_line) return 0; @@ -173,7 +169,6 @@ int Backend::filter_pois(struct item *item) { */ void Backend::get_bookmarks() { struct attr attr,mattr; - struct navigation * nav = NULL; struct item *item; struct coord c; struct pcoord pc; @@ -501,7 +496,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))); diff --git a/navit/gui/qt5_qml/backend.h b/navit/gui/qt5_qml/backend.h index 259be516c..9a27590d5 100644 --- a/navit/gui/qt5_qml/backend.h +++ b/navit/gui/qt5_qml/backend.h @@ -104,10 +104,10 @@ private: VehicleObject * m_currentVehicle; QList<QObject *> _search_results; void set_default_country(); - char * _country_iso2; - char * _current_country; - char * _current_town; - char * _current_street; + const char * _country_iso2; + const char * _current_country; + const char * _current_town; + const char * _current_street; struct search_param *search; enum attr_type _search_context; }; diff --git a/navit/gui/qt5_qml/proxy.c b/navit/gui/qt5_qml/proxy.c index 399925519..c38fe37e7 100644 --- a/navit/gui/qt5_qml/proxy.c +++ b/navit/gui/qt5_qml/proxy.c @@ -9,6 +9,7 @@ #include "transform.h" #include "debug.h" #include "search.h" +#include "proxy.h" char * get_icon(struct navit *nav, struct item *item) { @@ -31,7 +32,6 @@ char * get_icon(struct navit *nav, struct item *item) { if(el->type==element_icon) { char *src; char *icon; - struct graphics_image *img; if(item_is_custom_poi(*item)) { struct map_rect *mr=map_rect_new(item->map, NULL); item=map_rect_get_item_byid(mr, item->id_hi, item->id_lo); diff --git a/navit/gui/qt5_qml/qml_bookmark.cpp b/navit/gui/qt5_qml/qml_bookmark.cpp index 5f46a3a44..acfa987fb 100644 --- a/navit/gui/qt5_qml/qml_bookmark.cpp +++ b/navit/gui/qt5_qml/qml_bookmark.cpp @@ -8,7 +8,7 @@ BookmarkObject::BookmarkObject( const QString &name, struct pcoord &coords, QObject *parent) - : QObject(parent), m_name(name), m_coords(coords) { + : QObject(parent), m_coords(coords), m_name(name) { } QString BookmarkObject::name() const { diff --git a/navit/gui/qt5_qml/qml_poi.cpp b/navit/gui/qt5_qml/qml_poi.cpp index 8f0a0ab64..3e9c56745 100644 --- a/navit/gui/qt5_qml/qml_poi.cpp +++ b/navit/gui/qt5_qml/qml_poi.cpp @@ -11,7 +11,7 @@ PoiObject::PoiObject( const QString &icon, struct pcoord &coords, QObject *parent) - : QObject(parent), m_name(name), m_type(type), m_icon(icon), m_coords(coords) { + : QObject(parent), m_coords(coords), m_name(name), m_type(type), m_icon(icon) { } QString PoiObject::name() const { diff --git a/navit/navit.c b/navit/navit.c index d3ef113f5..e6e43064d 100644 --- a/navit/navit.c +++ b/navit/navit.c @@ -1806,7 +1806,9 @@ static int navit_former_destinations_active(struct navit *this_) { if (destination_file) { while(fgets(lastline, sizeof(lastline), destination_file)); fclose(destination_file); - if ((lastline != NULL) && (strcmp(lastline, TEXTFILE_COMMENT_NAVI_STOPPED))) { + /*forcefully terminate the string, there is no proper fgets error handling.*/ + lastline[sizeof(lastline) -1] = 0; + if (strcmp(lastline, TEXTFILE_COMMENT_NAVI_STOPPED)) { active=1; } } diff --git a/navit/vehicle/demo/vehicle_demo.c b/navit/vehicle/demo/vehicle_demo.c index fbca975d3..724b54048 100644 --- a/navit/vehicle/demo/vehicle_demo.c +++ b/navit/vehicle/demo/vehicle_demo.c @@ -102,7 +102,7 @@ static int vehicle_demo_position_attr_get(struct vehicle_priv *priv, attr->u.str=priv->timep; break; case attr_position_fix_type: - if(flags = tracking_get_current_flags(navit_get_tracking(priv->navit))) { + if((flags = tracking_get_current_flags(navit_get_tracking(priv->navit)))) { if(*flags & AF_UNDERGROUND) attr->u.num = 0; } else |