summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Grandin <grandinp@gmail.com>2018-04-26 23:02:15 -0700
committerPierre Grandin <grandinp@gmail.com>2018-04-26 23:02:15 -0700
commit0a0b65f49a19ddac53605c8b66242a7bf4df5102 (patch)
tree631f26306aa056eb8fd165c533889dd9925c6833
parentf0b46b6bccf68ae233e1209d1854b1885cf62188 (diff)
parent221f783ea1caaaab2f5ceadc6b0fb3e720aac3df (diff)
downloadnavit-0a0b65f49a19ddac53605c8b66242a7bf4df5102.tar.gz
Merge branch 'trunk' into fix_log_replay
-rw-r--r--navit/android.c78
-rw-r--r--navit/attr.c24
-rw-r--r--navit/autoload/osso/osso.c8
-rw-r--r--navit/binding/dbus/binding_dbus.c68
-rw-r--r--navit/binding/python/config.c2
-rw-r--r--navit/binding/python/navit.c8
-rw-r--r--navit/binding/python/pcoord.c2
-rw-r--r--navit/binding/win32/binding_win32.c20
-rw-r--r--navit/bookmarks.c12
-rw-r--r--navit/cache.c44
-rw-r--r--navit/callback.c10
-rw-r--r--navit/command.c80
-rw-r--r--navit/config_.c8
-rw-r--r--navit/coord.c32
-rw-r--r--navit/debug.c17
-rw-r--r--navit/event.c6
-rw-r--r--navit/file.c28
-rw-r--r--navit/font/freetype/font_freetype.c16
-rw-r--r--navit/graphics.c62
-rw-r--r--navit/graphics/android/graphics_android.c116
-rw-r--r--navit/graphics/cocoa/graphics_cocoa.m42
-rw-r--r--navit/graphics/egl/graphics_egl.c4
-rw-r--r--navit/graphics/gd/graphics_gd.c42
-rw-r--r--navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c30
-rw-r--r--navit/graphics/null/graphics_null.c20
-rw-r--r--navit/graphics/opengl/graphics_opengl.c32
-rw-r--r--navit/graphics/opengl/graphics_opengl_egl.c10
-rw-r--r--navit/graphics/opengl/graphics_opengl_x11.c18
-rw-r--r--navit/graphics/qt5/QNavitQuick.cpp30
-rw-r--r--navit/graphics/qt5/QNavitWidget.cpp22
-rw-r--r--navit/graphics/qt5/event_qt5.cpp26
-rw-r--r--navit/graphics/qt5/graphics_qt5.cpp102
-rw-r--r--navit/graphics/qt_qpainter/RenderArea.cpp12
-rw-r--r--navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp28
-rw-r--r--navit/graphics/sdl/event.c32
-rw-r--r--navit/graphics/sdl/event_sdl.c30
-rw-r--r--navit/graphics/sdl/graphics_sdl.c108
-rw-r--r--navit/graphics/win32/graphics_win32.c68
-rw-r--r--navit/gui.c6
-rw-r--r--navit/gui/gtk/datawindow.c2
-rw-r--r--navit/gui/gtk/destination.c16
-rw-r--r--navit/gui/gtk/gui_gtk_action.c8
-rw-r--r--navit/gui/gtk/gui_gtk_poi.c8
-rw-r--r--navit/gui/gtk/gui_gtk_window.c10
-rw-r--r--navit/gui/internal/gui_internal.c88
-rw-r--r--navit/gui/internal/gui_internal_bookmark.c6
-rw-r--r--navit/gui/internal/gui_internal_command.c58
-rw-r--r--navit/gui/internal/gui_internal_gesture.c14
-rw-r--r--navit/gui/internal/gui_internal_html.c16
-rw-r--r--navit/gui/internal/gui_internal_keyboard.c8
-rw-r--r--navit/gui/internal/gui_internal_menu.c6
-rw-r--r--navit/gui/internal/gui_internal_poi.c14
-rw-r--r--navit/gui/internal/gui_internal_search.c26
-rw-r--r--navit/gui/internal/gui_internal_widget.c4
-rw-r--r--navit/gui/qml/bookmarksProxy.h4
-rw-r--r--navit/gui/qml/gui_qml.cpp10
-rw-r--r--navit/gui/qml/ngqpoint.h2
-rw-r--r--navit/gui/qml/proxy.h2
-rw-r--r--navit/gui/qml/routeProxy.h2
-rw-r--r--navit/gui/qml/searchProxy.h6
-rw-r--r--navit/gui/qt5_qml/backend.cpp58
-rw-r--r--navit/gui/qt5_qml/gui_qt5_qml.cpp30
-rw-r--r--navit/gui/win32/gui_win32.c6
-rw-r--r--navit/gui/win32/win32_gui_destination.c6
-rw-r--r--navit/item.c6
-rw-r--r--navit/layout.c10
-rw-r--r--navit/linguistics.c4
-rw-r--r--navit/log.c12
-rw-r--r--navit/main.c4
-rw-r--r--navit/map.c12
-rw-r--r--navit/map/binfile/binfile.c184
-rw-r--r--navit/map/csv/csv.c42
-rw-r--r--navit/map/csv/quadtree.c26
-rw-r--r--navit/map/filter/filter.c10
-rw-r--r--navit/map/mg/block.c14
-rw-r--r--navit/map/mg/map.c36
-rw-r--r--navit/map/mg/poly.c6
-rw-r--r--navit/map/mg/street.c78
-rw-r--r--navit/map/mg/town.c16
-rw-r--r--navit/map/mg/tree.c52
-rw-r--r--navit/map/shapefile/shapefile.c26
-rw-r--r--navit/map/textfile/textfile.c46
-rw-r--r--navit/maps.c8
-rw-r--r--navit/mapset.c2
-rw-r--r--navit/maptool/ch.c10
-rw-r--r--navit/maptool/coastline.c16
-rw-r--r--navit/navigation.c184
-rw-r--r--navit/navit.c170
-rw-r--r--navit/osd.c34
-rw-r--r--navit/osd/core/osd_core.c56
-rw-r--r--navit/plugin.c24
-rw-r--r--navit/plugin/j1850/j1850.c38
-rw-r--r--navit/plugin/pedestrian/pedestrian.c140
-rw-r--r--navit/popup.c12
-rw-r--r--navit/profile_option.c2
-rw-r--r--navit/projection.c8
-rw-r--r--navit/route.c128
-rw-r--r--navit/script.c10
-rw-r--r--navit/search.c52
-rw-r--r--navit/search_houseno_interpol.c20
-rw-r--r--navit/speech.c16
-rw-r--r--navit/speech/android/speech_android.c14
-rw-r--r--navit/speech/cmdline/speech_cmdline.c14
-rw-r--r--navit/speech/espeak/speak.c30
-rw-r--r--navit/speech/iphone/speech_iphone.m8
-rw-r--r--navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp14
-rwxr-xr-xnavit/speech/qt5_espeak/qt5_espeak.cpp32
-rw-r--r--navit/start_apple.m4
-rw-r--r--navit/start_real.c16
-rw-r--r--navit/support/libc/stat.c8
-rw-r--r--navit/support/win32/serial_io.c16
-rw-r--r--navit/support/wordexp/glob.c6
-rw-r--r--navit/track.c54
-rw-r--r--navit/transform.c46
-rw-r--r--navit/util.c20
-rw-r--r--navit/vehicle.c24
-rw-r--r--navit/vehicle/android/vehicle_android.c24
-rw-r--r--navit/vehicle/demo/vehicle_demo.c24
-rw-r--r--navit/vehicle/file/vehicle_file.c70
-rw-r--r--navit/vehicle/gpsd/vehicle_gpsd.c38
-rw-r--r--navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c10
-rw-r--r--navit/vehicle/gypsy/vehicle_gypsy.c12
-rw-r--r--navit/vehicle/iphone/vehicle_iphone.c8
-rw-r--r--navit/vehicle/maemo/vehicle_maemo.c76
-rw-r--r--navit/vehicle/null/vehicle_null.c12
-rw-r--r--navit/vehicle/qt5/vehicle_qt5.cpp40
-rw-r--r--navit/vehicle/webos/bluetooth.c92
-rw-r--r--navit/vehicle/webos/vehicle_webos.c32
-rw-r--r--navit/vehicle/wince/vehicle_wince.c76
-rw-r--r--navit/vehicleprofile.c16
-rw-r--r--navit/xmlconfig.c54
131 files changed, 2064 insertions, 2053 deletions
diff --git a/navit/android.c b/navit/android.c
index 6e62da1b3..eadd6eaab 100644
--- a/navit/android.c
+++ b/navit/android.c
@@ -43,7 +43,7 @@ android_find_class_global(char *name, jclass *ret)
{
*ret=(*jnienv)->FindClass(jnienv, name);
if (! *ret) {
- dbg(lvl_error,"Failed to get Class %s\n",name);
+ dbg(lvl_error,"Failed to get Class %s",name);
return 0;
}
*ret = (*jnienv)->NewGlobalRef(jnienv, *ret);
@@ -55,7 +55,7 @@ android_find_method(jclass class, char *name, char *args, jmethodID *ret)
{
*ret = (*jnienv)->GetMethodID(jnienv, class, name, args);
if (*ret == NULL) {
- dbg(lvl_error,"Failed to get Method %s with signature %s\n",name,args);
+ dbg(lvl_error,"Failed to get Method %s with signature %s",name,args);
return 0;
}
return 1;
@@ -67,7 +67,7 @@ android_find_static_method(jclass class, char *name, char *args, jmethodID *ret)
{
*ret = (*jnienv)->GetStaticMethodID(jnienv, class, name, args);
if (*ret == NULL) {
- dbg(lvl_error,"Failed to get static Method %s with signature %s\n",name,args);
+ dbg(lvl_error,"Failed to get static Method %s with signature %s",name,args);
return 0;
}
return 1;
@@ -84,12 +84,12 @@ Java_org_navitproject_navit_Navit_NavitMain( JNIEnv* env, jobject thiz, jobject
jnienv=env;
android_activity = (*jnienv)->NewGlobalRef(jnienv, activity);
langstr=(*env)->GetStringUTFChars(env, lang, NULL);
- dbg(lvl_debug,"enter env=%p thiz=%p activity=%p lang=%s version=%d\n",env,thiz,android_activity,langstr,version);
+ dbg(lvl_debug,"enter env=%p thiz=%p activity=%p lang=%s version=%d",env,thiz,android_activity,langstr,version);
setenv("LANG",langstr,1);
(*env)->ReleaseStringUTFChars(env, lang, langstr);
displaydensitystr=(*env)->GetStringUTFChars(env, display_density_string, NULL);
- dbg(lvl_debug,"*****displaydensity=%s\n",displaydensitystr);
+ dbg(lvl_debug,"*****displaydensity=%s",displaydensitystr);
setenv("ANDROID_DENSITY",displaydensitystr,1);
(*env)->ReleaseStringUTFChars(env, display_density_string, displaydensitystr);
@@ -105,14 +105,14 @@ Java_org_navitproject_navit_Navit_NavitMain( JNIEnv* env, jobject thiz, jobject
JNIEXPORT void JNICALL
Java_org_navitproject_navit_Navit_NavitDestroy( JNIEnv* env)
{
- dbg(lvl_debug, "shutdown navit\n");
+ dbg(lvl_debug, "shutdown navit");
exit(0);
}
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_SizeChangedCallback( JNIEnv* env, jobject thiz, int id, int w, int h)
{
- dbg(lvl_debug,"enter %p %d %d\n",(struct callback *)id,w,h);
+ dbg(lvl_debug,"enter %p %d %d",(struct callback *)id,w,h);
if (id)
callback_call_2((struct callback *)id,w,h);
}
@@ -120,7 +120,7 @@ Java_org_navitproject_navit_NavitGraphics_SizeChangedCallback( JNIEnv* env, jobj
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_PaddingChangedCallback(JNIEnv* env, jobject thiz, int id, int left, int top, int right, int bottom)
{
- dbg(lvl_debug,"enter %p %d %d %d %d\n",(struct callback *)id, left, top, right, bottom);
+ dbg(lvl_debug,"enter %p %d %d %d %d",(struct callback *)id, left, top, right, bottom);
if (id)
callback_call_4((struct callback *)id, left, top, right, bottom);
}
@@ -128,7 +128,7 @@ Java_org_navitproject_navit_NavitGraphics_PaddingChangedCallback(JNIEnv* env, jo
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_ButtonCallback( JNIEnv* env, jobject thiz, int id, int pressed, int button, int x, int y)
{
- dbg(lvl_debug,"enter %p %d %d\n",(struct callback *)id,pressed,button);
+ dbg(lvl_debug,"enter %p %d %d",(struct callback *)id,pressed,button);
if (id)
callback_call_4((struct callback *)id,pressed,button,x,y);
}
@@ -136,7 +136,7 @@ Java_org_navitproject_navit_NavitGraphics_ButtonCallback( JNIEnv* env, jobject t
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_MotionCallback( JNIEnv* env, jobject thiz, int id, int x, int y)
{
- dbg(lvl_debug,"enter %p %d %d\n",(struct callback *)id,x,y);
+ dbg(lvl_debug,"enter %p %d %d",(struct callback *)id,x,y);
if (id)
callback_call_2((struct callback *)id,x,y);
}
@@ -145,7 +145,7 @@ JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_KeypressCallback( JNIEnv* env, jobject thiz, int id, jobject str)
{
const char *s;
- dbg(lvl_debug,"enter %p %p\n",(struct callback *)id,str);
+ dbg(lvl_debug,"enter %p %p",(struct callback *)id,str);
s=(*env)->GetStringUTFChars(env, str, NULL);
dbg(lvl_debug,"key=%d",s);
if (id)
@@ -157,7 +157,7 @@ JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitTimeout_TimeoutCallback( JNIEnv* env, jobject thiz, int id)
{
void (*event_handler)(void *) = *(void **)id;
- dbg(lvl_debug,"enter %p %p\n",thiz, (void *)id);
+ dbg(lvl_debug,"enter %p %p",thiz, (void *)id);
event_handler((void*)id);
}
@@ -170,7 +170,7 @@ Java_org_navitproject_navit_NavitVehicle_VehicleCallback( JNIEnv * env, jobject
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitIdle_IdleCallback( JNIEnv* env, jobject thiz, int id)
{
- dbg(lvl_debug,"enter %p %p\n",thiz, (void *)id);
+ dbg(lvl_debug,"enter %p %p",thiz, (void *)id);
callback_call_0((struct callback *)id);
}
@@ -185,14 +185,14 @@ Java_org_navitproject_navit_NavitWatch_poll( JNIEnv* env, jobject thiz, int func
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitWatch_WatchCallback( JNIEnv* env, jobject thiz, int id)
{
- dbg(lvl_debug,"enter %p %p\n",thiz, (void *)id);
+ dbg(lvl_debug,"enter %p %p",thiz, (void *)id);
callback_call_0((struct callback *)id);
}
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitSensors_SensorCallback( JNIEnv* env, jobject thiz, int id, int sensor, float x, float y, float z)
{
- dbg(lvl_debug,"enter %p %p %f %f %f\n",thiz, (void *)id,x,y,z);
+ dbg(lvl_debug,"enter %p %p %f %f %f",thiz, (void *)id,x,y,z);
callback_call_4((struct callback *)id, sensor, &x, &y, &z);
}
@@ -222,7 +222,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackLocalizedString( JNIEnv* env,
const char *localized_str;
s=(*env)->GetStringUTFChars(env, str, NULL);
- //dbg(lvl_debug,"*****string=%s\n",s);
+ //dbg(lvl_debug,"*****string=%s",s);
localized_str=navit_nls_gettext(s);
//dbg(lvl_debug,"localized string=%s",localized_str);
@@ -241,7 +241,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
struct attr attr;
const char *s;
jint ret = 0;
- dbg(lvl_debug,"enter %d %p\n",channel,str);
+ dbg(lvl_debug,"enter %d %p",channel,str);
config_get_attr(config_get(), attr_navit, &attr, NULL);
@@ -262,7 +262,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
struct mapset *ms = navit_get_mapset(attr.u.navit);
struct attr type, name, data, *attrs[4];
const char *map_location=(*env)->GetStringUTFChars(env, str, NULL);
- dbg(lvl_debug,"*****string=%s\n",map_location);
+ dbg(lvl_debug,"*****string=%s",map_location);
type.type=attr_type;
type.u.str="binfile";
@@ -306,7 +306,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
case 5:
// call a command (like in gui)
s=(*env)->GetStringUTFChars(env, str, NULL);
- dbg(lvl_debug,"*****string=%s\n",s);
+ dbg(lvl_debug,"*****string=%s",s);
command_evaluate(&attr,s);
(*env)->ReleaseStringUTFChars(env, str, s);
break;
@@ -324,7 +324,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
char parse_str[strlen(s) + 1];
strcpy(parse_str, s);
(*env)->ReleaseStringUTFChars(env, str, s);
- dbg(lvl_debug,"*****string=%s\n",parse_str);
+ dbg(lvl_debug,"*****string=%s",parse_str);
// set destination to (pixel-x#pixel-y)
// pixel-x
@@ -334,8 +334,8 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
pstr = strtok (NULL, "#");
p.y = atoi(pstr);
- dbg(lvl_debug,"11x=%d\n",p.x);
- dbg(lvl_debug,"11y=%d\n",p.y);
+ dbg(lvl_debug,"11x=%d",p.x);
+ dbg(lvl_debug,"11y=%d",p.y);
transform_reverse(transform, &p, &c);
@@ -344,8 +344,8 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
pc.y = c.y;
pc.pro = transform_get_projection(transform);
- dbg(lvl_debug,"22x=%d\n",pc.x);
- dbg(lvl_debug,"22y=%d\n",pc.y);
+ dbg(lvl_debug,"22x=%d",pc.x);
+ dbg(lvl_debug,"22y=%d",pc.y);
// start navigation asynchronous
navit_set_destination(attr.u.navit, &pc, parse_str, 1);
@@ -359,7 +359,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
char parse_str[strlen(s) + 1];
strcpy(parse_str, s);
(*env)->ReleaseStringUTFChars(env, str, s);
- dbg(lvl_debug,"*****string=%s\n",s);
+ dbg(lvl_debug,"*****string=%s",s);
// set destination to (lat#lon#title)
struct coord_geo g;
@@ -375,9 +375,9 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
// description
name = strtok (NULL, "#");
- dbg(lvl_debug,"lat=%f\n",g.lat);
- dbg(lvl_debug,"lng=%f\n",g.lng);
- dbg(lvl_debug,"str1=%s\n",name);
+ dbg(lvl_debug,"lat=%f",g.lat);
+ dbg(lvl_debug,"lng=%f",g.lng);
+ dbg(lvl_debug,"str1=%s",name);
struct coord c;
transform_from_geo(projection_mg, &g, &c);
@@ -408,7 +408,7 @@ Java_org_navitproject_navit_NavitGraphics_GetDefaultCountry( JNIEnv* env, jobjec
jstring return_string = NULL;
struct attr attr;
- dbg(lvl_debug,"enter %d %p\n",channel,str);
+ dbg(lvl_debug,"enter %d %p",channel,str);
config_get_attr(config_get(), attr_navit, &attr, NULL);
@@ -423,12 +423,12 @@ Java_org_navitproject_navit_NavitGraphics_GetDefaultCountry( JNIEnv* env, jobjec
struct mapset *ms=navit_get_mapset(attr.u.navit);
struct search_list *search_list = search_list_new(ms);
search_attr.type=attr_country_all;
- dbg(lvl_debug,"country %s\n", country_name.u.str);
+ dbg(lvl_debug,"country %s", country_name.u.str);
search_attr.u.str=country_name.u.str;
search_list_search(search_list, &search_attr, 0);
while((res=search_list_get_result(search_list)))
{
- dbg(lvl_debug,"Get result: %s\n", res->country->iso2);
+ dbg(lvl_debug,"Get result: %s", res->country->iso2);
}
if (item_attr_get(item, attr_country_iso2, &country_iso2))
return_string = (*env)->NewStringUTF(env,country_iso2.u.str);
@@ -449,7 +449,7 @@ Java_org_navitproject_navit_NavitGraphics_GetAllCountries( JNIEnv* env, jobject
jobjectArray all_countries;
struct attr attr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
config_get_attr(config_get(), attr_navit, &attr, NULL);
@@ -457,12 +457,12 @@ Java_org_navitproject_navit_NavitGraphics_GetAllCountries( JNIEnv* env, jobject
struct search_list *search_list = search_list_new(ms);
jobjectArray current_country = NULL;
search_attr.type=attr_country_all;
- //dbg(lvl_debug,"country %s\n", country_name.u.str);
+ //dbg(lvl_debug,"country %s", country_name.u.str);
search_attr.u.str=g_strdup("");//country_name.u.str;
search_list_search(search_list, &search_attr, 1);
while((res=search_list_get_result(search_list)))
{
- dbg(lvl_debug,"Get result: %s\n", res->country->iso2);
+ dbg(lvl_debug,"Get result: %s", res->country->iso2);
if (strlen(res->country->iso2)==2)
{
@@ -593,7 +593,7 @@ android_search_idle(struct android_search_priv *search_priv)
struct search_list_result *res = search_list_get_result(search_priv->search_list);
if (res) {
- dbg(lvl_debug, "Town: %s, Street: %s\n",res->town ? res->town->common.town_name : "no town", res->street ? res->street->name : "no street");
+ dbg(lvl_debug, "Town: %s, Street: %s",res->town ? res->town->common.town_name : "no town", res->street ? res->street->name : "no street");
search_priv->found = 1;
switch (search_priv->search_attr.type)
{
@@ -691,7 +691,7 @@ search_fix_spaces(const char *str)
static void start_search(struct android_search_priv *search_priv, const char *search_string)
{
- dbg(lvl_debug,"enter %s\n", search_string);
+ dbg(lvl_debug,"enter %s", search_string);
char *str=search_fix_spaces(search_string);
search_priv->phrases = g_strsplit(str, " ", 0);
//ret=search_address_town(ret, sl, phrases, NULL, partial, jni);
@@ -706,7 +706,7 @@ static void start_search(struct android_search_priv *search_priv, const char *se
//callback_call_0(search_priv->idle_clb);
g_free(str);
- dbg(lvl_debug,"leave\n");
+ dbg(lvl_debug,"leave");
}
JNIEXPORT jlong JNICALL
@@ -714,7 +714,7 @@ Java_org_navitproject_navit_NavitAddressSearchActivity_CallbackStartAddressSearc
{
struct attr attr;
const char *search_string =(*env)->GetStringUTFChars(env, str, NULL);
- dbg(lvl_debug,"search '%s'\n", search_string);
+ dbg(lvl_debug,"search '%s'", search_string);
config_get_attr(config_get(), attr_navit, &attr, NULL);
@@ -747,7 +747,7 @@ Java_org_navitproject_navit_NavitAddressSearchActivity_CallbackStartAddressSearc
if (!count)
dbg(lvl_error,"Country not found");
- dbg(lvl_debug,"search in country '%s'\n", str_country);
+ dbg(lvl_debug,"search in country '%s'", str_country);
(*env)->ReleaseStringUTFChars(env, country, str_country);
search_priv->search_result_obj.env = env;
diff --git a/navit/attr.c b/navit/attr.c
index 18ad79f64..863ab08ae 100644
--- a/navit/attr.c
+++ b/navit/attr.c
@@ -153,7 +153,7 @@ attr_new_from_text(const char *name, const char *value)
int min,max,count;
ret=g_new0(struct attr, 1);
- dbg(lvl_debug,"enter name='%s' value='%s'\n", name, value);
+ dbg(lvl_debug,"enter name='%s' value='%s'", name, value);
attr=attr_from_name(name);
ret->type=attr;
switch (attr) {
@@ -171,7 +171,7 @@ attr_new_from_text(const char *name, const char *value)
ret->u.item_types[count++]=item_type;
ret->u.item_types[count]=type_none;
} else {
- dbg(lvl_error,"Unknown item type '%s' ignored.\n",tok);
+ dbg(lvl_error,"Unknown item type '%s' ignored.",tok);
}
str=NULL;
}
@@ -251,13 +251,13 @@ attr_new_from_text(const char *name, const char *value)
}
if (value_is_relative) {
if ((ret->u.num > ATTR_REL_MAXREL) || (ret->u.num < ATTR_REL_MINREL)) {
- dbg(lvl_error, "Relative possibly-relative attribute with value out of range: %li\n", ret->u.num);
+ dbg(lvl_error, "Relative possibly-relative attribute with value out of range: %li", ret->u.num);
}
ret->u.num += ATTR_REL_RELSHIFT;
} else {
if ((ret->u.num > ATTR_REL_MAXABS) || (ret->u.num < ATTR_REL_MINABS)) {
- dbg(lvl_error, "Non-relative possibly-relative attribute with value out of range: %li\n", ret->u.num);
+ dbg(lvl_error, "Non-relative possibly-relative attribute with value out of range: %li", ret->u.num);
}
}
break;
@@ -291,7 +291,7 @@ attr_new_from_text(const char *name, const char *value)
color->b = (b << 8) | b;
color->a = (a << 8) | a;
} else {
- dbg(lvl_error,"color %s has unknown format\n",value);
+ dbg(lvl_error,"color %s has unknown format",value);
}
break;
}
@@ -302,7 +302,7 @@ attr_new_from_text(const char *name, const char *value)
transform_to_geo(projection_mg, &c, g);
break;
}
- dbg(lvl_debug,"unknown attribute\n");
+ dbg(lvl_debug,"unknown attribute");
g_free(ret);
ret=NULL;
}
@@ -515,9 +515,9 @@ attr_to_text(struct attr *attr, struct map *map, int pretty)
struct attr *
attr_search(struct attr **attrs, struct attr *last, enum attr_type attr)
{
- dbg(lvl_info, "enter attrs=%p\n", attrs);
+ dbg(lvl_info, "enter attrs=%p", attrs);
while (*attrs) {
- dbg(lvl_debug,"*attrs=%p\n", *attrs);
+ dbg(lvl_debug,"*attrs=%p", *attrs);
if ((*attrs)->type == attr) {
return *attrs;
}
@@ -615,7 +615,7 @@ attr_generic_set_attr(struct attr **attrs, struct attr *attr)
{
struct attr **curr=attrs;
int i,count=0;
- dbg(lvl_debug, "enter, attrs=%p, attr=%p (%s)\n", attrs, attr, attr_to_name(attr->type));
+ dbg(lvl_debug, "enter, attrs=%p, attr=%p (%s)", attrs, attr, attr_to_name(attr->type));
while (curr && *curr) {
if ((*curr)->type == attr->type) {
attr_free(*curr);
@@ -648,7 +648,7 @@ attr_generic_add_attr(struct attr **attrs, struct attr *attr)
{
struct attr **curr=attrs;
int i,count=0;
- dbg(lvl_debug, "enter, attrs=%p, attr=%p (%s)\n", attrs, attr, attr_to_name(attr->type));
+ dbg(lvl_debug, "enter, attrs=%p, attr=%p (%s)", attrs, attr, attr_to_name(attr->type));
while (curr && *curr) {
curr++;
count++;
@@ -796,7 +796,7 @@ attr_data_size(struct attr *attr)
while (attr->u.attr_types[i++] != attr_none);
return i*sizeof(enum attr_type);
}
- dbg(lvl_error,"size for %s unknown\n", attr_to_name(attr->type));
+ dbg(lvl_error,"size for %s unknown", attr_to_name(attr->type));
return 0;
}
@@ -956,7 +956,7 @@ attr_from_line(char *line, char *name, int *pos, char *val_ret, char *name_ret)
int len=0,quoted;
char *p,*e,*n;
- dbg(lvl_debug,"get_tag %s from %s\n", name, line);
+ dbg(lvl_debug,"get_tag %s from %s", name, line);
if (name)
len=strlen(name);
if (pos)
diff --git a/navit/autoload/osso/osso.c b/navit/autoload/osso/osso.c
index f6672090c..d14229f05 100644
--- a/navit/autoload/osso/osso.c
+++ b/navit/autoload/osso/osso.c
@@ -33,7 +33,7 @@ osso_display_on(struct navit *this_)
static gboolean
osso_cb_hw_state_idle(struct cb_hw_state_trail * params)
{
- dbg(lvl_debug, "(inact=%d, save=%d, shut=%d, memlow=%d, state=%d)\n",
+ dbg(lvl_debug, "(inact=%d, save=%d, shut=%d, memlow=%d, state=%d)",
params->state->system_inactivity_ind,
params->state->save_unsaved_data_ind, params->state->shutdown_ind,
params->state->memory_low_ind, params->state->sig_device_mode_ind);
@@ -69,10 +69,10 @@ osso_cb_hw_state(osso_hw_state_t * state, gpointer data)
static void
osso_navit(struct navit *nav, int add)
{
- dbg(lvl_debug, "Installing osso context for org.navit_project.navit\n");
+ dbg(lvl_debug, "Installing osso context for org.navit_project.navit");
osso_context = osso_initialize("org.navit_project.navit", version, TRUE, NULL);
if (osso_context == NULL) {
- dbg(lvl_error, "error initiating osso context\n");
+ dbg(lvl_error, "error initiating osso context");
}
osso_hw_set_event_cb(osso_context, NULL, osso_cb_hw_state, nav);
@@ -87,7 +87,7 @@ plugin_init(void)
{
//struct callback *cb;
- dbg(lvl_info, "enter\n");
+ dbg(lvl_info, "enter");
callback.u.callback = callback_new_attr_0(callback_cast(osso_navit), attr_navit);
config_add_attr(config, &callback);
diff --git a/navit/binding/dbus/binding_dbus.c b/navit/binding/dbus/binding_dbus.c
index 86f4cb869..6242c27ed 100644
--- a/navit/binding/dbus/binding_dbus.c
+++ b/navit/binding/dbus/binding_dbus.c
@@ -85,7 +85,7 @@ object_new(char *type, void *object)
{
int id;
char *ret;
- dbg(lvl_debug,"enter %s\n", type);
+ dbg(lvl_debug,"enter %s", type);
if ((ret=g_hash_table_lookup(object_hash_rev, object)))
return ret;
id=GPOINTER_TO_INT(g_hash_table_lookup(object_count, type));
@@ -93,7 +93,7 @@ object_new(char *type, void *object)
ret=g_strdup_printf("%s/%s/%d", object_path, type, id);
g_hash_table_insert(object_hash, ret, object);
g_hash_table_insert(object_hash_rev, object, ret);
- dbg(lvl_debug,"return %s\n", ret);
+ dbg(lvl_debug,"return %s", ret);
return (ret);
}
@@ -135,7 +135,7 @@ resolve_object(const char *opath, char *type)
struct attr attr;
if (strncmp(opath, object_path, strlen(object_path))) {
- dbg(lvl_error,"wrong object path %s\n",opath);
+ dbg(lvl_error,"wrong object path %s",opath);
return NULL;
}
prefix=g_strdup_printf("%s/%s/", object_path, type);
@@ -152,7 +152,7 @@ resolve_object(const char *opath, char *type)
if (!config_get_attr(config, attr_navit, &navit, NULL))
return NULL;
if (!oprefix[0]) {
- dbg(lvl_debug,"default_navit\n");
+ dbg(lvl_debug,"default_navit");
return navit.u.navit;
}
if (!strncmp(oprefix,def_graphics,strlen(def_graphics))) {
@@ -389,42 +389,42 @@ dbus_dump_iter(char *prefix, DBusMessageIter *iter)
switch (arg) {
case DBUS_TYPE_INT32:
dbus_message_iter_get_basic(iter, &vali);
- dbg(lvl_debug,"%sDBUS_TYPE_INT32: %d\n",prefix,vali);
+ dbg(lvl_debug,"%sDBUS_TYPE_INT32: %d",prefix,vali);
break;
case DBUS_TYPE_STRING:
dbus_message_iter_get_basic(iter, &vals);
- dbg(lvl_debug,"%sDBUS_TYPE_STRING: %s\n",prefix,vals);
+ dbg(lvl_debug,"%sDBUS_TYPE_STRING: %s",prefix,vals);
break;
case DBUS_TYPE_STRUCT:
- dbg(lvl_debug,"%sDBUS_TYPE_STRUCT:\n",prefix);
+ dbg(lvl_debug,"%sDBUS_TYPE_STRUCT:",prefix);
prefixr=g_strdup_printf("%s ",prefix);
dbus_message_iter_recurse(iter, &iterr);
dbus_dump_iter(prefixr, &iterr);
g_free(prefixr);
break;
case DBUS_TYPE_VARIANT:
- dbg(lvl_debug,"%sDBUS_TYPE_VARIANT:\n",prefix);
+ dbg(lvl_debug,"%sDBUS_TYPE_VARIANT:",prefix);
prefixr=g_strdup_printf("%s ",prefix);
dbus_message_iter_recurse(iter, &iterr);
dbus_dump_iter(prefixr, &iterr);
g_free(prefixr);
break;
case DBUS_TYPE_DICT_ENTRY:
- dbg(lvl_debug,"%sDBUS_TYPE_DICT_ENTRY:\n",prefix);
+ dbg(lvl_debug,"%sDBUS_TYPE_DICT_ENTRY:",prefix);
prefixr=g_strdup_printf("%s ",prefix);
dbus_message_iter_recurse(iter, &iterr);
dbus_dump_iter(prefixr, &iterr);
g_free(prefixr);
break;
case DBUS_TYPE_ARRAY:
- dbg(lvl_debug,"%sDBUS_TYPE_ARRAY:\n",prefix);
+ dbg(lvl_debug,"%sDBUS_TYPE_ARRAY:",prefix);
prefixr=g_strdup_printf("%s ",prefix);
dbus_message_iter_recurse(iter, &iterr);
dbus_dump_iter(prefixr, &iterr);
g_free(prefixr);
break;
default:
- dbg(lvl_debug,"%c\n",arg);
+ dbg(lvl_debug,"%c",arg);
}
dbus_message_iter_next(iter);
}
@@ -524,7 +524,7 @@ decode_attr_type_from_iter(DBusMessageIter *iter)
dbus_message_iter_get_basic(iter, &attr_type);
dbus_message_iter_next(iter);
ret=attr_from_name(attr_type);
- dbg(lvl_debug, "attr value: 0x%x string: %s\n", ret, attr_type);
+ dbg(lvl_debug, "attr value: 0x%x string: %s", ret, attr_type);
return ret;
}
@@ -541,7 +541,7 @@ decode_attr_from_iter(DBusMessageIter *iter, struct attr *attr)
dbus_message_iter_recurse(iter, &iterattr);
dbus_message_iter_next(iter);
- dbg(lvl_debug, "seems valid. signature: %s\n", dbus_message_iter_get_signature(&iterattr));
+ dbg(lvl_debug, "seems valid. signature: %s", dbus_message_iter_get_signature(&iterattr));
if (attr->type >= attr_type_item_begin && attr->type <= attr_type_item_end)
return 0;
@@ -823,9 +823,9 @@ request_set_add_remove_attr(DBusConnection *connection, DBusMessage *message, ch
destroy_attr(&attr);
if (ret)
return empty_reply(connection, message);
- dbg(lvl_error,"failed to set/add/remove attr\n");
+ dbg(lvl_error,"failed to set/add/remove attr");
} else {
- dbg(lvl_error,"failed to decode attr\n");
+ dbg(lvl_error,"failed to decode attr");
}
return dbus_error_invalid_parameter(connection, message);
}
@@ -1007,7 +1007,7 @@ request_map_dump(DBusConnection *connection, DBusMessage *message)
char *file;
FILE *f;
dbus_message_iter_get_basic(&iter, &file);
- /* dbg(0,"File '%s'\n",file); */
+ /* dbg(0,"File '%s'",file); */
f=fopen(file,"w");
map_dump_filedesc(map,f);
fclose(f);
@@ -1157,7 +1157,7 @@ point_get_from_message(DBusMessage *message, DBusMessageIter *iter, struct point
{
DBusMessageIter iter2;
- dbg(lvl_debug,"%s\n", dbus_message_iter_get_signature(iter));
+ dbg(lvl_debug,"%s", dbus_message_iter_get_signature(iter));
dbus_message_iter_recurse(iter, &iter2);
@@ -1171,7 +1171,7 @@ point_get_from_message(DBusMessage *message, DBusMessageIter *iter, struct point
return 0;
dbus_message_iter_get_basic(&iter2, &p->y);
- dbg(lvl_debug, " x -> %x y -> %x\n", p->x, p->y);
+ dbg(lvl_debug, " x -> %x y -> %x", p->x, p->y);
dbus_message_iter_next(&iter2);
@@ -1300,7 +1300,7 @@ request_navit_set_layout(DBusConnection *connection, DBusMessage *message)
static DBusHandlerResult
request_navit_quit(DBusConnection *connection, DBusMessage *message)
{
- dbg(lvl_debug,"Got a quit request from DBUS\n");
+ dbg(lvl_debug,"Got a quit request from DBUS");
struct attr navit;
navit.type=attr_navit;
struct navit *nav;
@@ -1329,7 +1329,7 @@ request_navit_zoom(DBusConnection *connection, DBusMessage *message)
return dbus_error_invalid_object_path(connection, message);
dbus_message_iter_init(message, &iter);
- dbg(lvl_debug,"%s\n", dbus_message_iter_get_signature(&iter));
+ dbg(lvl_debug,"%s", dbus_message_iter_get_signature(&iter));
dbus_message_iter_get_basic(&iter, &factor);
@@ -1361,7 +1361,7 @@ request_navit_zoom_to_route(DBusConnection *connection, DBusMessage *message)
return dbus_error_invalid_object_path(connection, message);
dbus_message_iter_init(message, &iter);
- dbg(lvl_debug,"%s\n", dbus_message_iter_get_signature(&iter));
+ dbg(lvl_debug,"%s", dbus_message_iter_get_signature(&iter));
navit_zoom_to_route(navit,0);
@@ -1396,7 +1396,7 @@ request_navit_route_export_gpx(DBusConnection *connection, DBusMessage *message)
return dbus_error_navigation_not_configured(connection, message);
}
- dbg(lvl_debug,"Dumping route from dbus to %s\n", filename);
+ dbg(lvl_debug,"Dumping route from dbus to %s", filename);
struct map * map=NULL;
struct map_rect * mr=NULL;
@@ -1465,7 +1465,7 @@ request_navit_route_export_geojson(DBusConnection *connection, DBusMessage *mess
return dbus_error_invalid_parameter(connection, message);
}
- dbg(lvl_debug,"Dumping route from dbus to %s\n", filename);
+ dbg(lvl_debug,"Dumping route from dbus to %s", filename);
struct map * map=NULL;
struct navigation * nav = NULL;
@@ -1557,7 +1557,7 @@ request_navit_resize(DBusConnection *connection, DBusMessage *message)
return dbus_error_invalid_object_path(connection, message);
dbus_message_iter_init(message, &iter);
- dbg(lvl_debug,"%s\n", dbus_message_iter_get_signature(&iter));
+ dbg(lvl_debug,"%s", dbus_message_iter_get_signature(&iter));
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_INT32)
return dbus_error_invalid_parameter(connection, message);
@@ -1569,7 +1569,7 @@ request_navit_resize(DBusConnection *connection, DBusMessage *message)
return dbus_error_invalid_parameter(connection, message);
dbus_message_iter_get_basic(&iter, &h);
- dbg(lvl_debug, " w -> %i h -> %i\n", w, h);
+ dbg(lvl_debug, " w -> %i h -> %i", w, h);
navit_handle_resize(navit, w, h);
@@ -1668,7 +1668,7 @@ request_navit_set_destination(DBusConnection *connection, DBusMessage *message)
dbus_message_iter_next(&iter);
dbus_message_iter_get_basic(&iter, &description);
- dbg(lvl_debug, " destination -> %s\n", description);
+ dbg(lvl_debug, " destination -> %s", description);
navit_set_destination(navit, &pc, description, 1);
return empty_reply(connection, message);
@@ -2034,7 +2034,7 @@ introspect_path(const char *object)
if (strncmp(object, object_path, strlen(object_path)))
return NULL;
ret=g_strdup(object+strlen(object_path));
- dbg(lvl_debug,"path=%s\n",ret);
+ dbg(lvl_debug,"path=%s",ret);
for (i = strlen(ret)-1 ; i >= 0 ; i--) {
if (ret[i] == '/' || (ret[i] >= '0' && ret[i] <= '9'))
ret[i]='\0';
@@ -2062,7 +2062,7 @@ generate_navitintrospectxml(const char *object)
char *path=introspect_path(object);
if (!path)
return NULL;
- dbg(lvl_debug,"path=%s\n",path);
+ dbg(lvl_debug,"path=%s",path);
// write header and make navit introspectable
navitintrospectxml = g_strdup_printf("%s%s%s\n", navitintrospectxml_head1, object, navitintrospectxml_head2);
@@ -2105,11 +2105,11 @@ navit_handler_func(DBusConnection *connection, DBusMessage *message, void *user_
{
int i;
char *path;
- dbg(lvl_debug,"type=%s interface=%s path=%s member=%s signature=%s\n", dbus_message_type_to_string(dbus_message_get_type(message)), dbus_message_get_interface(message), dbus_message_get_path(message), dbus_message_get_member(message), dbus_message_get_signature(message));
+ dbg(lvl_debug,"type=%s interface=%s path=%s member=%s signature=%s", dbus_message_type_to_string(dbus_message_get_type(message)), dbus_message_get_interface(message), dbus_message_get_path(message), dbus_message_get_member(message), dbus_message_get_signature(message));
if (dbus_message_is_method_call (message, "org.freedesktop.DBus.Introspectable", "Introspect")) {
DBusMessage *reply;
char *navitintrospectxml = generate_navitintrospectxml(dbus_message_get_path(message));
- dbg(lvl_debug,"Introspect %s:Result:%s\n",dbus_message_get_path(message), navitintrospectxml);
+ dbg(lvl_debug,"Introspect %s:Result:%s",dbus_message_get_path(message), navitintrospectxml);
if (navitintrospectxml) {
reply = dbus_message_new_method_return(message);
dbus_message_append_args(reply, DBUS_TYPE_STRING, &navitintrospectxml, DBUS_TYPE_INVALID);
@@ -2143,7 +2143,7 @@ static DBusObjectPathVTable dbus_navit_vtable = {
DBusHandlerResult
filter(DBusConnection *connection, DBusMessage *message, void *user_data)
{
- dbg(lvl_debug,"type=%s interface=%s path=%s member=%s signature=%s\n", dbus_message_type_to_string(dbus_message_get_type(message)), dbus_message_get_interface(message), dbus_message_get_path(message), dbus_message_get_member(message), dbus_message_get_signature(message));
+ dbg(lvl_debug,"type=%s interface=%s path=%s member=%s signature=%s", dbus_message_type_to_string(dbus_message_get_type(message)), dbus_message_get_interface(message), dbus_message_get_path(message), dbus_message_get_member(message), dbus_message_get_signature(message));
if (dbus_message_is_signal(message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) {
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -2156,7 +2156,7 @@ dbus_cmd_send_signal(struct navit *navit, char *command, struct attr **in, struc
DBusMessage* msg;
char *opath=object_new("navit",navit);
char *interface=g_strdup_printf("%s%s", service_name, ".navit");
- dbg(lvl_debug,"enter %s %s %s\n",opath,command,interface);
+ dbg(lvl_debug,"enter %s %s %s",opath,command,interface);
msg = dbus_message_new_signal(opath, interface, "signal");
if (msg) {
DBusMessageIter iter1,iter2,iter3;
@@ -2211,7 +2211,7 @@ void plugin_init(void)
object_hash=g_hash_table_new(g_str_hash, g_str_equal);
object_hash_rev=g_hash_table_new(NULL, NULL);
object_count=g_hash_table_new(g_str_hash, g_str_equal);
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
dbus_error_init(&error);
#ifdef DBUS_USE_SYSTEM_BUS
connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
@@ -2219,7 +2219,7 @@ void plugin_init(void)
connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
#endif
if (!connection) {
- dbg(lvl_error,"Failed to open connection to session message bus: %s\n", error.message);
+ dbg(lvl_error,"Failed to open connection to session message bus: %s", error.message);
dbus_error_free(&error);
return;
}
diff --git a/navit/binding/python/config.c b/navit/binding/python/config.c
index c3f04c4df..9d5b1ae87 100644
--- a/navit/binding/python/config.c
+++ b/navit/binding/python/config.c
@@ -66,7 +66,7 @@ config_py(PyObject *self, PyObject *args)
{
configObject *ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret=PyObject_NEW(configObject, &config_Type);
return (PyObject *)ret;
}
diff --git a/navit/binding/python/navit.c b/navit/binding/python/navit.c
index 2fde44cbe..2ee7c3126 100644
--- a/navit/binding/python/navit.c
+++ b/navit/binding/python/navit.c
@@ -44,10 +44,10 @@ navit_get_attr_py(navitObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
if (!navit_get_attr(self->navit, attr_from_name(name), &attr, NULL)) {
- dbg(lvl_error,"get_attr not ok\n");
+ dbg(lvl_error,"get_attr not ok");
Py_RETURN_NONE;
}
- dbg(lvl_debug,"get_attr ok\n");
+ dbg(lvl_debug,"get_attr ok");
return python_object_from_attr(&attr);
}
@@ -131,7 +131,7 @@ navit_py(PyObject *self, PyObject *args)
{
navitObject *ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret=PyObject_NEW(navitObject, &navit_Type);
return (PyObject *)ret;
}
@@ -139,7 +139,7 @@ navit_py(PyObject *self, PyObject *args)
PyObject *
navit_py_ref(struct navit *navit)
{
- dbg(lvl_debug,"navit=%p\n", navit);
+ dbg(lvl_debug,"navit=%p", navit);
navitObject *ret=PyObject_NEW(navitObject, &navit_Type);
ret->navit=navit;
return (PyObject *)ret;
diff --git a/navit/binding/python/pcoord.c b/navit/binding/python/pcoord.c
index 4fe734a70..1588067bd 100644
--- a/navit/binding/python/pcoord.c
+++ b/navit/binding/python/pcoord.c
@@ -76,7 +76,7 @@ pcoord_py(PyObject *self, PyObject *args)
ret->pc.pro=pro;
ret->pc.x=c.x;
ret->pc.y=c.y;
- dbg(lvl_debug,"0x%x,0x%x\n", c.x, c.y);
+ dbg(lvl_debug,"0x%x,0x%x", c.x, c.y);
return (PyObject *)ret;
}
diff --git a/navit/binding/win32/binding_win32.c b/navit/binding/win32/binding_win32.c
index c6d3295cc..e44aff66b 100644
--- a/navit/binding/win32/binding_win32.c
+++ b/navit/binding/win32/binding_win32.c
@@ -60,10 +60,10 @@ struct win32_binding_private {
static int
win32_cmd_send_signal(struct navit *navit, char *command, struct attr **in, struct attr ***out)
{
- dbg(lvl_error,"this function is a stub\n");
+ dbg(lvl_error,"this function is a stub");
if (in) {
while (*in) {
- dbg(lvl_debug,"another attribute to be sent\n");
+ dbg(lvl_debug,"another attribute to be sent");
in++;
}
}
@@ -84,23 +84,23 @@ win32_wm_copydata(struct win32_binding_private *this, int *hwndSender, COPYDATAS
navit.type=attr_navit;
navit.u.navit=this->navit;
if(cpd->dwData!=NAVIT_BINDING_W32_DWDATA) {
- dbg(lvl_error,"COPYDATA message came with wrong DWDATA value, expected %d, got %d.\n",NAVIT_BINDING_W32_DWDATA,cpd->dwData);
+ dbg(lvl_error,"COPYDATA message came with wrong DWDATA value, expected %d, got %d.",NAVIT_BINDING_W32_DWDATA,cpd->dwData);
return;
}
if(cpd->cbData<sizeof(*msg)) {
- dbg(lvl_error,"COPYDATA message too short, expected >=%d, got %d.\n",sizeof(*msg),cpd->cbData);
+ dbg(lvl_error,"COPYDATA message too short, expected >=%d, got %d.",sizeof(*msg),cpd->cbData);
return;
}
msg=cpd->lpData;
if(cpd->dwData!=NAVIT_BINDING_W32_VERSION) {
- dbg(lvl_error,"Got request with wrong version number, expected %d, got %d.\n",NAVIT_BINDING_W32_VERSION,msg->version);
+ dbg(lvl_error,"Got request with wrong version number, expected %d, got %d.",NAVIT_BINDING_W32_VERSION,msg->version);
return;
}
if(strcmp(NAVIT_BINDING_W32_MAGIC,msg->magic)) {
- dbg(lvl_error,"Got request with wrong MAGIC, expected %s, got %*s.\n",NAVIT_BINDING_W32_MAGIC, msg->magic,sizeof(msg->magic));
+ dbg(lvl_error,"Got request with wrong MAGIC, expected %s, got %*s.",NAVIT_BINDING_W32_MAGIC, msg->magic,sizeof(msg->magic));
return;
}
- dbg(lvl_debug,"Running command %s\n", msg->text);
+ dbg(lvl_debug,"Running command %s", msg->text);
command_evaluate(&navit, msg->text);
}
@@ -120,9 +120,9 @@ static void
win32_main_navit(struct win32_binding_private *this, struct navit *navit, int added)
{
struct attr attr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (added==1) {
- dbg(lvl_debug,"enter2\n");
+ dbg(lvl_debug,"enter2");
this->navit=navit;
command_add_table_attr(commands, sizeof(commands)/sizeof(struct command_table), navit, &attr);
navit_add_attr(navit, &attr);
@@ -137,7 +137,7 @@ void plugin_init(void)
{
struct attr callback;
struct win32_binding_private *this=g_new0(struct win32_binding_private,1);
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
callback.type=attr_callback;
callback.u.callback=callback_new_attr_1(callback_cast(win32_main_navit),attr_navit,this);
config_add_attr(config, &callback);
diff --git a/navit/bookmarks.c b/navit/bookmarks.c
index aa180e947..7f1ce8661 100644
--- a/navit/bookmarks.c
+++ b/navit/bookmarks.c
@@ -83,7 +83,7 @@ struct bookmark_item_priv {
void bookmarks_move_root(struct bookmarks *this_) {
this_->current=this_->root;
this_->current->iter=g_list_first(this_->current->children);
- dbg(lvl_info,"Root list have %u entries\n",g_list_length(this_->current->children));
+ dbg(lvl_info,"Root list have %u entries",g_list_length(this_->current->children));
return;
}
void bookmarks_move_up(struct bookmarks *this_) {
@@ -103,7 +103,7 @@ int bookmarks_move_down(struct bookmarks *this_,const char* name) {
if (!strcmp(data->label,name)) {
this_->current=(struct bookmark_item_priv*)this_->current->iter->data;
this_->current->iter=g_list_first(this_->current->children);
- dbg(lvl_info,"%s list have %u entries\n",this_->current->label,g_list_length(this_->current->children));
+ dbg(lvl_info,"%s list have %u entries",this_->current->label,g_list_length(this_->current->children));
return 1;
}
this_->current->iter=g_list_next(this_->current->iter);
@@ -207,7 +207,7 @@ bookmarks_load_hash(struct bookmarks *this_) {
finder=b_item->label;
while ((pos=strchr(finder,'/'))) {
*pos=0x00;
- dbg(lvl_debug,"Found path entry: %s\n",finder);
+ dbg(lvl_debug,"Found path entry: %s",finder);
if (!bookmarks_move_down(this_,finder)) {
struct bookmark_item_priv *path_item=g_new0(struct bookmark_item_priv,1);
path_item->type=type_bookmark_folder;
@@ -231,7 +231,7 @@ bookmarks_load_hash(struct bookmarks *this_) {
this_->bookmarks_list=g_list_append(this_->bookmarks_list,b_item);
this_->current->children=g_list_append(this_->current->children,b_item);
this_->current->children=g_list_first(this_->current->children);
- dbg(lvl_debug,"Added %s to %s and current list now %u long\n",b_item->label,this_->current->label,g_list_length(this_->current->children));
+ dbg(lvl_debug,"Added %s to %s and current list now %u long",b_item->label,this_->current->label,g_list_length(this_->current->children));
}
bookmarks_move_root(this_);
}
@@ -327,7 +327,7 @@ bookmarks_store_bookmarks_to_file(struct bookmarks *this_, int limit,int replac
g_free(fullname);
fullname=g_strdup(pathHelper);
g_free(pathHelper);
- dbg(lvl_debug,"full name: %s\n",fullname);
+ dbg(lvl_debug,"full name: %s",fullname);
}
}
@@ -760,7 +760,7 @@ write_former_destinations(GList* former_destinations, char *former_destination_f
}
fclose(f);
} else {
- dbg(lvl_error, "Error updating destinations file %s: %s\n", former_destination_file, strerror(errno));
+ dbg(lvl_error, "Error updating destinations file %s: %s", former_destination_file, strerror(errno));
}
}
/**
diff --git a/navit/cache.c b/navit/cache.c
index 180b165c0..6c618c9fc 100644
--- a/navit/cache.c
+++ b/navit/cache.c
@@ -33,13 +33,13 @@ static void
cache_entry_dump(struct cache *cache, struct cache_entry *entry)
{
int i,size;
- dbg(lvl_debug,"Usage: %d size %d\n",entry->usage, entry->size);
+ dbg(lvl_debug,"Usage: %d size %d",entry->usage, entry->size);
if (cache)
size=cache->id_size;
else
size=5;
for (i = 0 ; i < size ; i++) {
- dbg(lvl_debug,"0x%x\n", entry->id[i]);
+ dbg(lvl_debug,"0x%x", entry->id[i]);
}
}
@@ -47,7 +47,7 @@ static void
cache_list_dump(char *str, struct cache *cache, struct cache_entry_list *list)
{
struct cache_entry *first=list->first;
- dbg(lvl_debug,"dump %s %d\n",str, list->size);
+ dbg(lvl_debug,"dump %s %d",str, list->size);
while (first) {
cache_entry_dump(cache, first);
first=first->next;
@@ -106,7 +106,7 @@ cache_new(int id_size, int size)
cache->hash=g_hash_table_new(cache_hash20, cache_equal20);
break;
default:
- dbg(lvl_error,"cache with id_size of %d not supported\n", id_size);
+ dbg(lvl_error,"cache with id_size of %d not supported", id_size);
g_free(cache);
cache=NULL;
}
@@ -152,7 +152,7 @@ cache_remove_from_list(struct cache_entry_list *list, struct cache_entry *entry)
static void
cache_remove(struct cache *cache, struct cache_entry *entry)
{
- dbg(lvl_debug,"remove 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"remove 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
g_hash_table_remove(cache->hash, (gpointer)(entry->id));
g_slice_free1(entry->size, entry);
}
@@ -185,7 +185,7 @@ cache_remove_lru(struct cache *cache, struct cache_entry_list *list)
last=list->last;
if (! last || last->usage || seen >= list->size)
return NULL;
- dbg(lvl_debug,"removing %d\n", last->id[0]);
+ dbg(lvl_debug,"removing %d", last->id[0]);
cache_remove_lru_helper(list);
if (cache) {
cache_remove(cache, last);
@@ -211,7 +211,7 @@ void
cache_entry_destroy(struct cache *cache, void *data)
{
struct cache_entry *entry=(struct cache_entry *)((char *)data-cache->entry_size);
- dbg(lvl_debug,"destroy 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"destroy 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
entry->usage--;
}
@@ -219,8 +219,8 @@ static struct cache_entry *
cache_trim(struct cache *cache, struct cache_entry *entry)
{
struct cache_entry *new_entry;
- dbg(lvl_debug,"trim 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
- dbg(lvl_debug,"Trim %x from %d -> %d\n", entry->id[0], entry->size, cache->size);
+ dbg(lvl_debug,"trim 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"Trim %x from %d -> %d", entry->id[0], entry->size, cache->size);
if ( cache->entry_size < entry->size )
{
g_hash_table_remove(cache->hash, (gpointer)(entry->id));
@@ -256,11 +256,11 @@ static int
cache_replace(struct cache *cache)
{
if (cache->t1.size >= MAX(1,cache->t1_target)) {
- dbg(lvl_debug,"replace 12\n");
+ dbg(lvl_debug,"replace 12");
if (!cache_move(cache, &cache->t1, &cache->b1))
cache_move(cache, &cache->t2, &cache->b2);
} else {
- dbg(lvl_debug,"replace t2\n");
+ dbg(lvl_debug,"replace t2");
if (!cache_move(cache, &cache->t2, &cache->b2))
cache_move(cache, &cache->t1, &cache->b1);
}
@@ -298,17 +298,17 @@ void *
cache_lookup(struct cache *cache, void *id) {
struct cache_entry *entry;
- dbg(lvl_debug,"get %d\n", ((int *)id)[0]);
+ dbg(lvl_debug,"get %d", ((int *)id)[0]);
entry=g_hash_table_lookup(cache->hash, id);
if (entry == NULL) {
cache->insert=&cache->t1;
#ifdef DEBUG_CACHE
fprintf(stderr,"-");
#endif
- dbg(lvl_debug,"not in cache\n");
+ dbg(lvl_debug,"not in cache");
return NULL;
}
- dbg(lvl_debug,"found 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"found 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
if (entry->where == &cache->t1 || entry->where == &cache->t2) {
cache->hits+=entry->size;
#ifdef DEBUG_CACHE
@@ -317,7 +317,7 @@ cache_lookup(struct cache *cache, void *id) {
else
fprintf(stderr,"H");
#endif
- dbg(lvl_debug,"in cache %s\n", entry->where == &cache->t1 ? "T1" : "T2");
+ dbg(lvl_debug,"in cache %s", entry->where == &cache->t1 ? "T1" : "T2");
cache_remove_from_list(entry->where, entry);
cache_insert_mru(NULL, &cache->t2, entry);
entry->usage++;
@@ -327,18 +327,18 @@ cache_lookup(struct cache *cache, void *id) {
#ifdef DEBUG_CACHE
fprintf(stderr,"m");
#endif
- dbg(lvl_debug,"in phantom cache B1\n");
+ dbg(lvl_debug,"in phantom cache B1");
cache->t1_target=MIN(cache->t1_target+MAX(cache->b2.size/cache->b1.size, 1),cache->size);
cache_remove_from_list(&cache->b1, entry);
} else if (entry->where == &cache->b2) {
#ifdef DEBUG_CACHE
fprintf(stderr,"M");
#endif
- dbg(lvl_debug,"in phantom cache B2\n");
+ dbg(lvl_debug,"in phantom cache B2");
cache->t1_target=MAX(cache->t1_target-MAX(cache->b1.size/cache->b2.size, 1),0);
cache_remove_from_list(&cache->b2, entry);
} else {
- dbg(lvl_error,"**ERROR** invalid where\n");
+ dbg(lvl_error,"**ERROR** invalid where");
}
cache_replace(cache);
cache_remove(cache, entry);
@@ -351,7 +351,7 @@ void
cache_insert(struct cache *cache, void *data)
{
struct cache_entry *entry=(struct cache_entry *)((char *)data-cache->entry_size);
- dbg(lvl_debug,"insert 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"insert 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
if (cache->insert == &cache->t1) {
if (cache->t1.size + cache->b1.size >= cache->size) {
if (cache->t1.size < cache->size) {
@@ -382,8 +382,8 @@ cache_insert_new(struct cache *cache, void *id, int size)
static void
cache_stats(struct cache *cache)
{
- dbg(lvl_debug,"hits %d misses %d hitratio %d size %d entry_size %d id_size %d T1 target %d\n", cache->hits, cache->misses, cache->hits*100/(cache->hits+cache->misses), cache->size, cache->entry_size, cache->id_size, cache->t1_target);
- dbg(lvl_debug,"T1:%d B1:%d T2:%d B2:%d\n", cache->t1.size, cache->b1.size, cache->t2.size, cache->b2.size);
+ dbg(lvl_debug,"hits %d misses %d hitratio %d size %d entry_size %d id_size %d T1 target %d", cache->hits, cache->misses, cache->hits*100/(cache->hits+cache->misses), cache->size, cache->entry_size, cache->id_size, cache->t1_target);
+ dbg(lvl_debug,"T1:%d B1:%d T2:%d B2:%d", cache->t1.size, cache->b1.size, cache->t2.size, cache->b2.size);
cache->hits=0;
cache->misses=0;
}
@@ -396,6 +396,6 @@ cache_dump(struct cache *cache)
cache_list_dump("B1", cache, &cache->b1);
cache_list_dump("T2", cache, &cache->t2);
cache_list_dump("B2", cache, &cache->b2);
- dbg(lvl_debug,"dump end\n");
+ dbg(lvl_debug,"dump end");
}
diff --git a/navit/callback.c b/navit/callback.c
index 293fab0af..e66f13b99 100644
--- a/navit/callback.c
+++ b/navit/callback.c
@@ -145,13 +145,13 @@ callback_call(struct callback *cb, int pcount, void **p)
if (! cb)
return;
if (cb->pcount + pcount <= 8) {
- dbg(lvl_debug,"cb->pcount=%d\n", cb->pcount);
+ dbg(lvl_debug,"cb->pcount=%d", cb->pcount);
if (cb->pcount && cb->p)
- dbg(lvl_debug,"cb->p[0]=%p\n", cb->p[0]);
- dbg(lvl_debug,"pcount=%d\n", pcount);
+ dbg(lvl_debug,"cb->p[0]=%p", cb->p[0]);
+ dbg(lvl_debug,"pcount=%d", pcount);
if (pcount) {
dbg_assert(p!=NULL);
- dbg(lvl_debug,"p[0]=%p\n", p[0]);
+ dbg(lvl_debug,"p[0]=%p", p[0]);
}
for (i = 0 ; i < cb->pcount ; i++)
pf[i]=cb->p[i];
@@ -195,7 +195,7 @@ callback_call(struct callback *cb, int pcount, void **p)
break;
}
} else {
- dbg(lvl_error,"too many parameters for callback (%d+%d)\n", cb->pcount, pcount);
+ dbg(lvl_error,"too many parameters for callback (%d+%d)", cb->pcount, pcount);
}
}
diff --git a/navit/command.c b/navit/command.c
index 3a7d8b154..a982606fa 100644
--- a/navit/command.c
+++ b/navit/command.c
@@ -217,8 +217,8 @@ dump(struct result *res)
if (res->attrn)
strncpy(attribute, res->attrn, res->attrnlen);
attribute[res->attrnlen]='\0';
- dbg(lvl_debug,"type:%s\n", attr_to_name(res->attr.type));
- dbg(lvl_debug,"attribute '%s' from '%s'\n", attribute, object);
+ dbg(lvl_debug,"type:%s", attr_to_name(res->attr.type));
+ dbg(lvl_debug,"attribute '%s' from '%s'", attribute, object);
#endif
}
@@ -254,14 +254,14 @@ command_object_get_attr(struct context *ctx, struct attr *object, enum attr_type
struct attr dup;
struct object_func *func=object_func_lookup(object->type);
if (!object->u.data || !func || !func->get_attr) {
- dbg(lvl_warning, "cannot retrieve attributes from %s (%p), func=%p\n", attr_to_name(object->type), object->u.data, func)
+ dbg(lvl_warning, "cannot retrieve attributes from %s (%p), func=%p", attr_to_name(object->type), object->u.data, func)
return 0;
}
r=func->get_attr(object->u.data, attr_type, &dup, NULL);
if(r)
attr_dup_content(&dup,ret);
else
- dbg(lvl_warning, "%s (%p) has no attribute %s\n", attr_to_name(object->type), object->u.data, attr_to_name(attr_type))
+ dbg(lvl_warning, "%s (%p) has no attribute %s", attr_to_name(object->type), object->u.data, attr_to_name(attr_type))
return r;
}
@@ -319,11 +319,11 @@ command_get_attr(struct context *ctx, struct result *res)
*res=tmp;
res->allocated=1;
if (result) {
- dbg(lvl_debug, "successfully retrieved '%s' from '%s'\n", attr_to_name(attr_type), attr_to_name(parent_type));
+ dbg(lvl_debug, "successfully retrieved '%s' from '%s'", attr_to_name(attr_type), attr_to_name(parent_type));
res->var=res->attrn;
res->varlen=res->attrnlen;
} else {
- dbg(lvl_warning, "could not retrieve '%s' from '%s'\n", attr_to_name(attr_type), attr_to_name(parent_type));
+ dbg(lvl_warning, "could not retrieve '%s' from '%s'", attr_to_name(attr_type), attr_to_name(parent_type));
result_free(res);
res->attr.type=attr_none;
res->var=NULL;
@@ -455,7 +455,7 @@ get_int_bool(struct context *ctx, int is_bool, struct result *res)
return res->attr.u.data != NULL;
if (is_bool && ATTR_IS_STRING(res->attr.type))
return res->attr.u.data != NULL;
- dbg(lvl_debug,"bool %d %s\n",is_bool,attr_to_name(res->attr.type));
+ dbg(lvl_debug,"bool %d %s",is_bool,attr_to_name(res->attr.type));
ctx->error=wrong_type;
return 0;
}
@@ -621,7 +621,7 @@ result_op(struct context *ctx, enum op_type op_type, const char *op, struct resu
default:
break;
}
- dbg(lvl_error,"Unknown op %d %s\n",op_type,op);
+ dbg(lvl_error,"Unknown op %d %s",op_type,op);
ctx->error=internal;
}
@@ -658,7 +658,7 @@ result_set(struct context *ctx, enum set_type set_type, const char *op, int len,
default:
break;
}
- dbg(lvl_error,"unknown set type %d %s\n",set_type,op);
+ dbg(lvl_error,"unknown set type %d %s",set_type,op);
ctx->error=internal;
}
@@ -780,7 +780,7 @@ eval_value(struct context *ctx, struct result *res) {
* If we get here, ctx->expr does not begin with a variable or a literal value. This is not an
* error if this function is being called to test if an expression begins with a value.
*/
- dbg(lvl_debug, "character 0x%x is illegal in a value\n",*op);
+ dbg(lvl_debug, "character 0x%x is illegal in a value",*op);
ctx->error=illegal_character;
}
}
@@ -854,7 +854,7 @@ command_call_function(struct context *ctx, struct result *res)
if (res->attrn)
strncpy(function, res->attrn, res->attrnlen);
function[res->attrnlen]='\0';
- dbg(lvl_debug,"function=%s\n", function);
+ dbg(lvl_debug,"function=%s", function);
if (ctx->expr[0] != ')') {
list=eval_list(ctx);
if (ctx->error) {
@@ -883,7 +883,7 @@ command_call_function(struct context *ctx, struct result *res)
res->attr.u.num=list[0]->u.num;
res->allocated=0;
} else {
- dbg(lvl_error,"don't know how to create int of args\n");
+ dbg(lvl_error,"don't know how to create int of args");
}
} else if (ATTR_IS_STRING(attr_type)) {
if (list && list[0] && ATTR_IS_STRING(list[0]->type)) {
@@ -891,7 +891,7 @@ command_call_function(struct context *ctx, struct result *res)
res->attr.u.str=g_strdup(list[0]->u.str);
res->allocated=1;
} else {
- dbg(lvl_error,"don't know how to create string of args\n");
+ dbg(lvl_error,"don't know how to create string of args");
}
} else if (ATTR_IS_OBJECT(attr_type)) {
struct object_func *func=object_func_lookup(attr_type);
@@ -903,7 +903,7 @@ command_call_function(struct context *ctx, struct result *res)
res->allocated=1;
}
} else {
- dbg(lvl_error,"don't know how to create %s (%s)\n",attr_to_name(attr_type),function+4);
+ dbg(lvl_error,"don't know how to create %s (%s)",attr_to_name(attr_type),function+4);
}
} else if (!strcmp(function,"add_attr")) {
command_object_add_attr(ctx, &res->attr, list[0]);
@@ -913,11 +913,11 @@ command_call_function(struct context *ctx, struct result *res)
if (command_object_get_attr(ctx, &res->attr, attr_callback_list, &cbl)) {
int valid =0;
struct attr **out=NULL;
- dbg(lvl_debug,"function call %s from %s\n",function, attr_to_name(res->attr.type));
+ dbg(lvl_debug,"function call %s from %s",function, attr_to_name(res->attr.type));
callback_list_call_attr_4(cbl.u.callback_list, attr_command, function, list, &out, &valid);
if (valid!=1){
dbg(lvl_error, "invalid command ignored: \"%s\"; see http://wiki.navit-project.org/index.php/"
- "OSD#Navit_commands for valid commands.\n", function);
+ "OSD#Navit_commands for valid commands.", function);
}
if (out && out[0]) {
result_free(res);
@@ -967,15 +967,15 @@ eval_postfix(struct context *ctx, struct result *res)
enum attr_type attr_type=command_attr_type(res);
void *obj=res->attr.u.data;
if (!obj) {
- dbg(lvl_error,"no object\n");
+ dbg(lvl_error,"no object");
return;
}
if (!obj_func) {
- dbg(lvl_error,"no object func\n");
+ dbg(lvl_error,"no object func");
return;
}
if (!obj_func->iter_new || !obj_func->iter_destroy) {
- dbg(lvl_error,"no iter func\n");
+ dbg(lvl_error,"no iter func");
return;
}
iter = obj_func->iter_new(NULL);
@@ -998,7 +998,7 @@ eval_postfix(struct context *ctx, struct result *res)
return;
}
} else if (op[0] == '(') {
- dbg(lvl_debug,"function call\n");
+ dbg(lvl_debug,"function call");
resolve_object(ctx, res);
command_call_function(ctx, res);
}
@@ -1186,7 +1186,7 @@ eval_conditional(struct context *ctx, struct result *res)
memset(&tmp,0,sizeof(tmp));
if (!get_op(ctx,0,":",NULL)) {
- dbg(lvl_debug,"ctxerr\n");
+ dbg(lvl_debug,"ctxerr");
ctx->error=missing_colon;
return;
}
@@ -1307,7 +1307,7 @@ command_evaluate_to_attr(struct attr *attr, char *expr, int *error, struct attr
return attr_none;
resolve_object(&ctx, &res);
*ret=res.attr;
- dbg(lvl_debug,"type %s\n",attr_to_name(command_attr_type(&res)));
+ dbg(lvl_debug,"type %s",attr_to_name(command_attr_type(&res)));
return command_attr_type(&res);
}
@@ -1477,15 +1477,15 @@ command_evaluate_single(struct context *ctx)
}
end=ctx->expr;
if (!obj) {
- dbg(lvl_error,"no object\n");
+ dbg(lvl_error,"no object");
return 0;
}
if (!obj_func) {
- dbg(lvl_error,"no object func\n");
+ dbg(lvl_error,"no object func");
return 0;
}
if (!obj_func->iter_new || !obj_func->iter_destroy) {
- dbg(lvl_error,"no iter func\n");
+ dbg(lvl_error,"no iter func");
return 0;
}
iter = obj_func->iter_new(NULL);
@@ -1571,7 +1571,7 @@ command_evaluate(struct attr *attr, const char *expr)
strncpy(expr, ctx.expr, 32);
expr[31]='\0';
err = command_error_to_text(ctx.error);
- dbg(lvl_error, "error %s starting at %s\n", err, expr);
+ dbg(lvl_error, "error %s starting at %s", err, expr);
g_free(err);
}
g_free(expr_dup);
@@ -1660,7 +1660,7 @@ command_saved_error (struct command_saved *cs)
static void
command_saved_evaluate_idle (struct command_saved *cs)
{
- dbg(lvl_debug, "enter: cs=%p, cs->command=%s\n", cs, cs->command);
+ dbg(lvl_debug, "enter: cs=%p, cs->command=%s", cs, cs->command);
// Only run once at a time
if (cs->idle_ev) {
event_remove_idle(cs->idle_ev);
@@ -1694,7 +1694,7 @@ command_saved_evaluate_idle (struct command_saved *cs)
static void
command_saved_evaluate(struct command_saved *cs)
{
- dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s\n", cs, cs->async, cs->command);
+ dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s", cs, cs->async, cs->command);
if (!cs->async) {
command_saved_evaluate_idle(cs);
return;
@@ -1724,7 +1724,7 @@ command_saved_callbacks_changed(struct command_saved *cs)
struct object_func *func;
struct attr attr;
- dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s\n", cs, cs->async, cs->command);
+ dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s", cs, cs->async, cs->command);
if (cs->register_ev) {
event_remove_idle(cs->register_ev);
@@ -1737,7 +1737,7 @@ command_saved_callbacks_changed(struct command_saved *cs)
func = object_func_lookup(cs->cbs[i].attr.type);
if (!func->remove_attr) {
- dbg(lvl_error, "Could not remove command-evaluation callback because remove_attr is missing for type %i!\n", cs->cbs[i].attr.type);
+ dbg(lvl_error, "Could not remove command-evaluation callback because remove_attr is missing for type %i!", cs->cbs[i].attr.type);
continue;
}
@@ -1784,7 +1784,7 @@ command_register_callbacks(struct command_saved *cs)
* we can figure out offsets by using simple pointer arithmetics.
*/
- dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s\n", cs, cs->async, cs->command);
+ dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s", cs, cs->async, cs->command);
cs->ctx.expr = cs->command;
prev = cs->context_attr;
@@ -1796,11 +1796,15 @@ command_register_callbacks(struct command_saved *cs)
if (cs->ctx.error) {
/* An error occurred while parsing the command */
tmpoffset = cs->ctx.expr - cs->command;
- dbg(lvl_error, "parsing error: cs=%p, cs->ctx.error=%d\n\t%s\n\t%*s\n", cs, cs->ctx.error, cs->command, tmpoffset + 1, "^");
+ dbg(lvl_error, "parsing error: cs=%p, cs->ctx.error=%d", cs, cs->ctx.error);
+ dbg(lvl_error, "\t%s", cs->command);
+ dbg(lvl_error, "\t%*s", tmpoffset + 1, "^");
return 0;
} else if (cs->res.attr.type == attr_none) {
/* We could not resolve an object, perhaps because it has not been created */
- dbg(lvl_error, "could not resolve object in cs=%p:\n\t%s\n\t%*s\n", cs, cs->command, tmpoffset + 1, "^");
+ dbg(lvl_error, "could not resolve object in cs=%p:", cs);
+ dbg(lvl_error, "\t%s", cs->command);
+ dbg(lvl_error, "\t%*s", tmpoffset + 1, "^");
return 0;
}
@@ -1814,7 +1818,7 @@ command_register_callbacks(struct command_saved *cs)
cb = callback_new_attr_1(callback_cast(command_saved_evaluate), cs->res.attr.type, (void*)cs);
cs->ctx.attr = &cs->context_attr;
} else {
- dbg(lvl_error, "Error: Strange status returned from get_next_object()\n");
+ dbg(lvl_error, "Error: Strange status returned from get_next_object()");
}
cs->num_cbs++;
@@ -1828,7 +1832,7 @@ command_register_callbacks(struct command_saved *cs)
func->add_attr(prev.u.data, &cb_attr);
} else {
- dbg(lvl_error, "Could not add callback because add_attr is missing for type %i\n", prev.type);
+ dbg(lvl_error, "Could not add callback because add_attr is missing for type %i", prev.type);
}
}
@@ -1841,7 +1845,7 @@ command_register_callbacks(struct command_saved *cs)
command_saved_evaluate_idle(cs);
- dbg(lvl_debug, "done: cs=%p, cs->command=%s\n", cs, cs->command);
+ dbg(lvl_debug, "done: cs=%p, cs->command=%s", cs, cs->command);
return 1;
}
@@ -1860,7 +1864,7 @@ command_saved_attr_new(char *command, struct attr *attr, struct callback *cb, in
struct command_saved *ret;
ret = g_new0(struct command_saved, 1);
- dbg(lvl_debug, "enter, ret=%p, command=%s\n", ret, command);
+ dbg(lvl_debug, "enter, ret=%p, command=%s", ret, command);
ret->command = g_strdup(command);
ret->context_attr = *attr;
ret->cb = cb;
@@ -1869,7 +1873,7 @@ command_saved_attr_new(char *command, struct attr *attr, struct callback *cb, in
if (!command_register_callbacks(ret)) {
// We try this as an idle call again
- dbg(lvl_debug, "could not register callbacks, will retry as an idle call\n");
+ dbg(lvl_debug, "could not register callbacks, will retry as an idle call");
ret->register_cb = callback_new_1(callback_cast(command_saved_callbacks_changed), ret);
ret->register_ev = event_add_idle(300, ret->register_cb);
}
diff --git a/navit/config_.c b/navit/config_.c
index 9f4bd5860..f658d8a20 100644
--- a/navit/config_.c
+++ b/navit/config_.c
@@ -60,7 +60,7 @@ config_destroy(struct config *this_)
static void
config_terminate(int sig)
{
- dbg(lvl_debug,"terminating\n");
+ dbg(lvl_debug,"terminating");
config_destroy(config);
}
@@ -142,11 +142,11 @@ struct config *
config_new(struct attr *parent, struct attr **attrs)
{
if (configured) {
- dbg(lvl_error,"only one config allowed\n");
+ dbg(lvl_error,"only one config allowed");
return config;
}
if (parent) {
- dbg(lvl_error,"no parent in config allowed\n");
+ dbg(lvl_error,"no parent in config allowed");
return NULL;
}
if (!config)
@@ -156,7 +156,7 @@ config_new(struct attr *parent, struct attr **attrs)
config->attrs=attr_generic_add_attr_list(config->attrs, attrs);
while (*attrs) {
if (!config_set_attr_int(config,*attrs)) {
- dbg(lvl_error,"failed to set attribute '%s'\n",attr_to_name((*attrs)->type));
+ dbg(lvl_error,"failed to set attribute '%s'",attr_to_name((*attrs)->type));
config_destroy(config);
config=NULL;
break;
diff --git a/navit/coord.c b/navit/coord.c
index 2bc169d46..4874a49ed 100644
--- a/navit/coord.c
+++ b/navit/coord.c
@@ -104,7 +104,7 @@ coord_rect_overlap(struct coord_rect *r1, struct coord_rect *r2)
dbg_assert(r1->lu.y >= r1->rl.y);
dbg_assert(r2->lu.x <= r2->rl.x);
dbg_assert(r2->lu.y >= r2->rl.y);
- dbg(lvl_debug,"0x%x,0x%x - 0x%x,0x%x vs 0x%x,0x%x - 0x%x,0x%x\n", r1->lu.x, r1->lu.y, r1->rl.x, r1->rl.y, r2->lu.x, r2->lu.y, r2->rl.x, r2->rl.y);
+ dbg(lvl_debug,"0x%x,0x%x - 0x%x,0x%x vs 0x%x,0x%x - 0x%x,0x%x", r1->lu.x, r1->lu.y, r1->rl.x, r1->rl.y, r2->lu.x, r2->lu.y, r2->rl.x, r2->rl.y);
if (r1->lu.x > r2->rl.x)
return 0;
if (r1->rl.x < r2->lu.x)
@@ -171,14 +171,14 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
struct coord c,offset;
enum projection str_pro=projection_none;
- dbg(lvl_debug,"enter('%s',%d,%p)\n", coord_input, output_projection, result);
+ dbg(lvl_debug,"enter('%s',%d,%p)", coord_input, output_projection, result);
s=strchr(str,' ');
co=strchr(str,':');
if (co && co < s) {
proj=malloc(co-str+1);
strncpy(proj, str, co-str);
proj[co-str]='\0';
- dbg(lvl_debug,"projection=%s\n", proj);
+ dbg(lvl_debug,"projection=%s", proj);
str=co+1;
s=strchr(str,' ');
if (!strcmp(proj, "geo"))
@@ -186,7 +186,7 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
else {
str_pro = projection_from_name(proj,&offset);
if (str_pro == projection_none) {
- dbg(lvl_error, "Unknown projection: %s\n", proj);
+ dbg(lvl_error, "Unknown projection: %s", proj);
goto out;
}
}
@@ -202,8 +202,8 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
args=sscanf(str, "%i %i%n",&c.x, &c.y, &ret);
if (args < 2)
goto out;
- dbg(lvl_debug,"str='%s' x=0x%x y=0x%x c=%d\n", str, c.x, c.y, ret);
- dbg(lvl_debug,"rest='%s'\n", str+ret);
+ dbg(lvl_debug,"str='%s' x=0x%x y=0x%x c=%d", str, c.x, c.y, ret);
+ dbg(lvl_debug,"rest='%s'", str+ret);
if (str_pro == projection_none)
str_pro=projection_mg;
@@ -215,13 +215,13 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
} else if (*s == 'N' || *s == 'n' || *s == 'S' || *s == 's') {
double lng, lat;
char ns, ew;
- dbg(lvl_debug,"str='%s'\n", str);
+ dbg(lvl_debug,"str='%s'", str);
args=sscanf(str, "%lf %c %lf %c%n", &lat, &ns, &lng, &ew, &ret);
- dbg(lvl_debug,"args=%d\n", args);
- dbg(lvl_debug,"lat=%f %c lon=%f %c\n", lat, ns, lng, ew);
+ dbg(lvl_debug,"args=%d", args);
+ dbg(lvl_debug,"lat=%f %c lon=%f %c", lat, ns, lng, ew);
if (args < 4)
goto out;
- dbg(lvl_debug,"projection=%d str_pro=%d projection_none=%d\n", output_projection, str_pro, projection_none);
+ dbg(lvl_debug,"projection=%d str_pro=%d projection_none=%d", output_projection, str_pro, projection_none);
if (str_pro == projection_none) {
g.lat=floor(lat/100);
lat-=g.lat*100;
@@ -235,10 +235,10 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
g.lng=-g.lng;
dbg(lvl_debug,"transform_from_geo(%f,%f)",g.lat,g.lng);
transform_from_geo(output_projection, &g, result);
- dbg(lvl_debug,"result 0x%x,0x%x\n", result->x,result->y);
+ dbg(lvl_debug,"result 0x%x,0x%x", result->x,result->y);
}
- dbg(lvl_debug,"str='%s' x=%f ns=%c y=%f ew=%c c=%d\n", str, lng, ns, lat, ew, ret);
- dbg(lvl_debug,"rest='%s'\n", str+ret);
+ dbg(lvl_debug,"str='%s' x=%f ns=%c y=%f ew=%c c=%d", str, lng, ns, lat, ew, ret);
+ dbg(lvl_debug,"rest='%s'", str+ret);
} else if (str_pro == projection_utm) {
double x,y;
args=sscanf(str, "%lf %lf%n", &x, &y, &ret);
@@ -256,14 +256,14 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
args=sscanf(str, "%lf %lf%n", &lng, &lat, &ret);
if (args < 2)
goto out;
- dbg(lvl_debug,"str='%s' x=%f y=%f c=%d\n", str, lng, lat, ret);
- dbg(lvl_debug,"rest='%s'\n", str+ret);
+ dbg(lvl_debug,"str='%s' x=%f y=%f c=%d", str, lng, lat, ret);
+ dbg(lvl_debug,"rest='%s'", str+ret);
g.lng=lng;
g.lat=lat;
transform_from_geo(output_projection, &g, result);
}
ret+=str-coord_input;
- dbg(lvl_info, "ret=%d delta=%d ret_str='%s'\n", ret, GPOINTER_TO_INT(str-coord_input), coord_input+ret);
+ dbg(lvl_info, "ret=%d delta=%d ret_str='%s'", ret, GPOINTER_TO_INT(str-coord_input), coord_input+ret);
out:
free(proj);
return ret;
diff --git a/navit/debug.c b/navit/debug.c
index 6d1bd4c95..3fd1c5386 100644
--- a/navit/debug.c
+++ b/navit/debug.c
@@ -155,12 +155,12 @@ parse_dbg_level(struct attr *dbg_level_attr, struct attr *level_attr)
if(!strcmp(dbg_level_attr->u.str,"debug")){
return lvl_debug;
}
- dbg(lvl_error, "Invalid debug level in config: '%s'\n", dbg_level_attr->u.str);
+ dbg(lvl_error, "Invalid debug level in config: '%s'", dbg_level_attr->u.str);
} else if (level_attr) {
if (level_attr->u.num>= lvl_error &&
level_attr->u.num<= lvl_debug)
return level_attr->u.num;
- dbg(lvl_error, "Invalid debug level in config: %ld\n", level_attr->u.num);
+ dbg(lvl_error, "Invalid debug level in config: %ld", level_attr->u.num);
}
return lvl_unset;
}
@@ -308,7 +308,14 @@ debug_vprintf(dbg_level level, const char *module, const int mlen, const char *f
#if defined HAVE_API_WIN32_CE
#define vsnprintf _vsnprintf
#endif
- vsnprintf(debug_message+strlen(debug_message),4095-strlen(debug_message),fmt,ap);
+ gchar *fmt_newline;
+#ifdef HAVE_API_WIN32_BASE
+ fmt_newline = g_strconcat(fmt, "\r\n");
+#else
+ fmt_newline = g_strconcat(fmt, "\n");
+#endif
+ vsnprintf(debug_message+strlen(debug_message),4095-strlen(debug_message),fmt_newline,ap);
+ g_free(fmt_newline);
#ifdef DEBUG_WIN32_CE_MESSAGEBOX
mbstowcs(muni, debug_message, strlen(debug_message)+1);
MessageBoxW(NULL, muni, TEXT("Navit - Error"), MB_APPLMODAL|MB_OK|MB_ICONERROR);
@@ -391,7 +398,7 @@ debug_dump_mallocs(void)
{
struct malloc_head *head=malloc_heads;
int i;
- dbg(lvl_debug,"mallocs %d\n",mallocs);
+ dbg(lvl_debug,"mallocs %d",mallocs);
while (head) {
fprintf(stderr,"unfreed malloc from %s of size %d\n",head->where,head->size);
for (i = 0 ; i < 8 ; i++)
@@ -414,7 +421,7 @@ debug_malloc(const char *where, int line, const char *func, int size)
debug_malloc_size+=size;
if (debug_malloc_size/(1024*1024) != debug_malloc_size_m) {
debug_malloc_size_m=debug_malloc_size/(1024*1024);
- dbg(lvl_debug,"malloced %d kb\n",debug_malloc_size/1024);
+ dbg(lvl_debug,"malloced %d kb",debug_malloc_size/1024);
}
head=malloc(size+sizeof(*head)+sizeof(*tail));
head->magic=0xdeadbeef;
diff --git a/navit/event.c b/navit/event.c
index 5aee40689..313680f4e 100644
--- a/navit/event.c
+++ b/navit/event.c
@@ -31,7 +31,7 @@ static int has_quit;
#define require_method_helper(m)\
if(!event_methods.m) {\
- dbg(lvl_error, "Can't find event system method %s. Event system is %s%s\n",\
+ dbg(lvl_error, "Can't find event system method %s. Event system is %s%s",\
#m ,e_system?"set to ":"not set.", e_system?e_system:"");\
#define require_method(m)\
@@ -133,14 +133,14 @@ event_request_system(const char *system, const char *requestor)
void (*event_type_new)(struct event_methods *meth);
if (e_system) {
if (strcmp(e_system, system)) {
- dbg(lvl_error,"system '%s' already requested by '%s', can't set to '%s' as requested from '%s'\n", e_system, e_requestor, system, requestor);
+ dbg(lvl_error,"system '%s' already requested by '%s', can't set to '%s' as requested from '%s'", e_system, e_requestor, system, requestor);
return 0;
}
return 1;
}
event_type_new=plugin_get_category_event(system);
if (! event_type_new) {
- dbg(lvl_error,"unsupported event system '%s' requested from '%s'\n", system, requestor);
+ dbg(lvl_error,"unsupported event system '%s' requested from '%s'", system, requestor);
return 0;
}
event_type_new(&event_methods);
diff --git a/navit/file.c b/navit/file.c
index 8363b6a8b..393c54642 100644
--- a/navit/file.c
+++ b/navit/file.c
@@ -83,7 +83,7 @@ file_socket_connect(char *host, char *service)
hints.ai_protocol = 0;
s = getaddrinfo(host, service, &hints, &result);
if (s != 0) {
- dbg(lvl_error,"getaddrinfo error %s\n",gai_strerror(s));
+ dbg(lvl_error,"getaddrinfo error %s",gai_strerror(s));
return -1;
}
for (rp = result; rp != NULL; rp = rp->ai_next) {
@@ -104,7 +104,7 @@ file_http_request(struct file *file, char *method, char *host, char *path, char
{
char *request=g_strdup_printf("%s %s HTTP/1.0\r\nUser-Agent: navit %s\r\nHost: %s\r\n%s%s%s\r\n",method,path,version,host,persistent?"Connection: Keep-Alive\r\n":"",header?header:"",header?"\r\n":"");
write(file->fd, request, strlen(request));
- dbg(lvl_debug,"%s\n",request);
+ dbg(lvl_debug,"%s",request);
file->requests++;
}
@@ -141,7 +141,7 @@ file_request_do(struct file *file, struct attr **options, int connect)
host[path-name-7]='\0';
if (port)
*port++='\0';
- dbg(lvl_debug,"host=%s path=%s\n",host,path);
+ dbg(lvl_debug,"host=%s path=%s",host,path);
if (connect)
file->fd=file_socket_connect(host,port?port:"80");
file_http_request(file,method,host,path,header,persistent);
@@ -215,11 +215,11 @@ file_create(char *name, struct attr **options)
g_free(file);
return NULL;
}
- dbg(lvl_debug,"fd=%d\n", file->fd);
+ dbg(lvl_debug,"fd=%d", file->fd);
file->size=lseek(file->fd, 0, SEEK_END);
if (file->size < 0)
file->size=0;
- dbg(lvl_debug,"size="LONGLONG_FMT"\n", file->size);
+ dbg(lvl_debug,"size="LONGLONG_FMT"", file->size);
file->name_id = (long)atom(name);
}
#ifdef CACHE_SIZE
@@ -274,7 +274,7 @@ int file_mkdir(char *name, int pflag)
char *buffer=g_alloca(sizeof(char)*(strlen(name)+1));
int ret;
char *next;
- dbg(lvl_debug,"enter %s %d\n",name,pflag);
+ dbg(lvl_debug,"enter %s %d",name,pflag);
if (!pflag) {
if (file_is_dir(name))
return 0;
@@ -372,7 +372,7 @@ file_process_headers(struct file *file, unsigned char *headers)
if (*sep == ' ')
sep++;
strtolower(tok, tok);
- dbg(lvl_debug,"header '%s'='%s'\n",tok,sep);
+ dbg(lvl_debug,"header '%s'='%s'",tok,sep);
g_hash_table_insert(file->headers, tok, sep);
headers=NULL;
}
@@ -416,10 +416,10 @@ file_data_read_special(struct file *file, int size, int *size_ret)
eof=1;
}
if (file->requests) {
- dbg(lvl_debug,"checking header\n");
+ dbg(lvl_debug,"checking header");
if ((hdr=file_http_header_end(file->buffer, file->buffer_len))) {
hdr[-1]='\0';
- dbg(lvl_debug,"found %s\n",file->buffer);
+ dbg(lvl_debug,"found %s",file->buffer);
file_process_headers(file, file->buffer);
file_shift_buffer(file, hdr-file->buffer);
file->requests--;
@@ -453,7 +453,7 @@ file_data_flush(struct file *file, long long offset, int size)
if (file->cache) {
struct file_cache_id id={offset,size,file->name_id,0};
cache_flush(file_cache,&id);
- dbg(lvl_debug,"Flushing "LONGLONG_FMT" %d bytes\n",offset,size);
+ dbg(lvl_debug,"Flushing "LONGLONG_FMT" %d bytes",offset,size);
}
}
@@ -537,7 +537,7 @@ file_data_read_compressed(struct file *file, long long offset, int size, int siz
ret=NULL;
} else {
if (uncompress_int(ret, &destLen, (Bytef *)buffer, size) != Z_OK) {
- dbg(lvl_error,"uncompress failed\n");
+ dbg(lvl_error,"uncompress failed");
g_free(ret);
ret=NULL;
}
@@ -749,7 +749,7 @@ file_wordexp_new(const char *pattern)
ret->pattern=g_strdup(pattern);
ret->err=wordexp(pattern, &ret->we, 0);
if (ret->err)
- dbg(lvl_debug,"wordexp('%s') returned %d\n", pattern, ret->err);
+ dbg(lvl_debug,"wordexp('%s') returned %d", pattern, ret->err);
return ret;
}
@@ -803,7 +803,7 @@ file_version(struct file *file, int mode)
file->mtime=st.st_mtime;
file->ctime=st.st_ctime;
file->version++;
- dbg(lvl_debug,"%s now version %d\n", file->name, file->version);
+ dbg(lvl_debug,"%s now version %d", file->name, file->version);
}
}
return file->version;
@@ -837,6 +837,6 @@ file_init(void)
file_cache=cache_new(sizeof(struct file_cache_id), CACHE_SIZE);
#endif
if(sizeof(off_t)<8)
- dbg(lvl_error,"Maps larger than 2GB are not supported by this binary, sizeof(off_t)=%zu\n",sizeof(off_t));
+ dbg(lvl_error,"Maps larger than 2GB are not supported by this binary, sizeof(off_t)=%zu",sizeof(off_t));
}
diff --git a/navit/font/freetype/font_freetype.c b/navit/font/freetype/font_freetype.c
index 0508c5870..c651ee72c 100644
--- a/navit/font/freetype/font_freetype.c
+++ b/navit/font/freetype/font_freetype.c
@@ -354,21 +354,21 @@ static FT_Error face_requester( FTC_FaceID face_id, FT_Library library, FT_Point
if (! face_id)
return FT_Err_Invalid_Handle;
fontfile=g_strdup((char *)face_id);
- dbg(lvl_debug,"fontfile=%s\n", fontfile);
+ dbg(lvl_debug,"fontfile=%s", fontfile);
fontindex=strrchr(fontfile,'/');
if (! fontindex) {
g_free(fontfile);
return FT_Err_Invalid_Handle;
}
*fontindex++='\0';
- dbg(lvl_debug,"new face %s %d\n", fontfile, atoi(fontindex));
+ dbg(lvl_debug,"new face %s %d", fontfile, atoi(fontindex));
ret = FT_New_Face( library, fontfile, atoi(fontindex), aface );
if(ret) {
- dbg(lvl_error,"Error while creating freetype face: %d\n", ret);
+ dbg(lvl_error,"Error while creating freetype face: %d", ret);
return ret;
}
if((ret = FT_Select_Charmap(*aface, FT_ENCODING_UNICODE))) {
- dbg(lvl_error,"Error while creating freetype face: %d\n", ret);
+ dbg(lvl_error,"Error while creating freetype face: %d", ret);
}
return 0;
}
@@ -405,7 +405,7 @@ font_freetype_font_new(struct graphics_priv *gr,
}
font->size=size;
#ifdef HAVE_FONTCONFIG
- dbg(lvl_info, " about to search for fonts, preferred = %s\n", fontfamily);
+ dbg(lvl_info, " about to search for fonts, preferred = %s", fontfamily);
family = g_malloc(sizeof(fontfamilies) + sizeof(fontfamily));
if (fontfamily) {
memcpy(family, &fontfamily, sizeof(fontfamily));
@@ -419,7 +419,7 @@ font_freetype_font_new(struct graphics_priv *gr,
while (*family && !found) {
- dbg(lvl_info, "Looking for font family %s. exact=%d\n",
+ dbg(lvl_info, "Looking for font family %s. exact=%d",
*family, exact);
FcPattern *required =
FcPatternBuild(NULL, FC_FAMILY, FcTypeString,
@@ -450,7 +450,7 @@ font_freetype_font_new(struct graphics_priv *gr,
&& (r2 == FcResultMatch)
&& (FcValueEqual(v1, v2) || !exact)) {
dbg(lvl_info,
- "About to load font from file %s index %d\n",
+ "About to load font from file %s index %d",
fontfile, fontindex);
#if USE_CACHING
idstr=g_strdup_printf("%s/%d", fontfile, fontindex);
@@ -521,7 +521,7 @@ font_freetype_font_new(struct graphics_priv *gr,
g_free(name);
#endif /* HAVE_FONTCONFIG */
if (!found) {
- dbg(lvl_error,"Failed to load font, no labelling\n");
+ dbg(lvl_error,"Failed to load font, no labelling");
g_free(font);
return NULL;
}
diff --git a/navit/graphics.c b/navit/graphics.c
index 378f177fb..69eabfc3e 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -242,7 +242,7 @@ graphics_set_attr(struct graphics *gra, struct attr *attr)
{
int ret=1;
/* FIXME if gra->meth doesn't have a setter, we don't even try the generic attrs - is that what we want? */
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (gra->meth.set_attr)
ret=gra->meth.set_attr(gra->priv, attr);
if (!ret)
@@ -270,13 +270,13 @@ struct graphics * graphics_new(struct attr *parent, struct attr **attrs)
struct graphics_priv * (*graphicstype_new)(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl);
if (! (type_attr=attr_search(attrs, NULL, attr_type))) {
- dbg(lvl_error,"Graphics plugin type is not set.\n");
+ dbg(lvl_error,"Graphics plugin type is not set.");
return NULL;
}
graphicstype_new=plugin_get_category_graphics(type_attr->u.str);
if (! graphicstype_new) {
- dbg(lvl_error,"Failed to load graphics plugin %s.\n", type_attr->u.str);
+ dbg(lvl_error,"Failed to load graphics plugin %s.", type_attr->u.str);
return NULL;
}
this_=g_new0(struct graphics, 1);
@@ -758,7 +758,7 @@ image_new_helper(struct graphics *gra, struct graphics_image *this_, char *path,
this_->width=width;
this_->height=height;
- dbg(lvl_debug,"Trying to load image '%s' for '%s' at %dx%d\n", new_name, path, width, height);
+ dbg(lvl_debug,"Trying to load image '%s' for '%s' at %dx%d", new_name, path, width, height);
if (zip) {
unsigned char *start;
int len;
@@ -774,7 +774,7 @@ image_new_helper(struct graphics *gra, struct graphics_image *this_, char *path,
this_->priv=gra->meth.image_new(gra->priv, &this_->meth, new_name, &this_->width, &this_->height, &this_->hot, rotate);
}
if (this_->priv) {
- dbg(lvl_info,"Using image '%s' for '%s' at %dx%d\n", new_name, path, width, height);
+ dbg(lvl_info,"Using image '%s' for '%s' at %dx%d", new_name, path, width, height);
g_free(new_name);
break;
}
@@ -803,7 +803,7 @@ struct graphics_image * graphics_image_new_scaled_rotated(struct graphics *gra,
if ( g_hash_table_lookup_extended( gra->image_cache_hash, hash_key, NULL, (gpointer)&this_) ) {
g_free(hash_key);
- dbg(lvl_debug,"Found cached image%sfor '%s'\n",this_?" ":" miss ",path);
+ dbg(lvl_debug,"Found cached image%sfor '%s'",this_?" ":" miss ",path);
return this_;
}
@@ -882,7 +882,7 @@ struct graphics_image * graphics_image_new_scaled_rotated(struct graphics *gra,
file_wordexp_destroy(we);
if (! this_->priv) {
- dbg(lvl_error,"No image for '%s'\n", path);
+ dbg(lvl_error,"No image for '%s'", path);
g_free(this_);
this_=NULL;
}
@@ -1117,7 +1117,7 @@ int graphics_show_native_keyboard (struct graphics *this_, struct graphics_keybo
ret = -1;
else
ret = this_->meth.show_native_keyboard(kbd);
- dbg(lvl_debug, "return %d\n", ret);
+ dbg(lvl_debug, "return %d", ret);
return ret;
}
@@ -1331,11 +1331,11 @@ intersection(struct point * a1, int adx, int ady, struct point * b1, int bdx, in
struct point * res)
{
int n, a, b;
- dbg(lvl_debug,"%d,%d - %d,%d x %d,%d-%d,%d\n",a1->x,a1->y,a1->x+adx,a1->y+ady,b1->x,b1->y,b1->x+bdx,b1->y+bdy);
+ dbg(lvl_debug,"%d,%d - %d,%d x %d,%d-%d,%d",a1->x,a1->y,a1->x+adx,a1->y+ady,b1->x,b1->y,b1->x+bdx,b1->y+bdy);
n = bdy * adx - bdx * ady;
a = bdx * (a1->y - b1->y) - bdy * (a1->x - b1->x);
b = adx * (a1->y - b1->y) - ady * (a1->x - b1->x);
- dbg(lvl_debug,"a %d b %d n %d\n",a,b,n);
+ dbg(lvl_debug,"a %d b %d n %d",a,b,n);
if (n < 0) {
n = -n;
a = -a;
@@ -1345,7 +1345,7 @@ intersection(struct point * a1, int adx, int ady, struct point * b1, int bdx, in
return 0;
res->x = a1->x + a * adx / n;
res->y = a1->y + a * ady / n;
- dbg(lvl_debug,"%d,%d\n",res->x,res->y);
+ dbg(lvl_debug,"%d,%d",res->x,res->y);
return 1;
}
@@ -1575,7 +1575,7 @@ draw_shape(struct draw_polyline_context *ctx, struct point *pnt, int wi)
struct draw_polyline_shape *prev=&ctx->prev_shape;
#if 0
- dbg(lvl_debug,"enter %d,%d - %d,%d %d\n",pnt[0].x,pnt[0].y,pnt[1].x,pnt[1].y,wi);
+ dbg(lvl_debug,"enter %d,%d - %d,%d %d",pnt[0].x,pnt[0].y,pnt[1].x,pnt[1].y,wi);
#endif
*prev=*shape;
@@ -1604,7 +1604,7 @@ draw_shape(struct draw_polyline_context *ctx, struct point *pnt, int wi)
l = int_sqrt((dxs+dys)*lscales);
#endif
shape->fow=fowler(-shape->dy, shape->dx);
- dbg(lvl_debug,"fow=%d\n",shape->fow);
+ dbg(lvl_debug,"fow=%d",shape->fow);
if (! l)
l=1;
if (wi*lscale > 10000)
@@ -1653,7 +1653,7 @@ draw_middle(struct draw_polyline_context *ctx, struct point *p)
draw_point(&ctx->shape, p, &ctx->res[ctx->ppos++], 1);
return 1;
}
- dbg(lvl_debug,"delta %d\n",delta);
+ dbg(lvl_debug,"delta %d",delta);
if (delta > 0) {
struct point pos,poso;
draw_point(&ctx->shape, p, &pos, 1);
@@ -1713,9 +1713,9 @@ graphics_draw_polyline_as_polygon(struct graphics_priv *gra_priv, struct graphic
if (count < 2)
return;
#if 0
- dbg(lvl_debug,"count=%d\n",count);
+ dbg(lvl_debug,"count=%d",count);
for (i = 0 ; i < count ; i++)
- dbg(lvl_debug,"%d,%d width %d\n",pnt[i].x,pnt[i].y,width[i]);
+ dbg(lvl_debug,"%d,%d width %d",pnt[i].x,pnt[i].y,width[i]);
#endif
ctx.shape.l=0;
ctx.shape.wi=0;
@@ -1875,10 +1875,10 @@ graphics_draw_polyline_clipped(struct graphics *gra, struct graphics_gc *gc, str
segment_end.x=pa[i].x;
segment_end.y=pa[i].y;
segment_end.w=width[i];
- dbg(lvl_debug, "Segment: [%d, %d] - [%d, %d]...\n", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
+ dbg(lvl_debug, "Segment: [%d, %d] - [%d, %d]...", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
clip_result=clip_line(&segment_start, &segment_end, &r);
if (clip_result != CLIPRES_INVISIBLE) {
- dbg(lvl_debug, "....clipped to [%d, %d] - [%d, %d]\n", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
+ dbg(lvl_debug, "....clipped to [%d, %d] - [%d, %d]", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
if ((i == 1) || (clip_result & CLIPRES_START_CLIPPED)) {
points_to_draw[points_to_draw_cnt].x=segment_start.x;
points_to_draw[points_to_draw_cnt].y=segment_start.y;
@@ -2069,7 +2069,7 @@ graphics_icon_path(const char *icon)
static char *navit_sharedir;
char *ret=NULL;
struct file_wordexp *wordexp=NULL;
- dbg(lvl_debug,"enter %s\n",icon);
+ dbg(lvl_debug,"enter %s",icon);
if (strchr(icon, '$')) {
wordexp=file_wordexp_new(icon);
if (file_wordexp_get_count(wordexp))
@@ -2082,7 +2082,7 @@ graphics_icon_path(const char *icon)
// get resources for the correct screen density
//
// this part not needed, android unpacks only the correct version into res/drawable dir!
- // dbg(lvl_debug,"android icon_path %s\n",icon);
+ // dbg(lvl_debug,"android icon_path %s",icon);
// static char *android_density;
// android_density = getenv("ANDROID_DENSITY");
// ret=g_strdup_printf("res/drawable-%s/%s",android_density ,icon);
@@ -2189,7 +2189,7 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
if (font)
gra->meth.draw_text(gra->priv, gc->priv, gc_background?gc_background->priv:NULL, font->priv, di->label, &p, 0x10000, 0);
else
- dbg(lvl_error,"Failed to get font with size %d\n",e->text_size);
+ dbg(lvl_error,"Failed to get font with size %d",e->text_size);
}
}
break;
@@ -2205,7 +2205,7 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
if (font)
label_line(gra, gc, gc_background, font, pa, count, di->label);
else
- dbg(lvl_error,"Failed to get font with size %d\n",e->text_size);
+ dbg(lvl_error,"Failed to get font with size %d",e->text_size);
}
break;
case element_icon:
@@ -2228,7 +2228,7 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
if (img)
dc->img=img;
else
- dbg(lvl_debug,"failed to load icon '%s'\n", path);
+ dbg(lvl_debug,"failed to load icon '%s'", path);
g_free(path);
}
if (img) {
@@ -2244,19 +2244,19 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
}
break;
case element_image:
- dbg(lvl_debug,"image: '%s'\n", di->label);
+ dbg(lvl_debug,"image: '%s'", di->label);
if (gra->meth.draw_image_warp) {
img=graphics_image_new_scaled_rotated(gra, di->label, IMAGE_W_H_UNSET, IMAGE_W_H_UNSET, 0);
if (img)
gra->meth.draw_image_warp(gra->priv, gra->gc[0]->priv, pa, count, img->priv);
} else
- dbg(lvl_error,"draw_image_warp not supported by graphics driver drawing '%s'\n", di->label);
+ dbg(lvl_error,"draw_image_warp not supported by graphics driver drawing '%s'", di->label);
break;
case element_arrows:
display_draw_arrows(gra,gc,pa,count);
break;
default:
- dbg(lvl_error, "Unhandled element type %d\n", e->type);
+ dbg(lvl_error, "Unhandled element type %d", e->type);
}
di=di->next;
@@ -2321,7 +2321,7 @@ graphics_draw_itemgra(struct graphics *gra, struct itemgra *itm, struct transfor
struct element *e=es->data;
if (e->coord_count) {
if (e->coord_count > max_coord) {
- dbg(lvl_error,"maximum number of coords reached: %d > %d\n",e->coord_count,max_coord);
+ dbg(lvl_error,"maximum number of coords reached: %d > %d",e->coord_count,max_coord);
di->count=max_coord;
} else
di->count=e->coord_count;
@@ -2423,7 +2423,7 @@ displaylist_update_hash(struct displaylist *displaylist)
displaylist->max_offset=0;
clear_hash(displaylist);
displaylist_update_layers(displaylist, displaylist->layout->layers, displaylist->order);
- dbg(lvl_debug,"max offset %d\n",displaylist->max_offset);
+ dbg(lvl_debug,"max offset %d",displaylist->max_offset);
}
@@ -2528,12 +2528,12 @@ do_draw(struct displaylist *displaylist, int cancel, int flags)
if (! count)
continue;
#if 0
- dbg(lvl_debug,"%s 0x%x 0x%x\n",item_to_name(item->type), item->id_hi, item->id_lo);
+ dbg(lvl_debug,"%s 0x%x 0x%x",item_to_name(item->type), item->id_hi, item->id_lo);
#endif
if (displaylist->dc.pro != pro)
transform_from_to_count(ca, displaylist->dc.pro, ca, pro, count);
if (count == max) {
- dbg(lvl_error,"point count overflow %d for %s "ITEM_ID_FMT"\n", count,item_to_name(item->type),ITEM_ID_ARGS(*item));
+ dbg(lvl_error,"point count overflow %d for %s "ITEM_ID_FMT"", count,item_to_name(item->type),ITEM_ID_ARGS(*item));
displaylist->dc.maxlen=max*2;
}
if (item_is_custom_poi(*item)) {
@@ -2645,7 +2645,7 @@ static void graphics_load_mapset(struct graphics *gra, struct displaylist *displ
do_draw(displaylist, 1, flags);
}
xdisplay_free(displaylist);
- dbg(lvl_debug,"order=%d\n", order);
+ dbg(lvl_debug,"order=%d", order);
displaylist->dc.gra=gra;
displaylist->ms=mapset;
diff --git a/navit/graphics/android/graphics_android.c b/navit/graphics/android/graphics_android.c
index 0d6aa30d2..6cc776227 100644
--- a/navit/graphics/android/graphics_android.c
+++ b/navit/graphics/android/graphics_android.c
@@ -96,7 +96,7 @@ find_class_global(char *name, jclass *ret)
{
*ret=(*jnienv)->FindClass(jnienv, name);
if (! *ret) {
- dbg(lvl_error,"Failed to get Class %s\n",name);
+ dbg(lvl_error,"Failed to get Class %s",name);
return 0;
}
*ret = (*jnienv)->NewGlobalRef(jnienv, *ret);
@@ -108,7 +108,7 @@ find_method(jclass class, char *name, char *args, jmethodID *ret)
{
*ret = (*jnienv)->GetMethodID(jnienv, class, name, args);
if (*ret == NULL) {
- dbg(lvl_error,"Failed to get Method %s with signature %s\n",name,args);
+ dbg(lvl_error,"Failed to get Method %s with signature %s",name,args);
return 0;
}
return 1;
@@ -119,7 +119,7 @@ find_static_method(jclass class, char *name, char *args, jmethodID *ret)
{
*ret = (*jnienv)->GetStaticMethodID(jnienv, class, name, args);
if (*ret == NULL) {
- dbg(lvl_error,"Failed to get static Method %s with signature %s\n",name,args);
+ dbg(lvl_error,"Failed to get static Method %s with signature %s",name,args);
return 0;
}
return 1;
@@ -227,18 +227,18 @@ image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *
jclass localBitmap = NULL;
int id;
- dbg(lvl_debug,"enter %s\n",path);
+ dbg(lvl_debug,"enter %s",path);
if (!strncmp(path,"res/drawable/",13)) {
jstring a=(*jnienv)->NewStringUTF(jnienv, "drawable");
char *path_noext=g_strdup(path+13);
char *pos=strrchr(path_noext, '.');
if (pos)
*pos='\0';
- dbg(lvl_debug,"path_noext=%s\n",path_noext);
+ dbg(lvl_debug,"path_noext=%s",path_noext);
string = (*jnienv)->NewStringUTF(jnienv, path_noext);
g_free(path_noext);
id=(*jnienv)->CallIntMethod(jnienv, gra->Resources, gra->Resources_getIdentifier, string, a, gra->packageName);
- dbg(lvl_debug,"id=%d\n",id);
+ dbg(lvl_debug,"id=%d",id);
if (id)
localBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapFactoryClass, gra->BitmapFactory_decodeResource, gra->Resources, id);
(*jnienv)->DeleteLocalRef(jnienv, a);
@@ -264,13 +264,13 @@ image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *
ret->Bitmap = (*jnienv)->NewGlobalRef(jnienv, localBitmap);
(*jnienv)->DeleteLocalRef(jnienv, localBitmap);
- dbg(lvl_debug,"w=%d h=%d for %s\n",ret->width,ret->height,path);
+ dbg(lvl_debug,"w=%d h=%d for %s",ret->width,ret->height,path);
ret->hot.x=ret->width/2;
ret->hot.y=ret->height/2;
} else {
g_free(ret);
ret=NULL;
- dbg(lvl_warning,"Failed to open %s\n",path);
+ dbg(lvl_warning,"Failed to open %s",path);
}
(*jnienv)->DeleteLocalRef(jnienv, string);
if (ret) {
@@ -361,7 +361,7 @@ static void
draw_text(struct graphics_priv *gra, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy)
{
int bgcolor=0;
- dbg(lvl_debug,"enter %s\n", text);
+ dbg(lvl_debug,"enter %s", text);
initPaint(gra, fg);
if(bg)
bgcolor=(bg->a<<24)| (bg->r<<16) | (bg->g<<8) | bg->b;
@@ -373,7 +373,7 @@ draw_text(struct graphics_priv *gra, struct graphics_gc_priv *fg, struct graphic
static void
draw_image(struct graphics_priv *gra, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img)
{
- dbg(lvl_debug,"enter %p\n",img);
+ dbg(lvl_debug,"enter %p",img);
initPaint(gra, fg);
(*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_image, fg->gra->Paint, p->x, p->y, img->Bitmap);
@@ -396,7 +396,7 @@ draw_image_warp (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct p
(*jnienv)->CallVoidMethod(jnienv, gr->NavitGraphics, gr->NavitGraphics_draw_image_warp, fg->gra->Paint,
count, p[0].x, p[0].y,p[1].x, p[1].y, p[2].x, p[2].y, img->Bitmap);
} else
- dbg(lvl_debug,"draw_image_warp is called with unsupported count parameter value %d\n", count);
+ dbg(lvl_debug,"draw_image_warp is called with unsupported count parameter value %d", count);
}
@@ -473,12 +473,12 @@ set_attr(struct graphics_priv *gra, struct attr *attr)
| (attr->u.color->r / 0x101) << 16
| (attr->u.color->g / 0x101) << 8
| (attr->u.color->b / 0x101);
- dbg(lvl_debug, "set attr_background_color %04x %04x %04x %04x (%08x)\n",
+ dbg(lvl_debug, "set attr_background_color %04x %04x %04x %04x (%08x)",
attr->u.color->r, attr->u.color->g, attr->u.color->b, attr->u.color->a, gra->bgcolor);
if (gra->NavitGraphics_setBackgroundColor != NULL)
(*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_setBackgroundColor, gra->bgcolor);
else
- dbg(lvl_error, "NavitGraphics.setBackgroundColor not found, cannot set background color\n");
+ dbg(lvl_error, "NavitGraphics.setBackgroundColor not found, cannot set background color");
return 1;
default:
return 0;
@@ -520,15 +520,15 @@ static struct graphics_methods graphics_methods = {
static void
resize_callback(struct graphics_priv *gra, int w, int h)
{
- dbg(lvl_debug,"w=%d h=%d ok\n",w,h);
- dbg(lvl_debug,"gra=%p, %d callbacks in list\n", gra, g_list_length(gra->cbl));
+ dbg(lvl_debug,"w=%d h=%d ok",w,h);
+ dbg(lvl_debug,"gra=%p, %d callbacks in list", gra, g_list_length(gra->cbl));
callback_list_call_attr_2(gra->cbl, attr_resize, (void *)w, (void *)h);
}
static void
padding_callback(struct graphics_priv *gra, int left, int top, int right, int bottom)
{
- dbg(lvl_debug, "win.padding left=%d top=%d right=%d bottom=%d ok\n", left, top, right, bottom);
+ dbg(lvl_debug, "win.padding left=%d top=%d right=%d bottom=%d ok", left, top, right, bottom);
gra->padding->left = left;
gra->padding->top = top;
gra->padding->right = right;
@@ -547,7 +547,7 @@ motion_callback(struct graphics_priv *gra, int x, int y)
static void
keypress_callback(struct graphics_priv *gra, char *s)
{
- dbg(lvl_debug,"enter %s\n",s);
+ dbg(lvl_debug,"enter %s",s);
callback_list_call_attr_1(gra->cbl, attr_keypress, s);
}
@@ -568,20 +568,20 @@ set_activity(jobject graphics)
jmethodID cid;
ActivityClass = (*jnienv)->GetObjectClass(jnienv, android_activity);
- dbg(lvl_debug,"at 5\n");
+ dbg(lvl_debug,"at 5");
if (ActivityClass == NULL) {
- dbg(lvl_debug,"no activity class found\n");
+ dbg(lvl_debug,"no activity class found");
return 0;
}
- dbg(lvl_debug,"at 6\n");
+ dbg(lvl_debug,"at 6");
cid = (*jnienv)->GetMethodID(jnienv, ActivityClass, "setContentView", "(Landroid/view/View;)V");
if (cid == NULL) {
- dbg(lvl_error,"no setContentView method found\n");
+ dbg(lvl_error,"no setContentView method found");
return 0;
}
- dbg(lvl_debug,"at 7\n");
+ dbg(lvl_debug,"at 7");
(*jnienv)->CallVoidMethod(jnienv, android_activity, cid, graphics);
- dbg(lvl_debug,"at 8\n");
+ dbg(lvl_debug,"at 8");
return 1;
}
@@ -604,7 +604,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
struct callback *cb;
jmethodID cid, Context_getPackageName;
- dbg(lvl_debug,"at 2 jnienv=%p\n",jnienv);
+ dbg(lvl_debug,"at 2 jnienv=%p",jnienv);
if (parent)
ret->padding = parent->padding;
if (!find_class_global("android/graphics/Paint", &ret->PaintClass))
@@ -653,15 +653,15 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
if (!find_class_global("org/navitproject/navit/NavitGraphics", &ret->NavitGraphicsClass))
return 0;
- dbg(lvl_debug,"at 3\n");
+ dbg(lvl_debug,"at 3");
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "<init>", "(Landroid/app/Activity;Lorg/navitproject/navit/NavitGraphics;IIIIII)V");
if (cid == NULL) {
- dbg(lvl_error,"no method found\n");
+ dbg(lvl_error,"no method found");
return 0; /* exception thrown */
}
- dbg(lvl_debug,"at 4 android_activity=%p\n",android_activity);
+ dbg(lvl_debug,"at 4 android_activity=%p",android_activity);
ret->NavitGraphics=(*jnienv)->NewObject(jnienv, ret->NavitGraphicsClass, cid, android_activity, parent ? parent->NavitGraphics : NULL, pnt ? pnt->x:0 , pnt ? pnt->y:0, w, h, wraparound, use_camera);
- dbg(lvl_debug,"result=%p\n",ret->NavitGraphics);
+ dbg(lvl_debug,"result=%p",ret->NavitGraphics);
if (ret->NavitGraphics)
ret->NavitGraphics = (*jnienv)->NewGlobalRef(jnienv, ret->NavitGraphics);
@@ -670,13 +670,13 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
/* 0x101 = text kerning (default), antialiasing */
ret->Paint=(*jnienv)->NewObject(jnienv, ret->PaintClass, ret->Paint_init, 0x101);
- dbg(lvl_debug,"result=%p\n",ret->Paint);
+ dbg(lvl_debug,"result=%p",ret->Paint);
if (ret->Paint)
ret->Paint = (*jnienv)->NewGlobalRef(jnienv, ret->Paint);
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setSizeChangedCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetResizeCallback method found\n");
+ dbg(lvl_error,"no SetResizeCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(resize_callback), ret);
@@ -684,7 +684,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setPaddingChangedCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetPaddingCallback method found\n");
+ dbg(lvl_error,"no SetPaddingCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(padding_callback), ret);
@@ -692,7 +692,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setButtonCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetButtonCallback method found\n");
+ dbg(lvl_error,"no SetButtonCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(button_callback), ret);
@@ -700,7 +700,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setMotionCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetMotionCallback method found\n");
+ dbg(lvl_error,"no SetMotionCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(motion_callback), ret);
@@ -708,7 +708,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setKeypressCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetKeypressCallback method found\n");
+ dbg(lvl_error,"no SetKeypressCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(keypress_callback), ret);
@@ -757,7 +757,7 @@ graphics_android_fullscreen(struct window *win, int on)
static void
graphics_android_disable_suspend(struct window *win)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_disableSuspend);
}
@@ -776,7 +776,7 @@ static void
graphics_android_cmd_runMenuItem(struct graphics_priv *this, char *function, struct attr **in, struct attr ***out, int *valid)
{
int ncmd=0;
- dbg(0,"Running %s\n",function);
+ dbg(0,"Running %s",function);
if(!strcmp(function,"map_download_dialog")) {
ncmd=3;
} else if(!strcmp(function,"backup_restore_dialog")) {
@@ -801,7 +801,7 @@ graphics_android_cmd_runMenuItem(struct graphics_priv *this, char *function, str
static void
graphics_android_cmd_menu(struct graphics_priv *this, char *function, struct attr **in, struct attr ***out, int *valid)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_showMenu);
}
@@ -838,7 +838,7 @@ graphics_android_new(struct navit *nav, struct graphics_methods *meth, struct at
jmethodID cid;
jint android_bgcolor;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (!event_request_system("android","graphics_android"))
return NULL;
ret=g_new0(struct graphics_priv, 1);
@@ -859,7 +859,7 @@ graphics_android_new(struct navit *nav, struct graphics_methods *meth, struct at
| (attr->u.color->r / 0x101) << 16
| (attr->u.color->g / 0x101) << 8
| (attr->u.color->b / 0x101);
- dbg(lvl_debug, "attr_background_color %04x %04x %04x %04x (%08x)\n",
+ dbg(lvl_debug, "attr_background_color %04x %04x %04x %04x (%08x)",
attr->u.color->r, attr->u.color->g, attr->u.color->b, attr->u.color->a, ret->bgcolor);
} else {
/* default is the same as for OSD */
@@ -886,14 +886,14 @@ graphics_android_new(struct navit *nav, struct graphics_methods *meth, struct at
* the navit object (as the fact that graphics also handles input devices is not immedately obvious).
*/
navit_object_set_attr((struct navit_object *) nav, attr);
- dbg(lvl_debug, "attr_has_menu_button=%d\n", attr->u.num);
+ dbg(lvl_debug, "attr_has_menu_button=%d", attr->u.num);
g_free(attr);
}
ret->NavitGraphics_setBackgroundColor = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setBackgroundColor", "(I)V");
if (ret->NavitGraphics_setBackgroundColor != NULL) {
(*jnienv)->CallVoidMethod(jnienv, ret->NavitGraphics, ret->NavitGraphics_setBackgroundColor, ret->bgcolor);
}
- dbg(lvl_debug,"returning %p\n",ret);
+ dbg(lvl_debug,"returning %p",ret);
return ret;
} else {
g_free(ret);
@@ -922,7 +922,7 @@ overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct poin
struct graphics_priv *ret=g_new0(struct graphics_priv, 1);
*meth=graphics_methods;
if (graphics_android_init(ret, gr, p, w, h, wraparound, 0)) {
- dbg(lvl_debug,"returning %p\n",ret);
+ dbg(lvl_debug,"returning %p",ret);
return ret;
} else {
g_free(ret);
@@ -934,12 +934,12 @@ overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct poin
static void
event_android_main_loop_run(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static void event_android_main_loop_quit(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_exit);
}
@@ -961,7 +961,7 @@ static void do_poll(JNIEnv *env, int fd, int cond)
{
struct pollfd pfd;
pfd.fd=fd;
- dbg(lvl_debug,"%p poll called for %d %d\n", fd, cond);
+ dbg(lvl_debug,"%p poll called for %d %d", fd, cond);
switch ((enum event_watch_cond)cond) {
case event_watch_cond_read:
pfd.events=POLLIN;
@@ -984,7 +984,7 @@ event_android_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
jobject ret;
ret=(*jnienv)->NewObject(jnienv, NavitWatchClass, NavitWatch_init, (int)do_poll, h, (int) cond, (int)cb);
- dbg(lvl_debug,"result for %d,%d,%p=%p\n",h,cond,cb,ret);
+ dbg(lvl_debug,"result for %d,%d,%p=%p",h,cond,cb,ret);
if (ret)
ret = (*jnienv)->NewGlobalRef(jnienv, ret);
return (struct event_watch *)ret;
@@ -993,7 +993,7 @@ event_android_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
static void
event_android_remove_watch(struct event_watch *ev)
{
- dbg(lvl_debug,"enter %p\n",ev);
+ dbg(lvl_debug,"enter %p",ev);
if (ev) {
jobject obj=(jobject )ev;
(*jnienv)->CallVoidMethod(jnienv, obj, NavitWatch_remove);
@@ -1045,9 +1045,9 @@ event_android_add_idle(int priority, struct callback *cb)
{
#if 0
jobject ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret=(*jnienv)->NewObject(jnienv, NavitIdleClass, NavitIdle_init, (int)cb);
- dbg(lvl_debug,"result for %p=%p\n",cb,ret);
+ dbg(lvl_debug,"result for %p=%p",cb,ret);
if (ret)
ret = (*jnienv)->NewGlobalRef(jnienv, ret);
return (struct event_idle *)ret;
@@ -1059,7 +1059,7 @@ static void
event_android_remove_idle(struct event_idle *ev)
{
#if 0
- dbg(lvl_debug,"enter %p\n",ev);
+ dbg(lvl_debug,"enter %p",ev);
if (ev) {
jobject obj=(jobject )ev;
(*jnienv)->CallVoidMethod(jnienv, obj, NavitIdle_remove);
@@ -1072,7 +1072,7 @@ event_android_remove_idle(struct event_idle *ev)
static void
event_android_call_callback(struct callback_list *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_methods event_android_methods = {
@@ -1090,7 +1090,7 @@ static struct event_methods event_android_methods = {
static struct event_priv *
event_android_new(struct event_methods *meth)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (!find_class_global("org/navitproject/navit/NavitTimeout", &NavitTimeoutClass))
return NULL;
NavitTimeout_init = (*jnienv)->GetMethodID(jnienv, NavitTimeoutClass, "<init>", "(IZI)V");
@@ -1139,7 +1139,7 @@ event_android_new(struct event_methods *meth)
Navit_showNativeKeyboard = (*jnienv)->GetMethodID(jnienv, NavitClass, "showNativeKeyboard", "()I");
Navit_hideNativeKeyboard = (*jnienv)->GetMethodID(jnienv, NavitClass, "hideNativeKeyboard", "()V");
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
*meth=event_android_methods;
return NULL;
}
@@ -1166,12 +1166,12 @@ event_android_new(struct event_methods *meth)
int show_native_keyboard (struct graphics_keyboard *kbd) {
kbd->w = -1;
if (Navit_showNativeKeyboard == NULL) {
- dbg(lvl_error, "method Navit.showNativeKeyboard() not found, cannot display keyboard\n");
+ dbg(lvl_error, "method Navit.showNativeKeyboard() not found, cannot display keyboard");
return 0;
}
kbd->h = (*jnienv)->CallIntMethod(jnienv, android_activity, Navit_showNativeKeyboard);
- dbg(lvl_error, "keyboard size is %d x %d px\n", kbd->w, kbd->h);
- dbg(lvl_error, "return\n");
+ dbg(lvl_error, "keyboard size is %d x %d px", kbd->w, kbd->h);
+ dbg(lvl_error, "return");
/* zero height means we're not showing a keyboard, therefore normalize height to boolean */
return !!(kbd->h);
}
@@ -1186,7 +1186,7 @@ int show_native_keyboard (struct graphics_keyboard *kbd) {
*/
void hide_native_keyboard (struct graphics_keyboard *kbd) {
if (Navit_hideNativeKeyboard == NULL) {
- dbg(lvl_error, "method Navit.hideNativeKeyboard() not found, cannot dismiss keyboard\n");
+ dbg(lvl_error, "method Navit.hideNativeKeyboard() not found, cannot dismiss keyboard");
return;
}
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_hideNativeKeyboard);
@@ -1197,7 +1197,7 @@ void hide_native_keyboard (struct graphics_keyboard *kbd) {
void
plugin_init(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
plugin_register_category_graphics("android", graphics_android_new);
plugin_register_category_event("android", event_android_new);
}
diff --git a/navit/graphics/cocoa/graphics_cocoa.m b/navit/graphics/cocoa/graphics_cocoa.m
index 16c879bd7..8612469ac 100644
--- a/navit/graphics/cocoa/graphics_cocoa.m
+++ b/navit/graphics/cocoa/graphics_cocoa.m
@@ -112,7 +112,7 @@ struct graphics_font_priv {
#if REVERSE_Y
pc.y=graphics->h-pc.y-gr->h;
#endif
- dbg(1,"draw %dx%d at %f,%f\n",gr->w,gr->h,pc.x,pc.y);
+ dbg(1,"draw %dx%d at %f,%f",gr->w,gr->h,pc.x,pc.y);
CGContextDrawLayerAtPoint(X, pc, gr->layer);
}
gr=gr->next;
@@ -128,7 +128,7 @@ struct graphics_font_priv {
struct point p;
p.x=pc.x;
p.y=pc.y;
- dbg(1,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
+ dbg(1,"Enter count=%d %d %d",touches.count,p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(1), GINT_TO_POINTER(1), (void *)&p);
}
@@ -141,7 +141,7 @@ struct graphics_font_priv {
struct point p;
p.x=pc.x;
p.y=pc.y;
- dbg(1,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
+ dbg(1,"Enter count=%d %d %d",touches.count,p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}
@@ -153,7 +153,7 @@ struct graphics_font_priv {
struct point p;
p.x=pc.x;
p.y=pc.y;
- dbg(1,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
+ dbg(1,"Enter count=%d %d %d",touches.count,p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}
@@ -165,7 +165,7 @@ struct graphics_font_priv {
struct point p;
p.x=pc.x;
p.y=pc.y;
- dbg(1,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
+ dbg(1,"Enter count=%d %d %d",touches.count,p.x,p.y);
callback_list_call_attr_1(graphics->cbl, attr_motion, (void *)&p);
}
@@ -176,7 +176,7 @@ struct graphics_font_priv {
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;
- dbg(1,"Enter %d %d\n",p.x,p.y);
+ dbg(1,"Enter %d %d",p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(1), GINT_TO_POINTER(1), (void *)&p);
}
@@ -186,7 +186,7 @@ struct graphics_font_priv {
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;
- dbg(1,"Enter %d %d\n",p.x,p.y);
+ dbg(1,"Enter %d %d",p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}
@@ -196,7 +196,7 @@ struct graphics_font_priv {
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;
- dbg(1,"Enter %d %d\n",p.x,p.y);
+ dbg(1,"Enter %d %d",p.x,p.y);
callback_list_call_attr_1(graphics->cbl, attr_motion, (void *)&p);
}
#endif
@@ -280,7 +280,7 @@ setup_graphics(struct graphics_priv *gr)
}
- (void)didReceiveMemoryWarning {
- dbg(0,"enter\n");
+ dbg(0,"enter");
}
- (void)viewDidUnload {
@@ -378,7 +378,7 @@ static void
draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
if (mode == draw_mode_end) {
- dbg(1,"end %p\n",gr);
+ dbg(1,"end %p",gr);
if (!gr->parent) {
#if USE_UIKIT
[gr->view setNeedsDisplay];
@@ -427,7 +427,7 @@ draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct poi
{
CGRect lr=CGRectMake(p->x, p->y, w, h);
if (p->x <= 0 && p->y <= 0 && p->x+w+1 >= gr->w && p->y+h+1 >= gr->h) {
- dbg(1,"clear %p %dx%d\n",gr,w,h);
+ dbg(1,"clear %p %dx%d",gr,w,h);
free_graphics(gr);
setup_graphics(gr);
}
@@ -571,7 +571,7 @@ image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *
CGImageRef image = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault);
CGDataProviderRelease(imgDataProvider);
- dbg(1,"size %dx%d\n",CGImageGetWidth(image),CGImageGetHeight(image));
+ dbg(1,"size %dx%d",CGImageGetWidth(image),CGImageGetHeight(image));
if (w)
*w=CGImageGetWidth(image);
if (h)
@@ -586,7 +586,7 @@ image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *
static void *
get_data(struct graphics_priv *this, const char *type)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
if (strcmp(type,"window"))
return NULL;
return &this->win;
@@ -670,7 +670,7 @@ graphics_cocoa_new(struct navit *nav, struct graphics_methods *meth, struct attr
{
struct graphics_priv *ret;
*meth=graphics_methods;
- dbg(0,"enter\n");
+ dbg(0,"enter");
if(!event_request_system("cocoa","graphics_cocoa"))
return NULL;
ret=g_new0(struct graphics_priv, 1);
@@ -683,7 +683,7 @@ static void
event_cocoa_main_loop_run(void)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
#if 0
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
@@ -693,9 +693,9 @@ event_cocoa_main_loop_run(void)
#endif
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#if USE_UIKIT
- dbg(0,"calling main\n");
+ dbg(0,"calling main");
int retval = UIApplicationMain(main_argc, main_argv, nil, @"NavitAppDelegate");
- dbg(0,"retval=%d\n",retval);
+ dbg(0,"retval=%d",retval);
#else
NavitAppDelegate * delegate = [[NavitAppDelegate alloc] init];
NSApplication * application = [NSApplication sharedApplication];
@@ -739,7 +739,7 @@ event_cocoa_add_timeout(int timeout, int multi, struct callback *cb)
NavitTimer *ret=[[NavitTimer alloc]init];
ret->cb=cb;
ret->timer=[NSTimer scheduledTimerWithTimeInterval:(timeout/1000.0) target:ret selector:@selector(onTimer:) userInfo:nil repeats:multi?YES:NO];
- dbg(1,"timer=%p\n",ret->timer);
+ dbg(1,"timer=%p",ret->timer);
return (struct event_timeout *)ret;
}
@@ -761,7 +761,7 @@ event_cocoa_add_idle(int priority, struct callback *cb)
ret->cb=cb;
ret->timer=[NSTimer scheduledTimerWithTimeInterval:(0.0) target:ret selector:@selector(onTimer:) userInfo:nil repeats:YES];
- dbg(1,"timer=%p\n",ret->timer);
+ dbg(1,"timer=%p",ret->timer);
return (struct event_idle *)ret;
}
@@ -790,7 +790,7 @@ static struct event_methods event_cocoa_methods = {
static struct event_priv *
event_cocoa_new(struct event_methods *meth)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
*meth=event_cocoa_methods;
return NULL;
}
@@ -799,7 +799,7 @@ event_cocoa_new(struct event_methods *meth)
void
plugin_init(void)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
plugin_register_category_graphics("cocoa", graphics_cocoa_new);
plugin_register_category_event("cocoa", event_cocoa_new);
}
diff --git a/navit/graphics/egl/graphics_egl.c b/navit/graphics/egl/graphics_egl.c
index 4d7780ff4..8a500a00e 100644
--- a/navit/graphics/egl/graphics_egl.c
+++ b/navit/graphics/egl/graphics_egl.c
@@ -492,7 +492,7 @@ image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *n
else
{
/* TODO: debug "colour parse errors" on xpm */
- dbg(lvl_error,"image_new on '%s' failed: %s\n", name, IMG_GetError());
+ dbg(lvl_error,"image_new on '%s' failed: %s", name, IMG_GetError());
g_free(gi);
gi = NULL;
g_hash_table_insert(hImageData,
@@ -829,7 +829,7 @@ draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg,
int color = 1;
if (!font) {
- dbg(lvl_error, "no font, returning\n");
+ dbg(lvl_error, "no font, returning");
return;
}
graphics_priv_root->dirty = 1;
diff --git a/navit/graphics/gd/graphics_gd.c b/navit/graphics/gd/graphics_gd.c
index 3ef6c520b..c2d09ae46 100644
--- a/navit/graphics/gd/graphics_gd.c
+++ b/navit/graphics/gd/graphics_gd.c
@@ -511,7 +511,7 @@ draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
if (gr->flags & 2) {
struct shmem_header *next=shm_next(gr);
gr->shm_header->flag=1;
- dbg(lvl_debug,"next flag is %d\n",next->flag);
+ dbg(lvl_debug,"next flag is %d",next->flag);
if (!next->flag) {
gr->shm_header=next;
image_setup(gr);
@@ -526,15 +526,15 @@ draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
while (sockets) {
int fd=socket(PF_INET, SOCK_STREAM, 0);
if (fd < 0) {
- dbg(lvl_error,"socket failed\n");
+ dbg(lvl_error,"socket failed");
} else {
if (connect(fd, (struct sockaddr *)sockets->data, sizeof(struct sockaddr_in)) < 0) {
- dbg(lvl_error,"connect failed\n");
+ dbg(lvl_error,"connect failed");
} else {
size_written=write(fd, data, size);
- dbg(lvl_debug,"size %d vs %d\n",size, size_written);
+ dbg(lvl_debug,"size %d vs %d",size, size_written);
if (shutdown(fd, SHUT_RDWR) < 0)
- dbg(lvl_error,"shutdown failed\n");
+ dbg(lvl_error,"shutdown failed");
}
close(fd);
}
@@ -586,7 +586,7 @@ get_data(struct graphics_priv *this, char *type)
int b;
struct point p;
gdImagePtr im = this->im;
- dbg(lvl_debug,"type=%s\n",type);
+ dbg(lvl_debug,"type=%s",type);
if (!strcmp(type,"window"))
return &this->window;
if (!strcmp(type,"image_png")) {
@@ -608,11 +608,11 @@ get_data(struct graphics_priv *this, char *type)
return &this->image;
}
if (sscanf(type,"click_%d_%d_%d",&p.x,&p.y,&b) == 3) {
- dbg(lvl_debug,"click %d %d %d\n",p.x,p.y,b);
+ dbg(lvl_debug,"click %d %d %d",p.x,p.y,b);
callback_list_call_attr_3(this->cbl, attr_button, (void *)b, (void *)1, (void *)&p);
}
if (sscanf(type,"move_%d_%d",&p.x,&p.y) == 2) {
- dbg(lvl_debug,"move %d %d\n",p.x,p.y);
+ dbg(lvl_debug,"move %d %d",p.x,p.y);
callback_list_call_attr_1(this->cbl, attr_motion, (void *)&p);
}
return NULL;
@@ -629,13 +629,13 @@ image_free(struct graphics_priv *gr, struct graphics_image_priv *priv)
static void
overlay_disable(struct graphics_priv *gr, int disable)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static void
overlay_resize(struct graphics_priv *gr, struct point *p, int w, int h, int wraparound)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
struct shmem_header *
@@ -643,10 +643,10 @@ shm_next(struct graphics_priv *gr)
{
char *next=(char *)gr->shm_header+gr->shmoffset;
if (next+gr->shmoffset > (char *)gr->shm+gr->shmsize) {
- dbg(lvl_debug,"wraparound\n");
+ dbg(lvl_debug,"wraparound");
return gr->shm;
}
- dbg(lvl_debug,"next 0x%x (offset 0x%x)\n",next-(char *)gr->shm,gr->shmoffset);
+ dbg(lvl_debug,"next 0x%x (offset 0x%x)",next-(char *)gr->shm,gr->shmoffset);
return (struct shmem_header *)next;
}
@@ -667,17 +667,17 @@ image_setup(struct graphics_priv *gr)
static void
image_create(struct graphics_priv *gr)
{
- dbg(lvl_debug,"shmkey %d\n",gr->shmkey);
+ dbg(lvl_debug,"shmkey %d",gr->shmkey);
#ifdef HAVE_SHMEM
if (gr->shmkey) {
int size=gr->h*gr->w*sizeof(int);
int shmid=shmget(gr->shmkey, size, 0666);
- dbg(lvl_debug,"shmid for key 0x%x is 0x%x\n",gr->shmkey, shmid);
+ dbg(lvl_debug,"shmid for key 0x%x is 0x%x",gr->shmkey, shmid);
if (shmid < 0)
- dbg(lvl_debug,"shmget\n");
+ dbg(lvl_debug,"shmget");
gr->shm=shmat(shmid, NULL, 0);
if (!gr->shm)
- dbg(lvl_debug,"shmat\n");
+ dbg(lvl_debug,"shmat");
gr->shm_header=gr->shm;
gr->im=g_new0(gdImage,1);
gr->im->tpixels=g_new(int *,gr->h);
@@ -754,7 +754,7 @@ set_attr_do(struct graphics_priv *gr, struct attr *attr, int init)
g_list_free(gr->sockets);
gr->sockets=NULL;
c=s=g_strdup(attr->u.str);
- dbg(lvl_debug,"s=%s\n",s);
+ dbg(lvl_debug,"s=%s",s);
while (c) {
n=strchr(c,',');
if (n)
@@ -768,12 +768,12 @@ set_attr_do(struct graphics_priv *gr, struct attr *attr, int init)
if (inet_aton(c, &sin->sin_addr)) {
gr->sockets=g_list_append(gr->sockets, sin);
} else {
- dbg(lvl_error,"error in %s\n",c);
+ dbg(lvl_error,"error in %s",c);
g_free(sin);
}
- dbg(lvl_debug,"host=%s port=%s\n",c,p);
+ dbg(lvl_debug,"host=%s port=%s",c,p);
} else
- dbg(lvl_error,"error in format: %s\n",p);
+ dbg(lvl_error,"error in format: %s",p);
c=n;
}
g_free(s);
@@ -823,7 +823,7 @@ overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct poin
struct font_priv * (*font_freetype_new)(void *meth);
struct graphics_priv *ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret=g_new0(struct graphics_priv, 1);
*meth=graphics_methods;
font_freetype_new=plugin_get_category_font("freetype");
diff --git a/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c b/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
index dbb18310a..0eb147fce 100644
--- a/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
+++ b/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
@@ -112,13 +112,13 @@ struct graphics_image_priv {
static void
graphics_destroy(struct graphics_priv *gr)
{
- dbg(lvl_debug,"enter parent %p\n",gr->parent);
+ dbg(lvl_debug,"enter parent %p",gr->parent);
gr->freetype_methods.destroy();
if (!gr->parent) {
- dbg(lvl_debug,"enter win %p\n",gr->win);
+ dbg(lvl_debug,"enter win %p",gr->win);
if (gr->win)
gtk_widget_destroy(gr->win);
- dbg(lvl_debug,"widget %p\n",gr->widget);
+ dbg(lvl_debug,"widget %p",gr->widget);
if (gr->widget)
gtk_widget_destroy(gr->widget);
g_free(gr->window_title);
@@ -401,7 +401,7 @@ draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics
if (! font)
{
- dbg(lvl_error,"no font, returning\n");
+ dbg(lvl_error,"no font, returning");
return;
}
#if 0 /* Temporarily disabled because it destroys text rendering of overlays and in gui internal in some places */
@@ -458,7 +458,7 @@ draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct po
unsigned char* intermediate_buffer_aligned;
Imlib_Image intermediate_image;
size_t stride;
- dbg(lvl_debug,"draw_image_warp data=%p\n", img);
+ dbg(lvl_debug,"draw_image_warp data=%p", img);
w = img->w;
h = img->h;
if (!img->image) {
@@ -466,7 +466,7 @@ draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct po
img->image=imlib_create_image(w, h);
imlib_context_set_image(img->image);
if (gdk_pixbuf_get_colorspace(img->pixbuf) != GDK_COLORSPACE_RGB || gdk_pixbuf_get_bits_per_sample(img->pixbuf) != 8) {
- dbg(lvl_error,"implement me\n");
+ dbg(lvl_error,"implement me");
} else if (gdk_pixbuf_get_has_alpha(img->pixbuf) && gdk_pixbuf_get_n_channels(img->pixbuf) == 4) {
for (y=0 ; y < h ; y++) {
unsigned int *dst=imlib_image_get_data()+y*w;
@@ -486,7 +486,7 @@ draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct po
}
}
} else {
- dbg(lvl_error,"implement me\n");
+ dbg(lvl_error,"implement me");
}
}
@@ -601,7 +601,7 @@ configure(GtkWidget * widget, GdkEventConfigure * event, gpointer user_data)
if (! gra->visible)
return TRUE;
#ifndef _WIN32
- dbg(lvl_debug,"window=%lu\n", GDK_WINDOW_XID(widget->window));
+ dbg(lvl_debug,"window=%lu", GDK_WINDOW_XID(widget->window));
#endif
gra->width=widget->allocation.width;
gra->height=widget->allocation.height;
@@ -750,7 +750,7 @@ static gint
delete(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
{
struct graphics_priv *this=user_data;
- dbg(lvl_debug,"enter this->win=%p\n",this->win);
+ dbg(lvl_debug,"enter this->win=%p",this->win);
if (this->delay & 2) {
if (this->win)
this->win=NULL;
@@ -834,7 +834,7 @@ keypress(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
if (key[0])
callback_list_call_attr_1(this->cbl, attr_keypress, (void *)key);
else
- dbg(lvl_debug,"keyval 0x%x\n", event->keyval);
+ dbg(lvl_debug,"keyval 0x%x", event->keyval);
return FALSE;
}
@@ -916,7 +916,7 @@ get_data_window(struct graphics_priv *this, unsigned int xid)
if (!gtk_widget_get_parent(this->widget))
gtk_widget_ref(this->widget);
gtk_window_set_default_size(GTK_WINDOW(this->win), this->win_w, this->win_h);
- dbg(lvl_debug,"h= %i, w= %i\n",this->win_h, this->win_w);
+ dbg(lvl_debug,"h= %i, w= %i",this->win_h, this->win_w);
gtk_window_set_title(GTK_WINDOW(this->win), this->window_title);
gtk_window_set_wmclass (GTK_WINDOW (this->win), "navit", this->window_title);
gtk_widget_realize(this->win);
@@ -935,7 +935,7 @@ get_data_window(struct graphics_priv *this, unsigned int xid)
static int
set_attr(struct graphics_priv *gr, struct attr *attr)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
switch (attr->type) {
case attr_windowid:
get_data_window(gr, attr->u.num);
@@ -1010,7 +1010,7 @@ graphics_gtk_drawing_area_disable_suspend(struct window *w)
if (gr->pid)
kill(gr->pid, SIGWINCH);
#else
- dbg(lvl_warning, "failed to kill() under Windows\n");
+ dbg(lvl_warning, "failed to kill() under Windows");
#endif
}
@@ -1041,9 +1041,9 @@ get_data(struct graphics_priv *this, char const *type)
int fscanf_result;
fscanf_result = fscanf(f,"%d",&this->pid);
if ((fscanf_result == EOF) || (fscanf_result == 0)){
- dbg(lvl_warning, "Failed to open iPaq sleep file. Error-Code: %d\n" , errno);
+ dbg(lvl_warning, "Failed to open iPaq sleep file. Error-Code: %d" , errno);
}
- dbg(lvl_debug,"ipaq_sleep pid=%d\n", this->pid);
+ dbg(lvl_debug,"ipaq_sleep pid=%d", this->pid);
pclose(f);
}
#endif
diff --git a/navit/graphics/null/graphics_null.c b/navit/graphics/null/graphics_null.c
index ecac7d528..3b527800f 100644
--- a/navit/graphics/null/graphics_null.c
+++ b/navit/graphics/null/graphics_null.c
@@ -257,7 +257,7 @@ graphics_null_new(struct navit *nav, struct graphics_methods *meth, struct attr
event_loop_system = attr_search(attrs, NULL, attr_event_loop_system);
if (event_loop_system && event_loop_system->u.str) {
- dbg(lvl_debug, "event_system is %s\n", event_loop_system->u.str);
+ dbg(lvl_debug, "event_system is %s", event_loop_system->u.str);
if (!event_request_system(event_loop_system->u.str, "graphics_null"))
return NULL;
} else {
@@ -273,7 +273,7 @@ static void
event_null_main_loop_run(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
for (;;)
sleep(1);
@@ -281,54 +281,54 @@ event_null_main_loop_run(void)
static void event_null_main_loop_quit(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_watch *
event_null_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
event_null_remove_watch(struct event_watch *ev)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_timeout *
event_null_add_timeout(int timeout, int multi, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
event_null_remove_timeout(struct event_timeout *to)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_idle *
event_null_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
event_null_remove_idle(struct event_idle *ev)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static void
event_null_call_callback(struct callback_list *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_methods event_null_methods = {
diff --git a/navit/graphics/opengl/graphics_opengl.c b/navit/graphics/opengl/graphics_opengl.c
index a0c2be2fe..c23d57204 100644
--- a/navit/graphics/opengl/graphics_opengl.c
+++ b/navit/graphics/opengl/graphics_opengl.c
@@ -527,7 +527,7 @@ image_new(struct graphics_priv *gr, struct graphics_image_methods *meth,
return gi;
}
#else
- dbg(lvl_error,"FreeImage not available - cannot load any images.\n");
+ dbg(lvl_error,"FreeImage not available - cannot load any images.");
return NULL;
#endif
}
@@ -748,7 +748,7 @@ getPrimitiveType(GLenum type)
void APIENTRY
tessBeginCB(GLenum which)
{
- dbg(lvl_debug, "glBegin( %s );\n", getPrimitiveType(which));
+ dbg(lvl_debug, "glBegin( %s );", getPrimitiveType(which));
tess_type=which;
tess_count=0;
}
@@ -758,7 +758,7 @@ tessBeginCB(GLenum which)
void APIENTRY
tessEndCB(void)
{
- dbg(lvl_debug, "glEnd();\n");
+ dbg(lvl_debug, "glEnd();");
draw_array(graphics_priv_root, tess_array, tess_count, tess_type);
}
@@ -769,14 +769,14 @@ tessVertexCB(const GLvoid * data)
{
// cast back to double type
const GLdouble *ptr = (const GLdouble *) data;
- dbg(lvl_debug, " glVertex3d();\n");
+ dbg(lvl_debug, " glVertex3d();");
tess_array[tess_count].x=ptr[0];
tess_array[tess_count].y=ptr[1];
if (tess_count < 511)
tess_count++;
else
- dbg(lvl_error,"overflow\n");
+ dbg(lvl_error,"overflow");
}
void APIENTRY
@@ -1031,7 +1031,7 @@ draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg,
int color = 1;
if (!font) {
- dbg(lvl_error, "no font, returning\n");
+ dbg(lvl_error, "no font, returning");
return;
}
@@ -1494,7 +1494,7 @@ static void
click_notify_do(struct graphics_priv *priv, int button, int state, int x, int y)
{
struct point p={x,y};
- dbg(lvl_debug,"enter state %d button %d\n",state,button);
+ dbg(lvl_debug,"enter state %d button %d",state,button);
callback_list_call_attr_3(priv->cbl, attr_button, (void *) state, (void *)button, (void *) &p);
}
#endif
@@ -1738,61 +1738,61 @@ graphics_opengl_new(struct navit *nav, struct graphics_methods *meth,
static void
event_opengl_main_loop_run(void)
{
- dbg(lvl_info, "enter\n");
+ dbg(lvl_info, "enter");
}
static void
event_opengl_main_loop_quit(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_watch *
event_opengl_add_watch(int fd, enum event_watch_cond cond,
struct callback *cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return NULL;
}
static void
event_opengl_remove_watch(struct event_watch *ev)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_timeout *
event_opengl_add_timeout(int timeout, int multi, struct callback *cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return NULL;
}
static void
event_opengl_remove_timeout(struct event_timeout *to)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_idle *
event_opengl_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return NULL;
}
static void
event_opengl_remove_idle(struct event_idle *ev)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static void
event_opengl_call_callback(struct callback_list *cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_methods event_opengl_methods = {
diff --git a/navit/graphics/opengl/graphics_opengl_egl.c b/navit/graphics/opengl/graphics_opengl_egl.c
index cb91ac88e..64e85e700 100644
--- a/navit/graphics/opengl/graphics_opengl_egl.c
+++ b/navit/graphics/opengl/graphics_opengl_egl.c
@@ -61,21 +61,21 @@ graphics_opengl_egl_new(void *display, void *window, struct graphics_opengl_plat
*methods=&graphics_opengl_egl_methods;
ret->egldisplay = eglGetDisplay((EGLNativeDisplayType)display);
if (!ret->egldisplay) {
- dbg(lvl_error, "can't get display\n");
+ dbg(lvl_error, "can't get display");
goto error;
}
if (!eglInitialize(ret->egldisplay, &major, &minor)) {
- dbg(lvl_error, "eglInitialize failed\n");
+ dbg(lvl_error, "eglInitialize failed");
goto error;
}
- dbg(lvl_debug,"eglInitialize ok with version %d.%d\n",major,minor);
+ dbg(lvl_debug,"eglInitialize ok with version %d.%d",major,minor);
eglBindAPI(EGL_OPENGL_ES_API);
if (!eglChooseConfig(ret->egldisplay, attributeList, ret->config, sizeof(ret->config)/sizeof(EGLConfig), &nconfig)) {
- dbg(lvl_error, "eglChooseConfig failed\n");
+ dbg(lvl_error, "eglChooseConfig failed");
goto error;
}
if (nconfig != 1) {
- dbg(lvl_error, "unexpected number of configs %d\n",nconfig);
+ dbg(lvl_error, "unexpected number of configs %d",nconfig);
goto error;
}
ret->eglwindow = eglCreateWindowSurface(ret->egldisplay, ret->config[0], (NativeWindowType) window, NULL);
diff --git a/navit/graphics/opengl/graphics_opengl_x11.c b/navit/graphics/opengl/graphics_opengl_x11.c
index 8f4b02eaf..a52192406 100644
--- a/navit/graphics/opengl/graphics_opengl_x11.c
+++ b/navit/graphics/opengl/graphics_opengl_x11.c
@@ -86,29 +86,29 @@ graphics_opengl_x11_watch(struct graphics_opengl_window_system *x11)
x11->button(x11->data,event.xbutton.button,0,event.xbutton.x,event.xbutton.y);
break;
case ConfigureNotify:
- dbg(lvl_debug,"ConfigureNotify\n");
+ dbg(lvl_debug,"ConfigureNotify");
break;
case Expose:
- dbg(lvl_debug,"Expose\n");
+ dbg(lvl_debug,"Expose");
break;
case KeyPress:
- dbg(lvl_debug,"KeyPress\n");
+ dbg(lvl_debug,"KeyPress");
break;
case KeyRelease:
- dbg(lvl_debug,"KeyRelease\n");
+ dbg(lvl_debug,"KeyRelease");
break;
case MapNotify:
- dbg(lvl_debug,"MapNotify\n");
+ dbg(lvl_debug,"MapNotify");
break;
case MotionNotify:
if (x11->motion)
x11->motion(x11->data,event.xmotion.x,event.xmotion.y);
break;
case ReparentNotify:
- dbg(lvl_debug,"ReparentNotify\n");
+ dbg(lvl_debug,"ReparentNotify");
break;
default:
- dbg(lvl_debug,"type %d\n",event.type);
+ dbg(lvl_debug,"type %d",event.type);
}
}
}
@@ -126,14 +126,14 @@ graphics_opengl_x11_new(void *displayname, int w, int h, int depth, struct graph
*methods=&graphics_opengl_x11_methods;
ret->display=XOpenDisplay(displayname);
if (!ret->display) {
- dbg(lvl_error,"failed to open display\n");
+ dbg(lvl_error,"failed to open display");
goto error;
}
ret->watch=event_add_watch(ConnectionNumber(ret->display), event_watch_cond_read, ret->cb);
ret->screen=XDefaultScreen(ret->display);
ret->root_window=RootWindow(ret->display, ret->screen);
if (!XMatchVisualInfo(ret->display, ret->screen, depth, TrueColor, &ret->visual)) {
- dbg(lvl_error,"failed to find visual\n");
+ dbg(lvl_error,"failed to find visual");
goto error;
}
ret->colormap=XCreateColormap(ret->display, ret->root_window, ret->visual.visual, AllocNone);
diff --git a/navit/graphics/qt5/QNavitQuick.cpp b/navit/graphics/qt5/QNavitQuick.cpp
index 7df3e0073..ffc7a56b0 100644
--- a/navit/graphics/qt5/QNavitQuick.cpp
+++ b/navit/graphics/qt5/QNavitQuick.cpp
@@ -54,7 +54,7 @@ QNavitQuick::QNavitQuick(QQuickItem* parent)
void QNavitQuick::setGraphicContext(GraphicsPriv* gp)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
graphics_priv = gp->gp;
QObject::connect(gp, SIGNAL(update()), this, SLOT(update()));
}
@@ -68,7 +68,7 @@ static void paintOverlays(QPainter* painter, struct graphics_priv* gp, QPaintEve
if (!value->disable) {
QRect rr(value->x, value->y, value->pixmap->width(), value->pixmap->height());
if (event->rect().intersects(rr)) {
- dbg(lvl_debug, "draw overlay (%d, %d, %d, %d)\n", value->x + value->scroll_x, value->y + value->scroll_y, value->pixmap->width(), value->pixmap->height());
+ dbg(lvl_debug, "draw overlay (%d, %d, %d, %d)", value->x + value->scroll_x, value->y + value->scroll_y, value->pixmap->width(), value->pixmap->height());
painter->drawPixmap(value->x, value->y, *value->pixmap);
/* draw overlays of overlay if any by recursive calling */
paintOverlays(painter, value, event);
@@ -81,7 +81,7 @@ void QNavitQuick::paint(QPainter* painter)
{
QPaintEvent event = QPaintEvent(QRect(boundingRect().x(), boundingRect().y(), boundingRect().width(), boundingRect().height()));
- dbg(lvl_debug, "enter (%f, %f, %f, %f)\n", boundingRect().x(), boundingRect().y(), boundingRect().width(), boundingRect().height());
+ dbg(lvl_debug, "enter (%f, %f, %f, %f)", boundingRect().x(), boundingRect().y(), boundingRect().width(), boundingRect().height());
/* color background if any */
if (graphics_priv->background_graphics_gc_priv != NULL) {
@@ -97,7 +97,7 @@ void QNavitQuick::paint(QPainter* painter)
void QNavitQuick::keyPressEvent(QKeyEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
char key[2];
int keycode;
char* text = NULL;
@@ -157,21 +157,21 @@ void QNavitQuick::keyPressEvent(QKeyEvent* event)
else if (key[0])
callback_list_call_attr_1(graphics_priv->callbacks, attr_keypress, (void*)key);
else
- dbg(lvl_debug, "keyval 0x%x\n", keycode);
+ dbg(lvl_debug, "keyval 0x%x", keycode);
}
void QNavitQuick::keyReleaseEvent(QKeyEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
QQuickPaintedItem::geometryChanged(newGeometry, oldGeometry);
QPainter* painter = NULL;
if (graphics_priv == NULL) {
- dbg(lvl_debug, "Context not set, aborting\n");
+ dbg(lvl_debug, "Context not set, aborting");
return;
}
if (graphics_priv->pixmap != NULL) {
@@ -186,8 +186,8 @@ void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGe
painter->fillRect(0, 0, width(), height(), brush);
delete painter;
}
- dbg(lvl_debug, "size %fx%f\n", width(), height());
- dbg(lvl_debug, "pixmap %p %dx%d\n", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height());
+ dbg(lvl_debug, "size %fx%f", width(), height());
+ dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height());
/* if the root window got resized, tell navit about it */
if (graphics_priv->root)
resize_callback(graphics_priv, width(), height());
@@ -196,7 +196,7 @@ void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGe
void QNavitQuick::mouseEvent(int pressed, QMouseEvent* event)
{
struct point p;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
p.x = event->x();
p.y = event->y();
switch (event->button()) {
@@ -216,19 +216,19 @@ void QNavitQuick::mouseEvent(int pressed, QMouseEvent* event)
void QNavitQuick::mousePressEvent(QMouseEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
mouseEvent(1, event);
}
void QNavitQuick::mouseReleaseEvent(QMouseEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
mouseEvent(0, event);
}
void QNavitQuick::mouseMoveEvent(QMouseEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
struct point p;
p.x = event->x();
p.y = event->y();
@@ -239,7 +239,7 @@ void QNavitQuick::wheelEvent(QWheelEvent* event)
{
struct point p;
int button;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
p.x = event->x(); // xy-coordinates of the mouse pointer
p.y = event->y();
diff --git a/navit/graphics/qt5/QNavitWidget.cpp b/navit/graphics/qt5/QNavitWidget.cpp
index 5a5bd303b..df051b557 100644
--- a/navit/graphics/qt5/QNavitWidget.cpp
+++ b/navit/graphics/qt5/QNavitWidget.cpp
@@ -70,7 +70,7 @@ static void paintOverlays(QPainter* painter, struct graphics_priv* gp, QPaintEve
if (!value->disable) {
QRect rr(value->x, value->y, value->pixmap->width(), value->pixmap->height());
if (event->rect().intersects(rr)) {
- dbg(lvl_debug, "draw overlay (%d, %d, %d, %d)\n", value->x + value->scroll_x, value->y + value->scroll_y, value->pixmap->width(), value->pixmap->height());
+ dbg(lvl_debug, "draw overlay (%d, %d, %d, %d)", value->x + value->scroll_x, value->y + value->scroll_y, value->pixmap->width(), value->pixmap->height());
painter->drawPixmap(value->x + value->scroll_x, value->y + value->scroll_y, *value->pixmap);
/* draw overlays of overlay if any by recursive calling */
paintOverlays(painter, value, event);
@@ -81,7 +81,7 @@ static void paintOverlays(QPainter* painter, struct graphics_priv* gp, QPaintEve
void QNavitWidget::paintEvent(QPaintEvent* event)
{
- dbg(lvl_debug, "enter (%d, %d, %d, %d)\n", event->rect().x(), event->rect().y(), event->rect().width(), event->rect().height());
+ dbg(lvl_debug, "enter (%d, %d, %d, %d)", event->rect().x(), event->rect().y(), event->rect().width(), event->rect().height());
QPainter painter(this);
/* color background if any */
if (graphics_priv->background_graphics_gc_priv != NULL) {
@@ -109,8 +109,8 @@ void QNavitWidget::resizeEvent(QResizeEvent* event)
painter->fillRect(0, 0, width(), height(), brush);
delete painter;
}
- dbg(lvl_debug, "size %dx%d\n", width(), height());
- dbg(lvl_debug, "pixmap %p %dx%d\n", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height());
+ dbg(lvl_debug, "size %dx%d", width(), height());
+ dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height());
/* if the root window got resized, tell navit about it */
if (graphics_priv->root)
resize_callback(graphics_priv, width(), height());
@@ -119,7 +119,7 @@ void QNavitWidget::resizeEvent(QResizeEvent* event)
void QNavitWidget::mouseEvent(int pressed, QMouseEvent* event)
{
struct point p;
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
p.x = event->x();
p.y = event->y();
switch (event->button()) {
@@ -139,7 +139,7 @@ void QNavitWidget::mouseEvent(int pressed, QMouseEvent* event)
void QNavitWidget::keyPressEvent(QKeyEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
char key[2];
int keycode;
char* text = NULL;
@@ -199,25 +199,25 @@ void QNavitWidget::keyPressEvent(QKeyEvent* event)
else if (key[0])
callback_list_call_attr_1(graphics_priv->callbacks, attr_keypress, (void*)key);
else
- dbg(lvl_debug, "keyval 0x%x\n", keycode);
+ dbg(lvl_debug, "keyval 0x%x", keycode);
}
void QNavitWidget::mousePressEvent(QMouseEvent* event)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
mouseEvent(1, event);
}
void QNavitWidget::mouseReleaseEvent(QMouseEvent* event)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
mouseEvent(0, event);
}
void QNavitWidget::mouseMoveEvent(QMouseEvent* event)
{
struct point p;
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
p.x = event->x();
p.y = event->y();
callback_list_call_attr_1(graphics_priv->callbacks, attr_motion, (void*)&p);
@@ -227,7 +227,7 @@ void QNavitWidget::wheelEvent(QWheelEvent* event)
{
struct point p;
int button;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
p.x = event->x(); // xy-coordinates of the mouse pointer
p.y = event->y();
diff --git a/navit/graphics/qt5/event_qt5.cpp b/navit/graphics/qt5/event_qt5.cpp
index 08fb6e525..e7cb1fd9f 100644
--- a/navit/graphics/qt5/event_qt5.cpp
+++ b/navit/graphics/qt5/event_qt5.cpp
@@ -63,7 +63,7 @@ qt5_navit_timer::qt5_navit_timer(QObject* parent)
timer_type = g_hash_table_new(NULL, NULL);
timer_callback = g_hash_table_new(NULL, NULL);
watches = g_hash_table_new(NULL, NULL);
- dbg(lvl_debug, "qt5_navit_timer object created\n");
+ dbg(lvl_debug, "qt5_navit_timer object created");
}
void qt5_navit_timer::watchEvent(int id)
@@ -71,7 +71,7 @@ void qt5_navit_timer::watchEvent(int id)
struct event_watch* ret = g_new0(struct event_watch, 1);
ret = (struct event_watch*)g_hash_table_lookup(watches, (void*)(long)id);
if (ret) {
- dbg(lvl_debug, "callback found, calling it\n");
+ dbg(lvl_debug, "callback found, calling it");
callback_call_0(ret->cb);
}
}
@@ -80,7 +80,7 @@ void qt5_navit_timer::timerEvent(QTimerEvent* event)
{
int id = event->timerId();
void* multi = NULL;
- // dbg(lvl_debug, "TimerEvent (%d)\n", id);
+ // dbg(lvl_debug, "TimerEvent (%d)", id);
struct callback* cb = (struct callback*)g_hash_table_lookup(timer_callback, (void*)(long)id);
if (cb)
callback_call_0(cb);
@@ -90,7 +90,7 @@ void qt5_navit_timer::timerEvent(QTimerEvent* event)
if (((int)(long)multi) == 0)
event_qt5_remove_timeout((struct event_timeout*)(long)id);
}
- // dbg(lvl_debug, "TimerEvent (%d) leave\n", id);
+ // dbg(lvl_debug, "TimerEvent (%d) leave", id);
}
qt5_navit_timer* qt5_timer = NULL;
@@ -99,21 +99,21 @@ static void
event_qt5_main_loop_run(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (navit_app != NULL)
navit_app->exec();
}
static void event_qt5_main_loop_quit(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
exit(0);
}
static struct event_watch*
event_qt5_add_watch(int fd, enum event_watch_cond cond, struct callback* cb)
{
- dbg(lvl_debug, "enter fd=%d\n", (int)(long)fd);
+ dbg(lvl_debug, "enter fd=%d", (int)(long)fd);
struct event_watch* ret = g_new0(struct event_watch, 1);
ret->fd = fd;
ret->cb = cb;
@@ -126,7 +126,7 @@ event_qt5_add_watch(int fd, enum event_watch_cond cond, struct callback* cb)
static void
event_qt5_remove_watch(struct event_watch* ev)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
g_hash_table_remove(qt5_timer->watches, GINT_TO_POINTER(ev->fd));
delete (ev->sn);
g_free(ev);
@@ -138,7 +138,7 @@ event_qt5_add_timeout(int timeout, int multi, struct callback* cb)
int id;
dbg(lvl_debug, "add timeout %d, mul %d, %p ==", timeout, multi, cb);
id = qt5_timer->startTimer(timeout);
- dbg(lvl_debug, "%d\n", id);
+ dbg(lvl_debug, "%d", id);
g_hash_table_insert(qt5_timer->timer_callback, (void*)(long)id, cb);
g_hash_table_insert(qt5_timer->timer_type, (void*)(long)id, (void*)(long)!!multi);
return (struct event_timeout*)(long)id;
@@ -147,7 +147,7 @@ event_qt5_add_timeout(int timeout, int multi, struct callback* cb)
static void
event_qt5_remove_timeout(struct event_timeout* to)
{
- dbg(lvl_debug, "remove timeout (%d)\n", (int)(long)to);
+ dbg(lvl_debug, "remove timeout (%d)", (int)(long)to);
qt5_timer->killTimer((int)(long)to);
g_hash_table_remove(qt5_timer->timer_callback, to);
g_hash_table_remove(qt5_timer->timer_type, to);
@@ -156,21 +156,21 @@ event_qt5_remove_timeout(struct event_timeout* to)
static struct event_idle*
event_qt5_add_idle(int priority, struct callback* cb)
{
- dbg(lvl_debug, "add idle event\n");
+ dbg(lvl_debug, "add idle event");
return (struct event_idle*)event_qt5_add_timeout(0, 1, cb);
}
static void
event_qt5_remove_idle(struct event_idle* ev)
{
- dbg(lvl_debug, "Remove idle timeout\n");
+ dbg(lvl_debug, "Remove idle timeout");
event_qt5_remove_timeout((struct event_timeout*)ev);
}
static void
event_qt5_call_callback(struct callback_list* cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_methods event_qt5_methods = {
diff --git a/navit/graphics/qt5/graphics_qt5.cpp b/navit/graphics/qt5/graphics_qt5.cpp
index f7ac15f43..f142758ea 100644
--- a/navit/graphics/qt5/graphics_qt5.cpp
+++ b/navit/graphics/qt5/graphics_qt5.cpp
@@ -92,7 +92,7 @@ struct graphics_image_priv {
static void
graphics_destroy(struct graphics_priv* gr)
{
-// dbg(lvl_debug,"enter\n");
+// dbg(lvl_debug,"enter");
#if HAVE_FREETYPE
gr->freetype_methods.destroy();
#endif
@@ -146,7 +146,7 @@ graphics_destroy(struct graphics_priv* gr)
static void font_destroy(struct graphics_font_priv* font)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
if (font->font != NULL)
delete (font->font);
g_free(font);
@@ -190,7 +190,7 @@ static struct graphics_font_priv* font_new(struct graphics_priv* gr, struct grap
{
int a = 0;
struct graphics_font_priv* font_priv;
- dbg(lvl_debug, "enter (font %s, %d, 0x%x)\n", font, size, flags);
+ dbg(lvl_debug, "enter (font %s, %d, 0x%x)", font, size, flags);
font_priv = g_new0(struct graphics_font_priv, 1);
font_priv->font = new QFont(fontfamilies[0]);
if (font != NULL)
@@ -201,7 +201,7 @@ static struct graphics_font_priv* font_new(struct graphics_priv* gr, struct grap
a++;
}
if (font_priv->font->exactMatch()) {
- dbg(lvl_debug, "Exactly matching font: %s\n", font_priv->font->family().toUtf8().data());
+ dbg(lvl_debug, "Exactly matching font: %s", font_priv->font->family().toUtf8().data());
} else {
/* set any font*/
if (font != NULL) {
@@ -209,7 +209,7 @@ static struct graphics_font_priv* font_new(struct graphics_priv* gr, struct grap
} else {
font_priv->font->setFamily(fontfamilies[0]);
}
- dbg(lvl_debug, "No matching font. Resort to: %s\n", font_priv->font->family().toUtf8().data());
+ dbg(lvl_debug, "No matching font. Resort to: %s", font_priv->font->family().toUtf8().data());
}
/* No clue why factor 20. Found this by comparing to Freetype rendering. */
@@ -227,7 +227,7 @@ static struct graphics_font_priv* font_new(struct graphics_priv* gr, struct grap
static void
gc_destroy(struct graphics_gc_priv* gc)
{
- // dbg(lvl_debug,"enter gc=%p\n", gc);
+ // dbg(lvl_debug,"enter gc=%p", gc);
delete (gc->pen);
delete (gc->brush);
g_free(gc);
@@ -236,7 +236,7 @@ gc_destroy(struct graphics_gc_priv* gc)
static void
gc_set_linewidth(struct graphics_gc_priv* gc, int w)
{
- // dbg(lvl_debug,"enter gc=%p, %d\n", gc, w);
+ // dbg(lvl_debug,"enter gc=%p, %d", gc, w);
gc->pen->setWidth(w);
}
@@ -266,7 +266,7 @@ static void
gc_set_foreground(struct graphics_gc_priv* gc, struct color* c)
{
QColor col(c->r >> 8, c->g >> 8, c->b >> 8, c->a >> 8);
- // dbg(lvl_debug,"context %p: color %02x%02x%02x\n",gc, c->r >> 8, c->g >> 8, c->b >> 8);
+ // dbg(lvl_debug,"context %p: color %02x%02x%02x",gc, c->r >> 8, c->g >> 8, c->b >> 8);
gc->pen->setColor(col);
gc->brush->setColor(col);
//gc->c=*c;
@@ -276,7 +276,7 @@ static void
gc_set_background(struct graphics_gc_priv* gc, struct color* c)
{
QColor col(c->r >> 8, c->g >> 8, c->b >> 8, c->a >> 8);
- // dbg(lvl_debug,"context %p: color %02x%02x%02x\n",gc, c->r >> 8, c->g >> 8, c->b >> 8);
+ // dbg(lvl_debug,"context %p: color %02x%02x%02x",gc, c->r >> 8, c->g >> 8, c->b >> 8);
//gc->pen->setColor(col);
//gc->brush->setColor(col);
}
@@ -292,7 +292,7 @@ static struct graphics_gc_methods gc_methods = {
static struct graphics_gc_priv* gc_new(struct graphics_priv* gr, struct graphics_gc_methods* meth)
{
struct graphics_gc_priv* graphics_gc_priv = NULL;
- // dbg(lvl_debug,"enter gr==%p\n", gr);
+ // dbg(lvl_debug,"enter gr==%p", gr);
graphics_gc_priv = g_new0(struct graphics_gc_priv, 1);
graphics_gc_priv->graphics_priv = gr;
graphics_gc_priv->pen = new QPen();
@@ -304,7 +304,7 @@ static struct graphics_gc_priv* gc_new(struct graphics_priv* gr, struct graphics
static void image_destroy(struct graphics_image_priv* img)
{
- // dbg(lvl_debug, "enter\n");
+ // dbg(lvl_debug, "enter");
if (img->pixmap != NULL)
delete (img->pixmap);
g_free(img);
@@ -318,9 +318,9 @@ static struct graphics_image_priv*
image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* path, int* w, int* h, struct point* hot, int rotation)
{
struct graphics_image_priv* image_priv;
- // dbg(lvl_debug,"enter %s, %d %d\n", path, *w, *h);
+ // dbg(lvl_debug,"enter %s, %d %d", path, *w, *h);
if (path[0] == 0) {
- dbg(lvl_debug, "Refuse to load image without path\n");
+ dbg(lvl_debug, "Refuse to load image without path");
return NULL;
}
QString key(path);
@@ -333,11 +333,11 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
*/
if (extension != "") {
/*file doesn't exist. give up */
- dbg(lvl_debug, "File %s does not exist\n", path);
+ dbg(lvl_debug, "File %s does not exist", path);
return NULL;
} else {
/* add ".svg" for renderer to try .svg file first in renderer */
- dbg(lvl_debug, "Guess extension on %s\n", path);
+ dbg(lvl_debug, "Guess extension on %s", path);
renderer_key += ".svg";
}
}
@@ -348,7 +348,7 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
if (renderer_key.endsWith("svg")) {
QSvgRenderer renderer(renderer_key);
if (renderer.isValid()) {
- dbg(lvl_debug, "render %s\n", path);
+ dbg(lvl_debug, "render %s", path);
/* try to render this */
/* assume "standard" size if size is not given */
if (*w <= 0)
@@ -364,7 +364,7 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
if (image_priv->pixmap == NULL) {
/*cannot be rendered. try to load it */
- dbg(lvl_debug, "cannot render %s\n", path);
+ dbg(lvl_debug, "cannot render %s", path);
image_priv->pixmap = new QPixmap(key);
}
@@ -376,7 +376,7 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
/* check if we need to scale this */
if ((*w > 0) && (*h > 0)) {
if ((image_priv->pixmap->width() != *w) || (image_priv->pixmap->height() != *h)) {
- dbg(lvl_debug, "scale pixmap %s, %d->%d,%d->%d\n", path, image_priv->pixmap->width(), *w, image_priv->pixmap->height(), *h);
+ dbg(lvl_debug, "scale pixmap %s, %d->%d,%d->%d", path, image_priv->pixmap->width(), *w, image_priv->pixmap->height(), *h);
QPixmap* scaled = new QPixmap(image_priv->pixmap->scaled(*w, *h, Qt::IgnoreAspectRatio, Qt::FastTransformation));
delete (image_priv->pixmap);
image_priv->pixmap = scaled;
@@ -386,7 +386,7 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
*w = image_priv->pixmap->width();
*h = image_priv->pixmap->height();
- // dbg(lvl_debug, "Got (%d,%d)\n", *w,*h);
+ // dbg(lvl_debug, "Got (%d,%d)", *w,*h);
if (hot) {
hot->x = *w / 2;
hot->y = *h / 2;
@@ -400,7 +400,7 @@ draw_lines(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point*
{
int i;
QPolygon polygon;
- // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d, %d)\n", gr, gc, p->x, p->y);
+ // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d, %d)", gr, gc, p->x, p->y);
if (gr->painter == NULL)
return;
@@ -415,7 +415,7 @@ draw_polygon(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point
{
int i;
QPolygon polygon;
- // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d, %d)\n", gr, gc, p->x, p->y);
+ // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d, %d)", gr, gc, p->x, p->y);
if (gr->painter == NULL)
return;
@@ -436,7 +436,7 @@ draw_polygon(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point
static void
draw_rectangle(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point* p, int w, int h)
{
- // dbg(lvl_debug,"gr=%p gc=%p %d,%d,%d,%d\n", gr, gc, p->x, p->y, w, h);
+ // dbg(lvl_debug,"gr=%p gc=%p %d,%d,%d,%d", gr, gc, p->x, p->y, w, h);
if (gr->painter == NULL)
return;
/* if the rectangle is transparent, we need to clear it first */
@@ -452,7 +452,7 @@ draw_rectangle(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct poi
static void
draw_circle(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point* p, int r)
{
- // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d,%d) r=%d\n", gr, gc, p->x, p->y, r);
+ // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d,%d) r=%d", gr, gc, p->x, p->y, r);
if (gr->painter == NULL)
return;
gr->painter->setPen(*gc->pen);
@@ -475,7 +475,7 @@ draw_circle(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point*
static void
draw_text(struct graphics_priv* gr, struct graphics_gc_priv* fg, struct graphics_gc_priv* bg, struct graphics_font_priv* font, char* text, struct point* p, int dx, int dy)
{
- dbg(lvl_debug, "enter gc=%p, fg=%p, bg=%p pos(%d,%d) d(%d, %d) %s\n", gr, fg, bg, p->x, p->y, dx, dy, text);
+ dbg(lvl_debug, "enter gc=%p, fg=%p, bg=%p pos(%d,%d) d(%d, %d) %s", gr, fg, bg, p->x, p->y, dx, dy, text);
QPainter* painter = gr->painter;
if (painter == NULL)
return;
@@ -568,11 +568,11 @@ draw_text(struct graphics_priv* gr, struct graphics_gc_priv* fg, struct graphics
static void
draw_image(struct graphics_priv* gr, struct graphics_gc_priv* fg, struct point* p, struct graphics_image_priv* img)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
if (gr->painter != NULL)
gr->painter->drawPixmap(p->x, p->y, *img->pixmap);
else
- dbg(lvl_debug, "Try to draw image, but no painter\n");
+ dbg(lvl_debug, "Try to draw image, but no painter");
}
/**
@@ -589,10 +589,10 @@ static void draw_drag(struct graphics_priv* gr, struct point* p)
struct point vector;
if (p != NULL) {
- dbg(lvl_debug, "enter %p (%d,%d)\n", gr, p->x, p->y);
+ dbg(lvl_debug, "enter %p (%d,%d)", gr, p->x, p->y);
vector = *p;
} else {
- dbg(lvl_debug, "enter %p (NULL)\n", gr);
+ dbg(lvl_debug, "enter %p (NULL)", gr);
vector.x = 0;
vector.y = 0;
}
@@ -624,7 +624,7 @@ static void draw_drag(struct graphics_priv* gr, struct point* p)
static void
background_gc(struct graphics_priv* gr, struct graphics_gc_priv* gc)
{
- // dbg(lvl_debug,"register context %p on %p\n", gc, gr);
+ // dbg(lvl_debug,"register context %p on %p", gc, gr);
gr->background_graphics_gc_priv = gc;
}
@@ -633,26 +633,26 @@ draw_mode(struct graphics_priv* gr, enum draw_mode_num mode)
{
switch (mode) {
case draw_mode_begin:
- dbg(lvl_debug, "Begin drawing on context %p (use == %d)\n", gr, gr->use_count);
+ dbg(lvl_debug, "Begin drawing on context %p (use == %d)", gr, gr->use_count);
gr->use_count++;
if (gr->painter == NULL)
gr->painter = new QPainter(gr->pixmap);
else
- dbg(lvl_debug, "drawing on %p already active\n", gr);
+ dbg(lvl_debug, "drawing on %p already active", gr);
break;
case draw_mode_end:
- dbg(lvl_debug, "End drawing on context %p (use == %d)\n", gr, gr->use_count);
+ dbg(lvl_debug, "End drawing on context %p (use == %d)", gr, gr->use_count);
gr->use_count--;
if (gr->use_count < 0)
gr->use_count = 0;
if (gr->use_count > 0) {
- dbg(lvl_debug, "drawing on %p still in use\n", gr);
+ dbg(lvl_debug, "drawing on %p still in use", gr);
} else if (gr->painter != NULL) {
gr->painter->end();
delete (gr->painter);
gr->painter = NULL;
} else {
- dbg(lvl_debug, "Context %p not active!\n", gr)
+ dbg(lvl_debug, "Context %p not active!", gr)
}
#if USE_QWIDGET
/* call repaint on widget */
@@ -667,7 +667,7 @@ draw_mode(struct graphics_priv* gr, enum draw_mode_num mode)
break;
default:
- dbg(lvl_debug, "Unknown drawing %d on context %p\n", mode, gr);
+ dbg(lvl_debug, "Unknown drawing %d on context %p", mode, gr);
break;
}
}
@@ -676,7 +676,7 @@ static struct graphics_priv* overlay_new(struct graphics_priv* gr, struct graphi
void resize_callback(struct graphics_priv* gr, int w, int h)
{
- // dbg(lvl_debug,"enter (%d, %d)\n", w, h);
+ // dbg(lvl_debug,"enter (%d, %d)", w, h);
callback_list_call_attr_2(gr->callbacks, attr_resize,
GINT_TO_POINTER(w), GINT_TO_POINTER(h));
}
@@ -685,7 +685,7 @@ static int
graphics_qt5_fullscreen(struct window* w, int on)
{
struct graphics_priv* gr;
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
gr = (struct graphics_priv*)w->priv;
#if USE_QML
if (gr->window != NULL) {
@@ -710,7 +710,7 @@ graphics_qt5_fullscreen(struct window* w, int on)
static void
keep_display_on(struct graphics_priv* priv)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
QDBusConnection system = QDBusConnection::connectToBus(QDBusConnection::SystemBus, "system");
QDBusInterface interface("com.nokia.mce", "/com/nokia/mce/request", "com.nokia.mce.request", system);
@@ -721,7 +721,7 @@ keep_display_on(struct graphics_priv* priv)
static void
graphics_qt5_disable_suspend(struct window* w)
{
-// dbg(lvl_debug,"enter\n");
+// dbg(lvl_debug,"enter");
#ifdef SAILFISH_OS
struct graphics_priv* gr;
gr = (struct graphics_priv*)w->priv;
@@ -736,10 +736,10 @@ graphics_qt5_disable_suspend(struct window* w)
static void*
get_data(struct graphics_priv* this_priv, char const* type)
{
- // dbg(lvl_debug,"enter: %s\n", type);
+ // dbg(lvl_debug,"enter: %s", type);
if (strcmp(type, "window") == 0) {
struct window* win;
- // dbg(lvl_debug,"window detected\n");
+ // dbg(lvl_debug,"window detected");
win = g_new0(struct window, 1);
win->priv = this_priv;
win->fullscreen = graphics_qt5_fullscreen;
@@ -748,7 +748,7 @@ get_data(struct graphics_priv* this_priv, char const* type)
return win;
}
if (strcmp(type, "engine") == 0) {
- dbg(lvl_debug, "Hand over QQmlApplicationEngine\n");
+ dbg(lvl_debug, "Hand over QQmlApplicationEngine");
return (this_priv->engine);
}
return NULL;
@@ -756,7 +756,7 @@ get_data(struct graphics_priv* this_priv, char const* type)
static void image_free(struct graphics_priv* gr, struct graphics_image_priv* priv)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
delete (priv->pixmap);
g_free(priv);
}
@@ -779,7 +779,7 @@ static void get_text_bbox(struct graphics_priv* gr, struct graphics_font_priv* f
struct point pt;
QString tmp = QString::fromUtf8(text);
QRect r;
- // dbg(lvl_debug,"enter %s %d %d\n", text, dx, dy);
+ // dbg(lvl_debug,"enter %s %d %d", text, dx, dy);
/* use QFontMetrix for bbox calculation as we do not always have a painter */
QFontMetrics fm(*font->font);
@@ -811,7 +811,7 @@ static void overlay_disable(struct graphics_priv* gr, int disable)
{
GHashTableIter iter;
struct graphics_priv *key, *value;
- // dbg(lvl_debug,"enter gr=%p, %d\n", gr, disable);
+ // dbg(lvl_debug,"enter gr=%p, %d", gr, disable);
g_hash_table_iter_init(&iter, gr->overlays);
while (g_hash_table_iter_next(&iter, (void**)&key, (void**)&value)) {
@@ -822,7 +822,7 @@ static void overlay_disable(struct graphics_priv* gr, int disable)
static void overlay_resize(struct graphics_priv* gr, struct point* p, int w, int h, int wraparound)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
gr->x = p->x;
gr->y = p->y;
if (gr->painter != NULL) {
@@ -897,7 +897,7 @@ overlay_new(struct graphics_priv* gr, struct graphics_methods* meth, struct poin
graphics_priv->argv[0] = NULL;
/* register on parent */
g_hash_table_insert(gr->overlays, graphics_priv, graphics_priv);
- // dbg(lvl_debug,"New overlay: %p\n", graphics_priv);
+ // dbg(lvl_debug,"New overlay: %p", graphics_priv);
return graphics_priv;
}
@@ -914,7 +914,7 @@ graphics_qt5_new(struct navit* nav, struct graphics_methods* meth, struct attr**
bool use_qml = USE_QML;
bool use_qwidget = USE_QWIDGET;
- //dbg(lvl_debug,"enter\n");
+ //dbg(lvl_debug,"enter");
/* get qt widget attr */
if ((attr_widget = attr_search(attrs, NULL, attr_qt5_widget))) {
@@ -938,7 +938,7 @@ graphics_qt5_new(struct navit* nav, struct graphics_methods* meth, struct attr**
/* get event loop from config and request event loop*/
event_loop_system = attr_search(attrs, NULL, attr_event_loop_system);
if (event_loop_system && event_loop_system->u.str) {
- //dbg(lvl_debug, "event_system is %s\n", event_loop_system->u.str);
+ //dbg(lvl_debug, "event_system is %s", event_loop_system->u.str);
if (!event_request_system(event_loop_system->u.str, "graphics_qt5"))
return NULL;
} else {
@@ -952,7 +952,7 @@ graphics_qt5_new(struct navit* nav, struct graphics_methods* meth, struct attr**
/* get font plugin if present */
font_freetype_new = (struct font_priv * (*)(void*))plugin_get_category_font("freetype");
if (!font_freetype_new) {
- dbg(lvl_error, "no freetype\n");
+ dbg(lvl_error, "no freetype");
return NULL;
}
#endif
@@ -1101,7 +1101,7 @@ void plugin_init(void)
#if USE_QML
Q_INIT_RESOURCE(graphics_qt5);
#endif
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
plugin_register_category_graphics("qt5", graphics_qt5_new);
qt5_event_init();
}
diff --git a/navit/graphics/qt_qpainter/RenderArea.cpp b/navit/graphics/qt_qpainter/RenderArea.cpp
index 1159082ed..4a20b1d54 100644
--- a/navit/graphics/qt_qpainter/RenderArea.cpp
+++ b/navit/graphics/qt_qpainter/RenderArea.cpp
@@ -86,7 +86,7 @@ bool RenderArea::event(QEvent *event)
{
#if QT_VERSION >= 0x040700
if (event->type() == QEvent::Gesture) {
- dbg(lvl_debug,"gesture\n");
+ dbg(lvl_debug,"gesture");
return true;
}
#endif
@@ -123,8 +123,8 @@ void RenderArea::do_resize(QSize size)
QPainter painter(pixmap);
QBrush brush;
painter.fillRect(0, 0, size.width(), size.height(), brush);
- dbg(lvl_debug,"size %dx%d\n", size.width(), size.height());
- dbg(lvl_debug,"pixmap %p %dx%d\n", pixmap, pixmap->width(), pixmap->height());
+ dbg(lvl_debug,"size %dx%d", size.width(), size.height());
+ dbg(lvl_debug,"pixmap %p %dx%d", pixmap, pixmap->width(), pixmap->height());
callback_list_call_attr_2(this->cbl, attr_resize, GINT_TO_POINTER(size.width()), GINT_TO_POINTER(size.height()));
}
@@ -223,9 +223,9 @@ void RenderArea::keyPressEvent(QKeyEvent *event)
{
QString str=event->text();
const char *text=str.toUtf8().constData();
- dbg(lvl_debug,"enter text='%s' 0x%x (%zu) key=%d\n", text, text[0], strlen(text), event->key());
+ dbg(lvl_debug,"enter text='%s' 0x%x (%zu) key=%d", text, text[0], strlen(text), event->key());
if (!text || !text[0] || text[0] == 0x7f) {
- dbg(lvl_debug,"special key\n");
+ dbg(lvl_debug,"special key");
switch (event->key()) {
case 4099:
{
@@ -288,7 +288,7 @@ void RenderArea::watchEvent(int fd)
{
#ifdef QT_QPAINTER_USE_EVENT_QT
struct event_watch *ev=(struct event_watch *)g_hash_table_lookup(watches, (void *)fd);
- dbg(lvl_debug,"fd=%d ev=%p cb=%p\n", fd, ev, ev->cb);
+ dbg(lvl_debug,"fd=%d ev=%p cb=%p", fd, ev, ev->cb);
callback_call_0(ev->cb);
#endif
}
diff --git a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
index 65163ea9d..4fd4f46f6 100644
--- a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
+++ b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
@@ -65,7 +65,7 @@ qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev)
{
if (!paintev) {
#ifndef QT_QPAINTER_NO_WIDGET
- dbg(lvl_debug,"update %d,%d %d x %d\n", r->x(), r->y(), r->width(), r->height());
+ dbg(lvl_debug,"update %d,%d %d x %d", r->x(), r->y(), r->width(), r->height());
if (r->x() <= -r->width())
return;
if (r->y() <= -r->height())
@@ -74,7 +74,7 @@ qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev)
return;
if (r->y() > gr->widget->pixmap->height())
return;
- dbg(lvl_debug,"update valid %d,%d %dx%d\n", r->x(), r->y(), r->width(), r->height());
+ dbg(lvl_debug,"update valid %d,%d %dx%d", r->x(), r->y(), r->width(), r->height());
gr->widget->update(*r);
#endif
return;
@@ -359,7 +359,7 @@ static void draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc,
//##############################################################################################################
static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h)
{
- dbg(lvl_debug,"gr=%p gc=%p %d,%d,%d,%d\n", gr, gc, p->x, p->y, w, h);
+ dbg(lvl_debug,"gr=%p gc=%p %d,%d,%d,%d", gr, gc, p->x, p->y, w, h);
gr->painter->fillRect(p->x,p->y, w, h, *gc->brush);
}
@@ -496,7 +496,7 @@ static void background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
//##############################################################################################################
static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
- dbg(lvl_debug,"mode for %p %d\n", gr, mode);
+ dbg(lvl_debug,"mode for %p %d", gr, mode);
QRect r;
if (mode == draw_mode_begin) {
if (gr->widget->pixmap->paintingActive()) {
@@ -574,7 +574,7 @@ static void * get_data(struct graphics_priv *this_, const char *type)
bool ok;
if (!strcmp(type, "resize")) {
- dbg(lvl_debug,"resize %d %d\n",this_->w,this_->h);
+ dbg(lvl_debug,"resize %d %d",this_->w,this_->h);
QSize size(this_->w,this_->h);
this_->widget->do_resize(size);
}
@@ -743,14 +743,14 @@ event_qt_main_loop_run(void)
static void event_qt_main_loop_quit(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
exit(0);
}
static struct event_watch *
event_qt_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"enter fd=%d\n",(int)(long)fd);
+ dbg(lvl_debug,"enter fd=%d",(int)(long)fd);
struct event_watch *ret=g_new0(struct event_watch, 1);
ret->fd=fd;
ret->cb=cb;
@@ -790,21 +790,21 @@ event_qt_remove_timeout(struct event_timeout *ev)
static struct event_idle *
event_qt_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return (struct event_idle *)event_qt_add_timeout(0, 1, cb);
}
static void
event_qt_remove_idle(struct event_idle *ev)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
event_qt_remove_timeout((struct event_timeout *) ev);
}
static void
event_qt_call_callback(struct callback_list *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_methods event_qt_methods = {
@@ -825,7 +825,7 @@ struct event_priv {
struct event_priv *
event_qt_new(struct event_methods *meth)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
*meth=event_qt_methods;
return NULL;
}
@@ -842,7 +842,7 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
struct font_priv * (*font_freetype_new)(void *meth);
struct attr *attr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#ifdef QT_QPAINTER_USE_EVENT_QT
if (event_gr)
return NULL;
@@ -856,7 +856,7 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
#ifdef QT_QPAINTER_USE_FREETYPE
font_freetype_new=(struct font_priv *(*)(void *))plugin_get_category_font("freetype");
if (!font_freetype_new) {
- dbg(lvl_error,"no freetype\n");
+ dbg(lvl_error,"no freetype");
return NULL;
}
#endif
@@ -909,7 +909,7 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
else
ret->window_title=g_strdup("Navit");
- dbg(lvl_debug,"return\n");
+ dbg(lvl_debug,"return");
return ret;
}
diff --git a/navit/graphics/sdl/event.c b/navit/graphics/sdl/event.c
index f96b079b3..647330813 100644
--- a/navit/graphics/sdl/event.c
+++ b/navit/graphics/sdl/event.c
@@ -48,7 +48,7 @@ static void sdl_accelerometer_handler(void* param) {
int zAxis = SDL_JoystickGetAxis(accelerometer, 2);
unsigned char new_orientation;
- dbg(lvl_info, "x(%d) y(%d) z(%d) c(%d)\n", xAxis, yAxis, zAxis,
+ dbg(lvl_info, "x(%d) y(%d) z(%d) c(%d)", xAxis, yAxis, zAxis,
sdl_orientation_count);
if (zAxis > -30000) {
@@ -74,7 +74,7 @@ static void sdl_accelerometer_handler(void* param) {
sdl_orientation_count++;
if (new_orientation != orientation) {
- dbg(lvl_debug, "x(%d) y(%d) z(%d) o(%d)\n", xAxis, yAxis, zAxis,
+ dbg(lvl_debug, "x(%d) y(%d) z(%d) o(%d)", xAxis, yAxis, zAxis,
new_orientation);
orientation = new_orientation;
@@ -100,7 +100,7 @@ static void sdl_accelerometer_handler(void* param) {
static Uint32 sdl_timer_callback(Uint32 interval, void* param) {
struct event_timeout *timeout = (struct event_timeout*) param;
- dbg(lvl_debug, "timer(%p) multi(%d) interval(%d) fired\n", param, timeout->multi,
+ dbg(lvl_debug, "timer(%p) multi(%d) interval(%d) fired", param, timeout->multi,
interval);
SDL_Event event;
@@ -169,7 +169,7 @@ static void event_sdl_watch_thread(GPtrArray *watch_list) {
for (idx = 0; idx < watch_list->len; idx++) {
if (pfds[idx].revents == pfds[idx].events) { /* The requested event happened, notify mainloop! */
ew = g_ptr_array_index(watch_list, idx);
- dbg(lvl_debug, "watch(%p) event(%d) encountered\n", ew,
+ dbg(lvl_debug, "watch(%p) event(%d) encountered", ew,
pfds[idx].revents);
SDL_Event event;
@@ -194,7 +194,7 @@ static void event_sdl_watch_thread(GPtrArray *watch_list) {
}
static void event_sdl_watch_startthread(GPtrArray *watch_list) {
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (sdl_watch_thread)
event_sdl_watch_stopthread();
@@ -206,7 +206,7 @@ static void event_sdl_watch_startthread(GPtrArray *watch_list) {
}
static void event_sdl_watch_stopthread() {
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (sdl_watch_thread) {
/* Notify the watch thread that the list of FDs will change */
pthread_kill(sdl_watch_thread, SIGUSR1);
@@ -217,7 +217,7 @@ static void event_sdl_watch_stopthread() {
static struct event_watch *
event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb) {
- dbg(lvl_debug, "fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
+ dbg(lvl_debug, "fd(%d) cond(%x) cb(%x)", fd, cond, cb);
event_sdl_watch_stopthread();
@@ -253,7 +253,7 @@ event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb) {
}
static void event_sdl_remove_watch(struct event_watch *ew) {
- dbg(lvl_debug, "enter %p\n", ew);
+ dbg(lvl_debug, "enter %p", ew);
event_sdl_watch_stopthread();
@@ -272,7 +272,7 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb) {
struct event_timeout * ret = g_new0(struct event_timeout, 1);
if (!ret)
return ret;
- dbg(lvl_debug, "timer(%p) multi(%d) interval(%d) cb(%p) added\n", ret, multi,
+ dbg(lvl_debug, "timer(%p) multi(%d) interval(%d) cb(%p) added", ret, multi,
timeout, cb);
ret->multi = multi;
ret->cb = cb;
@@ -282,14 +282,14 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb) {
}
static void event_sdl_remove_timeout(struct event_timeout *to) {
- dbg(lvl_info, "enter %p\n", to);
+ dbg(lvl_info, "enter %p", to);
if (to != NULL) {
int ret = to->id ? SDL_RemoveTimer(to->id) : SDL_TRUE;
if (ret == SDL_FALSE) {
- dbg(lvl_debug, "SDL_RemoveTimer (%p) failed\n", to->id);
+ dbg(lvl_debug, "SDL_RemoveTimer (%p) failed", to->id);
} else {
g_free(to);
- dbg(lvl_debug, "timer(%p) removed\n", to);
+ dbg(lvl_debug, "timer(%p) removed", to);
}
}
}
@@ -309,7 +309,7 @@ static gint sdl_sort_idle_tasks(gconstpointer parama, gconstpointer paramb) {
static struct event_idle *
event_sdl_add_idle(int priority, struct callback *cb) {
- dbg(lvl_debug, "add idle priority(%d) cb(%p)\n", priority, cb);
+ dbg(lvl_debug, "add idle priority(%d) cb(%p)", priority, cb);
struct idle_task *task = g_new0(struct idle_task, 1);
task->priority = priority;
@@ -321,7 +321,7 @@ event_sdl_add_idle(int priority, struct callback *cb) {
SDL_Event event;
SDL_UserEvent userevent;
- dbg(lvl_debug, "poking eventloop because of new idle_events\n");
+ dbg(lvl_debug, "poking eventloop because of new idle_events");
userevent.type = SDL_USEREVENT;
userevent.code = SDL_USEREVENT_CODE_IDLE_EVENT;
@@ -340,14 +340,14 @@ event_sdl_add_idle(int priority, struct callback *cb) {
}
static void event_sdl_remove_idle(struct event_idle *task) {
- dbg(lvl_debug, "remove task(%p)\n", task);
+ dbg(lvl_debug, "remove task(%p)", task);
g_ptr_array_remove(idle_tasks, (gpointer) task);
}
/* callback */
static void event_sdl_call_callback(struct callback_list *cbl) {
- dbg(lvl_debug, "call_callback cbl(%p)\n", cbl);
+ dbg(lvl_debug, "call_callback cbl(%p)", cbl);
SDL_Event event;
SDL_UserEvent userevent;
diff --git a/navit/graphics/sdl/event_sdl.c b/navit/graphics/sdl/event_sdl.c
index 28fe4fafb..d60c2d04c 100644
--- a/navit/graphics/sdl/event_sdl.c
+++ b/navit/graphics/sdl/event_sdl.c
@@ -48,7 +48,7 @@ sdl_timer_callback(Uint32 interval, void* param)
{
struct event_timeout *timeout=(struct event_timeout*)param;
- dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) fired\n", param, timeout->multi, interval);
+ dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) fired", param, timeout->multi, interval);
SDL_Event event;
SDL_UserEvent userevent;
@@ -104,7 +104,7 @@ event_sdl_watch_thread (GPtrArray *watch_list)
for (idx = 0; idx < watch_list->len; idx++ ) {
if (pfds[idx].revents == pfds[idx].events) { /* The requested event happened, notify mainloop! */
ew = g_ptr_array_index (watch_list, idx);
- dbg(lvl_debug,"watch(%p) event(%d) encountered\n", ew, pfds[idx].revents);
+ dbg(lvl_debug,"watch(%p) event(%d) encountered", ew, pfds[idx].revents);
SDL_Event event;
SDL_UserEvent userevent;
@@ -130,7 +130,7 @@ event_sdl_watch_thread (GPtrArray *watch_list)
static void
event_sdl_watch_startthread(GPtrArray *watch_list)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (sdl_watch_thread)
event_sdl_watch_stopthread();
@@ -143,7 +143,7 @@ event_sdl_watch_startthread(GPtrArray *watch_list)
static void
event_sdl_watch_stopthread()
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (sdl_watch_thread) {
/* Notify the watch thread that the list of FDs will change */
pthread_kill(sdl_watch_thread, SIGUSR1);
@@ -155,7 +155,7 @@ event_sdl_watch_stopthread()
static struct event_watch *
event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
+ dbg(lvl_debug,"fd(%d) cond(%x) cb(%x)", fd, cond, cb);
event_sdl_watch_stopthread();
@@ -193,7 +193,7 @@ event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
static void
event_sdl_remove_watch(struct event_watch *ew)
{
- dbg(lvl_debug,"enter %p\n",ew);
+ dbg(lvl_debug,"enter %p",ew);
event_sdl_watch_stopthread();
@@ -212,10 +212,10 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb)
{
struct event_timeout * ret = g_new0(struct event_timeout, 1);
if(!ret) {
- dbg(lvl_error,"g_new0 failed\n");
+ dbg(lvl_error,"g_new0 failed");
return ret;
}
- dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) cb(%p) added\n",ret, multi, timeout, cb);
+ dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) cb(%p) added",ret, multi, timeout, cb);
ret->multi = multi;
ret->cb = cb;
ret->id = SDL_AddTimer(timeout, sdl_timer_callback, ret);
@@ -226,17 +226,17 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb)
static void
event_sdl_remove_timeout(struct event_timeout *to)
{
- dbg(lvl_info,"enter %p\n", to);
+ dbg(lvl_info,"enter %p", to);
if(to)
{
/* do not SDL_RemoveTimer if oneshot timer has already fired */
int ret = to->id == 0 ? SDL_TRUE : SDL_RemoveTimer(to->id);
if (ret == SDL_FALSE)
- dbg(lvl_error,"SDL_RemoveTimer (%p) failed\n", to->id);
+ dbg(lvl_error,"SDL_RemoveTimer (%p) failed", to->id);
g_free(to);
- dbg(lvl_debug,"timer(%p) removed\n", to);
+ dbg(lvl_debug,"timer(%p) removed", to);
}
}
@@ -258,7 +258,7 @@ sdl_sort_idle_tasks(gconstpointer parama, gconstpointer paramb)
static struct event_idle *
event_sdl_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug,"add idle priority(%d) cb(%p)\n", priority, cb);
+ dbg(lvl_debug,"add idle priority(%d) cb(%p)", priority, cb);
struct idle_task *task = g_new0(struct idle_task, 1);
task->priority = priority;
@@ -271,7 +271,7 @@ event_sdl_add_idle(int priority, struct callback *cb)
SDL_Event event;
SDL_UserEvent userevent;
- dbg(lvl_debug,"poking eventloop because of new idle_events\n");
+ dbg(lvl_debug,"poking eventloop because of new idle_events");
userevent.type = SDL_USEREVENT;
userevent.code = SDL_USEREVENT_CODE_IDLE_EVENT;
@@ -292,7 +292,7 @@ event_sdl_add_idle(int priority, struct callback *cb)
static void
event_sdl_remove_idle(struct event_idle *task)
{
- dbg(lvl_debug,"remove task(%p)\n", task);
+ dbg(lvl_debug,"remove task(%p)", task);
g_ptr_array_remove(idle_tasks, (gpointer)task);
}
@@ -301,7 +301,7 @@ event_sdl_remove_idle(struct event_idle *task)
static void
event_sdl_call_callback(struct callback_list *cbl)
{
- dbg(lvl_debug,"call_callback cbl(%p)\n",cbl);
+ dbg(lvl_debug,"call_callback cbl(%p)",cbl);
SDL_Event event;
SDL_UserEvent userevent;
diff --git a/navit/graphics/sdl/graphics_sdl.c b/navit/graphics/sdl/graphics_sdl.c
index b1a9c17b9..a87805b73 100644
--- a/navit/graphics/sdl/graphics_sdl.c
+++ b/navit/graphics/sdl/graphics_sdl.c
@@ -185,7 +185,7 @@ struct graphics_image_priv {
static void
graphics_destroy(struct graphics_priv *gr)
{
- dbg(lvl_debug, "graphics_destroy %p %u\n", gr, gr->overlay_mode);
+ dbg(lvl_debug, "graphics_destroy %p %u", gr, gr->overlay_mode);
if(gr->overlay_mode)
{
@@ -220,7 +220,7 @@ gc_destroy(struct graphics_gc_priv *gc)
static void
gc_set_linewidth(struct graphics_gc_priv *gc, int w)
{
- dbg(lvl_debug, "gc_set_linewidth %p %d\n", gc, w);
+ dbg(lvl_debug, "gc_set_linewidth %p %d", gc, w);
gc->linewidth = w;
}
@@ -233,7 +233,7 @@ gc_set_dashes(struct graphics_gc_priv *gc, int w, int offset, unsigned char *das
static void
gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
{
- dbg(lvl_debug, "gc_set_foreground: %p %d %d %d %d\n", gc, c->a, c->r, c->g, c->b);
+ dbg(lvl_debug, "gc_set_foreground: %p %d %d %d %d", gc, c->a, c->r, c->g, c->b);
gc->fore_r = c->r/256;
gc->fore_g = c->g/256;
gc->fore_b = c->b/256;
@@ -243,7 +243,7 @@ gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
static void
gc_set_background(struct graphics_gc_priv *gc, struct color *c)
{
- dbg(lvl_debug, "gc_set_background: %p %d %d %d %d\n", gc, c->a, c->r, c->g, c->b);
+ dbg(lvl_debug, "gc_set_background: %p %d %d %d %d", gc, c->a, c->r, c->g, c->b);
gc->back_r = c->r/256;
gc->back_g = c->g/256;
gc->back_b = c->b/256;
@@ -292,7 +292,7 @@ image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *n
else
{
/* TODO: debug "colour parse errors" on xpm */
- dbg(lvl_error,"image_new on '%s' failed: %s\n", name, IMG_GetError());
+ dbg(lvl_error,"image_new on '%s' failed: %s", name, IMG_GetError());
g_free(gi);
gi = NULL;
}
@@ -329,7 +329,7 @@ draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point
vx[i] = x;
vy[i] = y;
- dbg(lvl_debug, "draw_polygon: %p %i %d,%d\n", gc, i, p[i].x, p[i].y);
+ dbg(lvl_debug, "draw_polygon: %p %i %d,%d", gc, i, p[i].x, p[i].y);
}
if(gr->aa)
@@ -360,7 +360,7 @@ draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct poi
return;
}
- dbg(lvl_debug, "draw_rectangle: %d %d %d %d r=%d g=%d b=%d a=%d\n", p->x, p->y, w, h,
+ dbg(lvl_debug, "draw_rectangle: %d %d %d %d r=%d g=%d b=%d a=%d", p->x, p->y, w, h,
gc->fore_r, gc->fore_g, gc->fore_b, gc->fore_a);
if(w > gr->screen->w)
{
@@ -493,10 +493,10 @@ draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *
y_lw_adj = round(cos(angle)*(float)lw/2.0);
if((x_lw_adj < 0) || (y_lw_adj < 0))
{
- dbg(lvl_debug, "i=%d\n", i);
- dbg(lvl_debug, " %d,%d->%d,%d\n", p[i].x, p[i].y, p[i+1].x, p[i+1].y);
- dbg(lvl_debug, " lw=%d angle=%f\n", lw, 180.0 * angle / M_PI);
- dbg(lvl_debug, " x_lw_adj=%d y_lw_adj=%d\n", x_lw_adj, y_lw_adj);
+ dbg(lvl_debug, "i=%d", i);
+ dbg(lvl_debug, " %d,%d->%d,%d", p[i].x, p[i].y, p[i+1].x, p[i+1].y);
+ dbg(lvl_debug, " lw=%d angle=%f", lw, 180.0 * angle / M_PI);
+ dbg(lvl_debug, " x_lw_adj=%d y_lw_adj=%d", x_lw_adj, y_lw_adj);
}
}
@@ -586,7 +586,7 @@ resize_ft_buffer (unsigned int new_size)
if (new_size > ft_buffer_size) {
g_free (ft_buffer);
ft_buffer = g_malloc (new_size);
- dbg(lvl_debug, "old_size(%u) new_size(%u) ft_buffer(%p)\n", ft_buffer_size, new_size, ft_buffer);
+ dbg(lvl_debug, "old_size(%u) new_size(%u) ft_buffer(%p)", ft_buffer_size, new_size, ft_buffer);
ft_buffer_size = new_size;
}
}
@@ -744,7 +744,7 @@ draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg,
int color = 1;
if (!font) {
- dbg(lvl_error, "no font, returning\n");
+ dbg(lvl_error, "no font, returning");
return;
}
t = gr->freetype_methods.text_new(text,
@@ -780,7 +780,7 @@ draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *
static void
background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
{
- dbg(lvl_debug, "background_gc\n");
+ dbg(lvl_debug, "background_gc");
}
@@ -797,7 +797,7 @@ draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
}
else
{
- dbg(lvl_debug, "draw_mode: %d\n", mode);
+ dbg(lvl_debug, "draw_mode: %d", mode);
if(mode == draw_mode_end)
{
@@ -927,11 +927,11 @@ overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct poin
}
if(i == OVERLAY_MAX)
{
- dbg(lvl_error, "too many overlays! increase OVERLAY_MAX\n");
+ dbg(lvl_error, "too many overlays! increase OVERLAY_MAX");
return NULL;
}
- dbg(lvl_debug, "overlay_new %d %d %d %u %u (%x, %x, %x ,%x, %d)\n", i,
+ dbg(lvl_debug, "overlay_new %d %d %d %u %u (%x, %x, %x ,%x, %d)", i,
p->x,
p->y,
w,
@@ -1025,7 +1025,7 @@ static gboolean graphics_sdl_idle(void *data)
gr = the_graphics;
}
else {
- dbg(lvl_error,"graphics_idle: graphics not set!\n");
+ dbg(lvl_error,"graphics_idle: graphics not set!");
return FALSE;
}
}
@@ -1070,7 +1070,7 @@ static gboolean graphics_sdl_idle(void *data)
if (idle_tasks_idx >= idle_tasks->len)
idle_tasks_idx = 0;
- dbg(lvl_debug,"idle_tasks_idx(%d)\n",idle_tasks_idx);
+ dbg(lvl_debug,"idle_tasks_idx(%d)",idle_tasks_idx);
task = (struct idle_task *)g_ptr_array_index(idle_tasks,idle_tasks_idx);
if (idle_tasks_idx == 0) // only execute tasks with lowest priority value
@@ -1095,7 +1095,7 @@ static gboolean graphics_sdl_idle(void *data)
}
#ifdef USE_WEBOS
- dbg(lvl_debug,"SDL_Event %d\n", ev.type);
+ dbg(lvl_debug,"SDL_Event %d", ev.type);
#endif
switch(ev.type)
{
@@ -1220,7 +1220,7 @@ static gboolean graphics_sdl_idle(void *data)
key_mod &= ~(WEBOS_KEY_MOD_ORANGE_STICKY);
}
else {
- dbg(lvl_error,"Unknown key sym: %x\n", ev.key.keysym.sym);
+ dbg(lvl_error,"Unknown key sym: %x", ev.key.keysym.sym);
}
#else
/* return unicode chars when they can be converted to ascii */
@@ -1230,7 +1230,7 @@ static gboolean graphics_sdl_idle(void *data)
}
}
- dbg(lvl_info,"key mod: 0x%x\n", key_mod);
+ dbg(lvl_info,"key mod: 0x%x", key_mod);
if (keybuf[0]) {
callback_list_call_attr_1(gr->cbl, attr_keypress, (void *)keybuf);
@@ -1245,7 +1245,7 @@ static gboolean graphics_sdl_idle(void *data)
case SDL_MOUSEBUTTONDOWN:
{
- dbg(lvl_debug, "SDL_MOUSEBUTTONDOWN %d %d %d %d %d\n",
+ dbg(lvl_debug, "SDL_MOUSEBUTTONDOWN %d %d %d %d %d",
ev.button.which,
ev.button.button,
ev.button.state,
@@ -1260,7 +1260,7 @@ static gboolean graphics_sdl_idle(void *data)
case SDL_MOUSEBUTTONUP:
{
- dbg(lvl_debug, "SDL_MOUSEBUTTONUP %d %d %d %d %d\n",
+ dbg(lvl_debug, "SDL_MOUSEBUTTONUP %d %d %d %d %d",
ev.button.which,
ev.button.button,
ev.button.state,
@@ -1302,7 +1302,7 @@ static gboolean graphics_sdl_idle(void *data)
case SDL_USEREVENT:
{
SDL_UserEvent userevent = ev.user;
- dbg(lvl_info,"received SDL_USEREVENT type(%x) code(%x)\n",userevent.type,userevent.code);
+ dbg(lvl_info,"received SDL_USEREVENT type(%x) code(%x)",userevent.type,userevent.code);
if (userevent.type != SDL_USEREVENT)
break;
@@ -1322,28 +1322,28 @@ static gboolean graphics_sdl_idle(void *data)
else if(userevent.code == SDL_USEREVENT_CODE_TIMER)
{
struct callback *cb = (struct callback *)userevent.data1;
- dbg(lvl_debug, "SDL_USEREVENT timer received cb(%p)\n", cb);
+ dbg(lvl_debug, "SDL_USEREVENT timer received cb(%p)", cb);
callback_call_0(cb);
}
else if(userevent.code == SDL_USEREVENT_CODE_WATCH)
{
struct callback *cb = (struct callback *)userevent.data1;
- dbg(lvl_debug, "SDL_USEREVENT watch received cb(%p)\n", cb);
+ dbg(lvl_debug, "SDL_USEREVENT watch received cb(%p)", cb);
callback_call_0(cb);
}
else if(userevent.code == SDL_USEREVENT_CODE_CALL_CALLBACK)
{
struct callback_list *cbl = (struct callback_list *)userevent.data1;
- dbg(lvl_debug, "SDL_USEREVENT call_callback received cbl(%p)\n", cbl);
+ dbg(lvl_debug, "SDL_USEREVENT call_callback received cbl(%p)", cbl);
callback_list_call_0(cbl);
}
else if(userevent.code == SDL_USEREVENT_CODE_IDLE_EVENT) {
- dbg(lvl_debug, "SDL_USEREVENT idle_event received\n");
+ dbg(lvl_debug, "SDL_USEREVENT idle_event received");
}
#ifdef USE_WEBOS_ACCELEROMETER
else if(userevent.code == SDL_USEREVENT_CODE_ROTATE)
{
- dbg(lvl_debug, "SDL_USEREVENT rotate received\n");
+ dbg(lvl_debug, "SDL_USEREVENT rotate received");
switch(gr->orientation)
{
case WEBOS_ORIENTATION_PORTRAIT:
@@ -1366,14 +1366,14 @@ static gboolean graphics_sdl_idle(void *data)
}
#endif
else
- dbg(lvl_warning, "unknown SDL_USEREVENT\n");
+ dbg(lvl_warning, "unknown SDL_USEREVENT");
break;
}
#endif
default:
{
- dbg(lvl_debug, "SDL_Event %d\n", ev.type);
+ dbg(lvl_debug, "SDL_Event %d", ev.type);
break;
}
}
@@ -1423,7 +1423,7 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
int)) this->freetype_methods.font_new;
meth->get_text_bbox = (void*) this->freetype_methods.get_text_bbox;
- dbg(lvl_debug,"Calling SDL_Init\n");
+ dbg(lvl_debug,"Calling SDL_Init");
#ifdef USE_WEBOS
# ifdef USE_WEBOS_ACCELEROMETER
ret = SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_JOYSTICK);
@@ -1435,18 +1435,18 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
#endif
if(ret < 0)
{
- dbg(lvl_error,"SDL_Init failed %d\n", ret);
+ dbg(lvl_error,"SDL_Init failed %d", ret);
this->freetype_methods.destroy();
g_free(this);
return NULL;
}
#ifdef USE_WEBOS
- dbg(lvl_debug,"Calling PDL_Init(0)\n");
+ dbg(lvl_debug,"Calling PDL_Init(0)");
ret = PDL_Init(0);
if(ret < 0)
{
- dbg(lvl_error,"PDL_Init failed %d\n", ret);
+ dbg(lvl_error,"PDL_Init failed %d", ret);
this->freetype_methods.destroy();
g_free(this);
return NULL;
@@ -1489,7 +1489,7 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
if(this->screen == NULL)
{
- dbg(lvl_error,"SDL_SetVideoMode failed\n");
+ dbg(lvl_error,"SDL_SetVideoMode failed");
this->freetype_methods.destroy();
g_free(this);
#ifdef USE_WEBOS
@@ -1503,7 +1503,7 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
w = this->screen->w;
h = this->screen->h;
- dbg(lvl_debug, "using screen %ix%i@%i\n",
+ dbg(lvl_debug, "using screen %ix%i@%i",
this->screen->w, this->screen->h,
this->screen->format->BytesPerPixel * 8);
#ifdef USE_WEBOS_ACCELEROMETER
@@ -1530,7 +1530,7 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
#ifdef USE_WEBOS
if(the_graphics!=NULL) {
- dbg(lvl_debug,"graphics_sdl_new: graphics struct already set: %d!\n", the_graphics_count);
+ dbg(lvl_debug,"graphics_sdl_new: graphics struct already set: %d!", the_graphics_count);
}
the_graphics = this;
the_graphics_count++;
@@ -1556,7 +1556,7 @@ sdl_timer_callback(Uint32 interval, void* param)
{
struct event_timeout *timeout=(struct event_timeout*)param;
- dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) fired\n", param, timeout->multi, interval);
+ dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) fired", param, timeout->multi, interval);
SDL_Event event;
SDL_UserEvent userevent;
@@ -1613,7 +1613,7 @@ event_sdl_watch_thread (GPtrArray *watch_list)
for (idx = 0; idx < watch_list->len; idx++ ) {
if (pfds[idx].revents == pfds[idx].events) { /* The requested event happened, notify mainloop! */
ew = g_ptr_array_index (watch_list, idx);
- dbg(lvl_debug,"watch(%p) event(%d) encountered\n", ew, pfds[idx].revents);
+ dbg(lvl_debug,"watch(%p) event(%d) encountered", ew, pfds[idx].revents);
SDL_Event event;
SDL_UserEvent userevent;
@@ -1639,7 +1639,7 @@ event_sdl_watch_thread (GPtrArray *watch_list)
static void
event_sdl_watch_startthread(GPtrArray *watch_list)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (sdl_watch_thread)
event_sdl_watch_stopthread();
@@ -1652,7 +1652,7 @@ event_sdl_watch_startthread(GPtrArray *watch_list)
static void
event_sdl_watch_stopthread()
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (sdl_watch_thread) {
/* Notify the watch thread that the list of FDs will change */
pthread_kill(sdl_watch_thread, SIGUSR1);
@@ -1664,7 +1664,7 @@ event_sdl_watch_stopthread()
static struct event_watch *
event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
+ dbg(lvl_debug,"fd(%d) cond(%x) cb(%x)", fd, cond, cb);
event_sdl_watch_stopthread();
@@ -1702,7 +1702,7 @@ event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
static void
event_sdl_remove_watch(struct event_watch *ew)
{
- dbg(lvl_debug,"enter %p\n",ew);
+ dbg(lvl_debug,"enter %p",ew);
event_sdl_watch_stopthread();
@@ -1721,10 +1721,10 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb)
{
struct event_timeout * ret = g_new0(struct event_timeout, 1);
if(!ret) {
- dbg(lvl_error,"g_new0 failed\n");
+ dbg(lvl_error,"g_new0 failed");
return ret;
}
- dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) cb(%p) added\n",ret, multi, timeout, cb);
+ dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) cb(%p) added",ret, multi, timeout, cb);
ret->multi = multi;
ret->cb = cb;
ret->id = SDL_AddTimer(timeout, sdl_timer_callback, ret);
@@ -1735,17 +1735,17 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb)
static void
event_sdl_remove_timeout(struct event_timeout *to)
{
- dbg(lvl_info,"enter %p\n", to);
+ dbg(lvl_info,"enter %p", to);
if(to)
{
/* do not SDL_RemoveTimer if oneshot timer has already fired */
int ret = to->id == 0 ? SDL_TRUE : SDL_RemoveTimer(to->id);
if (ret == SDL_FALSE)
- dbg(lvl_error,"SDL_RemoveTimer (%p) failed\n", to->id);
+ dbg(lvl_error,"SDL_RemoveTimer (%p) failed", to->id);
g_free(to);
- dbg(lvl_debug,"timer(%p) removed\n", to);
+ dbg(lvl_debug,"timer(%p) removed", to);
}
}
@@ -1767,7 +1767,7 @@ sdl_sort_idle_tasks(gconstpointer parama, gconstpointer paramb)
static struct event_idle *
event_sdl_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug,"add idle priority(%d) cb(%p)\n", priority, cb);
+ dbg(lvl_debug,"add idle priority(%d) cb(%p)", priority, cb);
struct idle_task *task = g_new0(struct idle_task, 1);
task->priority = priority;
@@ -1780,7 +1780,7 @@ event_sdl_add_idle(int priority, struct callback *cb)
SDL_Event event;
SDL_UserEvent userevent;
- dbg(lvl_debug,"poking eventloop because of new idle_events\n");
+ dbg(lvl_debug,"poking eventloop because of new idle_events");
userevent.type = SDL_USEREVENT;
userevent.code = SDL_USEREVENT_CODE_IDLE_EVENT;
@@ -1801,7 +1801,7 @@ event_sdl_add_idle(int priority, struct callback *cb)
static void
event_sdl_remove_idle(struct event_idle *task)
{
- dbg(lvl_debug,"remove task(%p)\n", task);
+ dbg(lvl_debug,"remove task(%p)", task);
g_ptr_array_remove(idle_tasks, (gpointer)task);
}
@@ -1810,7 +1810,7 @@ event_sdl_remove_idle(struct event_idle *task)
static void
event_sdl_call_callback(struct callback_list *cbl)
{
- dbg(lvl_debug,"call_callback cbl(%p)\n",cbl);
+ dbg(lvl_debug,"call_callback cbl(%p)",cbl);
SDL_Event event;
SDL_UserEvent userevent;
diff --git a/navit/graphics/win32/graphics_win32.c b/navit/graphics/win32/graphics_win32.c
index 3d8fa351d..a450789c4 100644
--- a/navit/graphics/win32/graphics_win32.c
+++ b/navit/graphics/win32/graphics_win32.c
@@ -274,7 +274,7 @@ static void create_memory_dc(struct graphics_priv *gr)
hdc = GetDC( gr->wnd_handle );
// Creates memory DC
gr->hMemDC = CreateCompatibleDC(hdc);
- dbg(lvl_debug, "resize memDC to: %d %d \n", gr->width, gr->height );
+ dbg(lvl_debug, "resize memDC to: %d %d ", gr->width, gr->height );
#ifndef FAST_TRANSPARENCY
@@ -311,7 +311,7 @@ static void HandleKeyChar(struct graphics_priv *gra_priv, WPARAM wParam)
TCHAR key = (TCHAR) wParam;
char *s=NULL;
char k[]={0,0};
- dbg(lvl_debug,"HandleKey %d\n",key);
+ dbg(lvl_debug,"HandleKey %d",key);
switch (key) {
default:
k[0]=key;
@@ -330,7 +330,7 @@ static void HandleKeyDown(struct graphics_priv *gra_priv, WPARAM wParam)
char left[]={NAVIT_KEY_LEFT,0};
char right[]={NAVIT_KEY_RIGHT,0};
char *s=NULL;
- dbg(lvl_debug,"HandleKey %d\n",key);
+ dbg(lvl_debug,"HandleKey %d",key);
switch (key) {
case 37:
s=left;
@@ -410,7 +410,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
gra_priv->width = LOWORD( lParam );
gra_priv->height = HIWORD( lParam );
create_memory_dc(gra_priv);
- dbg(lvl_debug, "resize gfx to: %d %d \n", gra_priv->width, gra_priv->height );
+ dbg(lvl_debug, "resize gfx to: %d %d ", gra_priv->width, gra_priv->height );
callback_list_call_attr_2(gra_priv->cbl, attr_resize, (void *)gra_priv->width, (void *)gra_priv->height);
}
break;
@@ -434,7 +434,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
PAINTSTRUCT ps = { 0 };
HDC hdc;
profile(0, NULL);
- dbg(lvl_debug, "WM_PAINT\n");
+ dbg(lvl_debug, "WM_PAINT");
overlay = gra_priv->overlays;
#ifndef FAST_TRANSPARENCY
@@ -535,13 +535,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
case WM_LBUTTONDOWN:
{
- dbg(lvl_debug, "LBUTTONDOWN\n");
+ dbg(lvl_debug, "LBUTTONDOWN");
HandleButtonClick( gra_priv, 1, 1, lParam);
}
break;
case WM_LBUTTONUP:
{
- dbg(lvl_debug, "LBUTTONUP\n");
+ dbg(lvl_debug, "LBUTTONUP");
HandleButtonClick( gra_priv, 0, 1, lParam);
}
break;
@@ -552,7 +552,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
HandleButtonClick( gra_priv, 0, 3,lParam );
break;
case WM_LBUTTONDBLCLK:
- dbg(lvl_debug, "LBUTTONDBLCLK\n");
+ dbg(lvl_debug, "LBUTTONDBLCLK");
HandleButtonClick( gra_priv, 1, 6,lParam );
break;
case WM_CHAR:
@@ -562,7 +562,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
HandleKeyDown( gra_priv, wParam);
break;
case WM_COPYDATA:
- dbg(lvl_debug,"got WM_COPYDATA\n");
+ dbg(lvl_debug,"got WM_COPYDATA");
callback_list_call_attr_2(gra_priv->cbl, attr_wm_copydata, (void *)wParam, (void*)lParam);
break;
#ifdef HAVE_API_WIN32_CE
@@ -689,7 +689,7 @@ static HANDLE CreateGraphicsWindows( struct graphics_priv* gr, HMENU hMenu )
if (!RegisterClassEx(&wc))
#endif
{
- dbg(lvl_error, "Window registration failed\n");
+ dbg(lvl_error, "Window registration failed");
return NULL;
}
@@ -732,7 +732,7 @@ static HANDLE CreateGraphicsWindows( struct graphics_priv* gr, HMENU hMenu )
#endif
if (hwnd == NULL)
{
- dbg(lvl_error, "Window creation failed: %d\n", GetLastError());
+ dbg(lvl_error, "Window creation failed: %d", GetLastError());
return NULL;
}
/* For Vista, we need here ChangeWindowMessageFilter(WM_COPYDATA,MSGFLT_ADD); since Win7 we need above one or ChangeWindowMessageFilterEx (MSDN), both are
@@ -932,7 +932,7 @@ static void draw_drag(struct graphics_priv *gr, struct point *p)
static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
- dbg(lvl_debug, "set draw_mode to %x, %d\n", gr, (int)mode );
+ dbg(lvl_debug, "set draw_mode to %x, %d", gr, (int)mode );
if ( mode == draw_mode_begin )
{
@@ -944,7 +944,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
if ( gr->hMemDC )
{
- dbg(lvl_debug, "Erase dc: %x, w: %d, h: %d, bg_color: %x\n", gr, gr->width, gr->height, gr->bg_color);
+ dbg(lvl_debug, "Erase dc: %x, w: %d, h: %d, bg_color: %x", gr, gr->width, gr->height, gr->bg_color);
#ifdef FAST_TRANSPARENCY
if ( gr->hPrebuildDC )
{
@@ -1136,11 +1136,11 @@ pngdecode(struct graphics_priv *gr, char *name, struct graphics_image_priv *img)
BITMAPINFO pnginfo;
HDC dc;
- dbg(lvl_debug,"enter %s\n",name);
+ dbg(lvl_debug,"enter %s",name);
png_file=fopen(name, "rb");
if (!png_file)
{
- dbg(lvl_warning,"failed to open %s\n",name);
+ dbg(lvl_warning,"failed to open %s",name);
return FALSE;
}
@@ -1278,7 +1278,7 @@ pngdecode(struct graphics_priv *gr, char *name, struct graphics_image_priv *img)
g_free (row_pointers);
img->hot.x=img->width/2-1;
img->hot.y=img->height/2-1;
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
fclose(png_file);
return TRUE;
@@ -1426,7 +1426,7 @@ static struct graphics_image_priv *image_new(struct graphics_priv *gr, struct gr
if (len >= 4)
{
char *ext;
- dbg(lvl_info, "loading image '%s'\n", name );
+ dbg(lvl_info, "loading image '%s'", name );
ret = g_new0( struct graphics_image_priv, 1 );
ext = name+len-4;
if (!strcmp(ext,".xpm")) {
@@ -1436,7 +1436,7 @@ static struct graphics_image_priv *image_new(struct graphics_priv *gr, struct gr
}
}
if (!rc) {
- dbg(lvl_warning, "failed loading '%s'\n", name );
+ dbg(lvl_warning, "failed loading '%s'", name );
g_free(ret);
ret=NULL;
}
@@ -1479,7 +1479,7 @@ static struct graphics_priv *
static void overlay_resize(struct graphics_priv *gr, struct point *p, int w, int h, int wraparound)
{
- dbg(lvl_debug, "resize overlay: %x, x: %d, y: %d, w: %d, h: %d, wraparound: %d\n", gr, p->x, p->y, w, h, wraparound);
+ dbg(lvl_debug, "resize overlay: %x, x: %d, y: %d, w: %d, h: %d, wraparound: %d", gr, p->x, p->y, w, h, wraparound);
if ( gr->width != w || gr->height != h )
{
@@ -1497,7 +1497,7 @@ static struct graphics_priv *
overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound)
{
struct graphics_priv *this=graphics_win32_new_helper(meth);
- dbg(lvl_debug, "overlay: %x, x: %d, y: %d, w: %d, h: %d, wraparound: %d\n", this, p->x, p->y, w, h, wraparound);
+ dbg(lvl_debug, "overlay: %x, x: %d, y: %d, w: %d, h: %d, wraparound: %d", this, p->x, p->y, w, h, wraparound);
this->width = w;
this->height = h;
this->parent = gr;
@@ -1531,7 +1531,7 @@ static struct graphics_priv *
static void overlay_disable(struct graphics_priv *gr, int disable)
{
- dbg(lvl_debug, "overlay: %x, disable: %d\n", gr, disable);
+ dbg(lvl_debug, "overlay: %x, disable: %d", gr, disable);
gr->disabled = disable;
}
@@ -1543,7 +1543,7 @@ static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *f
int yMax = 13*font->size/256;
int xMax = 9*font->size*len/256;
- dbg(lvl_info, "Get bbox for %s\n", text);
+ dbg(lvl_info, "Get bbox for %s", text);
ret[0].x = xMin;
ret[0].y = -yMin;
@@ -1610,7 +1610,7 @@ static void bind_late(struct graphics_priv* gra_priv)
gra_priv->AlphaBlend = (FP_AlphaBlend)GetProcAddress(gra_priv->hCoreDll, TEXT("AlphaBlend") );
if (!gra_priv->AlphaBlend)
{
- dbg(lvl_warning, "AlphaBlend not supported\n");
+ dbg(lvl_warning, "AlphaBlend not supported");
}
#if HAVE_API_WIN32_CE
gra_priv->SetStretchBltMode= (FP_SetStretchBltMode)GetProcAddress(gra_priv->hCoreDll, TEXT("SetStretchBltMode") );
@@ -1619,12 +1619,12 @@ static void bind_late(struct graphics_priv* gra_priv)
#endif
if (!gra_priv->SetStretchBltMode)
{
- dbg(lvl_warning, "SetStretchBltMode not supported\n");
+ dbg(lvl_warning, "SetStretchBltMode not supported");
}
}
else
{
- dbg(lvl_error, "Error loading coredll\n");
+ dbg(lvl_error, "Error loading coredll");
}
if(gra_priv->hUser32Dll) {
@@ -1678,7 +1678,7 @@ event_win32_main_loop_run(void)
{
MSG msg;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
while (GetMessage(&msg, 0, 0, 0))
{
TranslateMessage(&msg); /* Keyboard input. */
@@ -1694,7 +1694,7 @@ static void event_win32_main_loop_quit(void)
HWND hwndSip;
#endif
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#ifdef HAVE_API_WIN32_CE
hwndTaskbar = FindWindow(L"HHTaskBar", NULL);
@@ -1710,14 +1710,14 @@ static void event_win32_main_loop_quit(void)
static struct event_watch *
event_win32_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
event_win32_remove_watch(struct event_watch *ev)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static GList *timers;
@@ -1740,7 +1740,7 @@ static void run_timer(UINT_PTR idEvent)
if (t->timer_id == idEvent)
{
struct callback *cb = t->cb;
- dbg(lvl_info, "Timer %d (multi: %d)\n", t->timer_id, t->multi);
+ dbg(lvl_info, "Timer %d (multi: %d)", t->timer_id, t->multi);
if (!t->multi)
{
KillTimer(NULL, t->timer_id);
@@ -1752,7 +1752,7 @@ static void run_timer(UINT_PTR idEvent)
}
l = g_list_next(l);
}
- dbg(lvl_error, "timer %d not found\n", idEvent);
+ dbg(lvl_error, "timer %d not found", idEvent);
}
static VOID CALLBACK win32_timer_cb(HWND hwnd, UINT uMsg,
@@ -1773,7 +1773,7 @@ static struct event_timeout *
timers = g_list_prepend(timers, t);
t->cb = cb;
t->timer_id = SetTimer(NULL, 0, timeout, win32_timer_cb);
- dbg(lvl_debug, "Started timer %d for %d (multi: %d)\n", t->timer_id, timeout, multi);
+ dbg(lvl_debug, "Started timer %d for %d (multi: %d)", t->timer_id, timeout, multi);
return t;
}
@@ -1784,7 +1784,7 @@ event_win32_remove_timeout(struct event_timeout *to)
{
GList *l;
struct event_timeout *t=NULL;
- dbg(lvl_debug, "Try stopping timer %d\n", to->timer_id);
+ dbg(lvl_debug, "Try stopping timer %d", to->timer_id);
l = timers;
while (l)
{
@@ -1799,7 +1799,7 @@ event_win32_remove_timeout(struct event_timeout *to)
}
l = g_list_next(l);
}
- dbg(lvl_error, "Timer %d not found\n", to->timer_id);
+ dbg(lvl_error, "Timer %d not found", to->timer_id);
g_free(to);
}
}
diff --git a/navit/gui.c b/navit/gui.c
index 9b2ba4971..3e3b04269 100644
--- a/navit/gui.c
+++ b/navit/gui.c
@@ -145,12 +145,12 @@ int
gui_add_bookmark(struct gui *gui, struct pcoord *c, char *description)
{
int ret;
- dbg(lvl_info,"enter\n");
+ dbg(lvl_info,"enter");
if (! gui->meth.add_bookmark)
return 0;
ret=gui->meth.add_bookmark(gui->priv, c, description);
- dbg(lvl_info,"ret=%d\n", ret);
+ dbg(lvl_info,"ret=%d", ret);
return ret;
}
@@ -158,7 +158,7 @@ int
gui_set_graphics(struct gui *this_, struct graphics *gra)
{
if (! this_->meth.set_graphics) {
- dbg(lvl_error, "cannot set graphics, method 'set_graphics' not available\n");
+ dbg(lvl_error, "cannot set graphics, method 'set_graphics' not available");
return 1;
}
return this_->meth.set_graphics(this_->priv, gra);
diff --git a/navit/gui/gtk/datawindow.c b/navit/gui/gtk/datawindow.c
index dd71ce999..777a205e8 100644
--- a/navit/gui/gtk/datawindow.c
+++ b/navit/gui/gtk/datawindow.c
@@ -48,7 +48,7 @@ select_row(GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, stru
GtkTreeModel *model;
int i;
- dbg(lvl_debug,"win=%p\n", win);
+ dbg(lvl_debug,"win=%p", win);
model=gtk_tree_view_get_model(tree);
gtk_tree_model_get_iter(model, &iter, path);
diff --git a/navit/gui/gtk/destination.c b/navit/gui/gtk/destination.c
index 18fc58b75..a530cc559 100644
--- a/navit/gui/gtk/destination.c
+++ b/navit/gui/gtk/destination.c
@@ -164,7 +164,7 @@ static void row_activated(GtkWidget *widget, GtkTreePath *p1, GtkTreeViewColumn
char *str;
int column;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview), &path, &focus_column);
if(!path)
return;
@@ -184,11 +184,11 @@ static void row_activated(GtkWidget *widget, GtkTreePath *p1, GtkTreeViewColumn
column=4;
break;
default:
- dbg(lvl_debug,"Unknown mode\n");
+ dbg(lvl_debug,"Unknown mode");
return;
}
gtk_tree_model_get(search->liststore2, &iter, column, &str, -1);
- dbg(lvl_debug,"str=%s\n", str);
+ dbg(lvl_debug,"str=%s", str);
search->partial=0;
gtk_entry_set_text(GTK_ENTRY(entry_widget), str);
}
@@ -222,13 +222,13 @@ static void changed(GtkWidget *widget, struct search_param *search)
printf("changed %s partial %d\n", search->attr.u.str, search->partial);
if (widget == search->entry_country) {
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 3, GTK_SORT_ASCENDING);
- dbg(lvl_debug,"country\n");
+ dbg(lvl_debug,"country");
search->attr.type=attr_country_all;
set_columns(search, 0);
}
if (widget == search->entry_postal) {
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 1, GTK_SORT_ASCENDING);
- dbg(lvl_debug,"postal\n");
+ dbg(lvl_debug,"postal");
search->attr.type=attr_town_postal;
if (strlen(search->attr.u.str) < 2)
return;
@@ -236,14 +236,14 @@ static void changed(GtkWidget *widget, struct search_param *search)
}
if (widget == search->entry_city) {
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 2, GTK_SORT_ASCENDING);
- dbg(lvl_debug,"town\n");
+ dbg(lvl_debug,"town");
search->attr.type=attr_town_name;
if (strlen(search->attr.u.str) < 3)
return;
set_columns(search, 1);
}
if (widget == search->entry_street) {
- dbg(lvl_debug,"street\n");
+ dbg(lvl_debug,"street");
search->attr.type=attr_street_name;
// Searching for a street by just its first letter generates too many hits to be useful,
// plus it causes the GUI to become unresponsive because the search is single-threaded.
@@ -575,7 +575,7 @@ int destination_address(struct navit *nav)
gtk_entry_set_text(GTK_ENTRY(search->entry_country), country_name.u.str);
country_search_destroy(cs);
} else {
- dbg(lvl_error,"warning: no default country found\n");
+ dbg(lvl_error,"warning: no default country found");
}
search->partial=1;
return 0;
diff --git a/navit/gui/gtk/gui_gtk_action.c b/navit/gui/gtk/gui_gtk_action.c
index de5128756..469d04ec8 100644
--- a/navit/gui/gtk/gui_gtk_action.c
+++ b/navit/gui/gtk/gui_gtk_action.c
@@ -110,7 +110,7 @@ cursor_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
attr.type=attr_cursor;
attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_cursor\n");
+ dbg(lvl_error, "Failed to set attr_cursor");
}
}
@@ -122,7 +122,7 @@ tracking_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
attr.type=attr_tracking;
attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_tracking\n");
+ dbg(lvl_error, "Failed to set attr_tracking");
}
}
@@ -143,7 +143,7 @@ follow_vehicle_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
attr.type=attr_follow_cursor;
attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_follow_gps\n");
+ dbg(lvl_error, "Failed to set attr_follow_gps");
}
}
@@ -155,7 +155,7 @@ orient_north_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
attr.type=attr_orientation;
attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)) ? 0:-1;
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_orientation\n");
+ dbg(lvl_error, "Failed to set attr_orientation");
}
}
diff --git a/navit/gui/gtk/gui_gtk_poi.c b/navit/gui/gtk/gui_gtk_poi.c
index a3578243b..ba2a00e98 100644
--- a/navit/gui/gtk/gui_gtk_poi.c
+++ b/navit/gui/gtk/gui_gtk_poi.c
@@ -55,7 +55,7 @@ geticon(const char *name){
GError *error=NULL;
icon=gdk_pixbuf_new_from_file(graphics_icon_path(name),&error);
if (error) {
- dbg(lvl_error, "failed to load icon '%s': %s\n", name, error->message);
+ dbg(lvl_error, "failed to load icon '%s': %s", name, error->message);
}
return icon;
}
@@ -228,7 +228,7 @@ button_destination_clicked(GtkWidget *widget, struct gtk_poi_search *search)
dest.y=lon;
dest.pro=1;
navit_set_destination(search->nav, &dest, buffer, 1);
- dbg(lvl_debug,_("Set destination to %ld, %ld \n"),lat,lon);
+ dbg(lvl_debug,_("Set destination to %ld, %ld "),lat,lon);
}
/* Show the POI's position in the map. */
@@ -251,7 +251,7 @@ button_map_clicked(GtkWidget *widget, struct gtk_poi_search *search)
dest.y=lon;
dest.pro=1;
navit_set_center(search->nav, &dest,1);
- dbg(lvl_debug,_("Set map to %ld, %ld \n"),lat,lon);
+ dbg(lvl_debug,_("Set map to %ld, %ld "),lat,lon);
}
/** Set POI as the first "visit before". */
@@ -268,7 +268,7 @@ button_visit_clicked(GtkWidget *widget, struct gtk_poi_search *search)
if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_poi_sorted), &iter, path)) return;
gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 3, &lat, -1);
gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 4, &lon, -1);
- dbg(lvl_debug,_("Set next visit to %ld, %ld \n"),lat,lon);
+ dbg(lvl_debug,_("Set next visit to %ld, %ld "),lat,lon);
struct pcoord dest;
dest.x=lat;
diff --git a/navit/gui/gtk/gui_gtk_window.c b/navit/gui/gtk/gui_gtk_window.c
index 1741a54a0..c50aa2dcc 100644
--- a/navit/gui/gtk/gui_gtk_window.c
+++ b/navit/gui/gtk/gui_gtk_window.c
@@ -85,7 +85,7 @@ keypress(GtkWidget *widget, GdkEventKey *event, struct gui_priv *this)
struct point p;
if (event->type != GDK_KEY_PRESS)
return FALSE;
- dbg(lvl_debug,"keypress 0x%x\n", event->keyval);
+ dbg(lvl_debug,"keypress 0x%x", event->keyval);
transform_get_size(navit_get_trans(this->nav), &w, &h);
switch (event->keyval) {
case GDK_KP_Enter:
@@ -313,19 +313,19 @@ gui_gtk_toggle_init(struct gui_priv *this)
toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "CursorAction"));
gtk_toggle_action_set_active(toggle_action, attr.u.num);
} else {
- dbg(lvl_warning, "Unable to locate CursorAction\n");
+ dbg(lvl_warning, "Unable to locate CursorAction");
}
if (navit_get_attr(this->nav, attr_orientation, &attr, NULL)) {
toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "OrientationAction"));
gtk_toggle_action_set_active(toggle_action, attr.u.num != -1);
} else {
- dbg(lvl_error, "Unable to locate OrientationAction\n");
+ dbg(lvl_error, "Unable to locate OrientationAction");
}
if (navit_get_attr(this->nav, attr_tracking, &attr, NULL)) {
toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "TrackingAction"));
gtk_toggle_action_set_active(toggle_action, attr.u.num);
} else {
- dbg(lvl_error, "Unable to locate TrackingAction\n");
+ dbg(lvl_error, "Unable to locate TrackingAction");
}
}
@@ -478,7 +478,7 @@ gui_gtk_vehicles_update(struct gui_priv *this)
char *name;
GList *curr;
struct gui_menu_info *meninfo;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
curr = g_list_first(this->vehicle_menuitems);
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c
index a571a827c..d634470f0 100644
--- a/navit/gui/internal/gui_internal.c
+++ b/navit/gui/internal/gui_internal.c
@@ -134,10 +134,10 @@ image_new_scaled(struct gui_priv *this, const char *name, int w, int h)
char *full_path=NULL;
full_path=graphics_icon_path(name);
ret=graphics_image_new_scaled(this->gra, full_path, w, h);
- dbg(lvl_debug,"Trying to load image '%s' (w=%d, h=%d): %s\n", name, w, h, ret ? "OK" : "NOT FOUND");
+ dbg(lvl_debug,"Trying to load image '%s' (w=%d, h=%d): %s", name, w, h, ret ? "OK" : "NOT FOUND");
g_free(full_path);
if (!ret) {
- dbg(lvl_error,"Failed to load image for '%s' (w=%d, h=%d)\n", name, w, h);
+ dbg(lvl_error,"Failed to load image for '%s' (w=%d, h=%d)", name, w, h);
full_path=graphics_icon_path("unknown");
ret=graphics_image_new_scaled(this->gra, full_path, w, h);
g_free(full_path);
@@ -508,7 +508,7 @@ gui_internal_apply_config(struct gui_priv *this)
{
struct gui_config_settings * current_config=0;
- dbg(lvl_debug,"w=%d h=%d\n", this->root.w, this->root.h);
+ dbg(lvl_debug,"w=%d h=%d", this->root.w, this->root.h);
/*
* Select default values from profile based on the screen.
*/
@@ -593,7 +593,7 @@ static void
gui_internal_cmd_set_destination(struct gui_priv *this, struct widget *wm, void *data)
{
char *name=data;
- dbg(lvl_info,"c=%d:0x%x,0x%x\n", wm->c.pro, wm->c.x, wm->c.y);
+ dbg(lvl_info,"c=%d:0x%x,0x%x", wm->c.pro, wm->c.x, wm->c.y);
navit_set_destination(this->nav, &wm->c, name, 1);
if (this->flags & 512) {
struct attr follow;
@@ -848,13 +848,13 @@ gui_internal_cmd_view_attributes(struct gui_priv *this, struct widget *wm, void
char *text;
int count=0;
- dbg(lvl_info,"item=%p 0x%x 0x%x\n", wm->item.map,wm->item.id_hi, wm->item.id_lo);
+ dbg(lvl_info,"item=%p 0x%x 0x%x", wm->item.map,wm->item.id_hi, wm->item.id_lo);
wb=gui_internal_menu(this, "Attributes");
w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(wb, w);
mr=map_rect_new(wm->item.map, NULL);
item = map_rect_get_item_byid(mr, wm->item.id_hi, wm->item.id_lo);
- dbg(lvl_info,"item=%p\n", item);
+ dbg(lvl_info,"item=%p", item);
if (item) {
text=g_strdup_printf("%s:%s", _("Item type"), item_to_name(item->type));
gui_internal_widget_append(w,
@@ -896,10 +896,10 @@ gui_internal_cmd_view_in_browser(struct gui_priv *this, struct widget *wm, void
char *cmd=NULL;
if (!wm->name) {
- dbg(lvl_info,"item=%p 0x%x 0x%x\n", wm->item.map,wm->item.id_hi, wm->item.id_lo);
+ dbg(lvl_info,"item=%p 0x%x 0x%x", wm->item.map,wm->item.id_hi, wm->item.id_lo);
mr=map_rect_new(wm->item.map, NULL);
item = map_rect_get_item_byid(mr, wm->item.id_hi, wm->item.id_lo);
- dbg(lvl_info,"item=%p\n", item);
+ dbg(lvl_info,"item=%p", item);
if (item) {
while(item_attr_get(item, attr_url_local, &attr)) {
if (! cmd)
@@ -914,7 +914,7 @@ gui_internal_cmd_view_in_browser(struct gui_priv *this, struct widget *wm, void
#ifdef HAVE_SYSTEM
system(cmd);
#else
- dbg(lvl_error,"Error: External commands were disabled during compilation, cannot call '%s'.\n",cmd);
+ dbg(lvl_error,"Error: External commands were disabled during compilation, cannot call '%s'.",cmd);
#endif
g_free(cmd);
}
@@ -1004,7 +1004,7 @@ gui_internal_cmd_results_to_map(struct gui_priv *this, struct widget *wm, void *
if(!w) {
map_rect_destroy(mr);
- dbg(lvl_warning,"Can't find the results table - only map clean up is done.\n");
+ dbg(lvl_warning,"Can't find the results table - only map clean up is done.");
return;
}
@@ -1016,7 +1016,7 @@ gui_internal_cmd_results_to_map(struct gui_priv *this, struct widget *wm, void *
struct item* it;
if(wi->name==NULL)
continue;
- dbg(lvl_info,"%s\n",wi->name);
+ dbg(lvl_info,"%s",wi->name);
it=map_rect_create_item(mr,type_found_item);
if(it) {
struct coord c;
@@ -1132,7 +1132,7 @@ gui_internal_cmd_position_do(struct gui_priv *this, struct pcoord *pc_in, struct
pc=*pc_in;
c.x=pc.x;
c.y=pc.y;
- dbg(lvl_info,"x=0x%x y=0x%x\n", c.x, c.y);
+ dbg(lvl_info,"x=0x%x y=0x%x", c.x, c.y);
transform_to_geo(pc.pro, &c, &g);
} else if (g_in) {
struct attr attr;
@@ -1576,7 +1576,7 @@ gui_internal_cmd_bookmarks(struct gui_priv *this, struct widget *wm, void *data)
while ((item=bookmarks_get_item(mattr.u.bookmarks))) {
if (!item_attr_get(item, attr_label, &attr)) continue;
label_full=map_convert_string_tmp(item->map,attr.u.str);
- dbg(lvl_info,"full_labled: %s\n",label_full);
+ dbg(lvl_info,"full_labled: %s",label_full);
// hassub == 1 if the item type is a sub-folder
if (item->type == type_bookmark_folder) {
@@ -1658,7 +1658,7 @@ gui_internal_keypress_do(struct gui_priv *this, char *key)
}
return;
} else if (*key == NAVIT_KEY_BACKSPACE) {
- dbg(lvl_debug,"backspace\n");
+ dbg(lvl_debug,"backspace");
if (wi->text && wi->text[0]) {
len=g_utf8_prev_char(wi->text+strlen(wi->text))-wi->text;
wi->text[len]='\0';
@@ -1666,11 +1666,11 @@ gui_internal_keypress_do(struct gui_priv *this, char *key)
}
} else {
if (wi->state & STATE_CLEAR) {
- dbg(lvl_info,"wi->state=0x%x\n", wi->state);
+ dbg(lvl_info,"wi->state=0x%x", wi->state);
g_free(wi->text);
wi->text=NULL;
wi->state &= ~STATE_CLEAR;
- dbg(lvl_info,"wi->state=0x%x\n", wi->state);
+ dbg(lvl_info,"wi->state=0x%x", wi->state);
}
text=g_strdup_printf("%s%s", wi->text ? wi->text : "", key);
@@ -1760,7 +1760,7 @@ gui_internal_set(char *remove, char *add)
int len=strlen(line);
if (len > 0 && line[len-1] == '\n')
line[len-1]='\0';
- dbg(lvl_debug,"line=%s\n",line);
+ dbg(lvl_debug,"line=%s",line);
if (!gui_internal_match(remove, line))
fprintf(fo,"%s\n",line);
}
@@ -1819,12 +1819,12 @@ gui_internal_cmd_map_download_do(struct gui_priv *this, struct widget *wm, void
sel.range.max=type_last;
mr=map_rect_new(map, &sel);
while ((item=map_rect_get_item(mr))) {
- dbg(lvl_info,"item\n");
+ dbg(lvl_info,"item");
}
map_rect_destroy(mr);
}
- dbg(lvl_info,"bbox=%s\n",wm->prefix);
+ dbg(lvl_info,"bbox=%s",wm->prefix);
gui_internal_menu_render(this);
}
@@ -1838,7 +1838,7 @@ gui_internal_cmd_map_download(struct gui_priv *this, struct widget *wm, void *da
char *search,buffer[256];
int found,sp_match=0;
- dbg(lvl_debug,"wm=%p prefix=%s\n",wm,wm->prefix);
+ dbg(lvl_debug,"wm=%p prefix=%s",wm,wm->prefix);
search=wm->prefix;
if (search) {
@@ -2048,14 +2048,14 @@ gui_internal_cmd_set_active_profile(struct gui_priv *this, struct
vehicle_get_attr(v, attr_name, &vehicle_name_attr, NULL);
vehicle_name = vehicle_name_attr.u.str;
- dbg(lvl_debug, "Changing vehicle %s to profile %s\n", vehicle_name,
+ dbg(lvl_debug, "Changing vehicle %s to profile %s", vehicle_name,
profilename);
// Change the profile name
profilename_attr.type = attr_profilename;
profilename_attr.u.str = profilename;
if(!vehicle_set_attr(v, &profilename_attr)) {
- dbg(lvl_error, "Unable to set the vehicle's profile name\n");
+ dbg(lvl_error, "Unable to set the vehicle's profile name");
}
navit_set_vehicleprofile_name(this->nav,profilename);
@@ -2115,7 +2115,7 @@ gui_internal_add_vehicle_profile(struct gui_priv *this, struct widget
active_profile = profile_attr.u.str;
active = active_profile != NULL && !strcmp(name, active_profile);
- dbg(lvl_debug, "Adding vehicle profile %s, active=%s/%i\n", name,
+ dbg(lvl_debug, "Adding vehicle profile %s, active=%s/%i", name,
active_profile, active);
// Build a translatable label.
@@ -2262,7 +2262,7 @@ gui_internal_set_click_coord(struct gui_priv *this, struct point *p)
if (p) {
trans=navit_get_trans(this->nav);
transform_reverse(trans, p, &c);
- dbg(lvl_debug,"x=0x%x y=0x%x\n", c.x, c.y);
+ dbg(lvl_debug,"x=0x%x y=0x%x", c.x, c.y);
this->clickp.pro=transform_get_projection(trans);
this->clickp.x=c.x;
this->clickp.y=c.y;
@@ -2303,7 +2303,7 @@ gui_internal_enter_setup(struct gui_priv *this)
void
gui_internal_cmd_menu(struct gui_priv *this, int ignore, char *href)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
gui_internal_enter(this, ignore);
gui_internal_enter_setup(this);
// draw menu
@@ -2423,7 +2423,7 @@ gui_internal_set_attr(struct gui_priv *this, struct attr *attr)
this->on_map_click=g_strdup(attr->u.str);
return 1;
default:
- dbg(lvl_error,"Unknown attribute: %s\n",attr_to_name(attr->type));
+ dbg(lvl_error,"Unknown attribute: %s",attr_to_name(attr->type));
return 1;
}
}
@@ -2491,7 +2491,7 @@ gui_internal_coordinate_parse(char *s, char plus, char minus, double *x)
sscanf(degree, "%lf", x);
if(strchr(degree, plus) || strchr(degree, minus)) {
- dbg(lvl_debug,"degree %c/%c found\n",plus,minus);
+ dbg(lvl_debug,"degree %c/%c found",plus,minus);
} else {/* DEGREES_MINUTES */
if(!minute)
return 0;
@@ -2499,7 +2499,7 @@ gui_internal_coordinate_parse(char *s, char plus, char minus, double *x)
sscanf(minute, "%lf", &tmp);
*x+=tmp/60;
if(strchr(minute, plus) || strchr(minute, minus)) {
- dbg(lvl_debug,"minute %c/%c found\n",plus,minus);
+ dbg(lvl_debug,"minute %c/%c found",plus,minus);
} else { /* DEGREES_MINUTES_SECONDS */
second=strtok(NULL,"");
if(!second)
@@ -2523,7 +2523,7 @@ gui_internal_cmd_enter_coord_do(struct gui_priv *this, struct widget *widget)
char *lat, *lng;
char *widgettext;
double latitude, longitude;
- dbg(lvl_debug,"text entered:%s\n", widget->text);
+ dbg(lvl_debug,"text entered:%s", widget->text);
/* possible entry can be identical to coord_format output but only space between lat and lng is allowed */
widgettext=g_ascii_strup(widget->text,-1);
@@ -2556,7 +2556,7 @@ gui_internal_cmd_enter_coord_do(struct gui_priv *this, struct widget *widget)
void
gui_internal_cmd_enter_coord_clicked(struct gui_priv *this, struct widget *widget, void *data)
{
- dbg(lvl_debug,"entered\n");
+ dbg(lvl_debug,"entered");
gui_internal_cmd_enter_coord_do(this, widget->data);
}
@@ -2570,18 +2570,18 @@ static void gui_internal_button(void *data, int pressed, int button, struct poin
struct gui_priv *this=data;
struct graphics *gra=this->gra;
- dbg(lvl_debug,"enter %d %d\n", pressed, button);
+ dbg(lvl_debug,"enter %d %d", pressed, button);
// if still on the map (not in the menu, yet):
- dbg(lvl_debug,"children=%p ignore_button=%d\n",this->root.children,this->ignore_button);
+ dbg(lvl_debug,"children=%p ignore_button=%d",this->root.children,this->ignore_button);
if (!this->root.children || this->ignore_button) {
this->ignore_button=0;
// check whether the position of the mouse changed during press/release OR if it is the scrollwheel
if (!navit_handle_button(this->nav, pressed, button, p, NULL)) {
- dbg(lvl_debug,"navit has handled button\n");
+ dbg(lvl_debug,"navit has handled button");
return;
}
- dbg(lvl_debug,"menu_on_map_click=%d\n",this->menu_on_map_click);
+ dbg(lvl_debug,"menu_on_map_click=%d",this->menu_on_map_click);
if (button != 1)
return;
if (this->on_map_click || this->menu_on_map_click) {
@@ -2688,7 +2688,7 @@ static void gui_internal_resize(void *data, int w, int h)
*/
if (!changed && this->gra && graphics_get_data(this->gra, "padding"))
changed = 1;
- dbg(lvl_debug,"w=%d h=%d children=%p\n", w, h, this->root.children);
+ dbg(lvl_debug,"w=%d h=%d children=%p", w, h, this->root.children);
navit_handle_resize(this->nav, w, h);
if (this->root.children) {
if (changed) {
@@ -2805,7 +2805,7 @@ gui_internal_keynav_find_closest(struct widget *wi, struct point *p, int dx, int
if (dist1 < 0)
dist1=-dist1;
}
- dbg(lvl_debug,"checking %d,%d %d %d against %d,%d-%d,%d result %d,%d\n", p->x, p->y, dx, dy, wi->p.x, wi->p.y, wi->p.x+wi->w, wi->p.y+wi->h, dist1, dist2);
+ dbg(lvl_debug,"checking %d,%d %d %d against %d,%d-%d,%d result %d,%d", p->x, p->y, dx, dy, wi->p.x, wi->p.y, wi->p.x+wi->w, wi->p.y+wi->h, dist1, dist2);
if (dist1 >= 0) {
if (dist2 < 0)
dist1-=dist2;
@@ -2855,7 +2855,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro
gui_internal_keynav_find_closest(menu, &p, 0, 0, &distance, &result);
if (result) {
gui_internal_keynav_point(result, dx, dy, &p);
- dbg(lvl_debug,"result origin=%p p=%d,%d\n", result, p.x, p.y);
+ dbg(lvl_debug,"result origin=%p p=%d,%d", result, p.x, p.y);
current_highlight = result;
}
}
@@ -2867,7 +2867,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro
gui_internal_keynav_find_prev(menu, current_highlight, &result);
else
gui_internal_keynav_find_closest(menu, &p, dx, dy, &distance, &result);
- dbg(lvl_debug,"result=%p\n", result);
+ dbg(lvl_debug,"result=%p", result);
if (! result) {
if (dx < 0) {
p.x=this->root.w;
@@ -2884,7 +2884,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro
result=NULL;
distance=INT_MAX;
gui_internal_keynav_find_closest(menu, &p, dx, dy, &distance, &result);
- dbg(lvl_debug,"wraparound result=%p\n", result);
+ dbg(lvl_debug,"wraparound result=%p", result);
}
gui_internal_highlight_do(this, result);
if (result)
@@ -2992,7 +2992,7 @@ static int gui_internal_set_graphics(struct gui_priv *this, struct graphics *gra
win=graphics_get_data(gra, "window");
if (! win) {
- dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics\n");
+ dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics");
return 1;
}
navit_ignore_graphics_events(this->nav, 1);
@@ -3156,10 +3156,10 @@ line_intersection(struct coord* a1, struct coord *a2, struct coord * b1, struct
if (a > n || b > n)
return FALSE;
if (n == 0) {
- dbg(lvl_info,"a=%d b=%d n=%d\n", a, b, n);
- dbg(lvl_info,"a1=0x%x,0x%x ad %d,%d\n", a1->x, a1->y, adx, ady);
- dbg(lvl_info,"b1=0x%x,0x%x bd %d,%d\n", b1->x, b1->y, bdx, bdy);
- dbg(lvl_info,"No intersection found, lines assumed parallel ?\n");
+ dbg(lvl_info,"a=%d b=%d n=%d", a, b, n);
+ dbg(lvl_info,"a1=0x%x,0x%x ad %d,%d", a1->x, a1->y, adx, ady);
+ dbg(lvl_info,"b1=0x%x,0x%x bd %d,%d", b1->x, b1->y, bdx, bdy);
+ dbg(lvl_info,"No intersection found, lines assumed parallel ?");
return FALSE;
}
res->x = a1->x + a * adx / n;
diff --git a/navit/gui/internal/gui_internal_bookmark.c b/navit/gui/internal/gui_internal_bookmark.c
index eed0de123..7ae4df68e 100644
--- a/navit/gui/internal/gui_internal_bookmark.c
+++ b/navit/gui/internal/gui_internal_bookmark.c
@@ -21,7 +21,7 @@ gui_internal_cmd_add_bookmark_do(struct gui_priv *this, struct widget *widget)
{
GList *l;
struct attr attr;
- dbg(lvl_debug,"text='%s'\n", widget->text);
+ dbg(lvl_debug,"text='%s'", widget->text);
if (widget->text && strlen(widget->text)){
navit_get_attr(this->nav, attr_bookmarks, &attr, NULL);
bookmarks_add_bookmark(attr.u.bookmarks, &widget->c, widget->text);
@@ -37,7 +37,7 @@ gui_internal_cmd_add_bookmark_folder_do(struct gui_priv *this, struct widget *wi
{
GList *l;
struct attr attr;
- dbg(lvl_debug,"text='%s'\n", widget->text);
+ dbg(lvl_debug,"text='%s'", widget->text);
if (widget->text && strlen(widget->text)){
navit_get_attr(this->nav, attr_bookmarks, &attr, NULL);
bookmarks_add_bookmark(attr.u.bookmarks, NULL, widget->text);
@@ -66,7 +66,7 @@ gui_internal_cmd_rename_bookmark_clicked(struct gui_priv *this, struct widget *w
struct widget *w=(struct widget*)widget->data;
GList *l;
struct attr attr;
- dbg(lvl_debug,"text='%s'\n", w->text);
+ dbg(lvl_debug,"text='%s'", w->text);
if (w->text && strlen(w->text)){
navit_get_attr(this->nav, attr_bookmarks, &attr, NULL);
bookmarks_rename_bookmark(attr.u.bookmarks, w->name, w->text);
diff --git a/navit/gui/internal/gui_internal_command.c b/navit/gui/internal/gui_internal_command.c
index 1eb1163cb..19f0550dc 100644
--- a/navit/gui/internal/gui_internal_command.c
+++ b/navit/gui/internal/gui_internal_command.c
@@ -161,11 +161,11 @@ gui_internal_cmd_escape(struct gui_priv *this, char *function, struct attr **in,
{
struct attr escaped;
if (!in || !in[0]) {
- dbg(lvl_error,"first parameter missing or wrong type\n");
+ dbg(lvl_error,"first parameter missing or wrong type");
return;
}
if (!out) {
- dbg(lvl_error,"output missing\n");
+ dbg(lvl_error,"output missing");
return;
}
if (ATTR_IS_STRING(in[0]->type)) {
@@ -175,10 +175,10 @@ gui_internal_cmd_escape(struct gui_priv *this, char *function, struct attr **in,
escaped.type=attr_type_string_begin;
escaped.u.str=g_strdup_printf("%ld",in[0]->u.num);
} else {
- dbg(lvl_error,"first parameter wrong type\n");
+ dbg(lvl_error,"first parameter wrong type");
return;
}
- dbg(lvl_debug,"in %s result %s\n",in[0]->u.str,escaped.u.str);
+ dbg(lvl_debug,"in %s result %s",in[0]->u.str,escaped.u.str);
*out=attr_generic_add_attr(*out, attr_dup(&escaped));
g_free(escaped.u.str);
}
@@ -515,14 +515,14 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st
while ((map=mapset_next(msh, 1))) {
struct attr data_attr;
if (map_get_attr(map, attr_data, &data_attr, NULL)){
- dbg(lvl_debug,"map name = %s\n",data_attr.u.str);
+ dbg(lvl_debug,"map name = %s",data_attr.u.str);
if (strstr(data_attr.u.str,".heightlines.bin")){
- dbg(lvl_info,"reading heightlines from map %s\n",data_attr.u.str);
+ dbg(lvl_info,"reading heightlines from map %s",data_attr.u.str);
mr=map_rect_new(map, &sel);
heightmap_installed = TRUE;
}
else {
- dbg(lvl_debug,"ignoring map %s\n",data_attr.u.str);
+ dbg(lvl_debug,"ignoring map %s",data_attr.u.str);
}
}
if (mr) {
@@ -580,7 +580,7 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st
diagram_point->next=diagram_points;
diagram_points=diagram_point;
diagram_points_count ++;
- dbg(lvl_debug,"%d %d\n", diagram_point->c.x, diagram_point->c.y);
+ dbg(lvl_debug,"%d %d", diagram_point->c.x, diagram_point->c.y);
max_ele=MAX(max_ele, diagram_point->c.y);
min_ele=MIN(min_ele, diagram_point->c.y);
distance=diagram_point->c.x;
@@ -629,12 +629,12 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st
coord_rect_extend(&dbbox, &diagram_point->c);
diagram_point=diagram_point->next;
}
- dbg(lvl_debug,"%d %d %d %d\n", dbbox.lu.x, dbbox.lu.y, dbbox.rl.x, dbbox.rl.y);
+ dbg(lvl_debug,"%d %d %d %d", dbbox.lu.x, dbbox.lu.y, dbbox.rl.x, dbbox.rl.y);
if (dbbox.rl.x > dbbox.lu.x && dbbox.lu.x*100/(dbbox.rl.x-dbbox.lu.x) <= 25)
dbbox.lu.x=0;
if (dbbox.lu.y > dbbox.rl.y && dbbox.rl.y*100/(dbbox.lu.y-dbbox.rl.y) <= 25)
dbbox.rl.y=0;
- dbg(lvl_debug,"%d,%d %dx%d\n", box->p.x, box->p.y, box->w, box->h);
+ dbg(lvl_debug,"%d,%d %dx%d", box->p.x, box->p.y, box->w, box->h);
x=dbbox.lu.x;
first=1;
if (diagram_points_count > 1 && dbbox.rl.x != dbbox.lu.x && dbbox.lu.y != dbbox.rl.y){
@@ -650,7 +650,7 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st
break;
p[1].x=(min->c.x-dbbox.lu.x)*(box->w-10)/(dbbox.rl.x-dbbox.lu.x)+box->p.x+5;
p[1].y=(box->h)-5-(min->c.y-dbbox.rl.y)*(box->h-10)/(dbbox.lu.y-dbbox.rl.y)+box->p.y;
- dbg(lvl_debug,"%d,%d=%d,%d\n",min->c.x, min->c.y, p[1].x,p[1].y);
+ dbg(lvl_debug,"%d,%d=%d,%d",min->c.x, min->c.y, p[1].x,p[1].y);
graphics_draw_circle(this->gra, this->foreground, &p[1], 2);
if (first)
first=0;
@@ -726,7 +726,7 @@ gui_internal_cmd2_pois(struct gui_priv *this, char *function, struct attr **in,
struct attr pro;
struct coord c;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (!in || !in[0])
return;
if (!ATTR_IS_COORD_GEO(in[0]->type))
@@ -843,7 +843,7 @@ gui_internal_cmd2_network_info(struct gui_priv *this, char *function, struct att
gui_internal_menu_render(this);
graphics_draw_mode(this->gra, draw_mode_end);
#else
- dbg(lvl_error, "Cannot show network info: ifaddr.h not found\n");
+ dbg(lvl_error, "Cannot show network info: ifaddr.h not found");
#endif
}
@@ -1019,7 +1019,7 @@ gui_internal_cmd2_position(struct gui_priv *this, char *function, struct attr **
const char *name=_("Position");
int flags=-1;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (!in || !in[0])
return;
if (!ATTR_IS_COORD_GEO(in[0]->type))
@@ -1029,7 +1029,7 @@ gui_internal_cmd2_position(struct gui_priv *this, char *function, struct attr **
if (in[2] && ATTR_IS_INT(in[2]->type))
flags=in[2]->u.num;
}
- dbg(lvl_debug,"flags=0x%x\n",flags);
+ dbg(lvl_debug,"flags=0x%x",flags);
gui_internal_cmd_position_do(this, NULL, in[0]->u.coord_geo, NULL, name, flags);
}
@@ -1052,14 +1052,14 @@ gui_internal_cmd2_set(struct gui_priv *this, char *function, struct attr **in, s
{
char *pattern,*command=NULL;
if (!in || !in[0] || !ATTR_IS_STRING(in[0]->type)) {
- dbg(lvl_error,"first parameter missing or wrong type\n");
+ dbg(lvl_error,"first parameter missing or wrong type");
return;
}
pattern=in[0]->u.str;
- dbg(lvl_debug,"pattern %s\n",pattern);
+ dbg(lvl_debug,"pattern %s",pattern);
if (in[1]) {
command=gui_internal_cmd_match_expand(pattern, in+1);
- dbg(lvl_debug,"expand %s\n",command);
+ dbg(lvl_debug,"expand %s",command);
gui_internal_set(pattern, command);
command_evaluate(&this->self, command);
g_free(command);
@@ -1103,7 +1103,7 @@ static void
gui_internal_cmd_write(struct gui_priv * this, char *function, struct attr **in, struct attr ***out, int *valid)
{
char *str=NULL;
- dbg(lvl_debug,"enter %s %p %p %p\n",function,in,out,valid);
+ dbg(lvl_debug,"enter %s %p %p %p",function,in,out,valid);
if (!in)
return;
while (*in) {
@@ -1113,7 +1113,7 @@ gui_internal_cmd_write(struct gui_priv * this, char *function, struct attr **in,
if (str) {
str=g_strdup_printf("<html>%s</html>\n",str);
#if 0
- dbg(lvl_debug,"%s\n",str);
+ dbg(lvl_debug,"%s",str);
#endif
gui_internal_html_parse_text(this, str);
}
@@ -1136,11 +1136,11 @@ gui_internal_onclick(struct attr ***in, char **onclick, char *set)
char format[4],*end=strchr(c+2,'}'),*replacement=NULL,*new_str;
int is_arg;
if (!end) {
- dbg(lvl_error,"Missing closing brace in format string %s\n",c);
+ dbg(lvl_error,"Missing closing brace in format string %s",c);
goto error;
}
if (end-c > sizeof(format)) {
- dbg(lvl_error,"Invalid format string %s\n",c);
+ dbg(lvl_error,"Invalid format string %s",c);
goto error;
}
strncpy(format, c+2, end-c-2);
@@ -1167,7 +1167,7 @@ gui_internal_onclick(struct attr ***in, char **onclick, char *set)
}
}
if (!replacement) {
- dbg(lvl_error,"Unsupported format string %s\n",format);
+ dbg(lvl_error,"Unsupported format string %s",format);
goto error;
}
new_str=g_strconcat(str, replacement, end+1, NULL);
@@ -1210,7 +1210,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s
str=gui_internal_append_attr(str, escape_mode_string|escape_mode_html, " class=", *in, "");
in++;
} else {
- dbg(lvl_error,"argument error: class argument not string\n");
+ dbg(lvl_error,"argument error: class argument not string");
goto error;
}
if (ATTR_IS_STRING((*in)->type) && (*in)->u.str) {
@@ -1219,7 +1219,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s
}
in++;
} else {
- dbg(lvl_error,"argument error: image argument not string\n");
+ dbg(lvl_error,"argument error: image argument not string");
goto error;
}
if (ATTR_IS_STRING((*in)->type) && (*in)->u.str) {
@@ -1230,7 +1230,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s
}
in++;
} else {
- dbg(lvl_error,"argument error: text argument not string\n");
+ dbg(lvl_error,"argument error: text argument not string");
goto error;
}
gui_internal_onclick(&in,&onclick,NULL);
@@ -1256,16 +1256,16 @@ static void
gui_internal_cmd_debug(struct gui_priv * this, char *function, struct attr **in, struct attr ***out, int *valid)
{
char *str;
- dbg(lvl_debug,"begin\n");
+ dbg(lvl_debug,"begin");
if (in) {
while (*in) {
str=attr_to_text(*in, NULL, 0);
- dbg(lvl_debug,"%s:%s\n",attr_to_name((*in)->type),str);
+ dbg(lvl_debug,"%s:%s",attr_to_name((*in)->type),str);
in++;
g_free(str);
}
}
- dbg(lvl_debug,"done\n");
+ dbg(lvl_debug,"done");
}
static void
diff --git a/navit/gui/internal/gui_internal_gesture.c b/navit/gui/internal/gui_internal_gesture.c
index d01a80f1d..3ab0ec46b 100644
--- a/navit/gui/internal/gui_internal_gesture.c
+++ b/navit/gui/internal/gui_internal_gesture.c
@@ -61,7 +61,7 @@ gui_internal_gesture_ring_add(struct gui_priv *this, struct point *p)
}
this->gesture_ring[this->gesture_ring_last].p=*p;
this->gesture_ring[this->gesture_ring_last].msec=msec;
- dbg(lvl_info,"msec="LONGLONG_FMT" x=%d y=%d\n",msec,p->x,p->y);
+ dbg(lvl_info,"msec="LONGLONG_FMT" x=%d y=%d",msec,p->x,p->y);
};
int
@@ -89,7 +89,7 @@ gui_internal_gesture_get_vector(struct gui_priv *this, long long msec, struct po
*p0=g->p;
}
msec=g->msec;
- dbg(lvl_info,LONGLONG_FMT" %d %d\n",g->msec, g->p.x, g->p.y);
+ dbg(lvl_info,LONGLONG_FMT" %d %d",g->msec, g->p.x, g->p.y);
for(i=1;(g=gui_internal_gesture_ring_get(this,i))!=NULL;i++) {
if( msec-g->msec > 1000 )
break;
@@ -99,7 +99,7 @@ gui_internal_gesture_get_vector(struct gui_priv *this, long long msec, struct po
if(p0) {
*p0=g->p;
}
- dbg(lvl_info,LONGLONG_FMT" %d %d\n",g->msec, g->p.x, g->p.y);
+ dbg(lvl_info,LONGLONG_FMT" %d %d",g->msec, g->p.x, g->p.y);
}
return dt;
}
@@ -114,7 +114,7 @@ gui_internal_gesture_do(struct gui_priv *this)
if( abs(dx) > this->icon_s*3 && abs(dy) < this->icon_s ) {
struct widget *wt;
- dbg(lvl_debug,"horizontal dx=%d dy=%d\n",dx,dy);
+ dbg(lvl_debug,"horizontal dx=%d dy=%d",dx,dy);
/* Prevent swiping if widget was scrolled beforehand */
if(this->pressed==2)
@@ -133,11 +133,11 @@ gui_internal_gesture_do(struct gui_priv *this)
gui_internal_table_button_prev(this,NULL,wt);
return 1;
} else if( abs(dy) > this->icon_s*3 && abs(dx) < this->icon_s ) {
- dbg(lvl_debug,"vertical dx=%d dy=%d\n",dx,dy);
+ dbg(lvl_debug,"vertical dx=%d dy=%d",dx,dy);
} else if (dt>300 && abs(dx) <this->icon_s && abs(dy) <this->icon_s ) {
- dbg(lvl_debug,"longtap dx=%d dy=%d\n",dx,dy);
+ dbg(lvl_debug,"longtap dx=%d dy=%d",dx,dy);
} else {
- dbg(lvl_debug,"none dx=%d dy=%d\n",dx,dy);
+ dbg(lvl_debug,"none dx=%d dy=%d",dx,dy);
}
return 0;
diff --git a/navit/gui/internal/gui_internal_html.c b/navit/gui/internal/gui_internal_html.c
index 9b42fbdec..7035920a0 100644
--- a/navit/gui/internal/gui_internal_html.c
+++ b/navit/gui/internal/gui_internal_html.c
@@ -96,7 +96,7 @@ gui_internal_html_submit(struct gui_priv *this, struct widget *w, void *data)
struct widget *menu;
GList *l;
- dbg(lvl_debug,"enter form %p %s\n",w->form,w->form->onsubmit);
+ dbg(lvl_debug,"enter form %p %s",w->form,w->form->onsubmit);
l=g_list_last(this->root.children);
menu=l->data;
graphics_draw_mode(this->gra, draw_mode_begin);
@@ -113,7 +113,7 @@ gui_internal_html_load_href(struct gui_priv *this, char *href, int replace)
if (replace)
gui_internal_prune_menu_count(this, 1, 0);
if (href && href[0] == '#') {
- dbg(lvl_debug,"href=%s\n",href);
+ dbg(lvl_debug,"href=%s",href);
g_free(this->href);
this->href=g_strdup(href);
gui_internal_html_menu(this, this->html_text, href+1);
@@ -376,22 +376,22 @@ gui_internal_refresh_callback_called(struct gui_priv *this, struct menu_data *me
static void
gui_internal_set_refresh_callback(struct gui_priv *this, char *cond)
{
- dbg(lvl_info,"cond=%s\n",cond);
+ dbg(lvl_info,"cond=%s",cond);
if (cond) {
enum attr_type type;
struct object_func *func;
struct menu_data *menu_data=gui_internal_menu_data(this);
- dbg(lvl_info,"navit=%p\n",this->nav);
+ dbg(lvl_info,"navit=%p",this->nav);
type=command_evaluate_to_attr(&this->self, cond, NULL, &menu_data->refresh_callback_obj);
if (type == attr_none) {
- dbg(lvl_error,"can't get type of '%s'\n",cond);
+ dbg(lvl_error,"can't get type of '%s'",cond);
return;
}
func=object_func_lookup(menu_data->refresh_callback_obj.type);
if (!func)
- dbg(lvl_error,"'%s' has no functions\n",cond);
+ dbg(lvl_error,"'%s' has no functions",cond);
if (func && !func->add_attr)
- dbg(lvl_error,"'%s' has no add_attr function\n",cond);
+ dbg(lvl_error,"'%s' has no add_attr function",cond);
if (!func || !func->add_attr)
return;
menu_data->refresh_callback.type=attr_callback;
@@ -461,7 +461,7 @@ gui_internal_html_text(xml_context *dummy, const char *text, gsize len, void *da
}
break;
case html_tag_script:
- dbg(lvl_debug,"execute %s\n",text_stripped);
+ dbg(lvl_debug,"execute %s",text_stripped);
gui_internal_evaluate(this,text_stripped);
break;
default:
diff --git a/navit/gui/internal/gui_internal_keyboard.c b/navit/gui/internal/gui_internal_keyboard.c
index 7ef1c3d36..93480eb87 100644
--- a/navit/gui/internal/gui_internal_keyboard.c
+++ b/navit/gui/internal/gui_internal_keyboard.c
@@ -488,7 +488,7 @@ static void gui_internal_keyboard_hide_native(struct gui_priv *this_, struct wid
g_free(kbd->lang);
g_free(kbd->gui_priv);
} else
- dbg(lvl_warning, "no graphics_keyboard found, cleanup failed\n");
+ dbg(lvl_warning, "no graphics_keyboard found, cleanup failed");
g_free(w);
}
@@ -531,7 +531,7 @@ struct widget * gui_internal_keyboard_show_native(struct gui_priv *this, struct
switch(res) {
case -1:
- dbg(lvl_error, "graphics has no show_native_keyboard method, cannot display keyboard\n");
+ dbg(lvl_error, "graphics has no show_native_keyboard method, cannot display keyboard");
/* no break */
case 0:
g_free(kbd);
@@ -552,9 +552,9 @@ struct widget * gui_internal_keyboard_show_native(struct gui_priv *this, struct
ret->wmin = w->wmin;
} else
ret->w = kbd->w;
- dbg(lvl_error, "ret->w=%d, ret->h=%d\n", ret->w, ret->h);
+ dbg(lvl_error, "ret->w=%d, ret->h=%d", ret->w, ret->h);
ret->data = (void *) kbd;
gui_internal_widget_append(w, ret);
- dbg(lvl_error, "return\n");
+ dbg(lvl_error, "return");
return ret;
}
diff --git a/navit/gui/internal/gui_internal_menu.c b/navit/gui/internal/gui_internal_menu.c
index 33def9983..67da9c939 100644
--- a/navit/gui/internal/gui_internal_menu.c
+++ b/navit/gui/internal/gui_internal_menu.c
@@ -115,7 +115,7 @@ gui_internal_menu(struct gui_priv *this, const char *label)
if (this->gra) {
padding = graphics_get_data(this->gra, "padding");
} else
- dbg(lvl_warning, "cannot get padding: this->gra is NULL\n");
+ dbg(lvl_warning, "cannot get padding: this->gra is NULL");
gui_internal_search_idle_end(this);
topbox=gui_internal_box_new_with_label(this, 0, label);
@@ -149,7 +149,7 @@ gui_internal_menu(struct gui_priv *this, const char *label)
struct widget *wlb,*wb,*wm=w;
wm->flags=gravity_center|orientation_vertical|flags_expand|flags_fill;
w=gui_internal_box_new(this, gravity_center|orientation_horizontal|flags_expand|flags_fill);
- dbg(lvl_info,"topbox->menu_data=%p\n", topbox->menu_data);
+ dbg(lvl_info,"topbox->menu_data=%p", topbox->menu_data);
gui_internal_widget_append(wm, w);
wb=gui_internal_box_new(this, gravity_right_center|orientation_horizontal|flags_fill);
wb->bl=6;
@@ -309,7 +309,7 @@ gui_internal_top_bar(struct gui_priv *this)
use_sep=1;
else
use_sep=0;
- dbg(lvl_debug,"%d (%s) + %d + %d + %d > %d\n", wcn->w, wc->text, width_used, w->spx, use_sep ? sep_len : 0, width);
+ dbg(lvl_debug,"%d (%s) + %d + %d + %d > %d", wcn->w, wc->text, width_used, w->spx, use_sep ? sep_len : 0, width);
if (wcn->w + width_used + w->spx + (use_sep ? sep_len : 0) + (g_list_previous(l) ? dots_len : 0) > width) {
incomplete=1;
gui_internal_widget_destroy(this, wcn);
diff --git a/navit/gui/internal/gui_internal_poi.c b/navit/gui/internal/gui_internal_poi.c
index cb31ecc95..0b904c1d2 100644
--- a/navit/gui/internal/gui_internal_poi.c
+++ b/navit/gui/internal/gui_internal_poi.c
@@ -125,7 +125,7 @@ gui_internal_poi_icon(struct gui_priv *this, struct item *item)
icon=g_strdup(el->u.icon.src);
}
char *dot=g_strrstr(icon,".");
- dbg(lvl_debug,"%s %s\n", item_to_name(item->type),icon);
+ dbg(lvl_debug,"%s %s", item_to_name(item->type),icon);
if(dot)
*dot=0;
img=image_new_xs(this,icon);
@@ -601,7 +601,7 @@ dbg(lvl_debug,"POIs...");
items= g_new0( struct item_data, maxitem);
- dbg(lvl_debug, "Params: sel = %i, selnb = %i, pagenb = %i, dist = %i, filterstr = %s, AddressFilterType= %d\n",
+ dbg(lvl_debug, "Params: sel = %i, selnb = %i, pagenb = %i, dist = %i, filterstr = %s, AddressFilterType= %d",
param->sel, param->selnb, param->pagenb, param->dist, param->filterstr, param->AddressFilterType);
wb=gui_internal_menu(this, isel ? isel->name : _("POIs"));
@@ -619,7 +619,7 @@ dbg(lvl_debug,"POIs...");
while ((m=mapset_next(h, 1))) {
selm=map_selection_dup_pro(sel, pro, map_projection(m));
mr=map_rect_new(m, selm);
- dbg(lvl_debug,"mr=%p\n", mr);
+ dbg(lvl_debug,"mr=%p", mr);
if (mr) {
while ((item=map_rect_get_item(mr))) {
if (gui_internal_cmd_pois_item_selected(param, item) &&
@@ -690,10 +690,10 @@ dbg(lvl_debug,"POIs...");
struct item_data *data = fh_extractmin(fh);
if (data == NULL)
{
- dbg(lvl_debug, "Empty heap: maxitem = %i, it = %i, dist = %i\n", maxitem, it, dist);
+ dbg(lvl_debug, "Empty heap: maxitem = %i, it = %i, dist = %i", maxitem, it, dist);
break;
}
- dbg(lvl_debug, "dist1: %i, dist2: %i\n", data->dist, (-key)>>10);
+ dbg(lvl_debug, "dist1: %i, dist2: %i", data->dist, (-key)>>10);
if(i==(it-pagesize*pagenb) && data->dist>prevdist)
prevdist=data->dist;
wi=gui_internal_cmd_pois_item(this, &center, &data->item, &data->c, route.u.route, data->dist, data->label);
@@ -772,13 +772,13 @@ dbg(lvl_debug,"POIs...");
while(firstrow>=0) {
int currow=g_list_index(wtable->children, td->bottom_row->data) - firstrow;
if(currow<0) {
- dbg(lvl_debug,"Can't find bottom row in children list. Stop paging.\n");
+ dbg(lvl_debug,"Can't find bottom row in children list. Stop paging.");
break;
}
if(currow>=param->count)
break;
if(!(td->scroll_buttons.next_button->state & STATE_SENSITIVE)) {
- dbg(lvl_debug,"Reached last page but item %i not found. Stop paging.\n",param->count);
+ dbg(lvl_debug,"Reached last page but item %i not found. Stop paging.",param->count);
break;
}
gui_internal_table_button_next(this, td->scroll_buttons.next_button, NULL);
diff --git a/navit/gui/internal/gui_internal_search.c b/navit/gui/internal/gui_internal_search.c
index ceeeb7438..54fd55a57 100644
--- a/navit/gui/internal/gui_internal_search.c
+++ b/navit/gui/internal/gui_internal_search.c
@@ -87,7 +87,7 @@ gui_internal_search_cmp(gconstpointer _a, gconstpointer _b)
sa=removecase(a->text);
sb=removecase(b->text);
r=strcmp(sa,sb);
- dbg(lvl_debug,"%s %s %d\n",sa,sb,r);
+ dbg(lvl_debug,"%s %s %d",sa,sb,r);
g_free(sa);
g_free(sb);
return r;
@@ -210,7 +210,7 @@ gui_internal_find_next_possible_key(char *search_text, char *wm_name, char *poss
possible_keys[len]=trunk_name[next_char_pos];
possible_keys[len+1]='\0';
}
- dbg(lvl_info,"searching for %s, found: %s, currently possible_keys: %s \n", search_text, item_name, possible_keys);
+ dbg(lvl_info,"searching for %s, found: %s, currently possible_keys: %s ", search_text, item_name, possible_keys);
}
}
}
@@ -290,7 +290,7 @@ gui_internal_get_match_quality(char *item_name, char* search_text, int is_house_
if(!exp)
continue;
if(!strcmp(exp,folded_query)) {
- dbg(lvl_debug,"exact match for the whole string %s\n", exp);
+ dbg(lvl_debug,"exact match for the whole string %s", exp);
match_quality=full_string_match;
g_free(exp);
break;
@@ -298,7 +298,7 @@ gui_internal_get_match_quality(char *item_name, char* search_text, int is_house_
if((p=strstr(exp,folded_query))!=NULL) {
p+=strlen(folded_query);
if(!*p||strchr(LINGUISTICS_WORD_SEPARATORS_ASCII,*p)) {
- dbg(lvl_debug,"exact matching word found inside string %s\n",exp);
+ dbg(lvl_debug,"exact matching word found inside string %s",exp);
match_quality=word_match;
}
}
@@ -385,7 +385,7 @@ gui_internal_search_idle(struct gui_priv *this, char *wm_name, struct widget *se
widget_name=g_strdup(result_main_label);
}
if(!item_name) {
- dbg(lvl_error, "Skipping nameless item in search (search type: %s). Please report this as a bug.\n", wm_name);
+ dbg(lvl_error, "Skipping nameless item in search (search type: %s). Please report this as a bug.", wm_name);
return;
}
@@ -444,13 +444,13 @@ gui_internal_search_changed(struct gui_priv *this, struct widget *wm, void *data
param=(void *)5;
if (! strcmp(wm->name,"House number"))
param=(void *)6;
- dbg(lvl_debug,"%s now '%s'\n", wm->name, wm->text);
+ dbg(lvl_debug,"%s now '%s'", wm->name, wm->text);
gui_internal_search_idle_end(this);
if (wm->text && g_utf8_strlen(wm->text, -1) > 0) {
struct attr search_attr;
- dbg(lvl_debug,"process\n");
+ dbg(lvl_debug,"process");
if (! strcmp(wm->name,"Country"))
search_attr.type=attr_country_all;
if (! strcmp(wm->name,"Town"))
@@ -488,7 +488,7 @@ gui_internal_search_list_set_default_country(struct gui_priv *this)
item=country_search_get_item(cs);
if (item && item_attr_get(item, attr_country_name, &country_name)) {
search_attr.type=attr_country_all;
- dbg(lvl_debug,"country %s\n", country_name.u.str);
+ dbg(lvl_debug,"country %s", country_name.u.str);
search_attr.u.str=country_name.u.str;
search_list_search(this->sl, &search_attr, 0);
while((res=search_list_get_result(this->sl)));
@@ -501,9 +501,9 @@ gui_internal_search_list_set_default_country(struct gui_priv *this)
}
country_search_destroy(cs);
} else {
- dbg(lvl_error,"warning: no default country found\n");
+ dbg(lvl_error,"warning: no default country found");
if (this->country_iso2) {
- dbg(lvl_debug,"attempting to use country '%s'\n",this->country_iso2);
+ dbg(lvl_debug,"attempting to use country '%s'",this->country_iso2);
search_attr.type=attr_country_iso2;
search_attr.u.str=this->country_iso2;
search_list_search(this->sl, &search_attr, 0);
@@ -604,7 +604,7 @@ gui_internal_search(struct gui_priv *this, const char *what, const char *type, i
void
gui_internal_search_house_number_in_street(struct gui_priv *this, struct widget *widget, void *data)
{
- dbg(lvl_info,"id %d\n", widget->selection_id);
+ dbg(lvl_info,"id %d", widget->selection_id);
search_list_select(this->sl, attr_street_name, 0, 0);
search_list_select(this->sl, attr_street_name, widget->selection_id, 1);
gui_internal_search(this,_("House number"),"House number",0);
@@ -613,7 +613,7 @@ gui_internal_search_house_number_in_street(struct gui_priv *this, struct widget
void
gui_internal_search_street_in_town(struct gui_priv *this, struct widget *widget, void *data)
{
- dbg(lvl_info,"id %d\n", widget->selection_id);
+ dbg(lvl_info,"id %d", widget->selection_id);
search_list_select(this->sl, attr_town_or_district_name, 0, 0);
search_list_select(this->sl, attr_town_or_district_name, widget->selection_id, 1);
gui_internal_search(this,_("Street"),"Street",0);
@@ -623,7 +623,7 @@ void
gui_internal_search_town_in_country(struct gui_priv *this, struct widget *widget)
{
struct search_list_common *slc;
- dbg(lvl_info,"id %d\n", widget->selection_id);
+ dbg(lvl_info,"id %d", widget->selection_id);
search_list_select(this->sl, attr_country_all, 0, 0);
slc=search_list_select(this->sl, attr_country_all, widget->selection_id, 1);
if (slc) {
diff --git a/navit/gui/internal/gui_internal_widget.c b/navit/gui/internal/gui_internal_widget.c
index 3e1993025..98b690578 100644
--- a/navit/gui/internal/gui_internal_widget.c
+++ b/navit/gui/internal/gui_internal_widget.c
@@ -260,7 +260,7 @@ gui_internal_highlight_do(struct gui_priv *this, struct widget *found)
this->highlighted_menu=g_list_last(this->root.children)->data;
this->highlighted->state |= STATE_HIGHLIGHTED;
gui_internal_widget_render(this, this->highlighted);
- dbg(lvl_debug,"%d,%d %dx%d\n", found->p.x, found->p.y, found->w, found->h);
+ dbg(lvl_debug,"%d,%d %dx%d", found->p.x, found->p.y, found->w, found->h);
}
graphics_draw_mode(this->gra, draw_mode_end);
}
@@ -603,7 +603,7 @@ static void gui_internal_box_pack(struct gui_priv *this, struct widget *w)
w->scroll_buttons->button_box->p.x=w->p.x;
w->scroll_buttons->button_box->p.y=w->p.y+w->h-w->scroll_buttons->button_box->h;
gui_internal_widget_pack(this, w->scroll_buttons->button_box);
- dbg(lvl_debug,"needs buttons %d vs %d\n",y,w->h);
+ dbg(lvl_debug,"needs buttons %d vs %d",y,w->h);
gui_internal_box_pack(this, w);
return;
}
diff --git a/navit/gui/qml/bookmarksProxy.h b/navit/gui/qml/bookmarksProxy.h
index 03cbcbc88..de48898a0 100644
--- a/navit/gui/qml/bookmarksProxy.h
+++ b/navit/gui/qml/bookmarksProxy.h
@@ -72,7 +72,7 @@ public slots:
entries.appendChild(entry);
}
- dbg(lvl_info,"%s\n",retDoc.toString().toLocal8Bit().constData());
+ dbg(lvl_info,"%s",retDoc.toString().toLocal8Bit().constData());
return retDoc.toString();
}
QString AddFolder(QString description) {
@@ -144,7 +144,7 @@ public slots:
if (!item_attr_get(item, attr_label, &attr)) continue;
label=QString::fromLocal8Bit(attr.u.str);
- dbg(lvl_debug,"Bookmark is %s\n",bookmark.toStdString().c_str());
+ dbg(lvl_debug,"Bookmark is %s",bookmark.toStdString().c_str());
if (label.compare(bookmark)) continue;
item_coord_get(item, &c, 1);
if (this->object->currentPoint!=NULL) {
diff --git a/navit/gui/qml/gui_qml.cpp b/navit/gui/qml/gui_qml.cpp
index 3efc719dd..456c5d0be 100644
--- a/navit/gui/qml/gui_qml.cpp
+++ b/navit/gui/qml/gui_qml.cpp
@@ -161,11 +161,11 @@ static void gui_qml_button(void *data, int pressed, int button, struct point *p)
// check whether the position of the mouse changed during press/release OR if it is the scrollwheel
if (!navit_handle_button(this_->nav, pressed, button, p, NULL)) {
- dbg(lvl_debug,"navit has handled button\n");
+ dbg(lvl_debug,"navit has handled button");
return;
}
- dbg(lvl_debug,"enter %d %d\n", pressed, button);
+ dbg(lvl_debug,"enter %d %d", pressed, button);
if (this_->signal_on_map_click) {
gui_qml_dbus_signal(this_, p);
return;
@@ -278,7 +278,7 @@ static int gui_qml_set_graphics(struct gui_priv *this_, struct graphics *gra)
if (xid.length()>0) {
_mainWindow->embedInto(xid.toULong(&ok,0));
}else{
- dbg(lvl_error, "\nFATAL: Environment variable NAVIT_XID not set.\n"
+ dbg(lvl_error, "FATAL: Environment variable NAVIT_XID not set."
" Please set NAVIT_XID to the window ID of the window to embed into.\n");
exit(1);
}
@@ -322,7 +322,7 @@ static int gui_qml_set_graphics(struct gui_priv *this_, struct graphics *gra)
QString mainQml = QString(this_->source)+"/"+this_->skin+"/main.qml";
if (!QFile(mainQml).exists()){
- dbg(lvl_error, "FATAL: QML file %s not found. Navit is not installed correctly.\n", mainQml.toAscii().constData());
+ dbg(lvl_error, "FATAL: QML file %s not found. Navit is not installed correctly.", mainQml.toAscii().constData());
exit(1);
}
this_->guiWidget->setSource(QUrl::fromLocalFile(mainQml));
@@ -380,7 +380,7 @@ gui_qml_set_attr(struct gui_priv *this_, struct attr *attr)
this_->radius=attr->u.num;
return 1;
default:
- dbg(lvl_error,"unknown attr: %s\n",attr_to_name(attr->type));
+ dbg(lvl_error,"unknown attr: %s",attr_to_name(attr->type));
return 1;
}
}
diff --git a/navit/gui/qml/ngqpoint.h b/navit/gui/qml/ngqpoint.h
index 05142e5bf..b1e6312ff 100644
--- a/navit/gui/qml/ngqpoint.h
+++ b/navit/gui/qml/ngqpoint.h
@@ -248,7 +248,7 @@ public slots:
}
map_selection_destroy(sel);
mapset_close(h);
- dbg(lvl_info,"%s\n",retDoc.toString().toLocal8Bit().constData());
+ dbg(lvl_info,"%s",retDoc.toString().toLocal8Bit().constData());
return retDoc.toString();
}
protected:
diff --git a/navit/gui/qml/proxy.h b/navit/gui/qml/proxy.h
index 3243dc8cb..72a696f00 100644
--- a/navit/gui/qml/proxy.h
+++ b/navit/gui/qml/proxy.h
@@ -55,7 +55,7 @@ public slots:
struct attr attr_value;
double *helper;
- dbg(lvl_debug,"Setting %s to %s\n",attr_name.toStdString().c_str(),attr_string.toStdString().c_str());
+ dbg(lvl_debug,"Setting %s to %s",attr_name.toStdString().c_str(),attr_string.toStdString().c_str());
getAttrFunc(attr_from_name(attr_name.toStdString().c_str()), &attr_value, NULL);
if (ATTR_IS_INT(attr_value.type)) {
diff --git a/navit/gui/qml/routeProxy.h b/navit/gui/qml/routeProxy.h
index a2fb4c793..f4c5f9911 100644
--- a/navit/gui/qml/routeProxy.h
+++ b/navit/gui/qml/routeProxy.h
@@ -30,7 +30,7 @@ public slots:
QList<struct attr> destinations=this->_routeDestinations();
for (QList<struct attr>::const_iterator iter=destinations.begin();iter!=destinations.end();iter++) {
NGQPoint helperPoint(this->object,iter->u.pcoord,MapPoint);
- dbg(lvl_debug,"Added destination %s\n",helperPoint.coordString().toLocal8Bit().constData());
+ dbg(lvl_debug,"Added destination %s",helperPoint.coordString().toLocal8Bit().constData());
}
//dbg(lvl_debug,QString::number(_itemId).toStdString().c_str());
diff --git a/navit/gui/qml/searchProxy.h b/navit/gui/qml/searchProxy.h
index 579ac3dac..16f79a2a3 100644
--- a/navit/gui/qml/searchProxy.h
+++ b/navit/gui/qml/searchProxy.h
@@ -33,7 +33,7 @@ public:
item=country_search_get_item(cs);
if (item && item_attr_get(item, attr_country_name, &country_name)) {
search_attr.type=attr_country_all;
- dbg(lvl_debug,"country %s\n", country_name.u.str);
+ dbg(lvl_debug,"country %s", country_name.u.str);
this->country_name=QString::fromLocal8Bit(country_name.u.str);
search_attr.u.str=country_name.u.str;
search_list_search(this->sl, &search_attr, 0);
@@ -44,9 +44,9 @@ public:
}
country_search_destroy(cs);
} else {
- dbg(lvl_error,"warning: no default country found\n");
+ dbg(lvl_error,"warning: no default country found");
if (!this->country_iso2.isEmpty()) {
- dbg(lvl_debug,"attempting to use country '%s'\n",this->country_iso2.toStdString().c_str());
+ dbg(lvl_debug,"attempting to use country '%s'",this->country_iso2.toStdString().c_str());
search_attr.type=attr_country_iso2;
search_attr.u.str=(char*)this->country_iso2.toStdString().c_str();
search_list_search(this->sl, &search_attr, 0);
diff --git a/navit/gui/qt5_qml/backend.cpp b/navit/gui/qt5_qml/backend.cpp
index 395fff425..efbec8cda 100644
--- a/navit/gui/qt5_qml/backend.cpp
+++ b/navit/gui/qt5_qml/backend.cpp
@@ -43,15 +43,15 @@ void Backend::showMenu(struct point *p)
struct coord co;
transform_reverse(navit_get_trans(nav), p, &co);
- dbg(lvl_debug, "Point 0x%x 0x%x\n", co.x, co.y);
- dbg(lvl_debug, "Screen coord : %d %d\n", p->x, p->y);
+ dbg(lvl_debug, "Point 0x%x 0x%x", co.x, co.y);
+ dbg(lvl_debug, "Screen coord : %d %d", p->x, p->y);
transform_to_geo(transform_get_projection(navit_get_trans(nav)), &co, &(this->g));
- dbg(lvl_debug, "%f %f\n", this->g.lat, this->g.lng);
- dbg(lvl_debug, "%p %p\n", nav, &c);
+ dbg(lvl_debug, "%f %f", this->g.lat, this->g.lng);
+ dbg(lvl_debug, "%p %p", nav, &c);
this->c.pro = transform_get_projection(navit_get_trans(nav));
this->c.x = co.x;
this->c.y = co.y;
- dbg(lvl_debug, "c : %x %x\n", this->c.x, this->c.y);
+ dbg(lvl_debug, "c : %x %x", this->c.x, this->c.y);
// As a test, set the Demo vehicle position to wherever we just clicked
navit_set_position(this->nav, &c);
@@ -115,7 +115,7 @@ void Backend::get_vehicles()
vehicle_get_attr(attr.u.vehicle, attr_name, &vattr, NULL);
navit_attr_iter_destroy(iter);
_vehicles.append(new VehicleObject(g_strdup(vattr.u.str), active_vehicle.u.vehicle, attr.u.vehicle));
- dbg(lvl_debug, "done\n");
+ dbg(lvl_debug, "done");
emit vehiclesChanged();
return;
}
@@ -126,7 +126,7 @@ void Backend::get_vehicles()
iter=navit_attr_iter_new();
while(navit_get_attr(this->nav, attr_vehicle, &attr, iter)) {
vehicle_get_attr(attr.u.vehicle, attr_name, &vattr, NULL);
- dbg(lvl_debug, "adding vehicle %s\n", vattr.u.str);
+ dbg(lvl_debug, "adding vehicle %s", vattr.u.str);
_vehicles.append(
new VehicleObject(
g_strdup(vattr.u.str),
@@ -194,11 +194,11 @@ void Backend::get_bookmarks()
bookmarks_item_rewind(mattr.u.bookmarks);
while ((item=bookmarks_get_item(mattr.u.bookmarks))) {
if (!item_attr_get(item, attr_label, &attr)) continue;
- dbg(lvl_debug,"full_label: %s\n", attr.u.str);
+ dbg(lvl_debug,"full_label: %s", attr.u.str);
if (item_coord_get(item, &c, 1)) {
pc.x = c.x;
pc.y = c.y;
- dbg(lvl_debug, "coords : %i x %i\n", pc.x, pc.y);
+ dbg(lvl_debug, "coords : %i x %i", pc.x, pc.y);
_bookmarks.append(new BookmarkObject(attr.u.str, pc));
}
}
@@ -227,13 +227,13 @@ void Backend::get_pois()
center.x = this->c.x;
center.y = this->c.y;
- dbg(lvl_debug, "center is at %x, %x\n", center.x, center.y);
+ dbg(lvl_debug, "center is at %x, %x", center.x, center.y);
h = mapset_open(navit_get_mapset(this->nav));
while ((m = mapset_next(h, 1))) {
selm = map_selection_dup_pro(sel, pro, map_projection(m));
mr = map_rect_new(m, selm);
- dbg(lvl_debug, "mr=%p\n", mr);
+ dbg(lvl_debug, "mr=%p", mr);
if (mr) {
while ((item = map_rect_get_item(mr))) {
if ( filter_pois(item) &&
@@ -319,8 +319,8 @@ QQmlListProperty<QObject> Backend::getSearchResults(){
* @returns the active POI
*/
PoiObject * Backend::activePoi() {
- dbg(lvl_debug, "name : %s\n", m_activePoi->name().toUtf8().data());
- dbg(lvl_debug, "type : %s\n", m_activePoi->type().toLatin1().data());
+ dbg(lvl_debug, "name : %s", m_activePoi->name().toUtf8().data());
+ dbg(lvl_debug, "type : %s", m_activePoi->type().toLatin1().data());
return m_activePoi;
}
@@ -340,12 +340,12 @@ BookmarkObject * Backend::currentBookmark() {
*/
VehicleObject * Backend::currentVehicle() {
struct attr attr;
- dbg(lvl_debug, "name : %s\n", m_currentVehicle->name().toUtf8().data());
+ dbg(lvl_debug, "name : %s", m_currentVehicle->name().toUtf8().data());
if (m_currentVehicle->vehicle()) {
if (vehicle_get_attr(m_currentVehicle->vehicle(), attr_position_nmea, &attr, NULL))
- dbg(lvl_debug, "NMEA : %s\n", attr.u.str);
+ dbg(lvl_debug, "NMEA : %s", attr.u.str);
} else {
- dbg(lvl_debug, "m_currentVehicle->v is null\n");
+ dbg(lvl_debug, "m_currentVehicle->v is null");
}
return m_currentVehicle;
@@ -354,7 +354,7 @@ VehicleObject * Backend::currentVehicle() {
void Backend::block_draw(){
navit_block(this->nav, 1);
- dbg(lvl_debug, "Draw operations blocked per UI request\n");
+ dbg(lvl_debug, "Draw operations blocked per UI request");
}
/**
@@ -425,7 +425,7 @@ QString Backend::get_icon_path(){
void Backend::setActivePoiAsDestination(){
struct pcoord c;
c = m_activePoi->coords();
- dbg(lvl_debug, "Destination : %s c=%d:0x%x,0x%x\n",
+ dbg(lvl_debug, "Destination : %s c=%d:0x%x,0x%x",
m_activePoi->name().toUtf8().data(),
c.pro, c.x, c.y);
navit_set_destination(this->nav, &c, m_activePoi->name().toUtf8().data(), 1);
@@ -439,9 +439,9 @@ void Backend::setActivePoiAsDestination(){
*/
void Backend::searchValidateResult(int index){
SearchObject * r = (SearchObject *)_search_results.at(index);
- dbg(lvl_debug, "Saving %s [%i] as search result\n", r->name().toUtf8().data(), index);
+ dbg(lvl_debug, "Saving %s [%i] as search result", r->name().toUtf8().data(), index);
if (r->getCoords()){
- dbg(lvl_debug, "Item is at %x x %x\n", r->getCoords()->x, r->getCoords()->y);
+ dbg(lvl_debug, "Item is at %x x %x", r->getCoords()->x, r->getCoords()->y);
}
if (_search_context == attr_country_all) {
_current_country = g_strdup(r->name().toUtf8().data());
@@ -453,7 +453,7 @@ void Backend::searchValidateResult(int index){
} else if (_search_context == attr_street_name) {
_current_street = g_strdup(r->name().toUtf8().data());
} else {
- dbg(lvl_error, "Unknown search context for '%s'\n", r->name().toUtf8().data());
+ dbg(lvl_error, "Unknown search context for '%s'", r->name().toUtf8().data());
}
// navit_set_center(this->nav, r->getCoords(), 1);
emit displayMenu("destination_address.qml");
@@ -504,12 +504,12 @@ void Backend::updateSearch(QString text){
if (search == NULL){
search=&search_param;
- dbg(lvl_debug, "search = %p\n", search);
+ dbg(lvl_debug, "search = %p", search);
search->nav=this->nav;
search->ms=navit_get_mapset(this->nav);
search->sl=search_list_new(search->ms);
search->partial = 1;
- dbg(lvl_debug,"attempting to use country '%s'\n", _country_iso2);
+ dbg(lvl_debug,"attempting to use country '%s'", _country_iso2);
search_attr.type=attr_country_iso2;
search_attr.u.str=_country_iso2;
search_list_search(search->sl, &search_attr, 0);
@@ -529,7 +529,7 @@ void Backend::updateSearch(QString text){
// while((res=search_list_get_result(search->sl)));
search->attr.u.str = text.toUtf8().data();
- dbg(lvl_error, "searching for %s partial %d\n", search->attr.u.str, search->partial);
+ dbg(lvl_error, "searching for %s partial %d", search->attr.u.str, search->partial);
search->attr.type = _search_context;
search_list_search(search->sl, &search->attr, search->partial);
@@ -571,18 +571,18 @@ void Backend::setSearchContext(QString text){
} else if (text == "street") {
_search_context = attr_street_name;
} else {
- dbg(lvl_error, "Unhandled search context '%s'\n", text.toUtf8().data());
+ dbg(lvl_error, "Unhandled search context '%s'", text.toUtf8().data());
}
}
QString Backend::currentCountry() {
- dbg(lvl_debug, "Current country : %s/%s\n", _country_iso2, _current_country);
+ dbg(lvl_debug, "Current country : %s/%s", _country_iso2, _current_country);
return QString(_current_country);
}
QString Backend::currentCountryIso2() {
- dbg(lvl_debug, "Current country : %s/%s\n", _country_iso2, _current_country);
+ dbg(lvl_debug, "Current country : %s/%s", _country_iso2, _current_country);
return QString(_country_iso2);
}
@@ -590,7 +590,7 @@ QString Backend::currentTown() {
if (_current_town == NULL) {
_current_town = "Enter City";
}
- dbg(lvl_debug, "Current town : %s\n", _current_town);
+ dbg(lvl_debug, "Current town : %s", _current_town);
return QString(_current_town);
}
@@ -598,6 +598,6 @@ QString Backend::currentStreet() {
if (_current_street == NULL) {
_current_street = "Enter Street";
}
- dbg(lvl_debug, "Current street : %s\n", _current_street);
+ dbg(lvl_debug, "Current street : %s", _current_street);
return QString(_current_street);
}
diff --git a/navit/gui/qt5_qml/gui_qt5_qml.cpp b/navit/gui/qt5_qml/gui_qt5_qml.cpp
index 1b4062d33..bd9b8a306 100644
--- a/navit/gui/qt5_qml/gui_qt5_qml.cpp
+++ b/navit/gui/qt5_qml/gui_qt5_qml.cpp
@@ -102,14 +102,14 @@ gui_qt5_qml_button(void* data, int pressed, int button, struct point* p)
/* check if navit wants to handle this */
if (!navit_handle_button(gui_priv->nav, pressed, button, p, NULL)) {
- dbg(lvl_debug, "navit has handled button\n");
+ dbg(lvl_debug, "navit has handled button");
return;
}
- dbg(lvl_debug, "enter %d %d\n", pressed, button);
+ dbg(lvl_debug, "enter %d %d", pressed, button);
/* check if user requested menu */
if (button == 1 && gui_priv->menu_on_map_click) {
- dbg(lvl_debug, "navit wants us to enter menu\n");
+ dbg(lvl_debug, "navit wants us to enter menu");
/*TODO: want to emit a signal somewhere? */
gui_priv->backend->showMenu(p);
}
@@ -119,7 +119,7 @@ static void
gui_qt5_qml_motion(void* data, struct point* p)
{
struct gui_priv* gui_priv = (struct gui_priv*)data;
- dbg(lvl_debug, "enter (%d, %d)\n", p->x, p->y);
+ dbg(lvl_debug, "enter (%d, %d)", p->x, p->y);
/* forward this to navit */
navit_handle_motion(gui_priv->nav, p);
}
@@ -128,7 +128,7 @@ static void
gui_qt5_qml_resize(void* data, int w, int h)
{
struct gui_priv* gui_priv = (struct gui_priv*)data;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
/* forward this to navit */
navit_handle_resize(gui_priv->nav, w, h);
}
@@ -142,7 +142,7 @@ gui_qml_keypress(void* data, char* key)
transform_get_size(navit_get_trans(this_->nav), &w, &h);
switch (*key) {
case NAVIT_KEY_UP:
- dbg(lvl_debug, "got KEY_UP\n");
+ dbg(lvl_debug, "got KEY_UP");
p.x = w / 2;
p.y = 0;
navit_set_center_screen(this_->nav, &p, 1);
@@ -163,7 +163,7 @@ gui_qml_keypress(void* data, char* key)
navit_set_center_screen(this_->nav, &p, 1);
break;
case NAVIT_KEY_ZOOM_IN:
- dbg(lvl_debug, "got ZOOM_IN\n");
+ dbg(lvl_debug, "got ZOOM_IN");
navit_zoom_in(this_->nav, 2, NULL);
break;
case NAVIT_KEY_ZOOM_OUT:
@@ -183,7 +183,7 @@ static int
gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra)
{
struct transformation* trans;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
/* get navit transition */
trans = navit_get_trans(gui_priv->nav);
@@ -212,14 +212,14 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra)
/* get main navit window */
gui_priv->win = (struct window*)graphics_get_data(gra, "window");
if (!gui_priv->win) {
- dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics\n");
+ dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics");
return 1;
}
/* expect to have qt5 graphics. So get the qml engine prepared by graphics */
gui_priv->engine = (QQmlApplicationEngine*)graphics_get_data(gra, "engine");
if (gui_priv->engine == NULL) {
- dbg(lvl_error, "Graphics doesn't seem to be qt5, or doesn't have QML. Cannot set graphics\n");
+ dbg(lvl_error, "Graphics doesn't seem to be qt5, or doesn't have QML. Cannot set graphics");
return 1;
}
@@ -233,13 +233,13 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra)
/* find the loader component */
gui_priv->loader = gui_priv->engine->rootObjects().value(0)->findChild<QObject*>("navit_loader");
if (gui_priv->loader != NULL) {
- dbg(lvl_debug, "navit_loader found\n");
+ dbg(lvl_debug, "navit_loader found");
/* load our root window into the loader component */
gui_priv->loader->setProperty("source", "qrc:///skins/modern/main.qml");
}
transform_get_size(trans, &gui_priv->w, &gui_priv->h);
- dbg(lvl_debug, "navit provided geometry: (%d, %d)\n", gui_priv->w, gui_priv->h);
+ dbg(lvl_debug, "navit provided geometry: (%d, %d)", gui_priv->w, gui_priv->h);
/* Was resize callback already issued? */
// if (navit_get_ready(gui_priv->nav) & 2)
@@ -254,14 +254,14 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra)
static int
gui_qt5_qml_get_attr(struct gui_priv* gui_priv, enum attr_type type, struct attr* attr)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return 1;
}
static int
gui_qt5_qml_set_attr(struct gui_priv* gui_priv, struct attr* attr)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return 1;
}
@@ -284,7 +284,7 @@ gui_qt5_qml_new(struct navit* nav, struct gui_methods* meth, struct attr** attrs
struct gui_priv* gui_priv;
struct attr* attr;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
/* tell navit our methods */
*meth = gui_qt5_qml_methods;
diff --git a/navit/gui/win32/gui_win32.c b/navit/gui/win32/gui_win32.c
index 8a8cb37b9..7c964dbb9 100644
--- a/navit/gui/win32/gui_win32.c
+++ b/navit/gui/win32/gui_win32.c
@@ -185,7 +185,7 @@ static void window_layout( HWND hwnd )
rcClient.top += iToolHeight;
- dbg(lvl_debug, "resize gui to: %d %d %d %d \n", rcClient.left, rcClient.right, rcClient.top, rcClient.bottom );
+ dbg(lvl_debug, "resize gui to: %d %d %d %d ", rcClient.left, rcClient.right, rcClient.top, rcClient.bottom );
hChild = GetDlgItem(hwnd, ID_CHILD_GFX);
@@ -285,7 +285,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
attr.type=attr_cursor;
// TODO attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_cursor\n");
+ dbg(lvl_error, "Failed to set attr_cursor");
}
return 0;
}
@@ -298,7 +298,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
// attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
attr.u.num = 0; // TODO
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_orientation\n");
+ dbg(lvl_error, "Failed to set attr_orientation");
}
return 0;
}
diff --git a/navit/gui/win32/win32_gui_destination.c b/navit/gui/win32/win32_gui_destination.c
index 115b9058b..e4a08072f 100644
--- a/navit/gui/win32/win32_gui_destination.c
+++ b/navit/gui/win32/win32_gui_destination.c
@@ -212,7 +212,7 @@ static void notify_textchange(struct datawindow_priv *datawindow, int param1, in
(void)ListView_InsertItem(datawindow->hwndList, &lvI);
ListView_SetItemText(datawindow->hwndList, listIndex, 1, tcharBuffer);
g_free(tcharBuffer);
- dbg(lvl_debug,"%s\n", res->country->name);
+ dbg(lvl_debug,"%s", res->country->name);
listIndex++;
}
}
@@ -307,7 +307,7 @@ BOOL register_destination_window()
if (!RegisterClass(&wc))
{
- dbg(lvl_error, "Window Registration Failed!\n");
+ dbg(lvl_error, "Window Registration Failed!");
return FALSE;
}
return TRUE;
@@ -339,7 +339,7 @@ HANDLE create_destination_window( struct navit *nav )
if (this_->hwnd == NULL)
{
- dbg(lvl_error, "Window Creation Failed!\n");
+ dbg(lvl_error, "Window Creation Failed!");
return 0;
}
diff --git a/navit/item.c b/navit/item.c
index 2e00ea1fa..5f58a169e 100644
--- a/navit/item.c
+++ b/navit/item.c
@@ -488,7 +488,7 @@ item_hash_insert(struct item_hash *h, struct item *item, void *val)
{
struct item *hitem=g_new(struct item, 1);
*hitem=*item;
- dbg(lvl_info,"inserting (0x%x,0x%x) into %p\n", item->id_hi, item->id_lo, h->h);
+ dbg(lvl_info,"inserting (0x%x,0x%x) into %p", item->id_hi, item->id_lo, h->h);
g_hash_table_insert(h->h, hitem, val);
}
@@ -497,9 +497,9 @@ item_hash_remove(struct item_hash *h, struct item *item)
{
int ret;
- dbg(lvl_info,"removing (0x%x,0x%x) from %p\n", item->id_hi, item->id_lo, h->h);
+ dbg(lvl_info,"removing (0x%x,0x%x) from %p", item->id_hi, item->id_lo, h->h);
ret=g_hash_table_remove(h->h, item);
- dbg(lvl_info,"ret=%d\n", ret);
+ dbg(lvl_info,"ret=%d", ret);
return ret;
}
diff --git a/navit/layout.c b/navit/layout.c
index c78e7c79d..8a05096a3 100644
--- a/navit/layout.c
+++ b/navit/layout.c
@@ -202,7 +202,7 @@ cursor_new(struct attr *parent, struct attr **attrs)
else {
this->sequence_range=NULL;
}
- dbg(lvl_info,"ret=%p\n", this);
+ dbg(lvl_info,"ret=%p", this);
return this;
}
@@ -252,7 +252,7 @@ layer_set_attr_do(struct layer *l, struct attr *attr, int init)
l->ref=NULL;
obj=(struct navit_object *)l->navit;
if (obj==NULL){
- dbg(lvl_error, "Invalid layer reference '%s': Only layers inside a layout can use references.\n", attr->u.str);
+ dbg(lvl_error, "Invalid layer reference '%s': Only layers inside a layout can use references.", attr->u.str);
return 0;
}
iter=obj->func->iter_new(obj);
@@ -263,7 +263,7 @@ layer_set_attr_do(struct layer *l, struct attr *attr, int init)
}
}
if (l->ref==NULL){
- dbg(lvl_error, "Ignoring reference to unknown layer '%s' in layer '%s'.\n", attr->u.str, l->name);
+ dbg(lvl_error, "Ignoring reference to unknown layer '%s' in layer '%s'.", attr->u.str, l->name);
}
obj->func->iter_destroy(iter);
default:
@@ -287,7 +287,7 @@ struct layer * layer_new(struct attr *parent, struct attr **attrs)
layer_set_attr_do(l, *attrs, 1);
}
if (l->name==NULL){
- dbg(lvl_error, "Ignoring layer without name.\n");
+ dbg(lvl_error, "Ignoring layer without name.");
g_free(l);
return NULL;
}
@@ -397,7 +397,7 @@ itemgra_add_attr(struct itemgra *itemgra, struct attr *attr)
itemgra->elements = g_list_append(itemgra->elements, attr->u.element);
return 1;
default:
- dbg(lvl_error,"unknown: %s\n", attr_to_name(attr->type));
+ dbg(lvl_error,"unknown: %s", attr_to_name(attr->type));
return 0;
}
}
diff --git a/navit/linguistics.c b/navit/linguistics.c
index 82513b016..43c75cb77 100644
--- a/navit/linguistics.c
+++ b/navit/linguistics.c
@@ -317,7 +317,7 @@ linguistics_casefold(const char *in)
}
*dest=0;
if(*src)
- dbg(lvl_error,"Casefolded string for '%s' needs extra space, result is truncated to '%s'.\n",in,ret);
+ dbg(lvl_error,"Casefolded string for '%s' needs extra space, result is truncated to '%s'.",in,ret);
return ret;
}
@@ -423,7 +423,7 @@ linguistics_expand_special(const char *str, int mode)
out=new_ret+(out-ret);
ret=new_ret;
}
- dbg(lvl_debug,"found %s %s %d %s %d\n",in,spc[0],len,replace,replace_len);
+ dbg(lvl_debug,"found %s %s %d %s %d",in,spc[0],len,replace,replace_len);
strcpy(out, replace);
out+=replace_len;
match=1;
diff --git a/navit/log.c b/navit/log.c
index 2bca13425..5daca2eeb 100644
--- a/navit/log.c
+++ b/navit/log.c
@@ -349,7 +349,7 @@ log_timer(struct log *this_)
int delta;
gettimeofday(&tv, NULL);
delta=(tv.tv_sec-this_->last_flush.tv_sec)*1000+(tv.tv_usec-this_->last_flush.tv_usec)/1000;
- dbg(lvl_debug,"delta=%d flush_time=%d\n", delta, this_->flush_time);
+ dbg(lvl_debug,"delta=%d flush_time=%d", delta, this_->flush_time);
if (this_->flush_time && delta >= this_->flush_time*1000)
log_flush(this_,0);
#endif
@@ -386,7 +386,7 @@ log_new(struct attr * parent,struct attr **attrs)
struct file_wordexp *wexp;
char *filename, **wexp_data;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret->func=&log_func;
navit_object_ref((struct navit_object *)ret);
data=attr_search(attrs, NULL, attr_data);
@@ -418,7 +418,7 @@ log_new(struct attr * parent,struct attr **attrs)
if (flush_time)
ret->flush_time=flush_time->u.num;
if (ret->flush_time) {
- dbg(lvl_debug,"interval %d\n", ret->flush_time*1000);
+ dbg(lvl_debug,"interval %d", ret->flush_time*1000);
ret->timer_callback=callback_new_1(callback_cast(log_timer), ret);
ret->timer=event_add_timeout(ret->flush_time*1000, 1, ret->timer_callback);
}
@@ -492,7 +492,7 @@ log_set_trailer(struct log *this_, char *data, int len)
void
log_write(struct log *this_, char *data, int len, enum log_flags flags)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (log_change_required(this_)) {
dbg(lvl_debug,"log_change");
log_change(this_);
@@ -500,7 +500,7 @@ log_write(struct log *this_, char *data, int len, enum log_flags flags)
if (flags & log_flag_replace_buffer)
this_->data.len=0;
if (this_->data.len + len > this_->data.max_len) {
- dbg(lvl_info,"overflow\n");
+ dbg(lvl_info,"overflow");
this_->data.max_len+=16384; // FIXME: what if len exceeds this->data.max_len by more than 16384 bytes?
this_->data.data=g_realloc(this_->data.data,this_->data.max_len);
}
@@ -561,7 +561,7 @@ log_printf(struct log *this_, char *fmt, ...)
void
log_destroy(struct log *this_)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
attr_list_free(this_->attrs);
callback_destroy(this_->timer_callback);
event_remove_timeout(this_->timer);
diff --git a/navit/main.c b/navit/main.c
index 25dcb5267..322a5d886 100644
--- a/navit/main.c
+++ b/navit/main.c
@@ -315,13 +315,13 @@ win_set_nls(void)
#endif
while (nls_table[i][0]) {
if (!strcmp(nls_table[i][0], lang) && !(strcmp(nls_table[i][1], country))) {
- dbg(lvl_info,"Setting LANG=%s for Lang %s Country %s\n",nls_table[i][2], lang, country);
+ dbg(lvl_info,"Setting LANG=%s for Lang %s Country %s",nls_table[i][2], lang, country);
setenv("LANG",nls_table[i][2],0);
return;
}
i++;
}
- dbg(lvl_error,"Lang %s Country %s not found\n",lang,country);
+ dbg(lvl_error,"Lang %s Country %s not found",lang,country);
}
#endif
diff --git a/navit/map.c b/navit/map.c
index 2736da9f8..c1629e42a 100644
--- a/navit/map.c
+++ b/navit/map.c
@@ -96,12 +96,12 @@ map_new(struct attr *parent, struct attr **attrs)
struct attr *type=attr_search(attrs, NULL, attr_type);
if (! type) {
- dbg(lvl_error,"missing type\n");
+ dbg(lvl_error,"missing type");
return NULL;
}
maptype_new=plugin_get_category_map(type->u.str);
if (! maptype_new) {
- dbg(lvl_error,"invalid type '%s'\n", type->u.str);
+ dbg(lvl_error,"invalid type '%s'", type->u.str);
return NULL;
}
@@ -227,7 +227,7 @@ map_convert_string_tmp(struct map *this_, char *str)
return str;
map_converted_string_tmp=g_convert(str, -1, "utf-8", this_->meth.charset, NULL, NULL, NULL);
if(!map_converted_string_tmp) {
- dbg(lvl_error,"Error converting '%s' from %s to utf-8\n", str, this_->meth.charset);
+ dbg(lvl_error,"Error converting '%s' from %s to utf-8", str, this_->meth.charset);
return str;
}
return map_converted_string_tmp;
@@ -442,8 +442,8 @@ struct map_search *
map_search_new(struct map *m, struct item *item, struct attr *search_attr, int partial)
{
struct map_search *this_;
- dbg(lvl_debug,"enter(%p,%p,%p,%d)\n", m, item, search_attr, partial);
- dbg(lvl_debug,"0x%x 0x%x 0x%x\n", attr_country_all, search_attr->type, attr_country_name);
+ dbg(lvl_debug,"enter(%p,%p,%p,%d)", m, item, search_attr, partial);
+ dbg(lvl_debug,"0x%x 0x%x 0x%x", attr_country_all, search_attr->type, attr_country_name);
this_=g_new0(struct map_search,1);
this_->m=m;
this_->search_attr=*search_attr;
@@ -712,7 +712,7 @@ map_dump_file(struct map *map, const char *file)
map_dump_filedesc(map, f);
fclose(f);
} else
- dbg(lvl_error,"failed to open file '%s'\n",file);
+ dbg(lvl_error,"failed to open file '%s'",file);
}
void
diff --git a/navit/map/binfile/binfile.c b/navit/map/binfile/binfile.c
index 93cbbd466..cd6fec8dc 100644
--- a/navit/map/binfile/binfile.c
+++ b/navit/map/binfile/binfile.c
@@ -240,9 +240,9 @@ binfile_read_eoc(struct file *fi)
eoc=(struct zip_eoc *)file_data_read(fi,fi->size-sizeof(struct zip_eoc), sizeof(struct zip_eoc));
if (eoc) {
eoc_to_cpu(eoc);
- dbg(lvl_debug,"sig 0x%x\n", eoc->zipesig);
+ dbg(lvl_debug,"sig 0x%x", eoc->zipesig);
if (eoc->zipesig != zip_eoc_sig) {
- dbg(lvl_error,"map file %s: eoc signature check failed: 0x%x vs 0x%x\n", fi->name, eoc->zipesig,zip_eoc_sig);
+ dbg(lvl_error,"map file %s: eoc signature check failed: 0x%x vs 0x%x", fi->name, eoc->zipesig,zip_eoc_sig);
file_data_free(fi,(unsigned char *)eoc);
eoc=NULL;
}
@@ -258,20 +258,20 @@ binfile_read_eoc64(struct file *fi)
eocl=(struct zip64_eocl *)file_data_read(fi,fi->size-sizeof(struct zip_eoc)-sizeof(struct zip64_eocl), sizeof(struct zip64_eocl));
if (!eocl)
return NULL;
- dbg(lvl_debug,"sig 0x%x\n", eocl->zip64lsig);
+ dbg(lvl_debug,"sig 0x%x", eocl->zip64lsig);
if (eocl->zip64lsig != zip64_eocl_sig) {
file_data_free(fi,(unsigned char *)eocl);
- dbg(lvl_warning,"map file %s: eocl wrong\n", fi->name);
+ dbg(lvl_warning,"map file %s: eocl wrong", fi->name);
return NULL;
}
eoc=(struct zip64_eoc *)file_data_read(fi,eocl->zip64lofst, sizeof(struct zip64_eoc));
if (eoc) {
if (eoc->zip64esig != zip64_eoc_sig) {
file_data_free(fi,(unsigned char *)eoc);
- dbg(lvl_warning,"map file %s: eoc wrong\n", fi->name);
+ dbg(lvl_warning,"map file %s: eoc wrong", fi->name);
eoc=NULL;
}
- dbg(lvl_debug,"eoc64 ok 0x"LONGLONG_HEX_FMT " 0x"LONGLONG_HEX_FMT "\n",eoc->zip64eofst,eoc->zip64ecsz);
+ dbg(lvl_debug,"eoc64 ok 0x"LONGLONG_HEX_FMT " 0x"LONGLONG_HEX_FMT "",eoc->zip64eofst,eoc->zip64ecsz);
}
file_data_free(fi,(unsigned char *)eocl);
return eoc;
@@ -296,9 +296,9 @@ binfile_read_cd(struct map_priv *m, int offset, int len)
}
cd=(struct zip_cd *)file_data_read(m->fi,cdoffset+offset, sizeof(*cd)+len);
if (cd) {
- dbg(lvl_debug,"cd at "LONGLONG_FMT" %zu bytes\n",cdoffset+offset, sizeof(*cd)+len);
+ dbg(lvl_debug,"cd at "LONGLONG_FMT" %zu bytes",cdoffset+offset, sizeof(*cd)+len);
cd_to_cpu(cd);
- dbg(lvl_debug,"sig 0x%x\n", cd->zipcensig);
+ dbg(lvl_debug,"sig 0x%x", cd->zipcensig);
if (cd->zipcensig != zip_cd_sig) {
file_data_free(m->fi,(unsigned char *)cd);
cd=NULL;
@@ -375,7 +375,7 @@ binfile_read_content(struct map_priv *m, struct file *fi, long long offset, stru
ret=file_data_read_compressed(fi,offset, lfh->zipsize, lfh->zipuncmp);
break;
default:
- dbg(lvl_error,"map file %s: unknown compression method %d\n", fi->name, lfh->zipmthd);
+ dbg(lvl_error,"map file %s: unknown compression method %d", fi->name, lfh->zipmthd);
}
return ret;
}
@@ -389,7 +389,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
long long cdoffset=m->eoc64?m->eoc64->zip64eofst:m->eoc->zipeofst;
struct zip_cd *cd;
#if 0
- dbg(lvl_debug,"end=%d\n",end);
+ dbg(lvl_debug,"end=%d",end);
#endif
while (offset < end) {
cd=(struct zip_cd *)(m->search_data+offset-m->search_offset);
@@ -399,7 +399,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
offset-m->search_offset+sizeof(*cd)+cd->zipcfnl+cd->zipcxtl > m->search_size
) {
#if 0
- dbg(lvl_debug,"reload %p %d %d\n", m->search_data, m->search_offset, offset);
+ dbg(lvl_debug,"reload %p %d %d", m->search_data, m->search_offset, offset);
#endif
if (m->search_data)
file_data_free(m->fi,m->search_data);
@@ -411,8 +411,8 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
cd=(struct zip_cd *)m->search_data;
}
#if 0
- dbg(lvl_debug,"offset=%d search_offset=%d search_size=%d search_data=%p cd=%p\n", offset, m->search_offset, m->search_size, m->search_data, cd);
- dbg(lvl_debug,"offset=%d fn='%s'\n",offset,cd->zipcfn);
+ dbg(lvl_debug,"offset=%d search_offset=%d search_size=%d search_data=%p cd=%p", offset, m->search_offset, m->search_size, m->search_data, cd);
+ dbg(lvl_debug,"offset=%d fn='%s'",offset,cd->zipcfn);
#endif
if (!skip &&
(partial || cd->zipcfnl == len) &&
@@ -428,7 +428,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
static void
map_destroy_binfile(struct map_priv *m)
{
- dbg(lvl_debug,"map_destroy_binfile\n");
+ dbg(lvl_debug,"map_destroy_binfile");
if (m->fi)
map_binfile_close(m);
map_binfile_destroy(m);
@@ -523,7 +523,7 @@ binfile_extract(struct map_priv *m, char *dir, char *filename, int partial)
if (full[len-2] != '/') {
lfh=binfile_read_lfh(m->fi, binfile_cd_offset(cd));
start=binfile_read_content(m, m->fi, binfile_cd_offset(cd), lfh);
- dbg(lvl_debug,"fopen '%s'\n", full);
+ dbg(lvl_debug,"fopen '%s'", full);
f=fopen(full,"w");
fwrite(start, lfh->zipuncmp, 1, f);
fclose(f);
@@ -569,7 +569,7 @@ binfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
mr->label_attr[4]=t->pos_attr;
if (type == attr_type || attr_type == attr_any) {
if (attr_type == attr_any) {
- dbg(lvl_debug,"pos %p attr %s size %d\n", t->pos_attr-1, attr_to_name(type), size);
+ dbg(lvl_debug,"pos %p attr %s size %d", t->pos_attr-1, attr_to_name(type), size);
}
attr->type=type;
if (ATTR_IS_GROUP(type)) {
@@ -647,13 +647,13 @@ binfile_item_dup(struct map_priv *m, struct item *item, struct tile *t, int exte
entry->id.id_hi=item->id_hi;
entry->id.id_lo=item->id_lo;
entry->flags=1;
- dbg(lvl_debug,"id 0x%x,0x%x\n",entry->id.id_hi,entry->id.id_lo);
+ dbg(lvl_debug,"id 0x%x,0x%x",entry->id.id_hi,entry->id.id_lo);
memcpy(ret, t->pos, (size+1)*sizeof(int));
if (!m->changes)
m->changes=g_hash_table_new_full(binfile_hash_entry_hash, binfile_hash_entry_equal, g_free, NULL);
g_hash_table_replace(m->changes, entry, entry);
- dbg(lvl_debug,"ret %p\n",ret);
+ dbg(lvl_debug,"ret %p",ret);
return ret;
}
@@ -668,15 +668,15 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
{
int *i=t->pos,j=0;
- dbg(lvl_debug,"Before: pos_coord=%td\n",t->pos_coord-i);
+ dbg(lvl_debug,"Before: pos_coord=%td",t->pos_coord-i);
while (i < t->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
aoffset=t->pos_attr-t->pos_attr_start;
coffset=t->pos_coord-t->pos_coord_start-2;
clen=t->pos_attr_start-t->pos_coord+2;
- dbg(lvl_debug,"coffset=%d clen=%d\n",coffset,clen);
+ dbg(lvl_debug,"coffset=%d clen=%d",coffset,clen);
switch (mode) {
case change_mode_delete:
if (count*2 > clen)
@@ -713,7 +713,7 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
default:
return 0;
}
- dbg(lvl_debug,"delta %d\n",delta);
+ dbg(lvl_debug,"delta %d",delta);
data=binfile_item_dup(mr->m, &mr->item, t, delta > 0 ? delta:0);
data[0]=cpu_to_le32(le32_to_cpu(data[0])+delta);
data[2]=cpu_to_le32(le32_to_cpu(data[2])+delta);
@@ -725,18 +725,18 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
tn=mr->t;
tn->pos_coord=tn->pos_coord_start+coffset;
tn->pos_attr=tn->pos_attr_start+aoffset;
- dbg(lvl_debug,"moving %d ints from offset %td to %td\n",move_len,tn->pos_coord_start+move_offset-data,tn->pos_coord_start+move_offset+delta-data);
+ dbg(lvl_debug,"moving %d ints from offset %td to %td",move_len,tn->pos_coord_start+move_offset-data,tn->pos_coord_start+move_offset+delta-data);
memmove(tn->pos_coord_start+move_offset+delta, tn->pos_coord_start+move_offset, move_len*4);
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After move: pos_coord=%td\n",tn->pos_coord-i);
+ dbg(lvl_debug,"After move: pos_coord=%td",tn->pos_coord-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
if (mode != change_mode_append)
tn->pos_coord+=move_offset;
if (mode != change_mode_delete) {
- dbg(lvl_debug,"writing %d ints at offset %td\n",count*2,write_offset+tn->pos_coord_start-data);
+ dbg(lvl_debug,"writing %d ints at offset %td",count*2,write_offset+tn->pos_coord_start-data);
for (i = 0 ; i < count ; i++) {
tn->pos_coord_start[write_offset++]=c[i].x;
tn->pos_coord_start[write_offset++]=c[i].y;
@@ -745,9 +745,9 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
}
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After: pos_coord=%td\n",tn->pos_coord-i);
+ dbg(lvl_debug,"After: pos_coord=%td",tn->pos_coord-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
return 1;
}
@@ -764,9 +764,9 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
{
int *i=t->pos,j=0;
- dbg(lvl_debug,"Before: pos_attr=%td\n",t->pos_attr-i);
+ dbg(lvl_debug,"Before: pos_attr=%td",t->pos_attr-i);
while (i < t->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
@@ -777,7 +777,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
oattr_len=0;
if (!naoffset) {
if (mode == change_mode_delete || mode == change_mode_modify) {
- dbg(lvl_error,"no attribute selected\n");
+ dbg(lvl_error,"no attribute selected");
return 0;
}
if (mode == change_mode_append)
@@ -785,7 +785,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
}
while (offset < naoffset) {
oattr_len=le32_to_cpu(t->pos_attr_start[offset])+1;
- dbg(lvl_debug,"len %d\n",oattr_len);
+ dbg(lvl_debug,"len %d",oattr_len);
write_offset=offset;
offset+=oattr_len;
}
@@ -818,7 +818,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
delta=nattr_len-oattr_len;
else
delta=nattr_len;
- dbg(lvl_debug,"delta %d oattr_len %d nattr_len %d\n",delta,oattr_len, nattr_len);
+ dbg(lvl_debug,"delta %d oattr_len %d nattr_len %d",delta,oattr_len, nattr_len);
data=binfile_item_dup(mr->m, &mr->item, t, delta > 0 ? delta:0);
data[0]=cpu_to_le32(le32_to_cpu(data[0])+delta);
new.pos=new.start=data;
@@ -829,20 +829,20 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
tn=mr->t;
tn->pos_coord=tn->pos_coord_start+coffset;
tn->pos_attr=tn->pos_attr_start+offset;
- dbg(lvl_debug,"attr start %td offset %d\n",tn->pos_attr_start-data,offset);
- dbg(lvl_debug,"moving %d ints from offset %td to %td\n",move_len,tn->pos_attr_start+move_offset-data,tn->pos_attr_start+move_offset+delta-data);
+ dbg(lvl_debug,"attr start %td offset %d",tn->pos_attr_start-data,offset);
+ dbg(lvl_debug,"moving %d ints from offset %td to %td",move_len,tn->pos_attr_start+move_offset-data,tn->pos_attr_start+move_offset+delta-data);
memmove(tn->pos_attr_start+move_offset+delta, tn->pos_attr_start+move_offset, move_len*4);
if (mode != change_mode_append)
tn->pos_attr+=delta;
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After move: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After move: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
if (nattr_len) {
int *nattr=tn->pos_attr_start+write_offset;
- dbg(lvl_debug,"writing %d ints at %td\n",nattr_len,nattr-data);
+ dbg(lvl_debug,"writing %d ints at %td",nattr_len,nattr-data);
nattr[0]=cpu_to_le32(nattr_len-1);
nattr[1]=cpu_to_le32(attr->type);
memcpy(nattr+2, attr_data_get(attr), nattr_size);
@@ -850,11 +850,11 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
}
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"After: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
return 1;
}
@@ -891,7 +891,7 @@ pop_tile(struct map_rect_priv *mr)
file_data_free(mr->m->fi, (unsigned char *)(mr->t->start));
#ifdef DEBUG_SIZE
#if DEBUG_SIZE > 0
- dbg(lvl_debug,"leave %d\n",mr->t->zipfile_num);
+ dbg(lvl_debug,"leave %d",mr->t->zipfile_num);
#endif
#endif
mr->t=&mr->tiles[--mr->tile_depth-1];
@@ -906,8 +906,8 @@ zipfile_to_tile(struct map_priv *m, struct zip_cd *cd, struct tile *t)
struct zip_lfh *lfh;
char *zipfn;
struct file *fi;
- dbg(lvl_debug,"enter %p %p %p\n", m, cd, t);
- dbg(lvl_debug,"cd->zipofst=0x"LONGLONG_HEX_FMT "\n", binfile_cd_offset(cd));
+ dbg(lvl_debug,"enter %p %p %p", m, cd, t);
+ dbg(lvl_debug,"cd->zipofst=0x"LONGLONG_HEX_FMT "", binfile_cd_offset(cd));
t->start=NULL;
t->mode=1;
if (m->fis)
@@ -938,7 +938,7 @@ map_binfile_handle_redirect(struct map_priv *m)
if (m->redirect)
return 0;
m->redirect=1;
- dbg(lvl_debug,"redirected from %s to %s\n",m->url,location);
+ dbg(lvl_debug,"redirected from %s to %s",m->url,location);
g_free(m->url);
m->url=g_strdup(location);
file_destroy(m->http);
@@ -987,7 +987,7 @@ map_binfile_download_size(struct map_priv *m)
} while (map_binfile_handle_redirect(m));
ret=file_size(m->http);
- dbg(lvl_debug,"file size "LONGLONG_FMT"\n",ret);
+ dbg(lvl_debug,"file size "LONGLONG_FMT"",ret);
return ret;
}
@@ -1033,7 +1033,7 @@ map_binfile_download_range(struct map_priv *m, long long offset, int size)
ret=file_data_read_special(http, size, &size_ret);
if (size_ret != size) {
- dbg(lvl_debug,"size %d vs %d\n",size,size_ret);
+ dbg(lvl_debug,"size %d vs %d",size,size_ret);
g_free(ret);
return NULL;
}
@@ -1047,7 +1047,7 @@ download_cd(struct map_download *download)
struct zip64_eoc *zip64_eoc=(struct zip64_eoc *)file_data_read(m->fi, 0, sizeof(*zip64_eoc));
struct zip_cd *cd=(struct zip_cd *)map_binfile_download_range(m, zip64_eoc->zip64eofst+download->zipfile*m->cde_size,m->cde_size);
file_data_free(m->fi, (unsigned char *)zip64_eoc);
- dbg(lvl_debug,"needed cd, result %p\n",cd);
+ dbg(lvl_debug,"needed cd, result %p",cd);
return cd;
}
@@ -1061,7 +1061,7 @@ download_request(struct map_download *download)
if(!download->m->download_enabled)
{
- dbg(lvl_error,"Tried downloading while it's not allowed\n");
+ dbg(lvl_error,"Tried downloading while it's not allowed");
return 0;
}
attrs[0]=&url;
@@ -1080,7 +1080,7 @@ download_request(struct map_download *download)
attrs[3]=NULL;
download->dl_size=size;
}
- dbg(lvl_debug,"encountered missing tile %d %s(%s), Downloading %d bytes at "LONGLONG_FMT"\n",download->zipfile, url.u.str,(char *)(download->cd_copy+1), download->dl_size, download->offset);
+ dbg(lvl_debug,"encountered missing tile %d %s(%s), Downloading %d bytes at "LONGLONG_FMT"",download->zipfile, url.u.str,(char *)(download->cd_copy+1), download->dl_size, download->offset);
map_binfile_http_request(download->m, attrs);
g_free(url.u.str);
download->http=download->m->http;
@@ -1128,7 +1128,7 @@ download_download(struct map_download *download)
return 0;
}
- dbg(lvl_debug,"got %d bytes writing at offset "LONGLONG_FMT"\n",size_ret,download->offset);
+ dbg(lvl_debug,"got %d bytes writing at offset "LONGLONG_FMT"",size_ret,download->offset);
if (size_ret <= 0) {
g_free(data);
return 1;
@@ -1170,7 +1170,7 @@ download_finish(struct map_download *download)
g_free(download->cd_copy);
download->cd=(struct zip_cd *)(file_data_read(download->file, download->m->eoc->zipeofst + download->zipfile*download->m->cde_size, download->m->cde_size));
cd_to_cpu(download->cd);
- dbg(lvl_debug,"Offset %d\n",download->cd->zipofst);
+ dbg(lvl_debug,"Offset %d",download->cd->zipofst);
return 1;
}
@@ -1178,7 +1178,7 @@ static int
download_planet_size(struct map_download *download)
{
download->size=map_binfile_download_size(download->m);
- dbg(lvl_debug,"Planet size "LONGLONG_FMT"\n",download->size);
+ dbg(lvl_debug,"Planet size "LONGLONG_FMT"",download->size);
if (!download->size)
return 0;
return 1;
@@ -1194,7 +1194,7 @@ download_eoc(struct map_download *download)
download->zip_eoc=(struct zip_eoc *)(download->zip64_eocl+1);
if (download->zip64_eoc->zip64esig != zip64_eoc_sig || download->zip64_eocl->zip64lsig != zip64_eocl_sig || download->zip_eoc->zipesig != zip_eoc_sig)
{
- dbg(lvl_error,"wrong signature on zip64_eoc downloaded from "LONGLONG_FMT"\n",download->size-98);
+ dbg(lvl_error,"wrong signature on zip64_eoc downloaded from "LONGLONG_FMT"",download->size-98);
g_free(download->zip64_eoc);
return 0;
}
@@ -1221,11 +1221,11 @@ download_directory_do(struct map_download *download)
struct zip_cd *cd;
cd=(struct zip_cd *)file_data_read_special(download->http, sizeof(*cd), &size_ret);
cd->zipcunc=0;
- dbg(lvl_debug,"size_ret=%d\n",size_ret);
+ dbg(lvl_debug,"size_ret=%d",size_ret);
if (!size_ret)
return 0;
if (size_ret != sizeof(*cd) || cd->zipcensig != zip_cd_sig) {
- dbg(lvl_error,"error1 size=%d vs %zu\n",size_ret, sizeof(*cd));
+ dbg(lvl_error,"error1 size=%d vs %zu",size_ret, sizeof(*cd));
return 0;
}
file_data_write(download->file, download->offset, sizeof(*cd), (unsigned char *)cd);
@@ -1233,7 +1233,7 @@ download_directory_do(struct map_download *download)
cd_xlen=cd->zipcfnl+cd->zipcxtl;
cd_data=file_data_read_special(download->http, cd_xlen, &size_ret);
if (size_ret != cd_xlen) {
- dbg(lvl_error,"error2 size=%d vs %d\n",size_ret,cd_xlen);
+ dbg(lvl_error,"error2 size=%d vs %d",size_ret,cd_xlen);
return 0;
}
file_data_write(download->file, download->offset, cd_xlen, cd_data);
@@ -1278,14 +1278,14 @@ push_zipfile_tile_do(struct map_rect_priv *mr, struct zip_cd *cd, int zipfile, i
struct map_priv *m=mr->m;
struct file *f=m->fi;
- dbg(lvl_debug,"enter %p %d\n", mr, zipfile);
+ dbg(lvl_debug,"enter %p %d", mr, zipfile);
#ifdef DEBUG_SIZE
#if DEBUG_SIZE > 0
{
char filename[cd->zipcfnl+1];
memcpy(filename, cd+1, cd->zipcfnl);
filename[cd->zipcfnl]='\0';
- dbg(lvl_debug,"enter %d (%s) %d\n",zipfile, filename, cd->zipcunc);
+ dbg(lvl_debug,"enter %d (%s) %d",zipfile, filename, cd->zipcunc);
}
#endif
mr->size+=cd->zipcunc;
@@ -1341,10 +1341,10 @@ download(struct map_priv *m, struct map_rect_priv *mr, struct zip_cd *cd, int zi
return NULL;
}
for (;;) {
- dbg(lvl_debug,"state=%d\n",download->state);
+ dbg(lvl_debug,"state=%d",download->state);
switch (download->state) {
case 0:
- dbg(lvl_error,"error\n");
+ dbg(lvl_error,"error");
break;
case 1:
if (download_start(download))
@@ -1394,7 +1394,7 @@ download(struct map_priv *m, struct map_rect_priv *mr, struct zip_cd *cd, int zi
if (download_eoc(download))
download->state=6;
else {
- dbg(lvl_error,"download of eoc failed\n");
+ dbg(lvl_error,"download of eoc failed");
download->state=0;
}
break;
@@ -1443,7 +1443,7 @@ push_zipfile_tile(struct map_rect_priv *mr, int zipfile, int offset, int length,
struct file *f=m->fi;
long long cdoffset=m->eoc64?m->eoc64->zip64eofst:m->eoc->zipeofst;
struct zip_cd *cd=(struct zip_cd *)(file_data_read(f, cdoffset + zipfile*m->cde_size, m->cde_size));
- dbg(lvl_debug,"read from "LONGLONG_FMT" %d bytes\n",cdoffset + zipfile*m->cde_size, m->cde_size);
+ dbg(lvl_debug,"read from "LONGLONG_FMT" %d bytes",cdoffset + zipfile*m->cde_size, m->cde_size);
cd_to_cpu(cd);
if (!cd->zipcunc && m->url) {
cd=download(m, mr, cd, zipfile, offset, length, async);
@@ -1460,7 +1460,7 @@ map_rect_new_binfile_int(struct map_priv *map, struct map_selection *sel)
struct map_rect_priv *mr;
binfile_check_version(map);
- dbg(lvl_debug,"map_rect_new_binfile\n");
+ dbg(lvl_debug,"map_rect_new_binfile");
if (!map->fi && !map->url)
return NULL;
map_binfile_http_close(map);
@@ -1548,7 +1548,7 @@ map_rect_new_binfile(struct map_priv *map, struct map_selection *sel)
{
struct map_rect_priv *mr=map_rect_new_binfile_int(map, sel);
struct tile t;
- dbg(lvl_debug,"zip_members=%d\n", map->zip_members);
+ dbg(lvl_debug,"zip_members=%d", map->zip_members);
if (map->url && map->fi && sel && sel->order == 255) {
map_download_selection(map, mr, sel);
}
@@ -1580,7 +1580,7 @@ write_changes_do(gpointer key, gpointer value, gpointer user_data)
if (entry->flags) {
entry->flags=0;
fwrite(entry, sizeof(*entry)+(le32_to_cpu(entry->data[0])+1)*4, 1, out);
- dbg(lvl_debug,"yes\n");
+ dbg(lvl_debug,"yes");
}
}
@@ -1633,7 +1633,7 @@ map_rect_destroy_binfile(struct map_rect_priv *mr)
write_changes(mr->m);
while (pop_tile(mr));
#ifdef DEBUG_SIZE
- dbg(lvl_debug,"size=%d kb\n",mr->size/1024);
+ dbg(lvl_debug,"size=%d kb",mr->size/1024);
#endif
if (mr->tiles[0].fi && mr->tiles[0].start)
file_data_free(mr->tiles[0].fi, (unsigned char *)(mr->tiles[0].start));
@@ -1649,11 +1649,11 @@ setup_pos(struct map_rect_priv *mr)
struct tile *t=mr->t;
size=le32_to_cpu(t->pos[0]);
if (size > 1024*1024 || size < 0) {
- dbg(lvl_debug,"size=0x%x\n", size);
+ dbg(lvl_debug,"size=0x%x", size);
#if 0
fprintf(stderr,"offset=%d\n", (unsigned char *)(mr->pos)-mr->m->f->begin);
#endif
- dbg(lvl_debug,"size error\n");
+ dbg(lvl_debug,"size error");
}
t->pos_next=t->pos+size+1;
mr->item.type=le32_to_cpu(t->pos[1]);
@@ -1671,7 +1671,7 @@ selection_contains(struct map_selection *sel, struct coord_rect *r, struct range
while (sel) {
if (coord_rect_overlap(r, &sel->u.c_rect)) {
order=sel->order;
- dbg(lvl_debug,"min %d max %d order %d\n", mima->min, mima->max, order);
+ dbg(lvl_debug,"min %d max %d order %d", mima->min, mima->max, order);
if (!mima->min && !mima->max)
return 1;
if (order >= mima->min && order <= mima->max)
@@ -1703,13 +1703,13 @@ map_parse_country_binfile(struct map_rect_priv *mr)
struct attr af, al;
if(binfile_attr_get(mr->item.priv_data, attr_first_key, &af)) {
if(linguistics_compare(af.u.str,search->u.str,linguistics_cmp_partial)>0) {
- dbg(lvl_debug,"Skipping index item with first_key='%s'\n", af.u.str);
+ dbg(lvl_debug,"Skipping index item with first_key='%s'", af.u.str);
return;
}
}
if(binfile_attr_get(mr->item.priv_data, attr_last_key, &al)) {
if(linguistics_compare(al.u.str,search->u.str,linguistics_cmp_partial)<0) {
- dbg(lvl_debug,"Skipping index item with first_key='%s', last_key='%s'\n", af.u.str, al.u.str);
+ dbg(lvl_debug,"Skipping index item with first_key='%s', last_key='%s'", af.u.str, al.u.str);
return;
}
}
@@ -1744,7 +1744,7 @@ map_parse_submap(struct map_rect_priv *mr, int async)
return 0;
if (!binfile_attr_get(mr->item.priv_data, attr_zipfile_ref, &at))
return 0;
- dbg(lvl_debug,"pushing zipfile %ld from %d\n", at.u.num, mr->t->zipfile_num);
+ dbg(lvl_debug,"pushing zipfile %ld from %d", at.u.num, mr->t->zipfile_num);
return push_zipfile_tile(mr, at.u.num, 0, 0, async);
}
@@ -2110,12 +2110,12 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search,
if (town)
msp->mr = binmap_search_street_by_place(map, town, &c, &msp->ms, &msp->boundaries);
if (msp->boundaries)
- dbg(lvl_debug, "using map town boundaries\n");
+ dbg(lvl_debug, "using map town boundaries");
if (!msp->boundaries && town)
{
binmap_get_estimated_boundaries(town, &msp->boundaries);
if (msp->boundaries)
- dbg(lvl_debug, "using estimated boundaries\n");
+ dbg(lvl_debug, "using estimated boundaries");
}
map_rect_destroy_binfile(map_rec);
/* start searching in area around the street segment even if town boundaries are available */
@@ -2124,7 +2124,7 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search,
msp->rect_new=msp->ms.u.c_rect;
if(item_attr_get(msp->item, attr_street_name, &attr))
msp->parent_name=g_strdup(attr.u.str);
- dbg(lvl_debug,"pn=%s\n",msp->parent_name);
+ dbg(lvl_debug,"pn=%s",msp->parent_name);
}
}
if (idx != 3) {
@@ -2435,7 +2435,7 @@ binmap_search_get_item(struct map_search_priv *map_search)
map_search->ms.u.c_rect=map_search->rect_new;
map_rect_destroy_binfile(map_search->mr);
map_search->mr=map_rect_new_binfile(map_search->map, &map_search->ms);
- dbg(lvl_debug,"Extended house number search region to %d x %d, restarting...\n",map_search->ms.u.c_rect.rl.x - map_search->ms.u.c_rect.lu.x, map_search->ms.u.c_rect.lu.y-map_search->ms.u.c_rect.rl.y);
+ dbg(lvl_debug,"Extended house number search region to %d x %d, restarting...",map_search->ms.u.c_rect.rl.x - map_search->ms.u.c_rect.lu.x, map_search->ms.u.c_rect.lu.y-map_search->ms.u.c_rect.rl.y);
continue;
}
}
@@ -2567,7 +2567,7 @@ map_binfile_zip_setup(struct map_priv *m, char *filename, int mmap)
struct zip_cd *first_cd;
int i;
if (!(m->eoc=binfile_read_eoc(m->fi))) {
- dbg(lvl_error,"map file %s: unable to read eoc\n", filename);
+ dbg(lvl_error,"map file %s: unable to read eoc", filename);
return 0;
}
dbg_assert(m->eoc->zipedsk == m->eoc->zipecen);
@@ -2583,20 +2583,20 @@ map_binfile_zip_setup(struct map_priv *m, char *filename, int mmap)
m->fis[m->eoc->zipedsk-1]=m->fi;
g_free(tmpfilename);
}
- dbg(lvl_debug,"num_disk %d\n",m->eoc->zipedsk);
+ dbg(lvl_debug,"num_disk %d",m->eoc->zipedsk);
m->eoc64=binfile_read_eoc64(m->fi);
if (!binfile_get_index(m)) {
- dbg(lvl_error,"map file %s: no index found\n", filename);
+ dbg(lvl_error,"map file %s: no index found", filename);
return 0;
}
if (!(first_cd=binfile_read_cd(m, 0, 0))) {
- dbg(lvl_error,"map file %s: unable to get first cd\n", filename);
+ dbg(lvl_error,"map file %s: unable to get first cd", filename);
return 0;
}
m->cde_size=sizeof(struct zip_cd)+first_cd->zipcfnl+first_cd->zipcxtl;
m->zip_members=m->index_offset/m->cde_size+1;
- dbg(lvl_debug,"cde_size %d\n", m->cde_size);
- dbg(lvl_debug,"members %d\n",m->zip_members);
+ dbg(lvl_debug,"cde_size %d", m->cde_size);
+ dbg(lvl_debug,"members %d",m->zip_members);
file_data_free(m->fi, (unsigned char *)first_cd);
if (mmap)
file_mmap(m->fi);
@@ -2695,12 +2695,12 @@ map_binfile_open(struct map_priv *m)
struct attr readwrite={attr_readwrite, {(void *)1}};
struct attr *attrs[]={&readwrite, NULL};
- dbg(lvl_debug,"file_create %s\n", m->filename);
+ dbg(lvl_debug,"file_create %s", m->filename);
m->fi=file_create(m->filename, m->url?attrs:NULL);
if (! m->fi && m->url)
return 0;
if (! m->fi) {
- dbg(lvl_error,"Failed to load '%s'\n", m->filename);
+ dbg(lvl_error,"Failed to load '%s'", m->filename);
return 0;
}
if (m->check_version)
@@ -2714,13 +2714,13 @@ map_binfile_open(struct map_priv *m)
*magic = le32_to_cpu(*magic);
if (*magic == zip_lfh_sig || *magic == zip_split_sig || *magic == zip_cd_sig || *magic == zip64_eoc_sig) {
if (!map_binfile_zip_setup(m, m->filename, m->flags & 1)) {
- dbg(lvl_error,"invalid file format for '%s'\n", m->filename);
+ dbg(lvl_error,"invalid file format for '%s'", m->filename);
file_destroy(m->fi);
m->fi=NULL;
return 0;
}
} else if (*magic == zip_lfh_sig_rev || *magic == zip_split_sig_rev || *magic == zip_cd_sig_rev || *magic == zip64_eoc_sig_rev) {
- dbg(lvl_error,"endianness mismatch for '%s'\n", m->filename);
+ dbg(lvl_error,"endianness mismatch for '%s'", m->filename);
file_destroy(m->fi);
m->fi=NULL;
return 0;
@@ -2738,7 +2738,7 @@ map_binfile_open(struct map_priv *m)
if (binfile_attr_get(item->priv_data, attr_map_release, &attr))
m->map_release=g_strdup(attr.u.str);
if (m->url && binfile_attr_get(item->priv_data, attr_url, &attr)) {
- dbg(lvl_debug,"url config %s map %s\n",m->url,attr.u.str);
+ dbg(lvl_debug,"url config %s map %s",m->url,attr.u.str);
if (strcmp(m->url, attr.u.str))
m->update_available=1;
g_free(m->url);
@@ -2747,7 +2747,7 @@ map_binfile_open(struct map_priv *m)
}
map_rect_destroy_binfile(mr);
if (m->map_version >= 16) {
- dbg(lvl_error,"%s: This map is incompatible with your navit version. Please update navit. (map version %d)\n",
+ dbg(lvl_error,"%s: This map is incompatible with your navit version. Please update navit. (map version %d)",
m->filename, m->map_version);
return 0;
}
@@ -2811,7 +2811,7 @@ map_new_binfile(struct map_methods *meth, struct attr **attrs, struct callback_l
wexp=file_wordexp_new(data->u.str);
wexp_data=file_wordexp_get_array(wexp);
- dbg(lvl_debug,"map_new_binfile %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_binfile %s", data->u.str);
*meth=map_methods_binfile;
m=g_new0(struct map_priv, 1);
@@ -2844,9 +2844,9 @@ map_new_binfile(struct map_methods *meth, struct attr **attrs, struct callback_l
void
plugin_init(void)
{
- dbg(lvl_debug,"binfile: plugin_init\n");
+ dbg(lvl_debug,"binfile: plugin_init");
if (sizeof(struct zip_cd) != 46) {
- dbg(lvl_error,"error: sizeof(struct zip_cd)=%zu\n",sizeof(struct zip_cd));
+ dbg(lvl_error,"error: sizeof(struct zip_cd)=%zu",sizeof(struct zip_cd));
}
plugin_register_category_map("binfile", map_new_binfile);
}
diff --git a/navit/map/csv/csv.c b/navit/map/csv/csv.c
index 0477f7fdf..3ee2d6239 100644
--- a/navit/map/csv/csv.c
+++ b/navit/map/csv/csv.c
@@ -127,11 +127,11 @@ save_map_csv(struct map_priv *m)
} else if(ATTR_IS_STRING(*at)) {
tmpstr = g_strdup(found_attr->u.str);
} else {
- dbg(lvl_error,"Cant represent attribute %s\n",attr_to_name(*at));
+ dbg(lvl_error,"Cant represent attribute %s",attr_to_name(*at));
tmpstr=g_strdup("");
}
} else {
- dbg(lvl_debug,"No value defined for the attribute %s, assuming empty string\n",attr_to_name(*at));
+ dbg(lvl_debug,"No value defined for the attribute %s, assuming empty string",attr_to_name(*at));
tmpstr=g_strdup("");
}
}
@@ -150,7 +150,7 @@ save_map_csv(struct map_priv *m)
if(m->charset) {
tmpstr=g_convert(csv_line, -1,m->charset,"utf-8",NULL,NULL,NULL);
if(!tmpstr)
- dbg(lvl_error,"Error converting '%s' to %s\n",csv_line, m->charset);
+ dbg(lvl_error,"Error converting '%s' to %s",csv_line, m->charset);
} else
tmpstr=csv_line;
@@ -182,7 +182,7 @@ static const int zoom_max = 18;
static void
map_destroy_csv(struct map_priv *m)
{
- dbg(lvl_debug,"map_destroy_csv\n");
+ dbg(lvl_debug,"map_destroy_csv");
/*save if changed */
save_map_csv(m);
g_hash_table_destroy(m->qitem_hash);
@@ -356,10 +356,10 @@ static int
csv_type_set(void *priv_data, enum item_type type)
{
struct map_rect_priv* mr = (struct map_rect_priv*)priv_data;
- dbg(lvl_debug,"Enter %d\n", type);
+ dbg(lvl_debug,"Enter %d", type);
if(!mr || !mr->qitem) {
- dbg(lvl_debug,"Nothing to do\n");
+ dbg(lvl_debug,"Nothing to do");
return 0;
}
@@ -367,7 +367,7 @@ csv_type_set(void *priv_data, enum item_type type)
return 0;
mr->qitem->deleted=1;
- dbg(lvl_debug,"Item %p is deleted\n",mr->qitem);
+ dbg(lvl_debug,"Item %p is deleted",mr->qitem);
return 1;
}
@@ -396,7 +396,7 @@ csv_coord_set(void *priv_data, struct coord *c, int count, enum change_mode mode
struct map_priv* m;
struct quadtree_item* qi;
GList* new_it;
- dbg(lvl_debug,"Set coordinates %d %d\n", c->x, c->y);
+ dbg(lvl_debug,"Set coordinates %d %d", c->x, c->y);
/* for now we only support coord modification only */
if( ! change_mode_modify) {
@@ -431,7 +431,7 @@ csv_coord_set(void *priv_data, struct coord *c, int count, enum change_mode mode
qi->longitude = cg.lng;
qi->latitude = cg.lat;
quadtree_add( m->tree_root, qi, mr->qiter);
- dbg(lvl_debug,"Set coordinates %f %f\n", cg.lng, cg.lat);
+ dbg(lvl_debug,"Set coordinates %f %f", cg.lng, cg.lat);
m->new_items = g_list_remove_link(m->new_items,new_it);
m->dirty=1;
save_map_csv(m);
@@ -494,11 +494,11 @@ static void map_csv_debug_dump_hash_item(gpointer key, gpointer value, gpointer
{
struct quadtree_item *qi=value;
GList *attrs;
- dbg(lvl_debug,"%p del=%d ref=%d\n", qi,qi->deleted, qi->ref_count);
+ dbg(lvl_debug,"%p del=%d ref=%d", qi,qi->deleted, qi->ref_count);
attrs=((struct quadtree_data *)qi->data)->attr_list;
while(attrs) {
if(((struct attr*)attrs->data)->type==attr_label)
- dbg(lvl_debug,"... %s\n",((struct attr*)attrs->data)->u.str);
+ dbg(lvl_debug,"... %s",((struct attr*)attrs->data)->u.str);
attrs=g_list_next(attrs);
}
}
@@ -519,7 +519,7 @@ map_rect_new_csv(struct map_priv *map, struct map_selection *sel)
struct coord_geo lu;
struct coord_geo rl;
struct quadtree_iter *res = NULL;
- dbg(lvl_debug,"map_rect_new_csv\n");
+ dbg(lvl_debug,"map_rect_new_csv");
if(debug_level_get("map_csv")>2) {
map_csv_debug_dump(map);
}
@@ -726,7 +726,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
charset = attr_search(attrs, NULL, attr_charset);
if(charset) {
- dbg(lvl_debug,"charset:%s\n",charset->u.str);
+ dbg(lvl_debug,"charset:%s",charset->u.str);
m->charset=g_strdup(charset->u.str);
} else {
m->charset=g_strdup(map_methods_csv.charset);
@@ -758,7 +758,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
FILE *fp;
wexp=file_wordexp_new(data->u.str);
wexp_data=file_wordexp_get_array(wexp);
- dbg(lvl_debug,"map_new_csv %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_csv %s", data->u.str);
m->filename=g_strdup(wexp_data[0]);
file_wordexp_destroy(wexp);
@@ -775,7 +775,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
int col_cnt=0;
char *tok;
if(!line) {
- dbg(lvl_error,"Error converting '%s' to utf-8 from %s\n",linebuf, m->charset);
+ dbg(lvl_error,"Error converting '%s' to utf-8 from %s",linebuf, m->charset);
continue;
}
if(line[strlen(line)-1]=='\n' || line[strlen(line)-1]=='\r') {
@@ -848,7 +848,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
*pID = m->next_item_idx;
g_hash_table_insert(m->qitem_hash, pID,qi);
++m->next_item_idx;
- dbg(lvl_debug,"%s\n",line);
+ dbg(lvl_debug,"%s",line);
}
else {
g_free(curr_item);
@@ -856,7 +856,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
}
else {
- dbg(lvl_error,"ERROR: Non-matching attr count and column count: %d %d SKIPPING line: %s\n",col_cnt, attr_cnt,line);
+ dbg(lvl_error,"ERROR: Non-matching attr count and column count: %d %d SKIPPING line: %s",col_cnt, attr_cnt,line);
}
g_free(line);
g_free(line2);
@@ -865,21 +865,21 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
fclose(fp);
}
else {
- dbg(lvl_error,"Error opening csv map file '%s': %s\n", m->filename, strerror(errno));
+ dbg(lvl_error,"Error opening csv map file '%s': %s", m->filename, strerror(errno));
return NULL;
}
} else {
- dbg(lvl_debug,"No data attribute, starting with in-memory map\n");
+ dbg(lvl_debug,"No data attribute, starting with in-memory map");
}
- dbg(lvl_info,"%p\n",tree_root);
+ dbg(lvl_info,"%p",tree_root);
return m;
}
void
plugin_init(void)
{
- dbg(lvl_debug,"csv: plugin_init\n");
+ dbg(lvl_debug,"csv: plugin_init");
plugin_register_category_map("csv", map_new_csv);
}
diff --git a/navit/map/csv/quadtree.c b/navit/map/csv/quadtree.c
index ca6068541..32d075a3d 100644
--- a/navit/map/csv/quadtree.c
+++ b/navit/map/csv/quadtree.c
@@ -379,7 +379,7 @@ void quadtree_node_drop_garbage(struct quadtree_node* node, struct quadtree_iter
{
int i,j;
int node_num=node->node_num;
- dbg(lvl_debug,"Processing unreferenced subnode children...\n");
+ dbg(lvl_debug,"Processing unreferenced subnode children...");
for(i=0,j=0;i<node_num;i++) {
if(node->items[i]->deleted && !node->items[i]->ref_count) {
if(iter->item_free) {
@@ -426,7 +426,7 @@ quadtree_add(struct quadtree_node* this_, struct quadtree_item* item, struct qua
}
if (bSame) {
//FIXME: memleak and items thrown away if more than QUADTREE_NODE_CAPACITY-1 items with same coordinates added.
- dbg(lvl_error,"Unable to add another item with same coordinates. Throwing item to the ground. Will leak %p.\n",item);
+ dbg(lvl_error,"Unable to add another item with same coordinates. Throwing item to the ground. Will leak %p.",item);
return;
}
this_->items[this_->node_num++] = item;
@@ -561,7 +561,7 @@ struct quadtree_iter *quadtree_query(struct quadtree_node *this_, double dXMin,
ret->xmax=dXMax;
ret->ymin=dYMin;
ret->ymax=dYMax;
- dbg(lvl_debug,"%f %f %f %f\n",dXMin,dXMax,dYMin,dYMax)
+ dbg(lvl_debug,"%f %f %f %f",dXMin,dXMax,dYMin,dYMax)
ret->item_free=item_free;
ret->item_free_context=item_free_context;
n->node=this_;
@@ -577,7 +577,7 @@ struct quadtree_iter *quadtree_query(struct quadtree_node *this_, double dXMin,
}
this_->ref_count++;
- dbg(lvl_debug,"Query %p \n",this_)
+ dbg(lvl_debug,"Query %p ",this_)
return ret;
}
@@ -627,16 +627,16 @@ struct quadtree_item * quadtree_item_next(struct quadtree_iter *iter)
if(iter_node->is_leaf) {
/* Try to find undeleted item in the current node */
- dbg(lvl_debug,"find item %p %p ...\n",iter->iter_nodes,iter->iter_nodes->data);
+ dbg(lvl_debug,"find item %p %p ...",iter->iter_nodes,iter->iter_nodes->data);
while(iter_node->item<iter_node->node_num) {
- dbg(lvl_debug,"%d %d\n",iter_node->item,iter_node->items[iter_node->item]->deleted);
+ dbg(lvl_debug,"%d %d",iter_node->item,iter_node->items[iter_node->item]->deleted);
if(iter_node->items[iter_node->item]->deleted) {
iter_node->item++;
continue;
}
iter->item=iter_node->items[iter_node->item];
iter_node->item++;
- dbg(lvl_debug,"Returning %p\n",iter->item);
+ dbg(lvl_debug,"Returning %p",iter->item);
iter->item->ref_count++;
return iter->item;
}
@@ -654,13 +654,13 @@ struct quadtree_item * quadtree_item_next(struct quadtree_iter *iter)
i=iter_node->subnode;
if(!nodes[i] || !rects_overlap(nodes[i]->xmin, nodes[i]->ymin, nodes[i]->xmax, nodes[i]->ymax, iter->xmin, iter->ymin, iter->xmax, iter->ymax))
continue;
- dbg(lvl_debug,"%f %f %f %f\n",nodes[i]->xmin, nodes[i]->xmax, nodes[i]->ymin, nodes[i]->ymax)
+ dbg(lvl_debug,"%f %f %f %f",nodes[i]->xmin, nodes[i]->xmax, nodes[i]->ymin, nodes[i]->ymax)
subnode=nodes[i];
}
if(subnode) {
/* Go one level deeper */
- dbg(lvl_debug,"Go one level deeper...\n");
+ dbg(lvl_debug,"Go one level deeper...");
iter_node=g_new0(struct quadtree_iter_node, 1);
iter_node->node=subnode;
iter_node->is_leaf=subnode->is_leaf;
@@ -692,7 +692,7 @@ struct quadtree_item * quadtree_item_next(struct quadtree_iter *iter)
/* 2. remove empty leaf subnode if it's unreferenced */
if(!subnode->ref_count && !subnode->node_num && subnode->is_leaf ) {
- dbg(lvl_debug,"Going to delete an empty unreferenced leaf subnode...\n");
+ dbg(lvl_debug,"Going to delete an empty unreferenced leaf subnode...");
if(subnode->parent) {
if(subnode->parent->aa==subnode) {
@@ -704,19 +704,19 @@ struct quadtree_item * quadtree_item_next(struct quadtree_iter *iter)
} else if(subnode->parent->bb==subnode) {
subnode->parent->bb=NULL;
} else {
- dbg(lvl_error,"Found Quadtree structure corruption while trying to free an empty node.\n");
+ dbg(lvl_error,"Found Quadtree structure corruption while trying to free an empty node.");
}
if(!subnode->parent->aa && !subnode->parent->ab && !subnode->parent->ba && !subnode->parent->bb )
subnode->parent->is_leaf=1;
g_free(subnode);
} else
- dbg(lvl_debug,"Quadtree is empty. NOT deleting the root subnode...\n");
+ dbg(lvl_debug,"Quadtree is empty. NOT deleting the root subnode...");
}
/* Go one step towards root */
- dbg(lvl_info,"Going towards root...\n");
+ dbg(lvl_info,"Going towards root...");
g_free(iter->iter_nodes->data);
iter->iter_nodes=g_list_delete_link(iter->iter_nodes,iter->iter_nodes);
}
diff --git a/navit/map/filter/filter.c b/navit/map/filter/filter.c
index cecae7fc0..78d09e5b9 100644
--- a/navit/map/filter/filter.c
+++ b/navit/map/filter/filter.c
@@ -319,7 +319,7 @@ map_filter_rect_get_item(struct map_rect_priv *mr)
static struct item *
map_filter_rect_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
mr->parent_item=map_rect_get_item_byid(mr->parent, id_hi, id_lo);
if (!mr->parent_item)
return NULL;
@@ -332,21 +332,21 @@ map_filter_rect_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo)
static struct map_search_priv *
map_filter_search_new(struct map_priv *map, struct item *item, struct attr *search, int partial)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static struct item *
map_filter_search_get_item(struct map_search_priv *map_search)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
map_filter_search_destroy(struct map_search_priv *ms)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static void
@@ -429,7 +429,7 @@ map_filter_new(struct map_methods *meth, struct attr **attrs, struct callback_li
void
plugin_init(void)
{
- dbg(lvl_debug,"filter: plugin_init\n");
+ dbg(lvl_debug,"filter: plugin_init");
plugin_register_category_map("filter", map_filter_new);
}
diff --git a/navit/map/mg/block.c b/navit/map/mg/block.c
index b2bb64ac0..7e7326908 100644
--- a/navit/map/mg/block.c
+++ b/navit/map/mg/block.c
@@ -77,7 +77,7 @@ block_get_byid(struct file *file, int id, unsigned char **p_ret)
int
block_get_byindex(struct file *file, int idx, struct block_priv *blk)
{
- dbg(lvl_debug,"idx=%d\n", idx);
+ dbg(lvl_debug,"idx=%d", idx);
blk->b=block_get_byid(file, idx, &blk->p);
blk->block_start=(unsigned char *)(blk->b);
blk->p_start=blk->p;
@@ -177,7 +177,7 @@ block_next_lin(struct map_rect_priv *mr)
else
mr->b.p=mr->b.block_start+block_get_blocks(mr->b.b)*512;
if (mr->b.p >= mr->file->end) {
- dbg(lvl_debug,"end of blocks %p vs %p\n", mr->b.p, mr->file->end);
+ dbg(lvl_debug,"end of blocks %p vs %p", mr->b.p, mr->file->end);
return 0;
}
mr->b.block_start=mr->b.p;
@@ -185,17 +185,17 @@ block_next_lin(struct map_rect_priv *mr)
mr->b.p_start=mr->b.p;
mr->b.end=mr->b.block_start+block_get_size(mr->b.b);
if (block_get_count(mr->b.b) == -1) {
- dbg(lvl_warning,"empty blocks\n");
+ dbg(lvl_warning,"empty blocks");
return 0;
}
block_get_r(mr->b.b, &r);
if (!mr->cur_sel || coord_rect_overlap(&mr->cur_sel->u.c_rect, &r)) {
block_active_count++;
block_active_mem+=block_get_blocks(mr->b.b)*512-sizeof(struct block *);
- dbg(lvl_debug,"block ok\n");
+ dbg(lvl_debug,"block ok");
return 1;
}
- dbg(lvl_info,"block not in cur_sel\n");
+ dbg(lvl_info,"block not in cur_sel");
}
}
@@ -210,14 +210,14 @@ block_next(struct map_rect_priv *mr)
return block_next_lin(mr);
for (;;) {
if (! bt->p) {
- dbg(lvl_debug,"block 0x%x\n", bt->next);
+ dbg(lvl_debug,"block 0x%x", bt->next);
if (bt->next == -1)
return 0;
bt->b=block_get_byid(mr->file, bt->next, &bt->p);
bt->end=(unsigned char *)mr->b.bt.b+block_get_size(mr->b.bt.b);
bt->next=block_get_next(bt->b);
bt->order=0;
- dbg(lvl_debug,"size 0x%x next 0x%x\n", block_get_size(bt->b), block_get_next(bt->b));
+ dbg(lvl_debug,"size 0x%x next 0x%x", block_get_size(bt->b), block_get_next(bt->b));
if (! mr->b.bt.block_count) {
#if 0
if (debug) {
diff --git a/navit/map/mg/map.c b/navit/map/mg/map.c
index 13561e154..81d28a8f3 100644
--- a/navit/map/mg/map.c
+++ b/navit/map/mg/map.c
@@ -289,7 +289,7 @@ map_rect_get_item_mg(struct map_rect_priv *mr)
}
if (file_next(mr))
continue;
- dbg(lvl_debug,"lin_count %d idx_count %d active_count %d %d kB (%d kB)\n", block_lin_count, block_idx_count, block_active_count, (block_mem+block_active_mem)/1024, block_active_mem/1024);
+ dbg(lvl_debug,"lin_count %d idx_count %d active_count %d %d kB (%d kB)", block_lin_count, block_idx_count, block_active_count, (block_mem+block_active_mem)/1024, block_active_mem/1024);
return NULL;
}
}
@@ -361,7 +361,7 @@ map_search_mg_convert_special(char *str)
*c++='u';
break;
default:
- dbg(lvl_debug,"0x%x\n", *str);
+ dbg(lvl_debug,"0x%x", *str);
*c++=*str;
break;
}
@@ -375,11 +375,11 @@ static int
map_search_setup(struct map_rect_priv *mr)
{
char *prefix;
- dbg(lvl_debug,"%s\n", attr_to_name(mr->search_type));
+ dbg(lvl_debug,"%s", attr_to_name(mr->search_type));
switch (mr->search_type) {
case attr_town_postal:
if (mr->search_item.type != type_country_label) {
- dbg(lvl_error,"wrong parent type %s\n", item_to_name(mr->search_item.type));
+ dbg(lvl_error,"wrong parent type %s", item_to_name(mr->search_item.type));
return 0;
}
prefix=mg_country_postal_prefix(mr->search_item.id_lo);
@@ -388,12 +388,12 @@ map_search_setup(struct map_rect_priv *mr)
tree_search_init(mr->m->dirname, "town.b1", &mr->ts, 0);
mr->current_file=file_town_twn;
mr->search_str=g_strdup_printf("%s%s",prefix,mr->search_attr->u.str);
- dbg(lvl_debug,"search_str='%s'\n",mr->search_str);
+ dbg(lvl_debug,"search_str='%s'",mr->search_str);
mr->search_country=mg_country_from_isonum(mr->search_item.id_lo);
break;
case attr_town_name:
if (mr->search_item.type != type_country_label) {
- dbg(lvl_error,"wrong parent type %s\n", item_to_name(mr->search_item.type));
+ dbg(lvl_error,"wrong parent type %s", item_to_name(mr->search_item.type));
return 0;
}
tree_search_init(mr->m->dirname, "town.b2", &mr->ts, 0x1000);
@@ -403,7 +403,7 @@ map_search_setup(struct map_rect_priv *mr)
break;
case attr_district_name:
if (mr->search_item.type != type_country_label) {
- dbg(lvl_error,"wrong parent type %s\n", item_to_name(mr->search_item.type));
+ dbg(lvl_error,"wrong parent type %s", item_to_name(mr->search_item.type));
return 0;
}
tree_search_init(mr->m->dirname, "town.b3", &mr->ts, 0x1000);
@@ -434,11 +434,11 @@ map_search_setup(struct map_rect_priv *mr)
return 0;
}
} else {
- dbg(lvl_error,"wrong parent type %s %p 0x%x 0x%x\n", item_to_name(mr->search_item.type), item, mr->search_item.id_hi, mr->search_item.id_lo);
+ dbg(lvl_error,"wrong parent type %s %p 0x%x 0x%x", item_to_name(mr->search_item.type), item, mr->search_item.id_hi, mr->search_item.id_lo);
return 0;
}
}
- dbg(lvl_debug,"street_assoc=0x%x\n", mr->search_item.id_lo);
+ dbg(lvl_debug,"street_assoc=0x%x", mr->search_item.id_lo);
tree_search_init(mr->m->dirname, "strname.b1", &mr->ts, 0);
mr->current_file=file_strname_stn;
mr->search_str=g_strdup(mr->search_attr->u.str);
@@ -447,12 +447,12 @@ map_search_setup(struct map_rect_priv *mr)
if (!map_priv_is(mr->search_item.map, mr->m))
return 0;
if (!housenumber_search_setup(mr)) {
- dbg(lvl_error,"failed to search for attr_house_number\n");
+ dbg(lvl_error,"failed to search for attr_house_number");
return 0;
}
break;
default:
- dbg(lvl_error,"unknown search %s\n",attr_to_name(mr->search_type));
+ dbg(lvl_error,"unknown search %s",attr_to_name(mr->search_type));
return 0;
}
mr->file=mr->m->file[mr->current_file];
@@ -467,9 +467,9 @@ static struct map_search_priv *
map_search_new_mg(struct map_priv *map, struct item *item, struct attr *search, int partial)
{
struct map_rect_priv *mr=g_new0(struct map_rect_priv, 1);
- dbg(lvl_debug,"searching for %s '%s'\n", attr_to_name(search->type), search->u.str);
- dbg(lvl_debug,"id_lo=0x%x\n", item->id_lo);
- dbg(lvl_debug,"search=%s\n", search->u.str);
+ dbg(lvl_debug,"searching for %s '%s'", attr_to_name(search->type), search->u.str);
+ dbg(lvl_debug,"id_lo=0x%x", item->id_lo);
+ dbg(lvl_debug,"search=%s", search->u.str);
mr->m=map;
mr->search_attr=attr_dup(search);
mr->search_type=search->type;
@@ -480,7 +480,7 @@ map_search_new_mg(struct map_priv *map, struct item *item, struct attr *search,
mr->search_type_next=attr_district_name;
}
if (!map_search_setup(mr)) {
- dbg(lvl_warning,"map_search_new_mg failed\n");
+ dbg(lvl_warning,"map_search_new_mg failed");
g_free(mr);
return NULL;
}
@@ -507,7 +507,7 @@ map_search_destroy_mg(struct map_search_priv *ms)
{
struct map_rect_priv *mr=(struct map_rect_priv *)ms;
- dbg(lvl_debug,"mr=%p\n", mr);
+ dbg(lvl_debug,"mr=%p", mr);
if (! mr)
return;
map_search_cleanup(mr);
@@ -538,7 +538,7 @@ map_search_get_item_mg(struct map_search_priv *ms)
ret=housenumber_search_get_item(mr);
break;
default:
- dbg(lvl_error,"unknown search %s\n",attr_to_name(mr->search_type));
+ dbg(lvl_error,"unknown search %s",attr_to_name(mr->search_type));
break;
}
if (!ret && mr->search_type_next != attr_none) {
@@ -595,7 +595,7 @@ map_new_mg(struct map_methods *meth, struct attr **attrs, struct callback_list *
if (! m->file[i]) {
maybe_missing=(i == file_border_ply || i == file_height_ply || i == file_sea_ply);
if (! maybe_missing)
- dbg(lvl_error,"Failed to load %s\n", filename);
+ dbg(lvl_error,"Failed to load %s", filename);
} else
file_mmap(m->file[i]);
g_free(filename);
diff --git a/navit/map/mg/poly.c b/navit/map/mg/poly.c
index 7c73d4587..b759301e3 100644
--- a/navit/map/mg/poly.c
+++ b/navit/map/mg/poly.c
@@ -225,7 +225,7 @@ poly_get(struct map_rect_priv *mr, struct poly_priv *poly, struct item *item)
item->type=type_rail;
break;
default:
- dbg(lvl_error,"Unknown poly type 0x%x '%s' 0x%x,0x%x\n", poly->type,poly->name,r.lu.x,r.lu.y);
+ dbg(lvl_error,"Unknown poly type 0x%x '%s' 0x%x,0x%x", poly->type,poly->name,r.lu.x,r.lu.y);
item->type=type_street_unkn;
}
if (!map_selection_contains_item(mr->cur_sel, 0, item->type)) {
@@ -235,10 +235,10 @@ poly_get(struct map_rect_priv *mr, struct poly_priv *poly, struct item *item)
}
} else
mr->b.p=poly->subpoly_next;
- dbg(lvl_debug,"%d %d %s\n", poly->subpoly_num_all, mr->b.block_num, poly->name);
+ dbg(lvl_debug,"%d %d %s", poly->subpoly_num_all, mr->b.block_num, poly->name);
item->id_lo=poly->subpoly_num_all | (mr->b.block_num << 16);
item->id_hi=(mr->current_file << 16);
- dbg(lvl_debug,"0x%x 0x%x\n", item->id_lo, item->id_hi);
+ dbg(lvl_debug,"0x%x 0x%x", item->id_lo, item->id_hi);
poly->subpoly_next=mr->b.p+L(poly->count[poly->subpoly_num])*sizeof(struct coord);
poly->subpoly_num++;
poly->subpoly_num_all++;
diff --git a/navit/map/mg/street.c b/navit/map/mg/street.c
index 6aad6e5a0..49f790e9c 100644
--- a/navit/map/mg/street.c
+++ b/navit/map/mg/street.c
@@ -208,7 +208,7 @@ static int street_get_coord(unsigned char **pos, int bytes, struct coord_rect *r
if (f) {
f->x=ref->lu.x+x;
f->y=ref->rl.y+y;
- dbg(lvl_debug,"0x%x,0x%x + 0x%x,0x%x = 0x%x,0x%x\n", x, y, ref->lu.x, ref->rl.y, f->x, f->y);
+ dbg(lvl_debug,"0x%x,0x%x + 0x%x,0x%x = 0x%x,0x%x", x, y, ref->lu.x, ref->rl.y, f->x, f->y);
}
*pos=p;
return flags;
@@ -282,14 +282,14 @@ street_coord_get(void *priv_data, struct coord *c, int count)
if (segid == 0x15)
debug=1;
if (debug) {
- dbg(lvl_debug,"enter 0x%x\n",segid);
+ dbg(lvl_debug,"enter 0x%x",segid);
}
#endif
while (count > 0) {
if (street_coord_get_helper(street, c)) {
#ifdef DEBUG_COORD_GET
if (debug) {
- dbg(lvl_debug,"0x%x,0x%x\n", c->x, c->y);
+ dbg(lvl_debug,"0x%x,0x%x", c->x, c->y);
}
#endif
c++;
@@ -316,7 +316,7 @@ street_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
struct street_priv *street=priv_data;
int nameid;
- dbg(lvl_debug,"segid 0x%x\n", street_str_get_segid(street->str));
+ dbg(lvl_debug,"segid 0x%x", street_str_get_segid(street->str));
attr->type=attr_type;
switch (attr_type) {
case attr_any:
@@ -516,7 +516,7 @@ street_get(struct map_rect_priv *mr, struct street_priv *street, struct item *it
break;
default:
item->type=type_street_unkn;
- dbg(lvl_error,"unknown type 0x%x\n",street_str_get_type(street->str));
+ dbg(lvl_error,"unknown type 0x%x",street_str_get_type(street->str));
}
flags=item_get_default_flags(item->type);
if (flags)
@@ -557,12 +557,12 @@ street_get_byid(struct map_rect_priv *mr, struct street_priv *street, int id_hi,
int country=id_hi & 0xffff;
int res;
struct coord_rect r;
- dbg(lvl_debug,"enter(%p,%p,0x%x,0x%x,%p)\n", mr, street, id_hi, id_lo, item);
+ dbg(lvl_debug,"enter(%p,%p,0x%x,0x%x,%p)", mr, street, id_hi, id_lo, item);
if (! country)
return 0;
if (! tree_search_hv(mr->m->dirname, "street", (id_lo >> 8) | (country << 24), id_lo & 0xff, &res))
return 0;
- dbg(lvl_debug,"res=0x%x (blk=0x%x)\n", res, res >> 12);
+ dbg(lvl_debug,"res=0x%x (blk=0x%x)", res, res >> 12);
block_get_byindex(mr->m->file[mr->current_file], res >> 12, &mr->b);
street_get_data(street, &mr->b.p);
street->name_file=mr->m->file[file_strname_stn];
@@ -578,7 +578,7 @@ street_get_byid(struct map_rect_priv *mr, struct street_priv *street, int id_hi,
item->meth=&street_meth;
item->priv_data=street;
street->str+=(res & 0xfff)-1;
- dbg(lvl_debug,"segid 0x%x\n", street_str_get_segid(&street->str[1]));
+ dbg(lvl_debug,"segid 0x%x", street_str_get_segid(&street->str[1]));
return street_get(mr, street, item);
#if 0
mr->b.p=mr->b.block_start+(res & 0xffff);
@@ -620,7 +620,7 @@ latin1_tolower_ascii(unsigned char c)
return 'u';
default:
if (ret >= 0x80)
- dbg(lvl_debug,"ret=0x%x\n",c);
+ dbg(lvl_debug,"ret=0x%x",c);
return ret;
}
}
@@ -663,26 +663,26 @@ street_search_compare_do(struct map_rect_priv *mr, int country, int town_assoc,
int d,len;
dbg(lvl_debug,"enter");
- dbg(lvl_debug,"country 0x%x town_assoc 0x%x name '%s'\n", country, town_assoc, name);
+ dbg(lvl_debug,"country 0x%x town_assoc 0x%x name '%s'", country, town_assoc, name);
d=(mr->search_item.id_hi & 0xffff)-country;
- dbg(lvl_debug,"country %d (%d vs %d)\n", d, mr->search_item.id_hi & 0xffff, country);
+ dbg(lvl_debug,"country %d (%d vs %d)", d, mr->search_item.id_hi & 0xffff, country);
if (!d) {
if (mr->search_item.id_lo == town_assoc ) {
- dbg(lvl_debug,"town_assoc match (0x%x)\n", town_assoc);
+ dbg(lvl_debug,"town_assoc match (0x%x)", town_assoc);
len=mr->search_partial ? strlen(mr->search_str):INT_MAX;
d=strncasecmp_latin1(mr->search_str, name, len);
if (!strncasecmp_latin1_ascii(mr->search_str, name, len))
d=0;
- dbg(lvl_debug,"string %d\n", d);
+ dbg(lvl_debug,"string %d", d);
} else {
if (town_assoc < mr->search_item.id_lo)
d=1;
else
d=-1;
- dbg(lvl_debug,"assoc %d 0x%x-0x%x\n",d, mr->search_item.id_lo, town_assoc);
+ dbg(lvl_debug,"assoc %d 0x%x-0x%x",d, mr->search_item.id_lo, town_assoc);
}
}
- dbg(lvl_debug,"d=%d\n", d);
+ dbg(lvl_debug,"d=%d", d);
return d;
}
@@ -692,11 +692,11 @@ street_search_compare(unsigned char **p, struct map_rect_priv *mr)
struct street_name_index *i;
int ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
i=(struct street_name_index *)(*p);
*p+=sizeof(*i)+strlen(i->name)+1;
- dbg(lvl_debug,"block 0x%x\n", i->block);
+ dbg(lvl_debug,"block 0x%x", i->block);
ret=street_search_compare_do(mr, i->country, i->town_assoc, i->name);
if (ret <= 0)
@@ -725,7 +725,7 @@ street_name_coord_get(void *priv_data, struct coord *c, int count)
struct street_name_numbers snns;
unsigned char *p=mr->street.name.aux_data;
- dbg(lvl_debug,"aux_data=%p\n", p);
+ dbg(lvl_debug,"aux_data=%p", p);
if (count) {
street_name_numbers_get(&snns, &p);
street_name_numbers_get_coord(&snns, c);
@@ -801,7 +801,7 @@ street_name_attr_get(void *priv_data, enum attr_type attr_type, struct attr *att
return 0;
return item_attr_get(mr->search_item_tmp, attr_type, attr);
default:
- dbg(lvl_error,"unknown attr %s\n",attr_to_name(attr_type));
+ dbg(lvl_error,"unknown attr %s",attr_to_name(attr_type));
return 0;
}
}
@@ -830,7 +830,7 @@ street_name_get_byid(struct map_rect_priv *mr, struct street_priv *street, int i
item->map=NULL;
item->priv_data=mr;
mr->b.p=street->name_file->begin+item->id_lo;
- dbg(lvl_debug,"last %p map %p file %d begin %p\n", mr->b.p, mr->m, mr->current_file, mr->m->file[mr->current_file]->begin);
+ dbg(lvl_debug,"last %p map %p file %d begin %p", mr->b.p, mr->m, mr->current_file, mr->m->file[mr->current_file]->begin);
street_name_get(&street->name, &mr->b.p);
return 1;
}
@@ -841,30 +841,30 @@ street_search_get_item_street_name(struct map_rect_priv *mr)
int dir=1,leaf;
unsigned char *last;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (! mr->search_blk_count) {
- dbg(lvl_debug,"partial 0x%x '%s' ***\n", mr->town.street_assoc, mr->search_str);
+ dbg(lvl_debug,"partial 0x%x '%s' ***", mr->town.street_assoc, mr->search_str);
if (mr->search_linear)
return NULL;
- dbg(lvl_debug,"tree_search_next\n");
+ dbg(lvl_debug,"tree_search_next");
mr->search_block=-1;
while ((leaf=tree_search_next(&mr->ts, &mr->search_p, dir)) != -1) {
dir=street_search_compare(&mr->search_p, mr);
}
- dbg(lvl_debug,"dir=%d mr->search_block=0x%x\n", dir, mr->search_block);
+ dbg(lvl_debug,"dir=%d mr->search_block=0x%x", dir, mr->search_block);
if (mr->search_block == -1)
return NULL;
mr->search_blk_count=1;
block_get_byindex(mr->m->file[file_strname_stn], mr->search_block, &mr->b);
mr->b.p=mr->b.block_start+12;
}
- dbg(lvl_debug,"name id %td\n", mr->b.p-mr->m->file[file_strname_stn]->begin);
+ dbg(lvl_debug,"name id %td", mr->b.p-mr->m->file[file_strname_stn]->begin);
if (! mr->search_blk_count)
return NULL;
for (;;) {
if (mr->b.p >= mr->b.end) {
if (!block_next_lin(mr)) {
- dbg(lvl_debug,"end of blocks in %p, %p\n", mr->m->file[file_strname_stn]->begin, mr->m->file[file_strname_stn]->end);
+ dbg(lvl_debug,"end of blocks in %p, %p", mr->m->file[file_strname_stn]->begin, mr->m->file[file_strname_stn]->end);
return NULL;
}
mr->b.p=mr->b.block_start+12;
@@ -873,23 +873,23 @@ street_search_get_item_street_name(struct map_rect_priv *mr)
last=mr->b.p;
street_name_get(&mr->street.name, &mr->b.p);
dir=street_search_compare_do(mr, mr->street.name.country, mr->street.name.townassoc, mr->street.name.name2);
- dbg(lvl_debug,"country 0x%x assoc 0x%x name1 '%s' name2 '%s' dir=%d\n", mr->street.name.country, mr->street.name.townassoc, mr->street.name.name1, mr->street.name.name2, dir);
+ dbg(lvl_debug,"country 0x%x assoc 0x%x name1 '%s' name2 '%s' dir=%d", mr->street.name.country, mr->street.name.townassoc, mr->street.name.name1, mr->street.name.name2, dir);
if (dir < 0) {
- dbg(lvl_debug,"end of data\n");
+ dbg(lvl_debug,"end of data");
mr->search_blk_count=0;
return NULL;
}
if (!dir) {
- dbg(lvl_debug,"result country 0x%x assoc 0x%x name1 '%s' name2 '%s' dir=%d aux_data=%p len=0x%x\n", mr->street.name.country, mr->street.name.townassoc, mr->street.name.name1, mr->street.name.name2, dir, mr->street.name.aux_data, mr->street.name.aux_len);
+ dbg(lvl_debug,"result country 0x%x assoc 0x%x name1 '%s' name2 '%s' dir=%d aux_data=%p len=0x%x", mr->street.name.country, mr->street.name.townassoc, mr->street.name.name1, mr->street.name.name2, dir, mr->street.name.aux_data, mr->street.name.aux_len);
mr->item.type = type_street_name;
mr->item.id_hi=(file_strname_stn << 16);
mr->item.id_lo=last-mr->m->file[file_strname_stn]->begin;
- dbg(lvl_debug,"id 0x%x 0x%x last %p map %p file %d begin %p\n", mr->item.id_hi, mr->item.id_lo, last, mr->m, mr->current_file, mr->m->file[mr->current_file]->begin);
+ dbg(lvl_debug,"id 0x%x 0x%x last %p map %p file %d begin %p", mr->item.id_hi, mr->item.id_lo, last, mr->m, mr->current_file, mr->m->file[mr->current_file]->begin);
mr->item.meth=&street_name_meth;
mr->item.map=NULL;
mr->item.priv_data=mr;
/* debug(mr); */
- dbg(lvl_debug,"last %p\n",last);
+ dbg(lvl_debug,"last %p",last);
return &mr->item;
}
}
@@ -920,7 +920,7 @@ street_name_numbers_next(struct map_rect_priv *mr)
{
if (street_name_eod(&mr->street.name))
return 0;
- dbg(lvl_debug,"%p vs %p\n",mr->street.name.tmp_data, mr->street.name.aux_data);
+ dbg(lvl_debug,"%p vs %p",mr->street.name.tmp_data, mr->street.name.aux_data);
street_name_numbers_get(&mr->street.name_numbers, &mr->street.name.tmp_data);
return 1;
}
@@ -975,7 +975,7 @@ housenumber_attr_get(void *priv_data, enum attr_type attr_type, struct attr *att
return 0;
return item_attr_get(mr->search_item_tmp, attr_type, attr);
default:
- dbg(lvl_error,"unknown attr %s\n",attr_to_name(attr_type));
+ dbg(lvl_error,"unknown attr %s",attr_to_name(attr_type));
return 0;
}
}
@@ -991,20 +991,20 @@ static struct item_methods housenumber_meth = {
int
housenumber_search_setup(struct map_rect_priv *mr)
{
- dbg(lvl_debug,"enter (0x%x,0x%x)\n",mr->search_item.id_hi,mr->search_item.id_lo);
+ dbg(lvl_debug,"enter (0x%x,0x%x)",mr->search_item.id_hi,mr->search_item.id_lo);
int id=mr->search_item.id_hi & 0xff;
mr->current_file=file_strname_stn;
mr->street.name_file=mr->m->file[mr->current_file];
mr->b.p=mr->street.name_file->begin+mr->search_item.id_lo;
mr->search_str=g_strdup(mr->search_attr->u.str);
- dbg(lvl_debug,"last %p\n",mr->b.p);
+ dbg(lvl_debug,"last %p",mr->b.p);
street_name_get(&mr->street.name, &mr->b.p);
#if 0
debug(mr);
#endif
while (id > 0) {
id--;
- dbg(lvl_debug,"loop\n");
+ dbg(lvl_debug,"loop");
if (!street_name_numbers_next(mr))
return 0;
}
@@ -1015,10 +1015,10 @@ housenumber_search_setup(struct map_rect_priv *mr)
if (!id)
mr->item.id_hi+=1;
mr->item.id_lo=mr->search_item.id_lo;
- dbg(lvl_debug,"getting name_number %p vs %p + %d\n",mr->street.name_numbers.tmp_data,mr->street.name_numbers.aux_data, mr->street.name_numbers.aux_len);
+ dbg(lvl_debug,"getting name_number %p vs %p + %d",mr->street.name_numbers.tmp_data,mr->street.name_numbers.aux_data, mr->street.name_numbers.aux_len);
if (!street_name_number_next(mr))
return 0;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
// debug(mr);
return 1;
}
@@ -1055,7 +1055,7 @@ struct item *
housenumber_search_get_item(struct map_rect_priv *mr)
{
int d;
- dbg(lvl_debug,"enter %s %s\n",mr->street.first_number,mr->street.last_number);
+ dbg(lvl_debug,"enter %s %s",mr->street.first_number,mr->street.last_number);
for (;;) {
if (!house_number_next(mr->street.current_number, mr->street.first_number, mr->street.last_number, 0, NULL)) {
if (!street_name_number_next(mr))
diff --git a/navit/map/mg/town.c b/navit/map/mg/town.c
index 0fd19be0d..1399bca33 100644
--- a/navit/map/mg/town.c
+++ b/navit/map/mg/town.c
@@ -105,7 +105,7 @@ town_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
twn->attr_next=attr_none;
return 1;
default:
- dbg(lvl_warning, "Don't know about attribute %d[%04X]=%s yet\n",
+ dbg(lvl_warning, "Don't know about attribute %d[%04X]=%s yet",
attr_type, attr_type, attr_to_name(attr_type));
return 0;
}
@@ -237,7 +237,7 @@ town_search_compare(unsigned char **p, struct map_rect_priv *mr)
else
d=strcasecmp(mr->search_str, name);
}
- dbg(lvl_debug,"%d \n",d);
+ dbg(lvl_debug,"%d ",d);
return d;
}
@@ -250,7 +250,7 @@ town_search_get_item(struct map_rect_priv *mr)
int dir=1,leaf;
if (! mr->search_blk_count) {
- dbg(lvl_debug,"partial %d 0x%x '%s' ***\n", mr->search_partial, mr->search_country, mr->search_str);
+ dbg(lvl_debug,"partial %d 0x%x '%s' ***", mr->search_partial, mr->search_country, mr->search_str);
if (! mr->search_linear) {
while ((leaf=tree_search_next(&mr->ts, &mr->search_p, dir)) != -1) {
dir=town_search_compare(&mr->search_p, mr);
@@ -261,23 +261,23 @@ town_search_get_item(struct map_rect_priv *mr)
}
}
if (! mr->search_linear) {
- dbg(lvl_warning,"not found\n");
+ dbg(lvl_warning,"not found");
return NULL;
}
}
if (! tree_search_next_lin(&mr->ts, &mr->search_p)) {
- dbg(lvl_debug,"linear not found\n");
+ dbg(lvl_debug,"linear not found");
return NULL;
}
if (town_search_compare(&mr->search_p, mr)) {
- dbg(lvl_debug,"no match\n");
+ dbg(lvl_debug,"no match");
return NULL;
}
- dbg(lvl_debug,"found %d blocks\n",mr->search_blk_count);
+ dbg(lvl_debug,"found %d blocks",mr->search_blk_count);
}
if (! mr->search_blk_count)
return NULL;
- dbg(lvl_debug,"block 0x%x offset 0x%x\n", block_offset_get_block(mr->search_blk_off), block_offset_get_offset(mr->search_blk_off));
+ dbg(lvl_debug,"block 0x%x offset 0x%x", block_offset_get_block(mr->search_blk_off), block_offset_get_offset(mr->search_blk_off));
block_get_byindex(mr->m->file[mr->current_file], block_offset_get_block(mr->search_blk_off), &mr->b);
mr->b.p=mr->b.block_start+block_offset_get_offset(mr->search_blk_off);
town_get(mr, &mr->town, &mr->item);
diff --git a/navit/map/mg/tree.c b/navit/map/mg/tree.c
index e456ca87c..4774cf610 100644
--- a/navit/map/mg/tree.c
+++ b/navit/map/mg/tree.c
@@ -78,22 +78,22 @@ tree_search_h(struct file *file, unsigned int search)
struct tree_hdr_h *thdr;
struct tree_leaf_h *tleaf;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
while (i++ < 1000) {
thdr=(struct tree_hdr_h *)p;
p+=sizeof(*thdr);
end=p+tree_hdr_h_get_size(thdr);
- dbg(lvl_debug,"@%td\n", p-file->begin);
+ dbg(lvl_debug,"@%td", p-file->begin);
last=0;
while (p < end) {
tleaf=(struct tree_leaf_h *)p;
p+=sizeof(*tleaf);
- dbg(lvl_debug,"low:0x%x high:0x%x match:0x%x val:0x%x search:0x%x\n", tree_leaf_h_get_lower(tleaf), tree_leaf_h_get_higher(tleaf), tree_leaf_h_get_match(tleaf), tree_leaf_h_get_value(tleaf), search);
+ dbg(lvl_debug,"low:0x%x high:0x%x match:0x%x val:0x%x search:0x%x", tree_leaf_h_get_lower(tleaf), tree_leaf_h_get_higher(tleaf), tree_leaf_h_get_match(tleaf), tree_leaf_h_get_value(tleaf), search);
value=tree_leaf_h_get_value(tleaf);
if (value == search)
return tree_leaf_h_get_match(tleaf);
if (value > search) {
- dbg(lvl_debug,"lower\n");
+ dbg(lvl_debug,"lower");
lower=tree_leaf_h_get_lower(tleaf);
if (lower)
last=lower;
@@ -119,11 +119,11 @@ tree_search_v(struct file *file, int offset, int search)
thdr=(struct tree_hdr_v *)p;
p+=sizeof(*thdr);
count=tree_hdr_v_get_count(thdr);
- dbg(lvl_debug,"offset=%td count=0x%x\n", p-file->begin, count);
+ dbg(lvl_debug,"offset=%td count=0x%x", p-file->begin, count);
while (count--) {
tleaf=(struct tree_leaf_v *)p;
p+=sizeof(*tleaf);
- dbg(lvl_debug,"0x%x 0x%x\n", tleaf->key, search);
+ dbg(lvl_debug,"0x%x 0x%x", tleaf->key, search);
if (tleaf->key == search)
return tree_leaf_v_get_value(tleaf);
}
@@ -142,32 +142,32 @@ tree_search_hv(char *dirname, char *filename, unsigned int search_h, unsigned in
char buffer[4096];
int h,v;
- dbg(lvl_debug,"enter(%s, %s, 0x%x, 0x%x, %p)\n",dirname, filename, search_h, search_v, result);
+ dbg(lvl_debug,"enter(%s, %s, 0x%x, 0x%x, %p)",dirname, filename, search_h, search_v, result);
sprintf(buffer, "%s/%s.h1", dirname, filename);
f_idx_h=file_create_caseinsensitive(buffer, 0);
if ((!f_idx_h) || (!file_mmap(f_idx_h)))
return 0;
sprintf(buffer, "%s/%s.v1", dirname, filename);
f_idx_v=file_create_caseinsensitive(buffer, 0);
- dbg(lvl_debug,"%p %p\n", f_idx_h, f_idx_v);
+ dbg(lvl_debug,"%p %p", f_idx_h, f_idx_v);
if ((!f_idx_v) || (!file_mmap(f_idx_v))) {
file_destroy(f_idx_h);
return 0;
}
if ((h=tree_search_h(f_idx_h, search_h))) {
- dbg(lvl_debug,"h=0x%x\n", h);
+ dbg(lvl_debug,"h=0x%x", h);
if ((v=tree_search_v(f_idx_v, h, search_v))) {
- dbg(lvl_debug,"v=0x%x\n", v);
+ dbg(lvl_debug,"v=0x%x", v);
*result=v;
file_destroy(f_idx_v);
file_destroy(f_idx_h);
- dbg(lvl_debug,"return 1\n");
+ dbg(lvl_debug,"return 1");
return 1;
}
}
file_destroy(f_idx_v);
file_destroy(f_idx_h);
- dbg(lvl_debug,"return 0\n");
+ dbg(lvl_debug,"return 0");
return 0;
}
@@ -183,7 +183,7 @@ tree_search_enter(struct tree_search *ts, int offset)
tsn->end=p+tree_hdr_get_size(tsn->hdr);
tsn->low=tree_hdr_get_low(tsn->hdr);
tsn->high=tree_hdr_get_low(tsn->hdr);
- dbg(lvl_debug,"pos %td addr 0x%ux size 0x%ux low 0x%ux end %tu\n", p-ts->f->begin, tree_hdr_get_addr(tsn->hdr), tree_hdr_get_size(tsn->hdr), tree_hdr_get_low(tsn->hdr), tsn->end-ts->f->begin);
+ dbg(lvl_debug,"pos %td addr 0x%ux size 0x%ux low 0x%ux end %tu", p-ts->f->begin, tree_hdr_get_addr(tsn->hdr), tree_hdr_get_size(tsn->hdr), tree_hdr_get_low(tsn->hdr), tsn->end-ts->f->begin);
return tsn;
}
@@ -193,17 +193,17 @@ int tree_search_next(struct tree_search *ts, unsigned char **p, int dir)
if (! *p)
*p=tsn->p;
- dbg(lvl_debug,"next *p=%p dir=%d\n", *p, dir);
- dbg(lvl_debug,"low1=0x%x high1=0x%x\n", tsn->low, tsn->high);
+ dbg(lvl_debug,"next *p=%p dir=%d", *p, dir);
+ dbg(lvl_debug,"low1=0x%x high1=0x%x", tsn->low, tsn->high);
if (dir <= 0) {
- dbg(lvl_debug,"down 0x%x\n", tsn->low);
+ dbg(lvl_debug,"down 0x%x", tsn->low);
if (tsn->low != 0xffffffff) {
tsn=tree_search_enter(ts, tsn->low);
*p=tsn->p;
tsn->high=get_u32(p);
ts->last_node=ts->curr_node;
- dbg(lvl_debug,"saving last2 %d %td\n", ts->curr_node, tsn->last-ts->f->begin);
- dbg(lvl_debug,"high2=0x%x\n", tsn->high);
+ dbg(lvl_debug,"saving last2 %d %td", ts->curr_node, tsn->last-ts->f->begin);
+ dbg(lvl_debug,"high2=0x%x", tsn->high);
return 0;
}
return -1;
@@ -211,18 +211,18 @@ int tree_search_next(struct tree_search *ts, unsigned char **p, int dir)
tsn->low=tsn->high;
tsn->last=*p;
tsn->high=get_u32_unal(p);
- dbg(lvl_debug,"saving last3 %d %p\n", ts->curr_node, tsn->last);
+ dbg(lvl_debug,"saving last3 %d %p", ts->curr_node, tsn->last);
if (*p < tsn->end)
return (tsn->low == 0xffffffff ? 1 : 0);
- dbg(lvl_debug,"end reached high=0x%x\n",tsn->high);
+ dbg(lvl_debug,"end reached high=0x%x",tsn->high);
if (tsn->low != 0xffffffff) {
- dbg(lvl_debug,"low 0x%x\n", tsn->low);
+ dbg(lvl_debug,"low 0x%x", tsn->low);
tsn=tree_search_enter(ts, tsn->low);
*p=tsn->p;
tsn->high=get_u32_unal(p);
ts->last_node=ts->curr_node;
- dbg(lvl_debug,"saving last4 %d %td\n", ts->curr_node, tsn->last-ts->f->begin);
- dbg(lvl_debug,"high4=0x%x\n", tsn->high);
+ dbg(lvl_debug,"saving last4 %d %td", ts->curr_node, tsn->last-ts->f->begin);
+ dbg(lvl_debug,"high4=0x%x", tsn->high);
return 0;
}
return -1;
@@ -233,7 +233,7 @@ int tree_search_next_lin(struct tree_search *ts, unsigned char **p)
struct tree_search_node *tsn=&ts->nodes[ts->curr_node];
int high;
- dbg(lvl_debug,"pos=%d %td\n", ts->curr_node, *p-ts->f->begin);
+ dbg(lvl_debug,"pos=%d %td", ts->curr_node, *p-ts->f->begin);
if (*p)
ts->nodes[ts->last_node].last=*p;
*p=tsn->last;
@@ -243,12 +243,12 @@ int tree_search_next_lin(struct tree_search *ts, unsigned char **p)
ts->last_node=ts->curr_node;
while (high != 0xffffffff) {
tsn=tree_search_enter(ts, high);
- dbg(lvl_debug,"reload %d\n",ts->curr_node);
+ dbg(lvl_debug,"reload %d",ts->curr_node);
high=tsn->low;
}
return 1;
}
- dbg(lvl_debug,"eon %d %td %td\n", ts->curr_node, *p-ts->f->begin, tsn->end-ts->f->begin);
+ dbg(lvl_debug,"eon %d %td %td", ts->curr_node, *p-ts->f->begin, tsn->end-ts->f->begin);
if (! ts->curr_node)
break;
ts->curr_node--;
diff --git a/navit/map/shapefile/shapefile.c b/navit/map/shapefile/shapefile.c
index e3eb4b723..68c44272d 100644
--- a/navit/map/shapefile/shapefile.c
+++ b/navit/map/shapefile/shapefile.c
@@ -76,7 +76,7 @@ struct map_rect_priv {
static void
map_destroy_shapefile(struct map_priv *m)
{
- dbg(lvl_debug,"map_destroy_shapefile\n");
+ dbg(lvl_debug,"map_destroy_shapefile");
g_free(m);
}
@@ -328,7 +328,7 @@ build_match(struct longest_match *lm, struct longest_match_list *lml, char *line
{
struct longest_match_list_item *lmli;
char *kvl=NULL,*i=NULL,*p,*kv;
- dbg(lvl_debug,"line=%s\n",line);
+ dbg(lvl_debug,"line=%s",line);
kvl=line;
p=strchr(line,'\t');
if (p) {
@@ -424,7 +424,7 @@ attr_resolve(struct map_rect_priv *mr, enum attr_type attr_type, struct attr *at
}
if (!value[0])
return -1;
- dbg(lvl_debug,"name=%s value=%s\n",name,value);
+ dbg(lvl_debug,"name=%s value=%s",name,value);
attr_free(mr->attr);
mr->attr=attr_new_from_text(name,value);
if (mr->attr) {
@@ -524,14 +524,14 @@ map_rect_new_shapefile(struct map_priv *map, struct map_selection *sel)
}
file_destroy(file);
} else {
- dbg(lvl_error,"Failed to open %s\n",dbfmapfile);
+ dbg(lvl_error,"Failed to open %s",dbfmapfile);
if (map->dbfmap_data) {
changed=1;
g_free(map->dbfmap_data);
map->dbfmap_data=NULL;
}
}
- dbg(lvl_debug,"%s changed %d old %p\n",dbfmapfile,changed,map->dbfmap_data);
+ dbg(lvl_debug,"%s changed %d old %p",dbfmapfile,changed,map->dbfmap_data);
if (changed) {
longest_match_destroy(map->lm,1);
map->lm=NULL;
@@ -539,7 +539,7 @@ map_rect_new_shapefile(struct map_priv *map, struct map_selection *sel)
build_matches(map,map->dbfmap_data);
}
}
- dbg(lvl_debug,"map_rect_new_shapefile\n");
+ dbg(lvl_debug,"map_rect_new_shapefile");
mr=g_new0(struct map_rect_priv, 1);
mr->m=map;
mr->idx=0;
@@ -595,12 +595,12 @@ map_rect_get_item_shapefile(struct map_rect_priv *mr)
if (count) {
mr->line=lines[0];
if (attr_from_line(mr->line,"type",NULL,type,NULL)) {
- dbg(lvl_debug,"type='%s'\n", type);
+ dbg(lvl_debug,"type='%s'", type);
mr->item.type=item_from_name(type);
if (mr->item.type == type_none && strcmp(type,"none"))
- dbg(lvl_error,"Warning: type '%s' unknown\n", type);
+ dbg(lvl_error,"Warning: type '%s' unknown", type);
} else {
- dbg(lvl_debug,"failed to get attribute type\n");
+ dbg(lvl_debug,"failed to get attribute type");
}
} else
mr->line=NULL;
@@ -649,7 +649,7 @@ map_new_shapefile(struct map_methods *meth, struct attr **attrs, struct callback
char *shapefile,*dbffile;
if (! data)
return NULL;
- dbg(lvl_debug,"map_new_shapefile %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_shapefile %s", data->u.str);
wdata=g_strdup(data->u.str);
wexp=file_wordexp_new(wdata);
wexp_data=file_wordexp_get_array(wexp);
@@ -665,7 +665,7 @@ map_new_shapefile(struct map_methods *meth, struct attr **attrs, struct callback
m->hDBF=DBFOpen(dbffile, "rb");
m->nFields=DBFGetFieldCount(m->hDBF);
g_free(dbffile);
- dbg(lvl_debug,"map_new_shapefile %s %s\n", m->filename, wdata);
+ dbg(lvl_debug,"map_new_shapefile %s %s", m->filename, wdata);
if (charset) {
m->charset=g_strdup(charset->u.str);
meth->charset=m->charset;
@@ -681,7 +681,7 @@ map_new_shapefile(struct map_methods *meth, struct attr **attrs, struct callback
void
plugin_init(void)
{
- dbg(lvl_debug,"shapefile: plugin_init\n");
+ dbg(lvl_debug,"shapefile: plugin_init");
plugin_register_category_map("shapefile", map_new_shapefile);
}
@@ -759,7 +759,7 @@ static int VSI_SHP_Close( SAFile file )
static void VSI_SHP_Error( const char *message )
{
- dbg(lvl_error,"error:%s\n", message);
+ dbg(lvl_error,"error:%s", message);
}
/************************************************************************/
diff --git a/navit/map/textfile/textfile.c b/navit/map/textfile/textfile.c
index 43be12368..2dbcc1ab4 100644
--- a/navit/map/textfile/textfile.c
+++ b/navit/map/textfile/textfile.c
@@ -54,11 +54,11 @@ get_line(struct map_rect_priv *mr)
else
mr->pos+=mr->lastlen;
fgets(mr->line, TEXTFILE_LINE_SIZE, mr->f);
- dbg(lvl_debug,"read textfile line: %s\n", mr->line);
+ dbg(lvl_debug,"read textfile line: %s", mr->line);
remove_comment_line(mr->line);
mr->lastlen=strlen(mr->line)+1;
if (strlen(mr->line) >= TEXTFILE_LINE_SIZE-1)
- dbg(lvl_error, "line too long: %s\n", mr->line);
+ dbg(lvl_error, "line too long: %s", mr->line);
}
}
@@ -94,12 +94,12 @@ textfile_coord_get(void *priv_data, struct coord *c, int count)
{
struct map_rect_priv *mr=priv_data;
int ret=0;
- dbg(lvl_warning,"enter, count: %d\n",count);
+ dbg(lvl_warning,"enter, count: %d",count);
while (count--) {
if (mr->f && !feof(mr->f) && (!mr->item.id_hi || !mr->eoc) && parse_line(mr, mr->item.id_hi)) {
if (c){
*c=mr->c;
- dbg(lvl_debug,"c=0x%x,0x%x\n", c->x, c->y);
+ dbg(lvl_debug,"c=0x%x,0x%x", c->x, c->y);
c++;
}
ret++;
@@ -138,7 +138,7 @@ textfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
char *str=NULL;
dbg(lvl_debug,"mr=%p attrs='%s' ", mr, mr->attrs);
if (attr_type != mr->attr_last) {
- dbg(lvl_debug,"reset attr_pos\n");
+ dbg(lvl_debug,"reset attr_pos");
mr->attr_pos=0;
mr->attr_last=attr_type;
}
@@ -146,7 +146,7 @@ textfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
dbg(lvl_debug,"attr_any");
if (attr_from_line(mr->attrs,NULL,&mr->attr_pos,mr->attr, mr->attr_name)) {
attr_type=attr_from_name(mr->attr_name);
- dbg(lvl_debug,"found attr '%s' 0x%x\n", mr->attr_name, attr_type);
+ dbg(lvl_debug,"found attr '%s' 0x%x", mr->attr_name, attr_type);
attr->type=attr_type;
textfile_encode_attr(mr->attr, attr_type, attr);
return 1;
@@ -156,11 +156,11 @@ textfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
dbg(lvl_debug,"attr='%s' ",str);
if (attr_from_line(mr->attrs,str,&mr->attr_pos,mr->attr, NULL)) {
textfile_encode_attr(mr->attr, attr_type, attr);
- dbg(lvl_debug,"found\n");
+ dbg(lvl_debug,"found");
return 1;
}
}
- dbg(lvl_debug,"not found\n");
+ dbg(lvl_debug,"not found");
return 0;
}
@@ -176,7 +176,7 @@ map_rect_new_textfile(struct map_priv *map, struct map_selection *sel)
{
struct map_rect_priv *mr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
mr=g_new0(struct map_rect_priv, 1);
mr->m=map;
mr->sel=sel;
@@ -204,20 +204,20 @@ map_rect_new_textfile(struct map_priv *map, struct map_selection *sel)
}
sel=sel->next;
}
- dbg(lvl_debug,"popen args %s\n", args);
+ dbg(lvl_debug,"popen args %s", args);
mr->args=args;
mr->f=popen(mr->args, "r");
mr->pos=0;
mr->lastlen=0;
#else
- dbg(lvl_error,"unable to work with pipes %s\n",map->filename);
+ dbg(lvl_error,"unable to work with pipes %s",map->filename);
#endif
} else {
mr->f=fopen(map->filename, "r");
}
if(!mr->f) {
if (!(errno == ENOENT && map->no_warning_if_map_file_missing)) {
- dbg(lvl_error, "error opening textfile %s: %s\n", map->filename, strerror(errno));
+ dbg(lvl_error, "error opening textfile %s: %s", map->filename, strerror(errno));
}
}
get_line(mr);
@@ -255,7 +255,7 @@ map_rect_get_item_textfile(struct map_rect_priv *mr)
}
for(;;) {
if (feof(mr->f)) {
- dbg(lvl_debug,"map_rect_get_item_textfile: eof %d\n",mr->item.id_hi);
+ dbg(lvl_debug,"map_rect_get_item_textfile: eof %d",mr->item.id_hi);
if (mr->m->flags & 1) {
if (!mr->item.id_hi)
return NULL;
@@ -286,7 +286,7 @@ map_rect_get_item_textfile(struct map_rect_priv *mr)
get_line(mr);
continue;
}
- dbg(lvl_debug,"map_rect_get_item_textfile: point found\n");
+ dbg(lvl_debug,"map_rect_get_item_textfile: point found");
mr->eoc=0;
mr->item.id_lo=mr->pos;
} else {
@@ -294,7 +294,7 @@ map_rect_get_item_textfile(struct map_rect_priv *mr)
get_line(mr);
continue;
}
- dbg(lvl_debug,"map_rect_get_item_textfile: line found\n");
+ dbg(lvl_debug,"map_rect_get_item_textfile: line found");
if (! mr->line[0]) {
get_line(mr);
continue;
@@ -302,21 +302,21 @@ map_rect_get_item_textfile(struct map_rect_priv *mr)
mr->item.id_lo=mr->pos;
strcpy(mr->attrs, mr->line);
get_line(mr);
- dbg(lvl_debug,"mr=%p attrs=%s\n", mr, mr->attrs);
+ dbg(lvl_debug,"mr=%p attrs=%s", mr, mr->attrs);
}
- dbg(lvl_debug,"get_attrs %s\n", mr->attrs);
+ dbg(lvl_debug,"get_attrs %s", mr->attrs);
if (attr_from_line(mr->attrs,"type",NULL,type,NULL)) {
- dbg(lvl_debug,"type='%s'\n", type);
+ dbg(lvl_debug,"type='%s'", type);
mr->item.type=item_from_name(type);
if (mr->item.type == type_none)
- dbg(lvl_error, "Warning: type '%s' unknown\n", type);
+ dbg(lvl_error, "Warning: type '%s' unknown", type);
} else {
get_line(mr);
continue;
}
mr->attr_last=attr_none;
mr->more=1;
- dbg(lvl_debug,"return attr='%s'\n", mr->attrs);
+ dbg(lvl_debug,"return attr='%s'", mr->attrs);
return &mr->item;
}
}
@@ -362,7 +362,7 @@ map_new_textfile(struct map_methods *meth, struct attr **attrs, struct callback_
char **wexp_data;
if (! data)
return NULL;
- dbg(lvl_debug,"map_new_textfile %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_textfile %s", data->u.str);
wdata=g_strdup(data->u.str);
len=strlen(wdata);
if (len && wdata[len-1] == '|') {
@@ -380,7 +380,7 @@ map_new_textfile(struct map_methods *meth, struct attr **attrs, struct callback_
m->no_warning_if_map_file_missing=(no_warn!=NULL) && (no_warn->u.num);
if (flags)
m->flags=flags->u.num;
- dbg(lvl_debug,"map_new_textfile %s %s\n", m->filename, wdata);
+ dbg(lvl_debug,"map_new_textfile %s %s", m->filename, wdata);
if (charset) {
m->charset=g_strdup(charset->u.str);
meth->charset=m->charset;
@@ -393,7 +393,7 @@ map_new_textfile(struct map_methods *meth, struct attr **attrs, struct callback_
void
plugin_init(void)
{
- dbg(lvl_debug,"textfile: plugin_init\n");
+ dbg(lvl_debug,"textfile: plugin_init");
plugin_register_category_map("textfile", map_new_textfile);
}
diff --git a/navit/maps.c b/navit/maps.c
index 628713dd2..91a85bcd5 100644
--- a/navit/maps.c
+++ b/navit/maps.c
@@ -32,14 +32,14 @@ maps_new(struct attr *parent, struct attr **attrs)
{
struct attr *data,**attrs_dup;
if (!parent) {
- dbg(lvl_error,"No parent\n");
+ dbg(lvl_error,"No parent");
return NULL;
}
if (parent->type != attr_mapset) {
- dbg(lvl_error,"Parent must be mapset\n");
+ dbg(lvl_error,"Parent must be mapset");
return NULL;
}
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
attrs_dup=attr_list_dup(attrs);
data=attr_search(attrs_dup, NULL, attr_data);
if (data) {
@@ -79,7 +79,7 @@ maps_new(struct attr *parent, struct attr **attrs)
}
file_wordexp_destroy(wexp);
} else {
- dbg(lvl_error,"no data attribute\n");
+ dbg(lvl_error,"no data attribute");
}
attr_list_free(attrs_dup);
return NULL;
diff --git a/navit/mapset.c b/navit/mapset.c
index 6c3d0b5d1..82ab30edf 100644
--- a/navit/mapset.c
+++ b/navit/mapset.c
@@ -310,7 +310,7 @@ struct mapset_search *
mapset_search_new(struct mapset *ms, struct item *item, struct attr *search_attr, int partial)
{
struct mapset_search *this;
- dbg(lvl_debug,"enter(%p,%p,%p,%d)\n", ms, item, search_attr, partial);
+ dbg(lvl_debug,"enter(%p,%p,%p,%d)", ms, item, search_attr, partial);
this=g_new0(struct mapset_search,1);
if(this != NULL && ms!=NULL )
{
diff --git a/navit/maptool/ch.c b/navit/maptool/ch.c
index be0f22b48..b3ebb31b3 100644
--- a/navit/maptool/ch.c
+++ b/navit/maptool/ch.c
@@ -263,7 +263,7 @@ ch_process_node(FILE *out, int node, int resolve)
item_bin=init_item(type_ch_node);
oldnode=GPOINTER_TO_INT(g_hash_table_lookup(newnode_hash, GINT_TO_POINTER(node)));
#if 0
- dbg(lvl_debug,"0x%x,0x%x\n",node_index[oldnode].x,node_index[oldnode].y);
+ dbg(lvl_debug,"0x%x,0x%x",node_index[oldnode].x,node_index[oldnode].y);
#endif
item_bin_add_coord(item_bin, &node_index[oldnode], 1);
fwd.first=oldnode;
@@ -290,7 +290,7 @@ ch_process_node(FILE *out, int node, int resolve)
} else {
ch_edge.middle=*id;
#if 0
- dbg(lvl_debug,"middle street id for is "ITEM_ID_FMT"\n",ITEM_ID_ARGS(*id));
+ dbg(lvl_debug,"middle street id for is "ITEM_ID_FMT"",ITEM_ID_ARGS(*id));
#endif
}
} else {
@@ -299,12 +299,12 @@ ch_process_node(FILE *out, int node, int resolve)
dbg_assert(id != NULL);
ch_edge.middle=*id;
#if 0
- dbg(lvl_debug,"middle node id for is "ITEM_ID_FMT"\n",ITEM_ID_ARGS(*id));
+ dbg(lvl_debug,"middle node id for is "ITEM_ID_FMT"",ITEM_ID_ARGS(*id));
#endif
}
id=g_hash_table_lookup(sgr_nodes_hash, GINT_TO_POINTER((int)edge->target));
#if 0
- dbg(lvl_debug,"id for %d is "ITEM_ID_FMT"\n",edge->target,ITEM_ID_ARGS(*id));
+ dbg(lvl_debug,"id for %d is "ITEM_ID_FMT"",edge->target,ITEM_ID_ARGS(*id));
#endif
if (id == NULL) {
fprintf(stderr,"Failed to look up target %d\n",edge->target);
@@ -522,7 +522,7 @@ ch_assemble_map(char *map_suffix, char *suffix, struct zip_info *zip_info)
struct item_id *id2=g_slice_new(struct item_id);
*id2=id;
#if 0
- dbg(lvl_debug,"%d is "ITEM_ID_FMT"\n",nodeid,ITEM_ID_ARGS(*id2));
+ dbg(lvl_debug,"%d is "ITEM_ID_FMT"",nodeid,ITEM_ID_ARGS(*id2));
#endif
g_hash_table_insert(sgr_nodes_hash, GINT_TO_POINTER(nodeid), id2);
nodeid++;
diff --git a/navit/maptool/coastline.c b/navit/maptool/coastline.c
index 4e17fd652..0c0ea6250 100644
--- a/navit/maptool/coastline.c
+++ b/navit/maptool/coastline.c
@@ -52,11 +52,11 @@ find_next(struct rect *bbox, GList *segments, struct coord *c, int exclude, stru
for (i = 0 ; i < 2 ; i++) {
curr=segments;
- dbg(lvl_debug,"search distance %d\n",search);
+ dbg(lvl_debug,"search distance %d",search);
while (curr) {
struct geom_poly_segment *seg=curr->data;
int dist=distance_from_ll(seg->first, bbox);
- dbg(lvl_debug,"0x%x 0x%x dist %d\n",seg->first->x,seg->first->y,dist);
+ dbg(lvl_debug,"0x%x 0x%x dist %d",seg->first->x,seg->first->y,dist);
if (dist != -1 && seg->first != seg->last && dist < min && (dist >= search)) {
min=dist;
ci[0]=*seg->first;
@@ -255,7 +255,7 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
for (;;) {
search++;
// item_bin_write_debug_point_to_sink(out, &end, "Search %d",search);
- dbg(lvl_debug,"searching next polygon from 0x%x 0x%x\n",end.x,end.y);
+ dbg(lvl_debug,"searching next polygon from 0x%x 0x%x",end.x,end.y);
first=find_next(&bbox, sorted_segments, &end, exclude, cn);
exclude=1;
if (!first)
@@ -265,7 +265,7 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
tile_start_valid=1;
} else {
if (cn[0].x == tile_start.x && cn[0].y == tile_start.y) {
- dbg(lvl_debug,"end of tile reached\n");
+ dbg(lvl_debug,"end of tile reached");
break;
}
}
@@ -274,7 +274,7 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
continue;
}
poly_start_valid=0;
- dbg(lvl_debug,"start of polygon 0x%x 0x%x\n",cn[0].x,cn[0].y);
+ dbg(lvl_debug,"start of polygon 0x%x 0x%x",cn[0].x,cn[0].y);
for (;;) {
if (!poly_start_valid) {
poly_start=cn[0];
@@ -283,7 +283,7 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
} else {
close_polygon(ib, &end, &cn[0], 1, &bbox, &edges);
if (cn[0].x == poly_start.x && cn[0].y == poly_start.y) {
- dbg(lvl_debug,"poly end reached\n");
+ dbg(lvl_debug,"poly end reached");
item_bin_add_attr_longlong(ib, attr_osm_wayid, ct->wayid);
item_bin_write_to_sink(ib, out, NULL);
end=cn[0];
@@ -296,11 +296,11 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
first->type=geom_poly_segment_type_none;
end=cn[1];
if (distance_from_ll(&end, &bbox) == -1) {
- dbg(lvl_debug,"incomplete\n");
+ dbg(lvl_debug,"incomplete");
break;
}
first=find_next(&bbox, sorted_segments, &end, 1, cn);
- dbg(lvl_debug,"next segment of polygon 0x%x 0x%x\n",cn[0].x,cn[0].y);
+ dbg(lvl_debug,"next segment of polygon 0x%x 0x%x",cn[0].x,cn[0].y);
}
if (search > 55)
break;
diff --git a/navit/navigation.c b/navit/navigation.c
index a31ee8459..8ddee5a9d 100644
--- a/navit/navigation.c
+++ b/navit/navigation.c
@@ -420,14 +420,14 @@ static int
is_same_street2(char *old_name, char *old_name_systematic, char *new_name, char *new_name_systematic)
{
if (old_name && new_name && !strcmp(old_name, new_name)) {
- dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' yes (1.)\n", old_name_systematic, new_name_systematic, old_name, new_name);
+ dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' yes (1.)", old_name_systematic, new_name_systematic, old_name, new_name);
return 1;
}
if (old_name_systematic && new_name_systematic && !strcmp(old_name_systematic, new_name_systematic)) {
- dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' yes (2.)\n", old_name_systematic, new_name_systematic, old_name, new_name);
+ dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' yes (2.)", old_name_systematic, new_name_systematic, old_name, new_name);
return 1;
}
- dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' no\n", old_name_systematic, new_name_systematic, old_name, new_name);
+ dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' no", old_name_systematic, new_name_systematic, old_name, new_name);
return 0;
}
@@ -502,7 +502,7 @@ split_string_to_list(struct navigation_way *way, char* raw_string, char sep)
int count = 0;
free_list(way->destination); /*in case this is a retry with a different separator.*/
- dbg(lvl_debug,"raw_string=%s split with %c\n",raw_string, sep);
+ dbg(lvl_debug,"raw_string=%s split with %c",raw_string, sep);
if (strlen(raw_string)>0)
{
count = 1;
@@ -518,7 +518,7 @@ split_string_to_list(struct navigation_way *way, char* raw_string, char sep)
pos2++;
new_street_destination->destination = g_strdup(pos2+1);
new_street_destination->rank=0;
- dbg(lvl_debug,"splitted_off_string=%s\n",new_street_destination->destination);
+ dbg(lvl_debug,"splitted_off_string=%s",new_street_destination->destination);
count++;
}
else
@@ -528,7 +528,7 @@ split_string_to_list(struct navigation_way *way, char* raw_string, char sep)
new_street_destination->destination = g_strdup(pos1);
new_street_destination->rank=0;
pos1 = NULL;
- dbg(lvl_debug,"head_of_string=%s\n",new_street_destination->destination);
+ dbg(lvl_debug,"head_of_string=%s",new_street_destination->destination);
}
way->destination = next_street_destination_remember;
}
@@ -681,7 +681,7 @@ select_announced_destinations(struct navigation_command *current_command)
current_destination = current_destination->next;
}
- dbg(lvl_debug,"%s, max hits =%i\n",current_destination->destination,max_hits);
+ dbg(lvl_debug,"%s, max hits =%i",current_destination->destination,max_hits);
set_highrank(current_destination,current_command);
}
}
@@ -738,7 +738,7 @@ navigation_get_attr(struct navigation *this_, enum attr_type type, struct attr *
{
struct map_rect *mr;
struct item *item;
- dbg(lvl_debug,"enter %s\n", attr_to_name(type));
+ dbg(lvl_debug,"enter %s", attr_to_name(type));
switch (type) {
case attr_map:
attr->u.map=this_->map;
@@ -860,7 +860,7 @@ navigation_get_announce_level(struct navigation *this_, enum item_type type, int
if (type < route_item_first || type > route_item_last)
{
- dbg(lvl_error," item outside routable range\n");
+ dbg(lvl_error," item outside routable range");
return level_error;
}
for (level = level_now ; level < level_follow ; level++) {
@@ -899,7 +899,7 @@ static int
road_angle(struct coord *c1, struct coord *c2, int dir)
{
int ret=transform_get_angle_delta(c1, c2, dir);
- dbg(lvl_debug, "road_angle(0x%x,0x%x - 0x%x,0x%x)=%d\n", c1->x, c1->y, c2->x, c2->y, ret);
+ dbg(lvl_debug, "road_angle(0x%x,0x%x - 0x%x,0x%x)=%d", c1->x, c1->y, c2->x, c2->y, ret);
return ret;
}
@@ -1006,7 +1006,7 @@ round_distance_reduced( int dist )
break;
i++;
}
- dbg(lvl_debug,"converted %d to %d with factor %d\n",dist,distances[m],factor);
+ dbg(lvl_debug,"converted %d to %d with factor %d",dist,distances[m],factor);
return distances[m] * factor;
}
@@ -1152,7 +1152,7 @@ navigation_way_init(struct navigation_way *w)
realitem = map_rect_get_item_byid(mr, w->item.id_hi, w->item.id_lo);
if (!realitem) {
- dbg(lvl_warning,"Item from segment not found on map!\n");
+ dbg(lvl_warning,"Item from segment not found on map!");
map_rect_destroy(mr);
return;
}
@@ -1176,7 +1176,7 @@ navigation_way_init(struct navigation_way *w)
if (w->dir < 0) {
if (item_coord_get(realitem, cbuf, 2) != 2) {
- dbg(lvl_warning,"Using calculate_angle() with a less-than-two-coords-item?\n");
+ dbg(lvl_warning,"Using calculate_angle() with a less-than-two-coords-item?");
map_rect_destroy(mr);
return;
}
@@ -1188,7 +1188,7 @@ navigation_way_init(struct navigation_way *w)
} else {
if (item_coord_get(realitem, cbuf, 2) != 2) {
- dbg(lvl_warning,"Using calculate_angle() with a less-than-two-coords-item?\n");
+ dbg(lvl_warning,"Using calculate_angle() with a less-than-two-coords-item?");
map_rect_destroy(mr);
return;
}
@@ -1249,7 +1249,7 @@ navigation_way_get_max_delta(struct navigation_way *w, enum projection pro, int
realitem = map_rect_get_item_byid(mr, w->item.id_hi, w->item.id_lo);
if (!realitem) {
- dbg(lvl_warning,"Item from segment not found on map!\n");
+ dbg(lvl_warning,"Item from segment not found on map!");
map_rect_destroy(mr);
return ret;
}
@@ -1260,7 +1260,7 @@ navigation_way_get_max_delta(struct navigation_way *w, enum projection pro, int
}
if (item_coord_get(realitem, &cbuf[1], 1) != 1) {
- dbg(lvl_warning,"item has no coords\n");
+ dbg(lvl_warning,"item has no coords");
map_rect_destroy(mr);
return ret;
}
@@ -1285,7 +1285,7 @@ navigation_way_get_max_delta(struct navigation_way *w, enum projection pro, int
item_coord_rewind(realitem);
if (item_coord_get(realitem, &cbuf[1], 1) != 1) {
- dbg(lvl_warning,"item has no more coords after rewind\n");
+ dbg(lvl_warning,"item has no more coords after rewind");
map_rect_destroy(mr);
return ret;
}
@@ -1348,7 +1348,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map)
struct attr sitem_attr,direction_attr;
struct navigation_way *w, *l, *h;
- dbg(lvl_debug, "entering for item: %s %s %s\n", item_to_name(itm->way.item.type), itm->way.name_systematic, itm->way.name);
+ dbg(lvl_debug, "entering for item: %s %s %s", item_to_name(itm->way.item.type), itm->way.name_systematic, itm->way.name);
navigation_itm_ways_clear(itm);
@@ -1380,7 +1380,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map)
}
if (!item_attr_get(i,attr_street_item,&sitem_attr)) {
- dbg(lvl_warning, "Got no street item for route graph item in entering_straight()\n");
+ dbg(lvl_warning, "Got no street item for route graph item in entering_straight()");
continue;
}
@@ -1403,7 +1403,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map)
w->next = l;
navigation_way_init(w); /* calculate and set w->angle2 */
- dbg(lvl_debug, "- retrieved way: %s %s %s\n", item_to_name(w->item.type), w->name_systematic, w->name);
+ dbg(lvl_debug, "- retrieved way: %s %s %s", item_to_name(w->item.type), w->name_systematic, w->name);
/* check if w is already in the list */
h = l;
@@ -1411,7 +1411,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map)
if (is_same_way(w, h)) {
g_free(w);
w = l;
- dbg(lvl_debug, " - way is already in list, discarding\n");
+ dbg(lvl_debug, " - way is already in list, discarding");
}
h = h->next;
}
@@ -1438,12 +1438,12 @@ navigation_destroy_itms_cmds(struct navigation *this_, struct navigation_itm *en
{
struct navigation_itm *itm;
struct navigation_command *cmd;
- dbg(lvl_info,"enter this_=%p this_->first=%p this_->cmd_first=%p end=%p\n", this_, this_->first, this_->cmd_first, end);
+ dbg(lvl_info,"enter this_=%p this_->first=%p this_->cmd_first=%p end=%p", this_, this_->first, this_->cmd_first, end);
if (this_->cmd_first)
- dbg(lvl_info,"this_->cmd_first->itm=%p\n", this_->cmd_first->itm);
+ dbg(lvl_info,"this_->cmd_first->itm=%p", this_->cmd_first->itm);
while (this_->first && this_->first != end) {
itm=this_->first;
- dbg(lvl_debug,"destroying %p\n", itm);
+ dbg(lvl_debug,"destroying %p", itm);
item_hash_remove(this_->hash, &itm->way.item);
this_->first=itm->next;
if (this_->first)
@@ -1470,8 +1470,8 @@ navigation_destroy_itms_cmds(struct navigation *this_, struct navigation_itm *en
if (! this_->first)
this_->last=NULL;
if (! this_->first && end)
- dbg(lvl_error,"end wrong\n");
- dbg(lvl_info,"ret this_->first=%p this_->cmd_first=%p\n",this_->first, this_->cmd_first);
+ dbg(lvl_error,"end wrong");
+ dbg(lvl_info,"ret this_->first=%p this_->cmd_first=%p",this_->first, this_->cmd_first);
}
static void
@@ -1480,19 +1480,19 @@ navigation_itm_update(struct navigation_itm *itm, struct item *ritem)
struct attr length, time, speed;
if (! item_attr_get(ritem, attr_length, &length)) {
- dbg(lvl_error,"no length\n");
+ dbg(lvl_error,"no length");
return;
}
if (! item_attr_get(ritem, attr_time, &time)) {
- dbg(lvl_error,"no time\n");
+ dbg(lvl_error,"no time");
return;
}
if (! item_attr_get(ritem, attr_speed, &speed)) {
- dbg(lvl_error,"no speed\n");
+ dbg(lvl_error,"no speed");
return;
}
- dbg(lvl_debug,"length=%ld time=%ld speed=%ld\n", length.u.num, time.u.num, speed.u.num);
+ dbg(lvl_debug,"length=%ld time=%ld speed=%ld", length.u.num, time.u.num, speed.u.num);
itm->length=length.u.num;
itm->time=time.u.num;
itm->speed=speed.u.num;
@@ -1530,7 +1530,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
if (routeitem) {
ret->streetname_told=0;
if (! item_attr_get(routeitem, attr_street_item, &street_item)) {
- dbg(lvl_warning, "no street item\n");
+ dbg(lvl_warning, "no street item");
g_free(ret);
ret = NULL;
return ret;
@@ -1569,7 +1569,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
char *destination_raw;
destination_raw=map_convert_string(streetitem->map,attr.u.str);
- dbg(lvl_debug,"destination_raw =%s\n",destination_raw);
+ dbg(lvl_debug,"destination_raw =%s",destination_raw);
split_string_to_list(&(ret->way),destination_raw, ';');
g_free(destination_raw);
}
@@ -1582,7 +1582,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
char *destination_raw;
destination_raw=map_convert_string(streetitem->map,attr.u.str);
- dbg(lvl_debug,"destination_raw forward =%s\n",destination_raw);
+ dbg(lvl_debug,"destination_raw forward =%s",destination_raw);
split_string_to_list(&(ret->way),destination_raw, ';');
g_free(destination_raw);
}
@@ -1594,7 +1594,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
char *destination_raw;
destination_raw=map_convert_string(streetitem->map,attr.u.str);
- dbg(lvl_debug,"destination_raw backward =%s\n",destination_raw);
+ dbg(lvl_debug,"destination_raw backward =%s",destination_raw);
split_string_to_list(&(ret->way),destination_raw, ';');
g_free(destination_raw);
}
@@ -1604,7 +1604,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
while (item_coord_get(routeitem, &c[i], 1))
{
- dbg(lvl_debug, "coord %d 0x%x 0x%x\n", i, c[i].x ,c[i].y);
+ dbg(lvl_debug, "coord %d 0x%x 0x%x", i, c[i].x ,c[i].y);
if (i < 4)
i++;
else
@@ -1647,7 +1647,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
struct map_selection mselexit;
struct item *rampitem;
- dbg(lvl_debug,"test ramp\n");
+ dbg(lvl_debug,"test ramp");
mselexit.next = NULL;
mselexit.u.c_rect.lu = c[0] ;
mselexit.u.c_rect.rl = c[0] ;
@@ -1666,12 +1666,12 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
if (attr.type && attr.type == attr_label)
{
- dbg(lvl_debug,"exit_label=%s\n",attr.u.str);
+ dbg(lvl_debug,"exit_label=%s",attr.u.str);
ret->way.exit_label= map_convert_string(tmap,attr.u.str);
}
if (attr.type == attr_ref)
{
- dbg(lvl_debug,"exit_ref=%s\n",attr.u.str);
+ dbg(lvl_debug,"exit_ref=%s",attr.u.str);
ret->way.exit_ref= map_convert_string(tmap,attr.u.str);
}
if (attr.type == attr_exit_to)
@@ -1687,7 +1687,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
&& (!(this_->last->way.item.type == type_ramp))) {
char *destination_raw;
destination_raw=map_convert_string(tmap,attr.u.str);
- dbg(lvl_debug,"destination_raw from exit_to =%s\n",destination_raw);
+ dbg(lvl_debug,"destination_raw from exit_to =%s",destination_raw);
if ((split_string_to_list(&(ret->way),destination_raw, ';')) < 2)
/*
* if a first try did not result in an actual splitting
@@ -1703,7 +1703,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
}
}
}
- dbg(lvl_debug,"i=%d start %d end %d '%s' \n", i, ret->way.angle2, ret->angle_end, ret->way.name_systematic);
+ dbg(lvl_debug,"i=%d start %d end %d '%s' ", i, ret->way.angle2, ret->angle_end, ret->way.name_systematic);
map_rect_destroy(mr);
} else {
if (this_->last)
@@ -1715,7 +1715,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
this_->last->next=ret;
ret->prev=this_->last;
}
- dbg(lvl_debug,"ret=%p\n", ret);
+ dbg(lvl_debug,"ret=%p", ret);
this_->last=ret;
return ret;
}
@@ -1786,21 +1786,21 @@ calculate_dest_distance(struct navigation *this_, int incr)
{
int len=0, time=0, count=0;
struct navigation_itm *next,*itm=this_->last;
- dbg(lvl_debug, "enter this_=%p, incr=%d\n", this_, incr);
+ dbg(lvl_debug, "enter this_=%p, incr=%d", this_, incr);
if (incr) {
if (itm) {
- dbg(lvl_info, "old values: (%p) time=%d lenght=%d\n", itm, itm->dest_length, itm->dest_time);
+ dbg(lvl_info, "old values: (%p) time=%d lenght=%d", itm, itm->dest_length, itm->dest_time);
} else {
- dbg(lvl_info, "old values: itm is null\n");
+ dbg(lvl_info, "old values: itm is null");
}
itm=this_->first;
next=itm->next;
- dbg(lvl_info, "itm values: time=%d lenght=%d\n", itm->length, itm->time);
- dbg(lvl_info, "next values: (%p) time=%d lenght=%d\n", next, next->dest_length, next->dest_time);
+ dbg(lvl_info, "itm values: time=%d lenght=%d", itm->length, itm->time);
+ dbg(lvl_info, "next values: (%p) time=%d lenght=%d", next, next->dest_length, next->dest_time);
itm->dest_length=next->dest_length+itm->length;
itm->dest_count=next->dest_count+1;
itm->dest_time=next->dest_time+itm->time;
- dbg(lvl_info, "new values: time=%d lenght=%d\n", itm->dest_length, itm->dest_time);
+ dbg(lvl_info, "new values: time=%d lenght=%d", itm->dest_length, itm->dest_time);
return;
}
while (itm) {
@@ -1811,7 +1811,7 @@ calculate_dest_distance(struct navigation *this_, int incr)
itm->dest_count=count++;
itm=itm->prev;
}
- dbg(lvl_debug,"len %d time %d\n", len, time);
+ dbg(lvl_debug,"len %d time %d", len, time);
}
@@ -1981,9 +1981,9 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
dc = m.delta;
- dbg(lvl_debug,"enter %p %p %p\n",old, new, maneuver);
+ dbg(lvl_debug,"enter %p %p %p",old, new, maneuver);
#if 0
- dbg(lvl_debug, "old=%s %s, new=%s %s, angle old=%d, angle new=%d, d=%i\n ", old->way.name, old->way.name_systematic, new->way.name, new->way.name_systematic, old->angle_end, new->way.angle2, d);
+ dbg(lvl_debug, "old=%s %s, new=%s %s, angle old=%d, angle new=%d, d=%i ", old->way.name, old->way.name_systematic, new->way.name, new->way.name_systematic, old->angle_end, new->way.angle2, d);
#endif
if (!new->way.next || (new->way.next && (new->way.next->angle2 == new->way.angle2) && !new->way.next->next)) {
/* No announcement necessary (with extra magic to eliminate duplicate ways) */
@@ -2019,7 +2019,7 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
if ((w->angle2 != new->way.angle2) || (w == &(new->way))) {
dw=angle_delta(old->angle_end, w->angle2);
if (is_way_allowed(nav,w,1)) {
- dbg(lvl_debug, "- Examining allowed way: %s %s %s, delta=%i\n", item_to_name(w->item.type), w->name_systematic, w->name, dw);
+ dbg(lvl_debug, "- Examining allowed way: %s %s %s, delta=%i", item_to_name(w->item.type), w->name_systematic, w->name, dw);
m.num_options++;
/* ways of similar category */
if (maneuver_category(w->item.type) == m.old_cat) {
@@ -2248,7 +2248,7 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
m.is_unambiguous = 0;
/* if another way is within +/-min_turn_limit and on the same side as new, the maneuver is ambiguous */
if (dc != m.delta) {
- dbg(lvl_debug, "m.delta %d vs dc %d\n", m.delta, dc);
+ dbg(lvl_debug, "m.delta %d vs dc %d", m.delta, dc);
m.is_unambiguous=0;
}
if (!m.is_same_street && m.is_unambiguous < 1) { /* FIXME: why < 1? */
@@ -2340,7 +2340,7 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
memcpy(*maneuver, &m, sizeof(struct navigation_maneuver));
}
if (r)
- dbg(lvl_debug, "%s %s %s -> %s %s %s: %s, delta=%i, merge_or_exit=%i\n", item_to_name(old->way.item.type), old->way.name_systematic, old->way.name, item_to_name(new->way.item.type), new->way.name_systematic, new->way.name, r, m.delta, m.merge_or_exit);
+ dbg(lvl_debug, "%s %s %s -> %s %s %s: %s, delta=%i, merge_or_exit=%i", item_to_name(old->way.item.type), old->way.name_systematic, old->way.name, item_to_name(new->way.item.type), new->way.name_systematic, new->way.name, r, m.delta, m.merge_or_exit);
return ret;
}
@@ -2358,11 +2358,11 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
*/
static int adjust_delta(int delta, int reference) {
if ((delta >= 0) && (delta - reference) > 180) {
- dbg(lvl_debug,"adjusting delta from %d to %d\n", delta, delta - 360);
+ dbg(lvl_debug,"adjusting delta from %d to %d", delta, delta - 360);
return delta - 360;
}
else if ((delta <= 0) && (reference - delta) > 180) {
- dbg(lvl_debug,"adjusting delta from %d to %d\n", delta, delta + 360);
+ dbg(lvl_debug,"adjusting delta from %d to %d", delta, delta + 360);
return delta + 360;
}
else
@@ -2437,10 +2437,10 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
*/
dtsir = angle_delta(itm->prev->angle_end, w->angle2);
- dbg(lvl_debug,"delta to stay in roundabout %d\n", dtsir);
+ dbg(lvl_debug,"delta to stay in roundabout %d", dtsir);
exit_tangent = angle_median(itm->prev->angle_end, w->angle2);
- dbg(lvl_debug,"exit %d median from %d, %d\n", exit_tangent, itm->prev->angle_end, w->angle2);
+ dbg(lvl_debug,"exit %d median from %d, %d", exit_tangent, itm->prev->angle_end, w->angle2);
/* Move back to where we enter the roundabout, calculate length in roundabout */
itm2=itm;
@@ -2459,14 +2459,14 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
/* Calculate entry angle */
if (itm2 && w2) {
entry_tangent = angle_median(angle_opposite(itm2->way.angle2), w2->angle2);
- dbg(lvl_debug, "entry %d median from %d (%d), %d\n", entry_tangent, angle_opposite(itm2->way.angle2), itm2->way.angle2, itm2->way.next->angle2);
+ dbg(lvl_debug, "entry %d median from %d (%d), %d", entry_tangent, angle_opposite(itm2->way.angle2), itm2->way.angle2, itm2->way.next->angle2);
} else {
entry_tangent = angle_opposite(angle);
} /* endif itm2 && w2 */
- dbg(lvl_debug, "entry %d exit %d\n", entry_tangent, exit_tangent);
+ dbg(lvl_debug, "entry %d exit %d", entry_tangent, exit_tangent);
delta2 = angle_delta(entry_tangent, exit_tangent);
- dbg(lvl_debug, "delta2 %d\n", delta2);
+ dbg(lvl_debug, "delta2 %d", delta2);
if (itm2->prev) {
/* If there are V-shaped approach segments and we are turning around or making a sharp turn,
@@ -2495,25 +2495,25 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
dbg(lvl_error,"central_angle in roundabout_length computation lead to divide by zero (delta1 = %d, delta2 = %d, cmd->delta = %d, dtsir = %d, len = %d)",delta1,delta2,cmd->delta,dtsir,len);
roundabout_length = len;
}
- dbg(lvl_debug,"roundabout_length = %dm (for central_angle = %d degrees)\n", roundabout_length, central_angle);
+ dbg(lvl_debug,"roundabout_length = %dm (for central_angle = %d degrees)", roundabout_length, central_angle);
/* in the case of separate carriageways, approach roads become hard to identify, thus we keep a cap on distance.
* Currently this is at most half the length of the roundabout, which has worked well in tests but can be tweaked
* to further improve results. */
dist_left = roundabout_length / 2;
- dbg(lvl_debug,"examining roads for up to %dm\n", dist_left);
+ dbg(lvl_debug,"examining roads for up to %dm", dist_left);
/* examine items before roundabout */
itm3 = itm2->prev; /* last segment before roundabout */
abort = 0;
while (itm3->prev) {
if ((itm3->next && is_ramp(&(itm3->next->way)) && !is_ramp(&(itm3->way))) || !(itm3->way.flags & AF_ONEWAYMASK)) {
- dbg(lvl_debug,"items before roundabout: break because ramp or oneway ends, %dm left\n", dist_left);
+ dbg(lvl_debug,"items before roundabout: break because ramp or oneway ends, %dm left", dist_left);
dist_left = 0; /* to make sure we don't examine the following way in depth */
break;
}
if (dist_left <= itm3->length) {
- dbg(lvl_debug,"items before roundabout: maximum distance reached, %dm left, item length %dm\n", dist_left, itm3->length);
+ dbg(lvl_debug,"items before roundabout: maximum distance reached, %dm left, item length %dm", dist_left, itm3->length);
break;
}
d = navigation_way_get_max_delta(&(itm3->way), map_projection(this_->map), itm2->prev->angle_end, dist_left, -1);
@@ -2531,7 +2531,7 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
w2 = w2->next;
}
if (abort) {
- dbg(lvl_debug,"items before roundabout: break because of potential turn maneuver, %dm left\n", dist_left);
+ dbg(lvl_debug,"items before roundabout: break because of potential turn maneuver, %dm left", dist_left);
dist_left = itm3->length;
break;
}
@@ -2550,7 +2550,7 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
if ((d != invalid_angle) && (abs(d) > abs(dmax)))
dmax = d;
entry_road_angle = (itm2->prev->angle_end + dmax) % 360;
- dbg(lvl_debug,"entry_road_angle %d (%d + %d)\n", entry_road_angle, itm2->prev->angle_end, dmax);
+ dbg(lvl_debug,"entry_road_angle %d (%d + %d)", entry_road_angle, itm2->prev->angle_end, dmax);
/* examine items after roundabout */
dmax = 0;
@@ -2559,12 +2559,12 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
abort = 0;
while (itm3->next) {
if ((itm3->prev && is_ramp(&(itm3->prev->way)) && !is_ramp(&(itm3->way))) || !(itm3->way.flags & AF_ONEWAYMASK)) {
- dbg(lvl_debug,"items after roundabout: break because ramp or oneway ends, %dm left\n", dist_left);
+ dbg(lvl_debug,"items after roundabout: break because ramp or oneway ends, %dm left", dist_left);
dist_left = 0; /* to make sure we don't examine the following way in depth */
break;
}
if (dist_left <= itm3->length) {
- dbg(lvl_debug,"items after roundabout: maximum distance reached, %dm left, item length %dm\n", dist_left, itm3->length);
+ dbg(lvl_debug,"items after roundabout: maximum distance reached, %dm left, item length %dm", dist_left, itm3->length);
break;
}
d = navigation_way_get_max_delta(&(itm3->way), map_projection(this_->map), itm->way.angle2, dist_left, 1);
@@ -2582,7 +2582,7 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
w2 = w2->next;
}
if (abort) {
- dbg(lvl_debug,"items after roundabout: break because of potential turn maneuver, %dm left\n", dist_left);
+ dbg(lvl_debug,"items after roundabout: break because of potential turn maneuver, %dm left", dist_left);
dist_left = itm3->length;
break;
}
@@ -2602,15 +2602,15 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
dmax = d;
exit_road_angle = (itm->way.angle2 + dmax) % 360;
- dbg(lvl_debug,"exit_road_angle %d (%d + %d)\n", exit_road_angle, itm->way.angle2, dmax);
+ dbg(lvl_debug,"exit_road_angle %d (%d + %d)", exit_road_angle, itm->way.angle2, dmax);
- dbg(lvl_debug,"delta1 %d\n", delta1);
+ dbg(lvl_debug,"delta1 %d", delta1);
delta3 = adjust_delta(angle_delta(entry_road_angle, exit_road_angle), delta2);
- dbg(lvl_debug,"delta3 %d\n", delta3);
+ dbg(lvl_debug,"delta3 %d", delta3);
cmd->roundabout_delta = delta3;
- dbg(lvl_debug,"roundabout_delta %d\n", cmd->roundabout_delta);
+ dbg(lvl_debug,"roundabout_delta %d", cmd->roundabout_delta);
} else {
/* we don't know where we entered the roundabout, so we can't calculate delta1 */
cmd->roundabout_delta = delta2;
@@ -2654,14 +2654,14 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
l = type_nav_roundabout_l8;
break;
}
- dbg(lvl_debug,"delta %d\n", cmd->delta);
+ dbg(lvl_debug,"delta %d", cmd->delta);
/* if delta to leave the roundabout (cmd->delta) is less than delta to stay in roundabout (dtsir),
* we're exiting to the left, so we're probably in a clockwise roundabout, and vice versa */
if (cmd->delta < dtsir)
cmd->maneuver->type = l;
else
cmd->maneuver->type = r;
- dbg(lvl_debug,"type %s\n", item_to_name(cmd->maneuver->type));
+ dbg(lvl_debug,"type %s", item_to_name(cmd->maneuver->type));
}
@@ -2690,7 +2690,7 @@ command_new(struct navigation *this_, struct navigation_itm *itm, struct navigat
int turn_no_of_route_way = 0; /* The number of the route way of all ways that turn to the same direction.
Count direction from abs(0 degree) up to abs(180 degree). Strengthening criterion. */
- dbg(lvl_debug,"enter this_=%p itm=%p maneuver=%p delta=%d\n", this_, itm, maneuver, maneuver->delta);
+ dbg(lvl_debug,"enter this_=%p itm=%p maneuver=%p delta=%d", this_, itm, maneuver, maneuver->delta);
ret->maneuver = maneuver;
ret->delta=maneuver->delta;
ret->itm=itm;
@@ -3163,7 +3163,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
}
}
navigation_set_turnaround(nav, 0);
- dbg(lvl_debug,"distance=%d level=%d type=0x%x\n", distance, level, itm->way.item.type);
+ dbg(lvl_debug,"distance=%d level=%d type=0x%x", distance, level, itm->way.item.type);
}
@@ -3254,7 +3254,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
/* TRANSLATORS: first arg. is the manieth exit, second arg. is the destination to follow */
return g_strdup_printf(_("Leave the roundabout at the %1$s %2$s"), get_exit_count_str(count_roundabout),street_destination_announce);
default :
- dbg(lvl_error,"unexpected announcement level %d\n", level);
+ dbg(lvl_error,"unexpected announcement level %d", level);
return g_strdup_printf("internal error");
}
}
@@ -3507,7 +3507,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
instruction=g_strdup_printf(_("You have reached your destination %s"), d);
break;
default:
- dbg(lvl_error,"unhandled instruction\n");
+ dbg(lvl_error,"unhandled instruction");
break;
}
}
@@ -3531,7 +3531,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
break;
default :
ret= g_strdup_printf(("%1$s %2$s"),instruction,street_destination_announce);
- dbg(lvl_error,"unexpected announcement level %d\n", level);
+ dbg(lvl_error,"unexpected announcement level %d", level);
break;
}
@@ -3636,10 +3636,10 @@ navigation_call_callbacks(struct navigation *this_, int force_speech)
if (!this_->cmd_first)
return;
callback_list_call(this_->callback, 1, &p);
- dbg(lvl_debug,"force_speech=%d turn_around=%d turn_around_limit=%d\n", force_speech, this_->turn_around, this_->turn_around_limit);
+ dbg(lvl_debug,"force_speech=%d turn_around=%d turn_around_limit=%d", force_speech, this_->turn_around, this_->turn_around_limit);
distance=this_->first->dest_length-this_->cmd_first->itm->dest_length;
if (this_->turn_around_limit && this_->turn_around == this_->turn_around_limit) {
- dbg(lvl_debug,"distance=%d distance_turn=%d\n", distance, this_->distance_turn);
+ dbg(lvl_debug,"distance=%d distance_turn=%d", distance, this_->distance_turn);
while (distance > this_->distance_turn) {
this_->level_last=4;
level=4;
@@ -3657,8 +3657,8 @@ navigation_call_callbacks(struct navigation *this_, int force_speech)
/* only tell if the level is valid for more than 3 seconds */
int speed_distance=this_->first->speed*30/36;
if (distance < speed_distance || navigation_get_announce_level_cmd(this_, this_->first, this_->cmd_first, distance-speed_distance) == level) {
- dbg(lvl_debug,"distance %d speed_distance %d\n",distance,speed_distance);
- dbg(lvl_debug,"level %d < %d\n", level, this_->level_last);
+ dbg(lvl_debug,"distance %d speed_distance %d",distance,speed_distance);
+ dbg(lvl_debug,"level %d < %d", level, this_->level_last);
this_->level_last=level;
force_speech=3;
}
@@ -3680,7 +3680,7 @@ navigation_call_callbacks(struct navigation *this_, int force_speech)
if (force_speech) {
this_->level_last=level;
this_->curr_delay=0;
- dbg(lvl_debug,"force_speech=%d distance=%d level=%d type=0x%x\n", force_speech, distance, level, this_->first->way.item.type);
+ dbg(lvl_debug,"force_speech=%d distance=%d level=%d type=0x%x", force_speech, distance, level, this_->first->way.item.type);
callback_list_call(this_->callback_speech, 1, &p);
}
}
@@ -3783,11 +3783,11 @@ navigation_update_idle(struct navigation *this_) {
if (!item_attr_get(ritem, attr_direction, &street_direction))
street_direction.u.num = 0;
sitem = street_item.u.item;
- dbg(lvl_debug,"sitem=%p\n", sitem);
+ dbg(lvl_debug,"sitem=%p", sitem);
itm = item_hash_lookup(this_->hash, sitem);
- dbg(lvl_info,"itm for item with id (0x%x,0x%x) is %p\n", sitem->id_hi, sitem->id_lo, itm);
+ dbg(lvl_info,"itm for item with id (0x%x,0x%x) is %p", sitem->id_hi, sitem->id_lo, itm);
if (itm && itm->way.dir != street_direction.u.num) {
- dbg(lvl_info,"wrong direction\n");
+ dbg(lvl_info,"wrong direction");
itm = NULL;
}
navigation_destroy_itms_cmds(this_, itm);
@@ -3795,7 +3795,7 @@ navigation_update_idle(struct navigation *this_) {
navigation_itm_update(itm, ritem);
break;
}
- dbg(lvl_debug,"not on track\n");
+ dbg(lvl_debug,"not on track");
}
navigation_itm_new(this_, ritem);
count--;
@@ -3828,7 +3828,7 @@ navigation_update(struct navigation *this_, struct route *route, struct attr *at
if (attr->type != attr_route_status)
return;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
nav_status.type = attr_nav_status;
switch(attr->u.num) {
@@ -3870,7 +3870,7 @@ navigation_update(struct navigation *this_, struct route *route, struct attr *at
this_->vehicleprofile=vehicleprofile.u.vehicleprofile;
else
this_->vehicleprofile=NULL;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
this_->status_int = status_busy;
if (route_get_flags(this_->route) & route_path_flag_async) {
@@ -4366,7 +4366,7 @@ navigation_map_get_item(struct map_rect_priv *priv)
navigation_map_item_attr_rewind(priv);
ret->id_lo=priv->itm->dest_count;
- dbg(lvl_debug,"type=%d\n", ret->type);
+ dbg(lvl_debug,"type=%d", ret->type);
return ret;
}
diff --git a/navit/navit.c b/navit/navit.c
index a32de161e..b1617bcca 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -218,7 +218,7 @@ navit_get_mapset(struct navit *this_)
if(this_->mapsets){
return this_->mapsets->data;
} else {
- dbg(lvl_error,"No mapsets enabled! Is it on purpose? Navit can't draw a map. Please check your navit.xml\n");
+ dbg(lvl_error,"No mapsets enabled! Is it on purpose? Navit can't draw a map. Please check your navit.xml");
}
return NULL;
}
@@ -244,9 +244,9 @@ navit_get_user_data_directory(int create) {
char *dir;
dir = getenv("NAVIT_USER_DATADIR");
if (create && !file_exists(dir)) {
- dbg(lvl_debug,"creating dir %s\n", dir);
+ dbg(lvl_debug,"creating dir %s", dir);
if (file_mkdir(dir,0)) {
- dbg(lvl_error,"failed creating dir %s\n", dir);
+ dbg(lvl_error,"failed creating dir %s", dir);
return NULL;
}
}
@@ -450,7 +450,7 @@ update_transformation(struct transformation *tr, struct point *old, struct point
center_new.x=center_old->x+coord_old.x-coord_new.x;
center_new.y=center_old->y+coord_old.y-coord_new.y;
navit_restrict_map_center_to_world_boundingbox(tr, &center_new);
- dbg(lvl_debug,"change center from 0x%x,0x%x to 0x%x,0x%x\n", center_old->x, center_old->y, center_new.x, center_new.y);
+ dbg(lvl_debug,"change center from 0x%x,0x%x to 0x%x,0x%x", center_old->x, center_old->y, center_new.x, center_new.y);
transform_set_center(tr, &center_new);
}
@@ -468,7 +468,7 @@ navit_handle_button(struct navit *this_, int pressed, int button, struct point *
{
int border=16;
- dbg(lvl_debug,"button %d %s (ignore: %d)\n",button,pressed?"pressed":"released",this_->ignore_button);
+ dbg(lvl_debug,"button %d %s (ignore: %d)",button,pressed?"pressed":"released",this_->ignore_button);
callback_list_call_attr_4(this_->attr_cbl, attr_button, this_, GINT_TO_POINTER(pressed), GINT_TO_POINTER(button), p);
if (this_->ignore_button) {
this_->ignore_button=0;
@@ -512,7 +512,7 @@ navit_handle_button(struct navit *this_, int pressed, int button, struct point *
this_->motion_timeout=NULL;
}
if (this_->moved) {
- dbg(lvl_debug, "mouse drag (%d, %d)->(%d, %d)\n", this_->pressed.x, this_->pressed.y, p->x, p->y);
+ dbg(lvl_debug, "mouse drag (%d, %d)->(%d, %d)", this_->pressed.x, this_->pressed.y, p->x, p->y);
update_transformation(this_->trans, &this_->pressed, p);
graphics_draw_drag(this_->gra, NULL);
transform_copy(this_->trans, this_->trans_cursor);
@@ -530,7 +530,7 @@ static void
navit_button(void *data, int pressed, int button, struct point *p)
{
struct navit *this=data;
- dbg(lvl_debug,"enter %d %d ignore %d\n",pressed,button,this->ignore_graphics_events);
+ dbg(lvl_debug,"enter %d %d ignore %d",pressed,button,this->ignore_graphics_events);
if (!this->ignore_graphics_events) {
if (! this->popup_callback)
this->popup_callback=callback_new_1(callback_cast(navit_popup), this);
@@ -835,7 +835,7 @@ navit_cmd_set_attr_var(struct navit *this, char *function, struct attr **in, str
key = g_strdup(in[0]->u.str);
g_hash_table_insert(cmd_attr_var_hash, key, val);
} else {
- dbg(lvl_warning, "Wrong parameters for set_attr_var() command function\n");
+ dbg(lvl_warning, "Wrong parameters for set_attr_var() command function");
}
}
@@ -906,12 +906,12 @@ navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in,
) {
if(!(ms=navit_get_mapset(this))) {
- dbg(lvl_error, "Command function map_add_curr_pos(): there is no active mapset\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): there is no active mapset");
return;
}
if((item_type = item_from_name(in[1]->u.str))==type_none) {
- dbg(lvl_error, "Command function map_add_curr_pos(): unknown item type\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): unknown item type");
return;
}
@@ -919,7 +919,7 @@ navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in,
//no map with the given name found
if( ! curr_map) {
- dbg(lvl_error, "Command function map_add_curr_pos(): map not found\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): map not found");
return;
}
@@ -928,11 +928,11 @@ navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in,
if(vehicle_get_attr(this->vehicle->vehicle,attr_position_coord_geo,&pos_attr,NULL)) {
transform_from_geo(projection_mg, pos_attr.u.coord_geo, &curr_coord);
} else {
- dbg(lvl_error, "Command function map_add_curr_pos(): vehicle position is not accessible\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): vehicle position is not accessible");
return;
}
} else {
- dbg(lvl_error, "Command function map_add_curr_pos(): no vehicle\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): no vehicle");
return;
}
@@ -1018,11 +1018,11 @@ navit_cmd_map_item_set_attr(struct navit *this, char *function, struct attr **in
}
map_rect_destroy(mr);
} else {
- dbg(lvl_debug,"Error in command function item_set_attr()\n");
- dbg(lvl_debug,"Command function item_set_attr(): map cond: %d\n",(in[0] && ATTR_IS_STRING(in[0]->type) && in[0]->u.str)?1:0);
- dbg(lvl_debug,"Command function item_set_attr(): item cond: %d\n",(in[1] && ATTR_IS_ITEM(in[1]->type))?1:0);
- dbg(lvl_debug,"Command function item_set_attr(): attr type cond: %d\n",(in[2] && ATTR_IS_STRING(in[2]->type) && in[2]->u.str)?1:0);
- dbg(lvl_debug,"Command function item_set_attr(): attr val cond: %d\n",(in[3] && ATTR_IS_STRING(in[3]->type) && in[3]->u.str)?1:0);
+ dbg(lvl_debug,"Error in command function item_set_attr()");
+ dbg(lvl_debug,"Command function item_set_attr(): map cond: %d",(in[0] && ATTR_IS_STRING(in[0]->type) && in[0]->u.str)?1:0);
+ dbg(lvl_debug,"Command function item_set_attr(): item cond: %d",(in[1] && ATTR_IS_ITEM(in[1]->type))?1:0);
+ dbg(lvl_debug,"Command function item_set_attr(): attr type cond: %d",(in[2] && ATTR_IS_STRING(in[2]->type) && in[2]->u.str)?1:0);
+ dbg(lvl_debug,"Command function item_set_attr(): attr val cond: %d",(in[3] && ATTR_IS_STRING(in[3]->type) && in[3]->u.str)?1:0);
}
}
@@ -1349,7 +1349,7 @@ navit_cmd_spawn(struct navit *this, char *function, struct attr **in, struct att
if(in[i]->type!=attr_none ) {
argv[j++]=attr_to_text(in[i],NULL,1);
} else {
- dbg(lvl_debug,"Parameter #%i is attr_none - skipping\n",i);
+ dbg(lvl_debug,"Parameter #%i is attr_none - skipping",i);
}
}
argv[j]=NULL;
@@ -1358,15 +1358,15 @@ navit_cmd_spawn(struct navit *this, char *function, struct attr **in, struct att
// spawn_process() testing suite - uncomment following code to test.
//sleep(3);
// example of non-blocking wait
- //int st=spawn_process_check_status(pi,0);dbg(lvl_debug,"status %i\n",st);
+ //int st=spawn_process_check_status(pi,0);dbg(lvl_debug,"status %i",st);
// example of blocking wait
- //st=spawn_process_check_status(pi,1);dbg(lvl_debug,"status %i\n",st);
+ //st=spawn_process_check_status(pi,1);dbg(lvl_debug,"status %i",st);
// example of wait after process is finished and status is
// already tested
- //st=spawn_process_check_status(pi,1);dbg(lvl_debug,"status %i\n",st);
+ //st=spawn_process_check_status(pi,1);dbg(lvl_debug,"status %i",st);
// example of wait after process is finished and status is
// already tested - unblocked
- //st=spawn_process_check_status(pi,0);dbg(lvl_debug,"status %i\n",st);
+ //st=spawn_process_check_status(pi,0);dbg(lvl_debug,"status %i",st);
// End testing suite
spawn_process_info_free(pi);
@@ -1469,7 +1469,7 @@ navit_new(struct attr *parent, struct attr **attrs)
this_->messages = messagelist_new(attrs);
- dbg(lvl_debug,"return %p\n",this_);
+ dbg(lvl_debug,"return %p",this_);
return this_;
}
@@ -1560,7 +1560,7 @@ navit_mark_navigation_stopped(char *former_destination_file){
fprintf(f,"%s", TEXTFILE_COMMENT_NAVI_STOPPED);
fclose(f);
}else{
- dbg(lvl_error, "Error setting mark in destination file %s: %s\n", former_destination_file, strerror(errno));
+ dbg(lvl_error, "Error setting mark in destination file %s: %s", former_destination_file, strerror(errno));
}
}
@@ -1583,7 +1583,7 @@ navit_set_destination(struct navit *this_, struct pcoord *c, const char *descrip
this_->destination=*c;
this_->destination_valid=1;
- dbg(lvl_debug, "c=(%i,%i)\n", c->x,c->y);
+ dbg(lvl_debug, "c=(%i,%i)", c->x,c->y);
bookmarks_append_destinations(this_->former_destination, destination_file, c, 1, type_former_destination, description, this_->recentdest_count);
} else {
this_->destination_valid=0;
@@ -1868,7 +1868,7 @@ navit_say(struct navit *this_, const char *text)
if(this_->speech) {
if (!speech_get_attr(this_->speech, attr_active, &attr, NULL))
attr.u.num = 1;
- dbg(lvl_debug, "this_.speech->active %ld\n", attr.u.num);
+ dbg(lvl_debug, "this_.speech->active %ld", attr.u.num);
if(attr.u.num)
speech_say(this_->speech, text);
}
@@ -1915,7 +1915,7 @@ navit_speak(struct navit *this_)
if (!speech_get_attr(this_->speech, attr_active, &attr, NULL))
attr.u.num = 1;
- dbg(lvl_debug, "this_.speech->active %ld\n", attr.u.num);
+ dbg(lvl_debug, "this_.speech->active %ld", attr.u.num);
if(!attr.u.num)
return;
@@ -1952,24 +1952,24 @@ navit_window_roadbook_update(struct navit *this_)
if (navit_get_attr(this_, attr_imperial, &attr, NULL))
imperial=attr.u.num;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
datawindow_mode(this_->roadbook_window, 1);
if (nav)
map=navigation_get_map(nav);
if (map)
mr=map_rect_new(map, NULL);
- dbg(lvl_debug,"nav=%p map=%p mr=%p\n", nav, map, mr);
+ dbg(lvl_debug,"nav=%p map=%p mr=%p", nav, map, mr);
if (mr) {
- dbg(lvl_debug,"while loop\n");
+ dbg(lvl_debug,"while loop");
while ((item=map_rect_get_item(mr))) {
- dbg(lvl_debug,"item=%p\n", item);
+ dbg(lvl_debug,"item=%p", item);
attr.u.str=NULL;
if (item->type != type_nav_position) {
item_attr_get(item, attr_navigation_long, &attr);
if (attr.u.str == NULL) {
continue;
}
- dbg(lvl_info, "Command='%s'\n", attr.u.str);
+ dbg(lvl_info, "Command='%s'", attr.u.str);
param[0].value=g_strdup(attr.u.str);
} else
param[0].value=_("Position");
@@ -1977,7 +1977,7 @@ navit_window_roadbook_update(struct navit *this_)
/* Distance to the next maneuver. */
item_attr_get(item, attr_length, &attr);
- dbg(lvl_info, "Length=%ld in meters\n", attr.u.num);
+ dbg(lvl_info, "Length=%ld in meters", attr.u.num);
param[1].name=_("Length");
if ( attr.u.num >= 2000 )
@@ -1997,7 +1997,7 @@ navit_window_roadbook_update(struct navit *this_)
/* Time to next maneuver. */
item_attr_get(item, attr_time, &attr);
- dbg(lvl_info, "Time=%ld\n", attr.u.num);
+ dbg(lvl_info, "Time=%ld", attr.u.num);
secs=attr.u.num/10;
param[2].name=_("Time");
if ( secs >= 3600 )
@@ -2011,7 +2011,7 @@ navit_window_roadbook_update(struct navit *this_)
/* Distance from next maneuver to destination. */
item_attr_get(item, attr_destination_length, &attr);
- dbg(lvl_info, "Destlength=%ld in meters.\n", attr.u.num);
+ dbg(lvl_info, "Destlength=%ld in meters.", attr.u.num);
param[3].name=_("Destination Length");
if ( attr.u.num >= 2000 )
{
@@ -2030,7 +2030,7 @@ navit_window_roadbook_update(struct navit *this_)
/* Time from next maneuver to destination. */
item_attr_get(item, attr_destination_time, &attr);
- dbg(lvl_info, "Desttime=%ld\n", attr.u.num);
+ dbg(lvl_info, "Desttime=%ld", attr.u.num);
secs=attr.u.num/10;
param[4].name=_("Destination Time");
if ( secs >= 3600 )
@@ -2051,7 +2051,7 @@ navit_window_roadbook_update(struct navit *this_)
void
navit_window_roadbook_destroy(struct navit *this_)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
navigation_unregister_callback(this_->navigation, attr_navigation_long, this_->roadbook_callback);
callback_destroy(this_->roadbook_callback);
this_->roadbook_window=NULL;
@@ -2078,22 +2078,22 @@ navit_init(struct navit *this_)
int callback;
char *center_file;
- dbg(lvl_info,"enter gui %p graphics %p\n",this_->gui,this_->gra);
+ dbg(lvl_info,"enter gui %p graphics %p",this_->gui,this_->gra);
if (!this_->gui && !(this_->flags & 2)) {
- dbg(lvl_error,"FATAL: No GUI available.\n");
+ dbg(lvl_error,"FATAL: No GUI available.");
exit(1);
}
if (!this_->gra && !(this_->flags & 1)) {
- dbg(lvl_error,"FATAL: No graphics subsystem available.\n");
+ dbg(lvl_error,"FATAL: No graphics subsystem available.");
exit(1);
}
- dbg(lvl_info,"Connecting gui to graphics\n");
+ dbg(lvl_info,"Connecting gui to graphics");
if (this_->gui && this_->gra && gui_set_graphics(this_->gui, this_->gra)) {
struct attr attr_type_gui, attr_type_graphics;
gui_get_attr(this_->gui, attr_type, &attr_type_gui, NULL);
graphics_get_attr(this_->gra, attr_type, &attr_type_graphics, NULL);
- dbg(lvl_error,"FATAL: Failed to connect graphics '%s' to gui '%s'\n", attr_type_graphics.u.str, attr_type_gui.u.str);
+ dbg(lvl_error,"FATAL: Failed to connect graphics '%s' to gui '%s'", attr_type_graphics.u.str, attr_type_gui.u.str);
dbg(lvl_error,"Please see http://wiki.navit-project.org/index.php/Failed_to_connect_graphics_to_gui "
"for explanations and solutions\n");
exit(1);
@@ -2104,10 +2104,10 @@ navit_init(struct navit *this_)
speech.u.speech=this_->speech;
navigation_set_attr(this_->navigation, &speech);
}
- dbg(lvl_info,"Initializing graphics\n");
- dbg(lvl_info,"Setting Vehicle\n");
+ dbg(lvl_info,"Initializing graphics");
+ dbg(lvl_info,"Setting Vehicle");
navit_set_vehicle(this_, this_->vehicle);
- dbg(lvl_info,"Adding dynamic maps to mapset %p\n",this_->mapsets);
+ dbg(lvl_info,"Adding dynamic maps to mapset %p",this_->mapsets);
if (this_->mapsets) {
struct mapset_handle *msh;
ms=this_->mapsets->data;
@@ -2168,7 +2168,7 @@ navit_init(struct navit *this_)
}
navit_add_former_destinations_from_file(this_);
} else {
- dbg(lvl_error, "FATAL: No mapset available. Please add a (valid) mapset to your configuration.\n");
+ dbg(lvl_error, "FATAL: No mapset available. Please add a (valid) mapset to your configuration.");
exit(1);
}
if (this_->route) {
@@ -2186,7 +2186,7 @@ navit_init(struct navit *this_)
if (this_->route)
navigation_set_route(this_->navigation, this_->route);
}
- dbg(lvl_info,"Setting Center\n");
+ dbg(lvl_info,"Setting Center");
center_file = bookmarks_get_center_file(FALSE);
bookmarks_set_center_from_file(this_->bookmarks, center_file);
g_free(center_file);
@@ -2199,7 +2199,7 @@ navit_init(struct navit *this_)
callback_list_call_attr_1(this_->attr_cbl, attr_navit, this_);
callback=(this_->ready == 2);
this_->ready|=1;
- dbg(lvl_info,"ready=%d\n",this_->ready);
+ dbg(lvl_info,"ready=%d",this_->ready);
if (this_->ready == 3)
navit_draw_async(this_, 1);
if (callback)
@@ -2216,15 +2216,15 @@ navit_zoom_to_rect(struct navit *this_, struct coord_rect *r)
c.y=(r->rl.y+r->lu.y)/2;
transform_set_center(this_->trans, &c);
transform_get_size(this_->trans, &w, &h);
- dbg(lvl_debug,"center 0x%x,0x%x w %d h %d\n",c.x,c.y,w,h);
- dbg(lvl_debug,"%x,%x-%x,%x\n", r->lu.x,r->lu.y,r->rl.x,r->rl.y);
+ dbg(lvl_debug,"center 0x%x,0x%x w %d h %d",c.x,c.y,w,h);
+ dbg(lvl_debug,"%x,%x-%x,%x", r->lu.x,r->lu.y,r->rl.x,r->rl.y);
while (scale < 1<<20) {
struct point p1,p2;
transform_set_scale(this_->trans, scale);
transform_setup_source_rect(this_->trans);
transform(this_->trans, transform_get_projection(this_->trans), &r->lu, &p1, 1, 0, 0, NULL);
transform(this_->trans, transform_get_projection(this_->trans), &r->rl, &p2, 1, 0, 0, NULL);
- dbg(lvl_debug,"%d,%d-%d,%d\n",p1.x,p1.y,p2.x,p2.y);
+ dbg(lvl_debug,"%d,%d-%d,%d",p1.x,p1.y,p2.x,p2.y);
if (p1.x < 0 || p2.x < 0 || p1.x > w || p2.x > w ||
p1.y < 0 || p2.y < 0 || p1.y > h || p2.y > h)
scale*=2;
@@ -2232,7 +2232,7 @@ navit_zoom_to_rect(struct navit *this_, struct coord_rect *r)
break;
}
- dbg(lvl_debug,"scale=%d (0x%x) of %d (0x%x)\n",scale,scale,1<<20,1<<20);
+ dbg(lvl_debug,"scale=%d (0x%x) of %d (0x%x)",scale,scale,1<<20,1<<20);
if (this_->ready == 3)
navit_draw_async(this_,0);
}
@@ -2248,17 +2248,17 @@ navit_zoom_to_route(struct navit *this_, int orientation)
int count=0;
if (! this_->route)
return;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
map=route_get_map(this_->route);
- dbg(lvl_debug,"map=%p\n",map);
+ dbg(lvl_debug,"map=%p",map);
if (map)
mr=map_rect_new(map, NULL);
- dbg(lvl_debug,"mr=%p\n",mr);
+ dbg(lvl_debug,"mr=%p",mr);
if (mr) {
while ((item=map_rect_get_item(mr))) {
- dbg(lvl_debug,"item=%s\n", item_to_name(item->type));
+ dbg(lvl_debug,"item=%s", item_to_name(item->type));
while (item_coord_get(item, &c, 1)) {
- dbg(lvl_debug,"coord\n");
+ dbg(lvl_debug,"coord");
if (!count)
r.lu=r.rl=c;
else
@@ -2396,15 +2396,15 @@ navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation,
if (this_->gra) {
padding = graphics_get_data(this_->gra, "padding");
} else
- dbg(lvl_warning, "cannot get padding: this->gra is NULL\n");
+ dbg(lvl_warning, "cannot get padding: this->gra is NULL");
transform_get_size(this_->trans, &width, &height);
- dbg(lvl_debug, "width=%d height=%d\n", width, height);
+ dbg(lvl_debug, "width=%d height=%d", width, height);
if (padding) {
width -= (padding->left + padding->right);
height -= (padding->top + padding->bottom);
- dbg(lvl_debug, "corrected for padding: width=%d height=%d\n", width, height);
+ dbg(lvl_debug, "corrected for padding: width=%d height=%d", width, height);
}
if (this_->orientation == -1 || keep_orientation) {
@@ -2431,7 +2431,7 @@ navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation,
p->y += padding->top;
}
- dbg(lvl_debug, "x=%d y=%d, offset=%f\n", p->x, p->y, offset);
+ dbg(lvl_debug, "x=%d y=%d, offset=%f", p->x, p->y, offset);
return 1;
}
@@ -2521,7 +2521,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
active.type=attr_active;
active.u.num=0;
- dbg(lvl_debug, "enter, this_=%p, attr=%p (%s), init=%d\n", this_, attr, attr_to_name(attr->type), init);
+ dbg(lvl_debug, "enter, this_=%p, attr=%p (%s), init=%d", this_, attr, attr_to_name(attr->type), init);
switch (attr->type) {
case attr_autozoom:
@@ -2534,7 +2534,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
break;
case attr_center:
transform_from_geo(transform_get_projection(this_->trans), attr->u.coord_geo, &co);
- dbg(lvl_debug,"0x%x,0x%x\n",co.x,co.y);
+ dbg(lvl_debug,"0x%x,0x%x",co.x,co.y);
transform_set_center(this_->trans, &co);
break;
case attr_drag_bitmap:
@@ -2610,7 +2610,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
}
break;
case attr_osd_configuration:
- dbg(lvl_debug,"setting osd_configuration to %ld (was %d)\n", attr->u.num, this_->osd_configuration);
+ dbg(lvl_debug,"setting osd_configuration to %ld (was %d)", attr->u.num, this_->osd_configuration);
attr_updated=(this_->osd_configuration != attr->u.num);
this_->osd_configuration=attr->u.num;
break;
@@ -2715,7 +2715,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
this_->waypoints_flag=!!attr->u.num;
break;
default:
- dbg(lvl_debug, "calling generic setter method for attribute type %s\n", attr_to_name(attr->type))
+ dbg(lvl_debug, "calling generic setter method for attribute type %s", attr_to_name(attr->type))
return navit_object_set_attr((struct navit_object *) this_, attr);
}
if (attr_updated && !init) {
@@ -2933,7 +2933,7 @@ navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, stru
attr->u.num=this_->waypoints_flag;
break;
default:
- dbg(lvl_debug, "calling generic getter method for attribute type %s\n", attr_to_name(type))
+ dbg(lvl_debug, "calling generic getter method for attribute type %s", attr_to_name(type))
return navit_object_get_attr((struct navit_object *) this_, type, attr, iter);
}
attr->type=type;
@@ -3433,9 +3433,9 @@ navit_layout_switch(struct navit *n)
//Check that we aren't calculating too fast
if (vehicle_get_attr(n->vehicle->vehicle, attr_position_time_iso8601,&iso8601_attr,NULL)==1) {
currTs=iso8601_to_secs(iso8601_attr.u.str);
- dbg(lvl_debug,"currTs: %u:%u\n",currTs%86400/3600,((currTs%86400)%3600)/60);
+ dbg(lvl_debug,"currTs: %u:%u",currTs%86400/3600,((currTs%86400)%3600)/60);
}
- dbg(lvl_debug,"prevTs: %u:%u\n",n->prevTs%86400/3600,((n->prevTs%86400)%3600)/60);
+ dbg(lvl_debug,"prevTs: %u:%u",n->prevTs%86400/3600,((n->prevTs%86400)%3600)/60);
if (n->auto_switch == FALSE)
return;
@@ -3456,17 +3456,17 @@ navit_layout_switch(struct navit *n)
}
//We calculate sunrise anyway, cause it is needed both for day and for night
if (__sunriset__(year,month,day,geo_attr.u.coord_geo->lng,geo_attr.u.coord_geo->lat,-5,1,&trise,&tset)!=0) {
- dbg(lvl_debug,"near the pole sun never rises/sets, so we should never switch profiles\n");
- dbg(lvl_debug,"trise: %u:%u\n",HOURS(trise),MINUTES(trise));
- dbg(lvl_debug,"tset: %u:%u\n",HOURS(tset),MINUTES(tset));
+ dbg(lvl_debug,"near the pole sun never rises/sets, so we should never switch profiles");
+ dbg(lvl_debug,"trise: %u:%u",HOURS(trise),MINUTES(trise));
+ dbg(lvl_debug,"tset: %u:%u",HOURS(tset),MINUTES(tset));
n->prevTs=currTs;
return;
}
trise_actual=trise;
- dbg(lvl_debug,"trise: %u:%u\n",HOURS(trise),MINUTES(trise));
- dbg(lvl_debug,"tset: %u:%u\n",HOURS(tset),MINUTES(tset));
- dbg(lvl_debug,"dayname = %s, name =%s \n",l->dayname, l->name);
- dbg(lvl_debug,"nightname = %s, name = %s \n",l->nightname, l->name);
+ dbg(lvl_debug,"trise: %u:%u",HOURS(trise),MINUTES(trise));
+ dbg(lvl_debug,"tset: %u:%u",HOURS(tset),MINUTES(tset));
+ dbg(lvl_debug,"dayname = %s, name =%s ",l->dayname, l->name);
+ dbg(lvl_debug,"nightname = %s, name = %s ",l->nightname, l->name);
if (HOURS(trise)*60+MINUTES(trise)<(currTs%86400)/60) {
after_sunrise = TRUE;
}
@@ -3477,10 +3477,10 @@ navit_layout_switch(struct navit *n)
}
if (after_sunrise && !after_sunset && l->dayname) {
navit_set_layout_by_name(n,l->dayname);
- dbg(lvl_debug,"layout set to day\n");
+ dbg(lvl_debug,"layout set to day");
}else if (after_sunset && l->nightname) {
navit_set_layout_by_name(n,l->nightname);
- dbg(lvl_debug,"layout set to night\n");
+ dbg(lvl_debug,"layout set to night");
}
n->prevTs=currTs;
}
@@ -3514,7 +3514,7 @@ void navit_cmd_switch_layout_day_night(struct navit *this_, char *function, stru
return;
}
- dbg(lvl_debug," called with mode =%s\n",in[0]->u.str);
+ dbg(lvl_debug," called with mode =%s",in[0]->u.str);
if (!this_->layout_current)
return;
@@ -3534,26 +3534,26 @@ void navit_cmd_switch_layout_day_night(struct navit *this_, char *function, stru
if (this_->layout_current->dayname) {
navit_set_layout_by_name(this_,this_->layout_current->dayname);
this_->auto_switch = FALSE;
- dbg(lvl_debug,"toggeled layout to = %s\n",this_->layout_current->name);
+ dbg(lvl_debug,"toggeled layout to = %s",this_->layout_current->name);
}
else if (this_->layout_current->nightname) {
navit_set_layout_by_name(this_,this_->layout_current->nightname);
this_->auto_switch = FALSE;
- dbg(lvl_debug,"toggeled layout to = %s\n",this_->layout_current->name);
+ dbg(lvl_debug,"toggeled layout to = %s",this_->layout_current->name);
}
}
else if (!strcmp(in[0]->u.str,"manual_day") && this_->layout_current->dayname) {
navit_set_layout_by_name(this_,this_->layout_current->dayname);
this_->auto_switch = FALSE;
- dbg(lvl_debug,"switched layout to = %s\n",this_->layout_current->name);
+ dbg(lvl_debug,"switched layout to = %s",this_->layout_current->name);
}
else if (!strcmp(in[0]->u.str,"manual_night") && this_->layout_current->nightname) {
navit_set_layout_by_name(this_,this_->layout_current->nightname);
this_->auto_switch = FALSE;
- dbg(lvl_debug,"switched layout to = %s\n",this_->layout_current->name);
+ dbg(lvl_debug,"switched layout to = %s",this_->layout_current->name);
}
- dbg(lvl_debug,"auto = %i\n",this_->auto_switch);
+ dbg(lvl_debug,"auto = %i",this_->auto_switch);
return;
}
@@ -3668,7 +3668,7 @@ int navit_get_blocked(struct navit *this_)
void
navit_destroy(struct navit *this_)
{
- dbg(lvl_debug,"enter %p\n",this_);
+ dbg(lvl_debug,"enter %p",this_);
graphics_draw_cancel(this_->gra, this_->displaylist);
callback_list_call_attr_1(this_->attr_cbl, attr_destroy, this_);
attr_list_free(this_->attrs);
diff --git a/navit/osd.c b/navit/osd.c
index f2ac701d1..32269700e 100644
--- a/navit/osd.c
+++ b/navit/osd.c
@@ -54,7 +54,7 @@ osd_new(struct attr *parent, struct attr **attrs)
return NULL;
new=plugin_get_category_osd(type->u.str);
if (! new) {
- dbg(lvl_error, "invalid OSD type '%s'\n", type->u.str);
+ dbg(lvl_error, "invalid OSD type '%s'", type->u.str);
return NULL;
}
o=g_new0(struct osd, 1);
@@ -72,7 +72,7 @@ osd_new(struct attr *parent, struct attr **attrs)
g_free(o);
o=NULL;
}
- dbg(lvl_debug,"new osd %p\n",o);
+ dbg(lvl_debug,"new osd %p",o);
return o;
}
@@ -131,7 +131,7 @@ osd_evaluate_command(struct osd_item *this, struct navit *nav)
struct attr navit;
navit.type=attr_navit;
navit.u.navit=nav;
- dbg(lvl_debug, "calling command '%s'\n", this->command);
+ dbg(lvl_debug, "calling command '%s'", this->command);
command_evaluate(&navit, this->command);
}
@@ -192,14 +192,14 @@ osd_std_calculate_sizes(struct osd_item *item, int w, int h)
if (item->gr) {
padding = graphics_get_data(item->gr, "padding");
if (padding) {
- dbg(lvl_debug, "Got padding=%p for item=%p (item->gr=%p): left=%d top=%d right=%d bottom=%d\n",
+ dbg(lvl_debug, "Got padding=%p for item=%p (item->gr=%p): left=%d top=%d right=%d bottom=%d",
padding, item, item->gr, padding->left, padding->top, padding->right, padding->bottom);
} else {
- dbg(lvl_debug, "Got padding=%p for item=%p (item->gr=%p)\n",
+ dbg(lvl_debug, "Got padding=%p for item=%p (item->gr=%p)",
padding, item, item->gr);
}
} else
- dbg(lvl_warning, "cannot get padding for item=%p: item->gr is NULL\n", item);
+ dbg(lvl_warning, "cannot get padding for item=%p: item->gr is NULL", item);
/* reduce w and h by total padding in the respective dimension */
if (padding) {
@@ -260,12 +260,12 @@ osd_std_keypress(struct osd_item *item, struct navit *nav, char *key)
{
#if 0
int i;
- dbg(lvl_debug,"key=%s\n",key);
+ dbg(lvl_debug,"key=%s",key);
for (i = 0 ; i < strlen(key) ; i++) {
- dbg(lvl_debug,"key:0x%02x\n",key[i]);
+ dbg(lvl_debug,"key:0x%02x",key[i]);
}
for (i = 0 ; i < strlen(item->accesskey) ; i++) {
- dbg(lvl_debug,"accesskey:0x%02x\n",item->accesskey[i]);
+ dbg(lvl_debug,"accesskey:0x%02x",item->accesskey[i]);
}
#endif
if ( ! graphics_is_disabled(item->gr) && item->accesskey && key && !strcmp(key, item->accesskey))
@@ -289,14 +289,14 @@ osd_std_reconfigure(struct osd_item *item, struct command_saved *cs)
{
char *err = NULL; /* Error description */
- dbg(lvl_debug, "enter, item=%p, cs=%p\n", item, cs);
+ dbg(lvl_debug, "enter, item=%p, cs=%p", item, cs);
if (!command_saved_error(cs)) {
item->configured = !! command_saved_get_int(cs);
if (item->gr && !(item->flags & DISABLE_OVERLAY))
graphics_overlay_disable(item->gr, !item->configured);
} else {
err = command_error_to_text(command_saved_error(cs));
- dbg(lvl_error, "Error in saved command: %s, cs=%p.\n", err, cs);
+ dbg(lvl_error, "Error in saved command: %s, cs=%p.", err, cs);
g_free(err);
}
}
@@ -387,7 +387,7 @@ osd_std_config(struct osd_item *item, struct navit *navit)
struct attr attr;
char *err = NULL; /* Error description */
- dbg(lvl_debug, "enter, item=%p, enable_cs=%p\n", item, item->enable_cs);
+ dbg(lvl_debug, "enter, item=%p, enable_cs=%p", item, item->enable_cs);
if (item->enable_cs) {
item->reconfig_cb = callback_new_1(callback_cast(osd_std_reconfigure), item);
command_saved_set_cb(item->enable_cs, item->reconfig_cb);
@@ -396,7 +396,7 @@ osd_std_config(struct osd_item *item, struct navit *navit)
item->configured = !! command_saved_get_int(item->enable_cs);
} else {
err = command_error_to_text(command_saved_error(item->enable_cs));
- dbg(lvl_error, "Error in saved command: %s, item=%p.\n", err, item);
+ dbg(lvl_error, "Error in saved command: %s, item=%p.", err, item);
g_free(err);
}
} else {
@@ -412,7 +412,7 @@ osd_std_config(struct osd_item *item, struct navit *navit)
void
osd_set_std_config(struct navit *nav, struct osd_item *item)
{
- dbg(lvl_debug, "enter, item=%p\n", item);
+ dbg(lvl_debug, "enter, item=%p", item);
item->cb = callback_new_attr_2(callback_cast(osd_std_config), attr_osd_configuration, item, nav);
navit_add_callback(nav, item->cb);
osd_std_config(item, nav);
@@ -422,7 +422,7 @@ void
osd_set_keypress(struct navit *nav, struct osd_item *item)
{
struct graphics *navit_gr = navit_get_graphics(nav);
- dbg(lvl_info,"accesskey %s\n",item->accesskey);
+ dbg(lvl_info,"accesskey %s",item->accesskey);
if (item->accesskey) {
item->keypress_cb=callback_new_attr_2(callback_cast(osd_std_keypress), attr_keypress, item, nav);
graphics_add_callback(navit_gr, item->keypress_cb);
@@ -453,12 +453,12 @@ osd_set_std_graphic(struct navit *nav, struct osd_item *item, struct osd_priv *p
padding = graphics_get_data(navit_gr, "padding");
if (padding) {
- dbg(lvl_debug, "Got padding=%p for item=%p: left=%d top=%d right=%d bottom=%d\n",
+ dbg(lvl_debug, "Got padding=%p for item=%p: left=%d top=%d right=%d bottom=%d",
padding, item, padding->left, padding->top, padding->right, padding->bottom);
w -= (padding->left + padding->right);
h -= (padding->top + padding->bottom);
} else
- dbg(lvl_debug, "Padding is NULL\n");
+ dbg(lvl_debug, "Padding is NULL");
osd_std_calculate_sizes(item, w, h);
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c
index aca868f1d..7e3a0d737 100644
--- a/navit/osd/core/osd_core.c
+++ b/navit/osd/core/osd_core.c
@@ -785,7 +785,7 @@ static void draw_aligned_osd_text(char *buffer, int align, struct osd_item *osd_
last++;
}
- dbg(lvl_debug,"align=%d\n", align);
+ dbg(lvl_debug,"align=%d", align);
switch (align & 51) {
case 1:
p.y=0;
@@ -1688,7 +1688,7 @@ osd_button_draw(struct osd_priv_common *opc, struct navit *nav)
this->img = graphics_image_new_scaled(gra, this->src, opc->osd_item.w, opc->osd_item.h);
if (!this->img) {
- dbg(lvl_warning, "failed to load '%s'\n", this->src);
+ dbg(lvl_warning, "failed to load '%s'", this->src);
return;
}
@@ -1721,16 +1721,16 @@ osd_button_init(struct osd_priv_common *opc, struct navit *nav)
opc->osd_item.w = -1;
opc->osd_item.h = -1;
}
- dbg(lvl_debug, "enter\n");
- dbg(lvl_debug, "Get: %s, %d, %d, %d, %d\n", this->src, opc->osd_item.rel_w, opc->osd_item.rel_h, opc->osd_item.w, opc->osd_item.h);
+ dbg(lvl_debug, "enter");
+ dbg(lvl_debug, "Get: %s, %d, %d, %d, %d", this->src, opc->osd_item.rel_w, opc->osd_item.rel_h, opc->osd_item.w, opc->osd_item.h);
this->img = graphics_image_new_scaled(gra, this->src, opc->osd_item.w, opc->osd_item.h);
if (!this->img) {
- dbg(lvl_warning, "failed to load '%s'\n", this->src);
+ dbg(lvl_warning, "failed to load '%s'", this->src);
return;
}
else
{
- dbg(lvl_debug,"Got %s: %d, %d\n", this->src, this->img->width, this->img->height);
+ dbg(lvl_debug,"Got %s: %d, %d", this->src, this->img->width, this->img->height);
}
osd_button_adjust_sizes(opc, this->img);
if (this->use_overlay) {
@@ -1784,7 +1784,7 @@ osd_button_set_attr(struct osd_priv_common *opc, struct attr* attr)
gra = navit_get_graphics(nav);
this_->img = graphics_image_new_scaled(gra, this_->src, opc->osd_item.w, opc->osd_item.h);
if (!this_->img) {
- dbg(lvl_warning, "failed to load '%s'\n", this_->src);
+ dbg(lvl_warning, "failed to load '%s'", this_->src);
return 0;
}
@@ -1825,7 +1825,7 @@ osd_button_new(struct navit *nav, struct osd_methods *meth,
osd_set_std_attr(attrs, &opc->osd_item, this->use_overlay ? TRANSPARENT_BG:(TRANSPARENT_BG|DISABLE_OVERLAY));
if (!opc->osd_item.command) {
- dbg(lvl_error, "no command\n");
+ dbg(lvl_error, "no command");
goto error;
}
attr = attr_search(attrs, NULL, attr_src_dir);
@@ -1835,7 +1835,7 @@ osd_button_new(struct navit *nav, struct osd_methods *meth,
this->src_dir=NULL;
attr = attr_search(attrs, NULL, attr_src);
if (!attr) {
- dbg(lvl_error, "no src\n");
+ dbg(lvl_error, "no src");
goto error;
}
@@ -1861,10 +1861,10 @@ osd_image_init(struct osd_priv_common *opc, struct navit *nav)
struct osd_button *this = (struct osd_button *)opc->data;
struct graphics *gra = navit_get_graphics(nav);
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
this->img = graphics_image_new(gra, this->src);
if (!this->img) {
- dbg(lvl_warning, "failed to load '%s'\n", this->src);
+ dbg(lvl_warning, "failed to load '%s'", this->src);
return;
}
osd_button_adjust_sizes(opc, this->img);
@@ -1914,7 +1914,7 @@ osd_image_new(struct navit *nav, struct osd_methods *meth,
attr = attr_search(attrs, NULL, attr_src);
if (!attr) {
- dbg(lvl_error, "no src\n");
+ dbg(lvl_error, "no src");
goto error;
}
@@ -1974,13 +1974,13 @@ static void osd_navigation_status_draw_do(struct osd_priv_common *opc, int statu
if (do_draw) {
osd_fill_with_bgcolor(&opc->osd_item);
image = g_strdup_printf(this->icon_src, nav_status_to_text(status2));
- dbg(lvl_debug, "image=%s\n", image);
+ dbg(lvl_debug, "image=%s", image);
gr_image =
graphics_image_new_scaled(opc->osd_item.gr,
image, this->icon_w,
this->icon_h);
if (!gr_image) {
- dbg(lvl_error,"failed to load %s in %dx%d\n",image,this->icon_w,this->icon_h);
+ dbg(lvl_error,"failed to load %s in %dx%d",image,this->icon_w,this->icon_h);
g_free(image);
image = graphics_icon_path("unknown.png");
gr_image =
@@ -1991,7 +1991,7 @@ static void osd_navigation_status_draw_do(struct osd_priv_common *opc, int statu
this->
icon_h);
}
- dbg(lvl_debug, "gr_image=%p\n", gr_image);
+ dbg(lvl_debug, "gr_image=%p", gr_image);
if (gr_image) {
p.x =
(opc->osd_item.w -
@@ -2049,7 +2049,7 @@ static void osd_navigation_status_init(struct osd_priv_common *opc, struct navit
struct navigation *nav = NULL;
struct attr attr;
- dbg(lvl_debug, "enter, opc=%p\n", opc);
+ dbg(lvl_debug, "enter, opc=%p", opc);
osd_set_std_graphic(navit, &opc->osd_item, (struct osd_priv *)opc);
if (navit)
nav = navit_get_navigation(navit);
@@ -2059,7 +2059,7 @@ static void osd_navigation_status_init(struct osd_priv_common *opc, struct navit
osd_navigation_status_draw_do(opc, attr.u.num);
}
else
- dbg(lvl_error, "navigation instance is NULL, OSD will never update\n");
+ dbg(lvl_error, "navigation instance is NULL, OSD will never update");
//navit_add_callback(nav, callback_new_attr_1(callback_cast(osd_std_click), attr_button, &opc->osd_item)); // FIXME do we need this?
}
@@ -2159,7 +2159,7 @@ osd_nav_next_turn_draw(struct osd_priv_common *opc, struct navit *navit,
&& (item->type == type_nav_position || item->type == type_nav_none || level-- > 0));
if (item) {
name = item_to_name(item->type);
- dbg(lvl_debug, "name=%s\n", name);
+ dbg(lvl_debug, "name=%s", name);
if (this->active != 1 || this->last_name != name) {
this->active = 1;
this->last_name = name;
@@ -2178,13 +2178,13 @@ osd_nav_next_turn_draw(struct osd_priv_common *opc, struct navit *navit,
osd_fill_with_bgcolor(&opc->osd_item);
if (this->active) {
image = g_strdup_printf(this->icon_src, name);
- dbg(lvl_debug, "image=%s\n", image);
+ dbg(lvl_debug, "image=%s", image);
gr_image =
graphics_image_new_scaled(opc->osd_item.gr,
image, this->icon_w,
this->icon_h);
if (!gr_image) {
- dbg(lvl_error,"failed to load %s in %dx%d\n",image,this->icon_w,this->icon_h);
+ dbg(lvl_error,"failed to load %s in %dx%d",image,this->icon_w,this->icon_h);
g_free(image);
image = graphics_icon_path("unknown.png");
gr_image =
@@ -2195,7 +2195,7 @@ osd_nav_next_turn_draw(struct osd_priv_common *opc, struct navit *navit,
this->
icon_h);
}
- dbg(lvl_debug, "gr_image=%p\n", gr_image);
+ dbg(lvl_debug, "gr_image=%p", gr_image);
if (gr_image) {
p.x =
(opc->osd_item.w -
@@ -2302,7 +2302,7 @@ osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct navit *navit,
if (!navit_get_attr(navit, attr_speech, &speechattr, NULL))
{
- dbg(lvl_error, "No speech plugin available, toggle_announcer disabled.\n");
+ dbg(lvl_error, "No speech plugin available, toggle_announcer disabled.");
return;
}
if (!speech_get_attr(speechattr.u.speech, attr_active, &attr, NULL))
@@ -2335,7 +2335,7 @@ osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct navit *navit,
gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, this->icon_w, this->icon_h);
}
- dbg(lvl_debug, "gr_image=%p\n", gr_image);
+ dbg(lvl_debug, "gr_image=%p", gr_image);
if (gr_image)
{
@@ -3258,8 +3258,8 @@ osd_text_draw(struct osd_priv_common *opc, struct navit *navit, struct vehicle *
}
if (item) {
- dbg(lvl_debug,"name %s\n", item_to_name(item->type));
- dbg(lvl_debug,"type %s\n", attr_to_name(oti->attr_typ));
+ dbg(lvl_debug,"name %s", item_to_name(item->type));
+ dbg(lvl_debug,"type %s", attr_to_name(oti->attr_typ));
if (item_attr_get(item, oti->attr_typ, &attr))
value=osd_text_format_attr(&attr, oti->format, imperial);
}
@@ -3371,7 +3371,7 @@ osd_text_draw(struct osd_priv_common *opc, struct navit *navit, struct vehicle *
last++;
}
- dbg(lvl_debug,"this->align=%d\n", this->align);
+ dbg(lvl_debug,"this->align=%d", this->align);
switch (this->align & 51) {
case 1:
p.y=0;
@@ -3654,7 +3654,7 @@ osd_gps_status_draw(struct osd_priv_common *opc, struct navit *navit,
case 2:
strength=2;
if (vehicle_get_attr(vehicle_attr.u.vehicle, attr_position_sats_used, &attr, NULL)) {
- dbg(lvl_debug,"num=%ld\n", attr.u.num);
+ dbg(lvl_debug,"num=%ld", attr.u.num);
if (attr.u.num >= 3)
strength=attr.u.num-1;
if (strength > 5)
@@ -4043,7 +4043,7 @@ osd_auxmap_draw(struct osd_priv_common *opc)
memset(&sel, 0, sizeof(sel));
sel.u.p_rect.rl.x=opc->osd_item.w;
sel.u.p_rect.rl.y=opc->osd_item.h;
- dbg(lvl_debug,"osd_auxmap_draw: sel.u.p_rect.rl=(%d, %d)\n", opc->osd_item.w, opc->osd_item.h);
+ dbg(lvl_debug,"osd_auxmap_draw: sel.u.p_rect.rl=(%d, %d)", opc->osd_item.w, opc->osd_item.h);
transform_set_screen_selection(this->trans, &sel);
graphics_set_rect(opc->osd_item.gr, &sel.u.p_rect);
}
diff --git a/navit/plugin.c b/navit/plugin.c
index aae09c470..2b4749efb 100644
--- a/navit/plugin.c
+++ b/navit/plugin.c
@@ -177,20 +177,20 @@ plugin_load(struct plugin *pl)
GModule *mod;
if (pl->mod) {
- dbg(lvl_debug,"'%s' already loaded, returning\n", pl->name);
+ dbg(lvl_debug,"'%s' already loaded, returning", pl->name);
return 1;
}
mod=g_module_open(pl->name, G_MODULE_BIND_LOCAL | (pl->lazy ? G_MODULE_BIND_LAZY : 0));
if (! mod) {
- dbg(lvl_error,"can't load '%s', Error '%s'\n", pl->name, g_module_error());
+ dbg(lvl_error,"can't load '%s', Error '%s'", pl->name, g_module_error());
return 0;
}
if (!g_module_symbol(mod, "plugin_init", &init)) {
- dbg(lvl_error,"can't load '%s', plugin_init not found\n", pl->name);
+ dbg(lvl_error,"can't load '%s', plugin_init not found", pl->name);
g_module_close(mod);
return 0;
} else {
- dbg(lvl_debug, "loaded module %s\n", pl->name);
+ dbg(lvl_debug, "loaded module %s", pl->name);
pl->mod=mod;
pl->init=init;
}
@@ -285,7 +285,7 @@ plugin_new(struct attr *parent, struct attr **attrs) {
pls=parent->u.plugins;
if (! (path_attr=attr_search(attrs, NULL, attr_path))) {
- dbg(lvl_error,"missing path\n");
+ dbg(lvl_error,"missing path");
return NULL;
}
if ( (attr=attr_search(attrs, NULL, attr_active))) {
@@ -297,20 +297,20 @@ plugin_new(struct attr *parent, struct attr **attrs) {
if ( (attr=attr_search(attrs, NULL, attr_ondemand))) {
ondemand=attr->u.num;
}
- dbg(lvl_debug, "path=\"%s\", active=%d, lazy=%d, ondemand=%d\n",path_attr->u.str, active, lazy, ondemand);
+ dbg(lvl_debug, "path=\"%s\", active=%d, lazy=%d, ondemand=%d",path_attr->u.str, active, lazy, ondemand);
we=file_wordexp_new(path_attr->u.str);
count=file_wordexp_get_count(we);
array=file_wordexp_get_array(we);
- dbg(lvl_info,"expanded to %d words\n",count);
+ dbg(lvl_info,"expanded to %d words",count);
if (count != 1 || file_exists(array[0])) {
for (i = 0 ; i < count ; i++) {
name=array[i];
- dbg(lvl_info,"found plugin module file [%d]: '%s'\n", i, name);
+ dbg(lvl_info,"found plugin module file [%d]: '%s'", i, name);
if (! (pls && (pl=g_hash_table_lookup(pls->hash, name)))) {
pl=plugin_new_from_path(name);
if (! pl) {
- dbg(lvl_error,"failed to create plugin from file '%s'\n", name);
+ dbg(lvl_error,"failed to create plugin from file '%s'", name);
continue;
}
if (pls) {
@@ -362,7 +362,7 @@ plugins_init(struct plugins *pls)
l=g_list_next(l);
}
} else {
- dbg(lvl_error, "Warning: No plugins found. Is Navit installed correctly?\n");
+ dbg(lvl_error, "Warning: No plugins found. Is Navit installed correctly?");
}
#endif
}
@@ -405,7 +405,7 @@ plugin_get_category(enum plugin_category category, const char *category_name, co
char *mod_name, *filename=NULL, *corename=NULL;
void *result=NULL;
- dbg(lvl_debug, "category=\"%s\", name=\"%s\"\n", category_name, name);
+ dbg(lvl_debug, "category=\"%s\", name=\"%s\"", category_name, name);
if ((result=find_by_name(category, name))) {
return result;
@@ -422,7 +422,7 @@ plugin_get_category(enum plugin_category category, const char *category_name, co
else
mod_name=pl->name;
if (!g_ascii_strncasecmp(mod_name, filename, strlen(filename)) || !g_ascii_strncasecmp(mod_name, corename, strlen(corename))) {
- dbg(lvl_debug, "Loading module \"%s\"\n",pl->name) ;
+ dbg(lvl_debug, "Loading module \"%s\"",pl->name) ;
if (plugin_get_active(pl))
if (!plugin_load(pl))
plugin_set_active(pl, 0);
diff --git a/navit/plugin/j1850/j1850.c b/navit/plugin/j1850/j1850.c
index 26e18057d..046087fbe 100644
--- a/navit/plugin/j1850/j1850.c
+++ b/navit/plugin/j1850/j1850.c
@@ -112,7 +112,7 @@ void write_to_serial_port(unsigned char *cmd, int device)
n_written += write( device, &cmd[n_written], 1 );
}
while (cmd[n_written-1] != '\r' && n_written > 0);
- dbg(lvl_info,"sent %s to the serial port\n",cmd);
+ dbg(lvl_info,"sent %s to the serial port",cmd);
}
/**
@@ -152,7 +152,7 @@ j1850_idle(struct j1850 *j1850)
// Make sure we sent all init commands before trying to read
if ( init_string[j1850->init_string_index])
{
- dbg(lvl_info,"Sending next init command : %s\n",init_string[j1850->init_string_index]);
+ dbg(lvl_info,"Sending next init command : %s",init_string[j1850->init_string_index]);
if (j1850->device > 0 ){
write_to_serial_port(init_string[j1850->init_string_index++],j1850->device);
}
@@ -177,9 +177,9 @@ j1850_idle(struct j1850 *j1850)
n = read( j1850->device, &buf, 1 );
if(n == -1) {
- dbg(lvl_debug,"x\n");
+ dbg(lvl_debug,"x");
} else if (n==0) {
- dbg(lvl_debug,".\n");
+ dbg(lvl_debug,".");
} else {
if( buf == 13 ) {
gettimeofday(&tv, NULL);
@@ -205,25 +205,25 @@ j1850_idle(struct j1850 *j1850)
if (strcmp(j1850->message, "3D110000EE") == 0) {
// noise
} else if (strcmp(j1850->message, "3D1120009B") == 0) {
- dbg(lvl_error,"L1\n");
+ dbg(lvl_error,"L1");
command_evaluate(&navit, "gui.spotify_volume_up()" );
} else if (strcmp(j1850->message, "3D110080C8") == 0) {
- dbg(lvl_error,"L2\n");
+ dbg(lvl_error,"L2");
command_evaluate(&navit, "gui.spotify_volume_toggle()" );
} else if (strcmp(j1850->message, "3D1110005A") == 0) {
- dbg(lvl_error,"L3\n");
+ dbg(lvl_error,"L3");
command_evaluate(&navit, "gui.spotify_volume_down()" );
} else if (strcmp(j1850->message, "3D110400C3") == 0) {
- dbg(lvl_error,"R1\n");
+ dbg(lvl_error,"R1");
command_evaluate(&navit, "gui.spotify_next_track()" );
} else if (strcmp(j1850->message, "3D110002D4") == 0) {
- dbg(lvl_error,"R2\n");
+ dbg(lvl_error,"R2");
command_evaluate(&navit, "gui.spotify_toggle()" );
} else if (strcmp(j1850->message, "3D11020076") == 0) {
- dbg(lvl_error,"R3\n");
+ dbg(lvl_error,"R3");
command_evaluate(&navit, "gui.spotify_previous_track()" );
} else {
- dbg(lvl_error,"Got button from %s\n", j1850->message);
+ dbg(lvl_error,"Got button from %s", j1850->message);
}
} else if( strncmp(header,"72",2)==0 ) {
char * data=strndup(j1850->message+2, 8);
@@ -375,11 +375,11 @@ void send_and_read(unsigned char *cmd, int USB)
while( buf != '\r' && n > 0);
if (n < 0) {
- dbg(lvl_error,"Read error\n");
+ dbg(lvl_error,"Read error");
} else if (n == 0) {
- dbg(lvl_error,"Nothing to read?\n");
+ dbg(lvl_error,"Nothing to read?");
} else {
- dbg(lvl_error,"Response : \n");
+ dbg(lvl_error,"Response : ");
}
}
@@ -400,7 +400,7 @@ j1850_init_serial_port(struct j1850 *j1850)
j1850->device = open( "/dev/ttyUSB0", O_RDWR| O_NOCTTY );
if ( j1850->device < 0 )
{
- dbg(lvl_error,"Can't open port\n");
+ dbg(lvl_error,"Can't open port");
j1850->idle=event_add_timeout(100, 1, j1850->callback);
return;
}
@@ -412,7 +412,7 @@ j1850_init_serial_port(struct j1850 *j1850)
/* Error Handling */
if ( tcgetattr ( j1850->device, &tty ) != 0 )
{
- dbg(lvl_error,"Error\n");
+ dbg(lvl_error,"Error");
return;
}
@@ -441,11 +441,11 @@ j1850_init_serial_port(struct j1850 *j1850)
tcflush( j1850->device, TCIFLUSH );
if ( tcsetattr ( j1850->device, TCSANOW, &tty ) != 0)
{
- dbg(lvl_error,"Flush error\n");
+ dbg(lvl_error,"Flush error");
return;
}
- dbg(lvl_error,"Port init ok\n");
+ dbg(lvl_error,"Port init ok");
// For the init part, we want to wait 1sec before each init string
j1850->idle=event_add_timeout(1000, 1, j1850->callback);
}
@@ -470,7 +470,7 @@ osd_j1850_new(struct navit *nav, struct osd_methods *meth,
time_t current_time = time(NULL);
// FIXME : make sure that the directory we log to exists!
this->filename=g_strdup_printf("/home/navit/.navit/obd/%ld.log",(long)current_time);
- dbg(lvl_error,"Will log to %s\n", this->filename);
+ dbg(lvl_error,"Will log to %s", this->filename);
this->init_string_index=0;
struct attr *attr;
this->osd_item.p.x = 120;
diff --git a/navit/plugin/pedestrian/pedestrian.c b/navit/plugin/pedestrian/pedestrian.c
index 7e5a4361d..93ba527d2 100644
--- a/navit/plugin/pedestrian/pedestrian.c
+++ b/navit/plugin/pedestrian/pedestrian.c
@@ -92,13 +92,13 @@ pedestrian_rocket_idle(struct rocket *rocket)
transform_set_hog(rocket->trans, rocket->hog);
graphics_displaylist_draw(rocket->gra, rocket->dl, rocket->trans, rocket->layout, 0);
rocket->v+=rocket->a-rocket->g;
- dbg(lvl_debug,"enter v=%d\n",rocket->v);
+ dbg(lvl_debug,"enter v=%d",rocket->v);
if (rocket->t > 0)
rocket->t--;
else
rocket->a=0;
rocket->hog+=rocket->v/rocket->vscale;
- dbg(lvl_debug,"hog=%d\n",rocket->hog);
+ dbg(lvl_debug,"hog=%d",rocket->hog);
if (rocket->hog < 0) {
transform_set_hog(rocket->trans, 0);
transform_set_order_base(rocket->trans, 14);
@@ -192,7 +192,7 @@ osd_rocket_init(struct navit *nav)
if (navit_get_attr(nav, attr_layout, &attr, NULL))
rocket->layout=attr.u.layout;
if (navit_get_attr(nav, attr_callback_list, &attr, NULL)) {
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
command_add_table(attr.u.callback_list, commands, sizeof(commands)/sizeof(struct command_table), rocket);
}
}
@@ -207,7 +207,7 @@ osd_marker_draw(struct marker *this, struct navit *nav)
#if 0
struct attr graphics;
struct point p;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (!navit_get_attr(nav, attr_graphics, &graphics, NULL))
return;
p.x=40;
@@ -401,7 +401,7 @@ static void
map_route_occluded_check_buildings(struct coord *c0)
{
struct building *b=buildings;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
int i,count;
struct coord *c;
#if 1
@@ -414,7 +414,7 @@ map_route_occluded_check_buildings(struct coord *c0)
count=b->sd->count;
if (c[count-1].x == c[0].x && c[count-1].y == c[0].y) {
#if 0
- dbg(lvl_debug,"closed\n");
+ dbg(lvl_debug,"closed");
#endif
count--;
}
@@ -457,11 +457,11 @@ intersect(struct coord *p1, struct coord *p2, struct coord *p3, struct coord *p4
num=-num;
den=-den;
}
- dbg(lvl_debug,"num=%f den=%f\n", num, den);
+ dbg(lvl_debug,"num=%f den=%f", num, den);
if (i) {
i->x=p1->x+(num/den)*(p2->x-p1->x)+0.5;
i->y=p1->y+(num/den)*(p2->y-p1->y)+0.5;
- dbg(lvl_debug,"i=0x%x,0x%x\n", i->x, i->y);
+ dbg(lvl_debug,"i=0x%x,0x%x", i->x, i->y);
if (debug2)
fprintf(debug2, "0x%x 0x%x type=town_label_5e3\n", i->x, i->y);
}
@@ -489,18 +489,18 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
struct building *b=buildings;
struct coord cn;
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#endif
while (b) {
if (side(&b->left, &b->right, c1) < 0 || side(&b->left, &b->right, c2) < 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"sides left: start %d end %d right: start %d end %d\n", side(c0, &b->left, c1), side(c0, &b->left, c2), side(c0, &b->right, c1), side(c0, &b->right, c2));
+ dbg(lvl_debug,"sides left: start %d end %d right: start %d end %d", side(c0, &b->left, c1), side(c0, &b->left, c2), side(c0, &b->right, c1), side(c0, &b->right, c2));
#endif
for (;;) {
if (side(c0, &b->left, c1) <= 0) {
if (side(c0, &b->left, c2) > 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: start is left of left corner and end is right of left corner, clipping end\n");
+ dbg(lvl_debug,"visible: start is left of left corner and end is right of left corner, clipping end");
#endif
res=intersect(c0, &b->left, c1, c2, &cn);
if (res < 256)
@@ -516,7 +516,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
if (side(c0, &b->right, c1) >= 0) {
if (side(c0, &b->right, c2) < 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: start is right of right corner and end is left of right corner, clipping end\n");
+ dbg(lvl_debug,"visible: start is right of right corner and end is left of right corner, clipping end");
#endif
res=intersect(c0, &b->right, c1, c2, &cn);
if (res < 256)
@@ -532,7 +532,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
if (side(c0, &b->left, c2) <= 0) {
if (side(c0, &b->left, c1) > 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: end is left of left corner and start is right of left corner, clipping start\n");
+ dbg(lvl_debug,"visible: end is left of left corner and start is right of left corner, clipping start");
#endif
res=intersect(c0, &b->left, c1, c2, &cn);
if (res < 256)
@@ -548,7 +548,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
if (side(c0, &b->right, c2) >= 0) {
if (side(c0, &b->right, c1) < 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: end is right of right corner and start is left of right corner, clipping start\n");
+ dbg(lvl_debug,"visible: end is right of right corner and start is left of right corner, clipping start");
#endif
res=intersect(c0, &b->right, c1, c2, &cn);
if (res < 256)
@@ -562,7 +562,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
break;
}
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: not visible\n");
+ dbg(lvl_debug,"visible: not visible");
#endif
return 4;
}
@@ -570,7 +570,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
b=b->next;
}
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"return %d\n",ret);
+ dbg(lvl_debug,"return %d",ret);
#endif
return ret;
}
@@ -579,7 +579,7 @@ static void
map_route_occluded_coord_rewind(void *priv_data)
{
struct map_rect_priv *mr = priv_data;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
mr->idx=mr->idx_base;
mr->first=1;
mr->lseg_done=mr->lseg_done_base;
@@ -594,7 +594,7 @@ static void
map_route_occluded_attr_rewind(void *priv_data)
{
struct map_rect_priv *mr=priv_data;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
item_attr_rewind(mr->route_item);
}
@@ -602,7 +602,7 @@ static int
map_route_occluded_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
{
struct map_rect_priv *mr=priv_data;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return item_attr_get(mr->route_item, attr_type, attr);
}
@@ -625,7 +625,7 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
char buffer[4096];
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#endif
dbg_assert(count >= 2);
if (! mr->checked) {
@@ -635,11 +635,11 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
}
while (ret < count && !mr->last) {
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"coord first %d lseg_done %d\n",mr->first,mr->lseg_done);
+ dbg(lvl_debug,"coord first %d lseg_done %d",mr->first,mr->lseg_done);
#endif
if (mr->lseg_done) {
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"loading %d of %d from id_lo %d\n", mr->idx, mr->sd->count, mr->sd->item.id_lo);
+ dbg(lvl_debug,"loading %d of %d from id_lo %d", mr->idx, mr->sd->count, mr->sd->item.id_lo);
#endif
if (!mr->idx) {
if (coord_next(mr, &mr->lseg[0])) {
@@ -663,7 +663,7 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
l0=mr->c_next;
l1=mr->lseg[1];
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"line (0x%x,0x%x)-(0x%x,0x%x)\n", l0.x,l0.y,l1.x,l1.y);
+ dbg(lvl_debug,"line (0x%x,0x%x)-(0x%x,0x%x)", l0.x,l0.y,l1.x,l1.y);
#endif
vis=is_visible_line(&mr->c0, &l0, &l1);
if (debug) {
@@ -672,7 +672,7 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
fprintf(debug,"0x%x 0x%x\n", l1.x, l1.y);
}
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"vis=%d line (0x%x,0x%x)-(0x%x,0x%x)\n", vis, l0.x,l0.y,l1.x,l1.y);
+ dbg(lvl_debug,"vis=%d line (0x%x,0x%x)-(0x%x,0x%x)", vis, l0.x,l0.y,l1.x,l1.y);
#endif
mr->idx_base=mr->idx;
mr->c_next_base=mr->c_next;
@@ -683,11 +683,11 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
case 0:
mr->c_next_base=mr->c_next;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l0.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
#endif
c[ret++]=l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
#endif
c[ret++]=l1;
mr->lseg_done_base=mr->lseg_done=1;
@@ -695,12 +695,12 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
break;
case 1:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"begin clipped\n");
- dbg(lvl_debug,"out 0x%x,0x%x\n", l0.x, l1.y);
+ dbg(lvl_debug,"begin clipped");
+ dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
#endif
c[ret++]=l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
#endif
c[ret++]=l1;
mr->c_next_base=mr->c_next=l1;
@@ -708,15 +708,15 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
break;
case 2:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"end clipped\n");
+ dbg(lvl_debug,"end clipped");
#endif
mr->c_next_base=mr->c_next;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l0.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
#endif
c[ret++]=l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
#endif
c[ret++]=l1;
mr->c_next_base=mr->c_next=l1;
@@ -724,15 +724,15 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
break;
case 3:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"both clipped\n");
+ dbg(lvl_debug,"both clipped");
#endif
mr->c_next_base=mr->c_next;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l0.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
#endif
c[ret++]=l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
#endif
c[ret++]=l1;
mr->c_next_base=mr->c_next=l1;
@@ -745,21 +745,21 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
#if 0
case 2:
- dbg(lvl_debug,"visible up to 0x%x,0x%x\n",l1.x,l1.y);
+ dbg(lvl_debug,"visible up to 0x%x,0x%x",l1.x,l1.y);
if (mr->first) {
mr->first=0;
c[ret++]=mr->c_out;
- dbg(lvl_debug,"out 0x%x,0x%x\n", mr->c_out.x, mr->c_out.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", mr->c_out.x, mr->c_out.y);
}
c[ret++]=mr->c_out=l1;
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
mr->last=1;
mr->route_item_done=1;
break;
case 1:
case 3:
case 4:
- dbg(lvl_debug,"invisible\n");
+ dbg(lvl_debug,"invisible");
mr->c_out=l1;
mr->idx++;
mr->last=1;
@@ -772,7 +772,7 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
}
}
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"ret=%d last=%d\n", ret, mr->last);
+ dbg(lvl_debug,"ret=%d last=%d", ret, mr->last);
#endif
return ret;
}
@@ -801,16 +801,16 @@ map_route_occluded_rect_new(struct map_priv *priv, struct map_selection *sel)
struct map_rect *route_map_rect;
struct coord_rect r;
if (!navit_get_attr(priv->navit, attr_route, &route, NULL)) {
- dbg(lvl_debug,"no route in navit\n");
+ dbg(lvl_debug,"no route in navit");
return NULL;
}
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL)) {
- dbg(lvl_debug,"no map in route\n");
+ dbg(lvl_debug,"no map in route");
return NULL;
}
route_map_rect=map_rect_new(route_map.u.map, sel);
if (!route_map_rect) {
- dbg(lvl_debug,"no route map rect\n");
+ dbg(lvl_debug,"no route map rect");
return NULL;
}
map_dump_file(route_map.u.map, "route.txt");
@@ -865,17 +865,17 @@ map_route_occluded_rect_destroy(struct map_rect_priv *mr)
static struct item *
map_route_occluded_get_item(struct map_rect_priv *mr)
{
- dbg(lvl_debug,"enter last=%d\n",mr->last);
+ dbg(lvl_debug,"enter last=%d",mr->last);
while (!mr->last) {
struct coord c[128];
map_route_occluded_coord_get(mr, c, 128);
}
if (mr->route_item_done) {
- dbg(lvl_debug,"next route item\n");
+ dbg(lvl_debug,"next route item");
do {
mr->route_item=map_rect_get_item(mr->route_map_rect);
} while (mr->route_item && mr->route_item->type != type_street_route);
- dbg(lvl_debug,"item %p\n", mr->route_item);
+ dbg(lvl_debug,"item %p", mr->route_item);
if (!mr->route_item)
return NULL;
mr->item.type=type_street_route_occluded;
@@ -889,7 +889,7 @@ map_route_occluded_get_item(struct map_rect_priv *mr)
return NULL;
#endif
map_route_occluded_coord_rewind(mr);
- dbg(lvl_debug,"type %s\n", item_to_name(mr->route_item->type));
+ dbg(lvl_debug,"type %s", item_to_name(mr->route_item->type));
return &mr->item;
}
@@ -921,14 +921,14 @@ map_route_occluded_new(struct map_methods *meth, struct attr **attrs)
{
struct map_priv *ret;
struct attr *navit;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
navit=attr_search(attrs, NULL, attr_navit);
if (! navit)
return NULL;
ret=g_new0(struct map_priv, 1);
*meth=map_route_occluded_methods;
ret->navit=navit->u.navit;
- dbg(lvl_debug,"m=%p navit=%p\n", ret, ret->navit);
+ dbg(lvl_debug,"m=%p navit=%p", ret, ret->navit);
return ret;
}
@@ -977,16 +977,16 @@ pedestrian_draw_arrows(struct graphics *gra)
if (orientation == 2)
return;
if (!navit_get_attr(pedestrian_data.nav, attr_route, &route, NULL)) {
- dbg(lvl_debug,"no route in navit\n");
+ dbg(lvl_debug,"no route in navit");
return;
}
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL)) {
- dbg(lvl_debug,"no map in route\n");
+ dbg(lvl_debug,"no map in route");
return;
}
route_map_rect=map_rect_new(route_map.u.map, NULL);
if (!route_map_rect) {
- dbg(lvl_debug,"no route map rect\n");
+ dbg(lvl_debug,"no route map rect");
return;
}
while ((item=map_rect_get_item(route_map_rect))) {
@@ -1041,7 +1041,7 @@ pedestrian_write_tilt(int fd, int axis)
ret=write(fd, buffer+axis, 1);
if (ret != 2) {
- dbg(lvl_debug,"ret=%d\n",ret);
+ dbg(lvl_debug,"ret=%d",ret);
}
}
@@ -1061,7 +1061,7 @@ pedestrian_read_tilt(int fd, struct navit *nav, struct tilt_data *data)
data->len=0;
if (navit_get_attr(nav, attr_transformation, &attr, NULL)) {
struct transformation *trans=attr.u.transformation;
- dbg(lvl_debug,"ok axis=%d val=0x%x\n", data->axis, val);
+ dbg(lvl_debug,"ok axis=%d val=0x%x", data->axis, val);
if (data->axis != 1) {
transform_set_pitch(trans, 90+(val-0x80));
} else {
@@ -1092,7 +1092,7 @@ pedestrian_setup_tilt(struct navit *nav)
char buffer[32];
fd=open("/dev/tiltsensor",O_RDWR);
if (fd == -1) {
- dbg(lvl_error,"Failed to set up tilt sensor, error %d\n",errno);
+ dbg(lvl_error,"Failed to set up tilt sensor, error %d",errno);
return;
}
tcgetattr(fd, &t);
@@ -1125,7 +1125,7 @@ android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z)
sensors[sensor-1][2]=*z;
if (sensors_locked)
return;
- dbg(lvl_debug,"enter %d %f %f %f\n",sensor,*x,*y,*z);
+ dbg(lvl_debug,"enter %d %f %f %f",sensor,*x,*y,*z);
if (sensor == 1) {
if (*x > 7.5)
orientation=1; /* landscape */
@@ -1133,7 +1133,7 @@ android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z)
orientation=0; /* portrait */
if (*z > 7.5)
orientation=2; /* flat */
- dbg(lvl_debug,"orientation=%d\n",orientation);
+ dbg(lvl_debug,"orientation=%d",orientation);
}
if ((orientation_old == 2) != (orientation == 2)) {
struct attr attr, flags_graphics, osd_configuration;
@@ -1178,7 +1178,7 @@ android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z)
if (orientation != 2)
pitch+=2.0;
transform_set_pitch(trans, (int)pitch);
- dbg(lvl_debug,"pich %d %f\n",orientation,pitch);
+ dbg(lvl_debug,"pich %d %f",orientation,pitch);
} else {
struct attr attr;
attr.type=attr_orientation;
@@ -1187,7 +1187,7 @@ android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z)
attr.u.num+=360;
pedestrian_data.yaw=attr.u.num;
navit_set_attr(nav, &attr);
- dbg(lvl_debug,"yaw %d %f\n",orientation,yaw);
+ dbg(lvl_debug,"yaw %d %f",orientation,yaw);
if (orientation == 2)
navit_set_center_cursor(nav, 1, 0);
}
@@ -1219,7 +1219,7 @@ vehicle_changed(struct vehicle *v, struct transformation *trans)
struct attr attr;
if (vehicle_get_attr(v, attr_position_direction, &attr, NULL)) {
int dir=(int)(*attr.u.numd);
- dbg(lvl_debug,"enter %d\n",dir);
+ dbg(lvl_debug,"enter %d",dir);
transform_set_pitch(trans, 90);
transform_set_yaw(trans, dir);
}
@@ -1244,15 +1244,15 @@ pedestrian_navit_init(struct navit *nav)
jmethodID cid;
jobject navitsensors;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (android_find_class_global("org/navitproject/navit/NavitSensors", &navitsensorsclass)) {
- dbg(lvl_debug,"class found\n");
+ dbg(lvl_debug,"class found");
cid = (*jnienv)->GetMethodID(jnienv, navitsensorsclass, "<init>", "(Landroid/content/Context;I)V");
- dbg(lvl_debug,"cid=%p\n",cid);
+ dbg(lvl_debug,"cid=%p",cid);
if (cid) {
cb=callback_new_1(callback_cast(android_sensors), nav);
navitsensors=(*jnienv)->NewObject(jnienv, navitsensorsclass, cid, android_activity, cb);
- dbg(lvl_debug,"object=%p\n",navitsensors);
+ dbg(lvl_debug,"object=%p",navitsensors);
if (navitsensors)
navitsensors = (*jnienv)->NewGlobalRef(jnienv, navitsensors);
}
@@ -1287,14 +1287,14 @@ pedestrian_navit_init(struct navit *nav)
return;
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL))
return;
- dbg(lvl_debug,"enter 1\n");
+ dbg(lvl_debug,"enter 1");
#if 0
struct attr active;
active.type=attr_active;
active.u.num=0;
if (!map_set_attr(route_map.u.map, &active))
return;
- dbg(lvl_debug,"enter 2\n");
+ dbg(lvl_debug,"enter 2");
#endif
if (!navit_get_attr(nav, attr_mapset, &mapset, NULL))
return;
@@ -1317,7 +1317,7 @@ pedestrian_navit_init(struct navit *nav)
iter=navit_attr_iter_new();
while(navit_get_attr(nav, attr_layout, &attr, iter)) {
if (!strcmp(attr.u.layout->name, "Route")) {
- dbg(lvl_debug,"found %s\n",attr_to_name(attr.type));
+ dbg(lvl_debug,"found %s",attr_to_name(attr.type));
main_layout=attr;
#if 1
navit_set_attr(nav, &attr);
@@ -1343,7 +1343,7 @@ pedestrian_navit_init(struct navit *nav)
static void
pedestrian_navit(struct navit *nav, int add)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
struct attr callback;
if (add) {
callback.type=attr_callback;
@@ -1362,10 +1362,10 @@ plugin_init(void)
jmethodID Activity_setRequestedOrientation;
if (!android_find_class_global("android/app/Activity", &ActivityClass))
- dbg(lvl_error,"failed to get class android/app/Activity\n");
+ dbg(lvl_error,"failed to get class android/app/Activity");
Activity_setRequestedOrientation = (*jnienv)->GetMethodID(jnienv, ActivityClass, "setRequestedOrientation", "(I)V");
if (Activity_setRequestedOrientation == NULL)
- dbg(lvl_error,"failed to get method setRequestedOrientation from android/app/Activity\n");
+ dbg(lvl_error,"failed to get method setRequestedOrientation from android/app/Activity");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Activity_setRequestedOrientation, 0);
#endif
diff --git a/navit/popup.c b/navit/popup.c
index 71b82b1d9..beaf9a000 100644
--- a/navit/popup.c
+++ b/navit/popup.c
@@ -99,7 +99,7 @@ popup_traffic_distortion(struct item *item, char *attr)
static void
popup_traffic_distortion_blocked(struct item *item)
{
- dbg(lvl_debug,"item=%p\n",item);
+ dbg(lvl_debug,"item=%p",item);
popup_traffic_distortion(item, "maxspeed=0");
}
@@ -180,7 +180,7 @@ extern void *vehicle;
static void
popup_set_position(struct navit *nav, struct pcoord *pc)
{
- dbg(lvl_debug,"%p %p\n", nav, pc);
+ dbg(lvl_debug,"%p %p", nav, pc);
navit_set_position(nav, pc);
}
@@ -214,7 +214,7 @@ popup_printf_cb(void *menu, enum menu_type type, struct callback *cb, const char
va_start(ap, fmt);
str=g_strdup_vprintf(fmt, ap);
- dbg(lvl_debug,"%s\n", str);
+ dbg(lvl_debug,"%s", str);
us=str;
while (*us) {
if (*us == '_')
@@ -310,7 +310,7 @@ popup_item_dump(struct item *item)
struct map_rect *mr;
mr=map_rect_new(item->map,NULL);
item=map_rect_get_item_byid(mr, item->id_hi, item->id_lo);
- dbg(lvl_debug,"item=%p\n",item);
+ dbg(lvl_debug,"item=%p",item);
item_dump_filedesc(item,item->map,stdout);
map_rect_destroy(mr);
}
@@ -349,7 +349,7 @@ popup_show_item(struct navit *nav, void *popup, struct displayitem *di)
if (diitem->map) {
mr=map_rect_new(diitem->map,NULL);
item=map_rect_get_item_byid(mr, diitem->id_hi, diitem->id_lo);
- dbg(lvl_debug,"item=%p\n", item);
+ dbg(lvl_debug,"item=%p", item);
if (item) {
popup_show_attrs(item->map, menu_item, item);
popup_printf_cb(menu_item, menu_type_menu, callback_new_1(callback_cast(popup_item_dump), diitem), "Dump");
@@ -425,7 +425,7 @@ popup(struct navit *nav, int button, struct point *p)
coord_format(g.lat,g.lng,DEGREES_MINUTES_SECONDS,buffer,sizeof(buffer));
popup_printf(men, menu_type_menu, "%s", buffer);
popup_printf(men, menu_type_menu, "%f %f", g.lat, g.lng);
- dbg(lvl_debug,"%p %p\n", nav, &c);
+ dbg(lvl_debug,"%p %p", nav, &c);
c.pro = transform_get_projection(navit_get_trans(nav));
c.x = co.x;
c.y = co.y;
diff --git a/navit/profile_option.c b/navit/profile_option.c
index 8a1049068..7baeee7b5 100644
--- a/navit/profile_option.c
+++ b/navit/profile_option.c
@@ -34,7 +34,7 @@ profile_option_new(struct attr *parent, struct attr **attrs)
po->func=&profile_option_func;
navit_object_ref((struct navit_object *)po);
po->attrs=attr_list_dup(attrs);
- dbg(lvl_debug,"return %p\n",po);
+ dbg(lvl_debug,"return %p",po);
return po;
}
diff --git a/navit/projection.c b/navit/projection.c
index d916689ee..3c9a7810a 100644
--- a/navit/projection.c
+++ b/navit/projection.c
@@ -77,20 +77,20 @@ projection_from_name(const char *name, struct coord *utm_offset)
if (sscanf(name,"utmref%d%c%c%c",&zone,&zone_field,&square_x,&square_y)) {
i=utmref_letter(zone_field);
if (i < 2 || i > 21) {
- dbg(lvl_error,"invalid zone field '%c' in '%s'\n",zone_field,name);
+ dbg(lvl_error,"invalid zone field '%c' in '%s'",zone_field,name);
return projection_none;
}
i-=12;
- dbg(lvl_debug,"zone_field %d\n",i);
+ dbg(lvl_debug,"zone_field %d",i);
baserow=i*887.6/100;
utm_offset->x=zone*1000000;
i=utmref_letter(square_x);
utm_offset->x+=((i%8)+1)*100000;
i=utmref_letter(square_y);
- dbg(lvl_debug,"baserow %d\n",baserow);
+ dbg(lvl_debug,"baserow %d",baserow);
if (!(zone % 2))
i-=5;
- dbg(lvl_debug,"i=%d\n",i);
+ dbg(lvl_debug,"i=%d",i);
i=(i-baserow+100)%20+baserow;
utm_offset->y=i*100000;
return projection_utm;
diff --git a/navit/route.c b/navit/route.c
index 3e3bb02ea..a45d2f2f7 100644
--- a/navit/route.c
+++ b/navit/route.c
@@ -828,7 +828,7 @@ route_path_update_done(struct route *this, int new_graph)
/* FIXME */
int seg_time=route_time_seg(this->vehicleprofile, seg->data, NULL);
if (seg_time == INT_MAX) {
- dbg(lvl_debug,"error\n");
+ dbg(lvl_debug,"error");
} else
path_time+=seg_time;
path_len+=seg->data->len;
@@ -877,10 +877,10 @@ route_path_update_done(struct route *this, int new_graph)
static void
route_path_update_flags(struct route *this, enum route_path_flags flags)
{
- dbg(lvl_debug,"enter %d\n", flags);
+ dbg(lvl_debug,"enter %d", flags);
this->flags = flags;
if (! this->pos || ! this->destinations) {
- dbg(lvl_debug,"destroy\n");
+ dbg(lvl_debug,"destroy");
route_path_destroy(this->path2,1);
this->path2 = NULL;
return;
@@ -892,21 +892,21 @@ route_path_update_flags(struct route *this, enum route_path_flags flags)
/* the graph is destroyed when setting the destination */
if (this->graph) {
if (this->graph->busy) {
- dbg(lvl_debug,"busy building graph\n");
+ dbg(lvl_debug,"busy building graph");
return;
}
// we can try to update
- dbg(lvl_debug,"try update\n");
+ dbg(lvl_debug,"try update");
route_path_update_done(this, 0);
} else {
route_path_destroy(this->path2,1);
this->path2 = NULL;
}
if (!this->graph || (!this->path2 && !(flags & route_path_flag_no_rebuild))) {
- dbg(lvl_debug,"rebuild graph %p %p\n",this->graph,this->path2);
+ dbg(lvl_debug,"rebuild graph %p %p",this->graph,this->path2);
if (! this->route_graph_flood_done_cb)
this->route_graph_flood_done_cb=callback_new_2(callback_cast(route_path_update_done), this, (long)1);
- dbg(lvl_debug,"route_graph_update\n");
+ dbg(lvl_debug,"route_graph_update");
route_graph_update(this, this->route_graph_flood_done_cb, !!(flags & route_path_flag_async));
}
}
@@ -972,7 +972,7 @@ route_set_position_flags(struct route *this, struct pcoord *pos, enum route_path
if (!this->pos) return 0;
this->pos->street_direction=0;
- dbg(lvl_debug,"this->pos=%p\n", this->pos);
+ dbg(lvl_debug,"this->pos=%p", this->pos);
route_info_distances(this->pos, pos->pro);
route_path_update_flags(this, flags);
return 1;
@@ -1006,7 +1006,7 @@ route_set_position_from_tracking(struct route *this, struct tracking *tracking,
struct route_info *ret;
struct street_data *sd;
- dbg(lvl_info,"enter\n");
+ dbg(lvl_info,"enter");
c=tracking_get_pos(tracking);
ret=g_new0(struct route_info, 1);
if (!ret) {
@@ -1025,13 +1025,13 @@ route_set_position_from_tracking(struct route *this, struct tracking *tracking,
ret->street=street_data_dup(sd);
route_info_distances(ret, pro);
}
- dbg(lvl_debug,"position 0x%x,0x%x item 0x%x,0x%x direction %d pos %d lenpos %d lenneg %d\n",c->x,c->y,sd?sd->item.id_hi:0,sd?sd->item.id_lo:0,ret->street_direction,ret->pos,ret->lenpos,ret->lenneg);
- dbg(lvl_debug,"c->x=0x%x, c->y=0x%x pos=%d item=(0x%x,0x%x)\n", c->x, c->y, ret->pos, ret->street?ret->street->item.id_hi:0, ret->street?ret->street->item.id_lo:0);
- dbg(lvl_debug,"street 0=(0x%x,0x%x) %d=(0x%x,0x%x)\n", ret->street?ret->street->c[0].x:0, ret->street?ret->street->c[0].y:0, ret->street?ret->street->count-1:0, ret->street?ret->street->c[ret->street->count-1].x:0, ret->street?ret->street->c[ret->street->count-1].y:0);
+ dbg(lvl_debug,"position 0x%x,0x%x item 0x%x,0x%x direction %d pos %d lenpos %d lenneg %d",c->x,c->y,sd?sd->item.id_hi:0,sd?sd->item.id_lo:0,ret->street_direction,ret->pos,ret->lenpos,ret->lenneg);
+ dbg(lvl_debug,"c->x=0x%x, c->y=0x%x pos=%d item=(0x%x,0x%x)", c->x, c->y, ret->pos, ret->street?ret->street->item.id_hi:0, ret->street?ret->street->item.id_lo:0);
+ dbg(lvl_debug,"street 0=(0x%x,0x%x) %d=(0x%x,0x%x)", ret->street?ret->street->c[0].x:0, ret->street?ret->street->c[0].y:0, ret->street?ret->street->count-1:0, ret->street?ret->street->c[ret->street->count-1].x:0, ret->street?ret->street->c[ret->street->count-1].y:0);
this->pos=ret;
if (this->destinations)
route_path_update(this, 0, 1);
- dbg(lvl_info,"ret\n");
+ dbg(lvl_info,"ret");
}
/* Used for debuging of route_rect, what routing sees */
@@ -1052,7 +1052,7 @@ route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs)
sel->order=order;
sel->range.min=route_item_first;
sel->range.max=route_item_last;
- dbg(lvl_debug,"%p %p\n", c1, c2);
+ dbg(lvl_debug,"%p %p", c1, c2);
dx=c1->x-c2->x;
dy=c1->y-c2->y;
if (dx < 0) {
@@ -1809,7 +1809,7 @@ route_path_add_line(struct route_path *this, struct coord *start, struct coord *
struct route_path_segment *segment;
int seg_size,seg_dat_size;
- dbg(lvl_debug,"line from 0x%x,0x%x-0x%x,0x%x\n", start->x, start->y, end->x, end->y);
+ dbg(lvl_debug,"line from 0x%x,0x%x-0x%x,0x%x", start->x, start->y, end->x, end->y);
seg_size=sizeof(*segment) + sizeof(struct coord) * ccnt;
seg_dat_size=sizeof(struct route_segment_data);
segment=g_malloc0(seg_size + seg_dat_size);
@@ -1852,7 +1852,7 @@ route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpa
if (rgs->data.flags & AF_SEGMENTED)
offset=RSD_OFFSET(&rgs->data);
- dbg(lvl_debug,"enter (0x%x,0x%x) dir=%d pos=%p dst=%p\n", rgs->data.item.id_hi, rgs->data.item.id_lo, dir, pos, dst);
+ dbg(lvl_debug,"enter (0x%x,0x%x) dir=%d pos=%p dst=%p", rgs->data.item.id_hi, rgs->data.item.id_lo, dir, pos, dst);
if (oldpath) {
segment=item_hash_lookup(oldpath->path_hash, &rgs->data.item);
if (segment && segment->direction == dir) {
@@ -1882,9 +1882,9 @@ route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpa
}
} else {
extra=1;
- dbg(lvl_debug,"pos dir=%d\n", dir);
- dbg(lvl_debug,"pos pos=%d\n", pos->pos);
- dbg(lvl_debug,"pos count=%d\n", pos->street->count);
+ dbg(lvl_debug,"pos dir=%d", dir);
+ dbg(lvl_debug,"pos pos=%d", pos->pos);
+ dbg(lvl_debug,"pos count=%d", pos->street->count);
if (dir > 0) {
c=pos->street->c+pos->pos+1;
ccnt=pos->street->count-pos->pos-1;
@@ -1898,8 +1898,8 @@ route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpa
pos->dir=dir;
} else if (dst) {
extra=1;
- dbg(lvl_debug,"dst dir=%d\n", dir);
- dbg(lvl_debug,"dst pos=%d\n", dst->pos);
+ dbg(lvl_debug,"dst dir=%d", dir);
+ dbg(lvl_debug,"dst pos=%d", dst->pos);
if (dir > 0) {
c=dst->street->c;
ccnt=dst->pos+1;
@@ -2143,7 +2143,7 @@ route_value_seg(struct vehicleprofile *profile, struct route_graph_point *from,
int ret;
struct route_traffic_distortion dist,*distp=NULL;
#if 0
- dbg(lvl_debug,"flags 0x%x mask 0x%x flags 0x%x\n", over->flags, dir >= 0 ? profile->flags_forward_mask : profile->flags_reverse_mask, profile->flags);
+ dbg(lvl_debug,"flags 0x%x mask 0x%x flags 0x%x", over->flags, dir >= 0 ? profile->flags_forward_mask : profile->flags_reverse_mask, profile->flags);
#endif
if ((over->data.flags & (dir >= 0 ? profile->flags_forward_mask : profile->flags_reverse_mask)) != profile->flags)
return INT_MAX;
@@ -2278,14 +2278,14 @@ route_process_turn_restriction(struct route_graph *this, struct item *item)
count=item_coord_get(item, c, 5);
if (count != 3 && count != 4) {
- dbg(lvl_debug,"wrong count %d\n",count);
+ dbg(lvl_debug,"wrong count %d",count);
return;
}
if (count == 4)
return;
for (i = 0 ; i < count ; i++)
pnt[i]=route_graph_add_point(this,&c[i]);
- dbg(lvl_debug,"%s: (0x%x,0x%x)-(0x%x,0x%x)-(0x%x,0x%x) %p-%p-%p\n",item_to_name(item->type),c[0].x,c[0].y,c[1].x,c[1].y,c[2].x,c[2].y,pnt[0],pnt[1],pnt[2]);
+ dbg(lvl_debug,"%s: (0x%x,0x%x)-(0x%x,0x%x)-(0x%x,0x%x) %p-%p-%p",item_to_name(item->type),c[0].x,c[0].y,c[1].x,c[1].y,c[2].x,c[2].y,pnt[0],pnt[1],pnt[2]);
data.item=item;
data.flags=0;
data.len=0;
@@ -2580,7 +2580,7 @@ route_graph_flood(struct route_graph *this, struct route_info *dst, struct vehic
}
fh_deleteheap(heap);
callback_call_0(cb);
- dbg(lvl_debug,"return\n");
+ dbg(lvl_debug,"return");
}
/**
@@ -2691,7 +2691,7 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
struct route_path *ret;
if (! pos->street || ! dst->street) {
- dbg(lvl_error,"pos or dest not set\n");
+ dbg(lvl_error,"pos or dest not set");
return NULL;
}
@@ -2701,12 +2701,12 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
val=route_value_seg(profile, NULL, s, 2);
if (val != INT_MAX && s->end->value != INT_MAX) {
val=val*(100-pos->percent)/100;
- dbg(lvl_debug,"val1 %d\n",val);
+ dbg(lvl_debug,"val1 %d",val);
if (route_graph_segment_match(s,this->avoid_seg) && pos->street_direction < 0)
val+=profile->turn_around_penalty;
- dbg(lvl_debug,"val1 %d\n",val);
+ dbg(lvl_debug,"val1 %d",val);
val1_new=s->end->value+val;
- dbg(lvl_debug,"val1 +%d=%d\n",s->end->value,val1_new);
+ dbg(lvl_debug,"val1 +%d=%d",s->end->value,val1_new);
if (val1_new < val1) {
val1=val1_new;
s1=s;
@@ -2715,12 +2715,12 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
val=route_value_seg(profile, NULL, s, -2);
if (val != INT_MAX && s->start->value != INT_MAX) {
val=val*pos->percent/100;
- dbg(lvl_debug,"val2 %d\n",val);
+ dbg(lvl_debug,"val2 %d",val);
if (route_graph_segment_match(s,this->avoid_seg) && pos->street_direction > 0)
val+=profile->turn_around_penalty;
- dbg(lvl_debug,"val2 %d\n",val);
+ dbg(lvl_debug,"val2 %d",val);
val2_new=s->start->value+val;
- dbg(lvl_debug,"val2 +%d=%d\n",s->start->value,val2_new);
+ dbg(lvl_debug,"val2 +%d=%d",s->start->value,val2_new);
if (val2_new < val2) {
val2=val2_new;
s2=s;
@@ -2728,7 +2728,7 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
}
}
if (val1 == INT_MAX && val2 == INT_MAX) {
- dbg(lvl_error,"no route found, pos blocked\n");
+ dbg(lvl_error,"no route found, pos blocked");
return NULL;
}
if (val1 == val2) {
@@ -2746,7 +2746,7 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
}
if (pos->street_direction && dir != pos->street_direction && profile->turn_around_penalty) {
if (!route_graph_segment_match(this->avoid_seg,s)) {
- dbg(lvl_debug,"avoid current segment\n");
+ dbg(lvl_debug,"avoid current segment");
if (this->avoid_seg)
route_graph_set_traffic_distortion(this, this->avoid_seg, 0);
this->avoid_seg=s;
@@ -2787,7 +2787,7 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
}
if (dst->lenextra)
route_path_add_line(ret, &dst->lp, &dst->c, dst->lenextra);
- dbg(lvl_debug, "%d segments\n", segs);
+ dbg(lvl_debug, "%d segments", segs);
return ret;
}
@@ -2827,29 +2827,29 @@ is_turn_allowed(struct route_graph_point *p, struct route_graph_segment *from, s
(tmp1->data.item.type == type_street_turn_restriction_no ||
tmp1->data.item.type == type_street_turn_restriction_only)) {
tmp2=p->start;
- dbg(lvl_debug,"found %s (0x%x,0x%x) (0x%x,0x%x)-(0x%x,0x%x) %p-%p\n",item_to_name(tmp1->data.item.type),tmp1->data.item.id_hi,tmp1->data.item.id_lo,tmp1->start->c.x,tmp1->start->c.y,tmp1->end->c.x,tmp1->end->c.y,tmp1->start,tmp1->end);
+ dbg(lvl_debug,"found %s (0x%x,0x%x) (0x%x,0x%x)-(0x%x,0x%x) %p-%p",item_to_name(tmp1->data.item.type),tmp1->data.item.id_hi,tmp1->data.item.id_lo,tmp1->start->c.x,tmp1->start->c.y,tmp1->end->c.x,tmp1->end->c.y,tmp1->start,tmp1->end);
while (tmp2) {
- dbg(lvl_debug,"compare %s (0x%x,0x%x) (0x%x,0x%x)-(0x%x,0x%x) %p-%p\n",item_to_name(tmp2->data.item.type),tmp2->data.item.id_hi,tmp2->data.item.id_lo,tmp2->start->c.x,tmp2->start->c.y,tmp2->end->c.x,tmp2->end->c.y,tmp2->start,tmp2->end);
+ dbg(lvl_debug,"compare %s (0x%x,0x%x) (0x%x,0x%x)-(0x%x,0x%x) %p-%p",item_to_name(tmp2->data.item.type),tmp2->data.item.id_hi,tmp2->data.item.id_lo,tmp2->start->c.x,tmp2->start->c.y,tmp2->end->c.x,tmp2->end->c.y,tmp2->start,tmp2->end);
if (item_is_equal(tmp1->data.item, tmp2->data.item))
break;
tmp2=tmp2->start_next;
}
- dbg(lvl_debug,"tmp2=%p\n",tmp2);
+ dbg(lvl_debug,"tmp2=%p",tmp2);
if (tmp2) {
- dbg(lvl_debug,"%s tmp2->end=%p next=%p\n",item_to_name(tmp1->data.item.type),tmp2->end,next);
+ dbg(lvl_debug,"%s tmp2->end=%p next=%p",item_to_name(tmp1->data.item.type),tmp2->end,next);
}
if (tmp1->data.item.type == type_street_turn_restriction_no && tmp2 && tmp2->end->c.x == next->c.x && tmp2->end->c.y == next->c.y) {
- dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x not allowed (no)\n",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
+ dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x not allowed (no)",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
return 0;
}
if (tmp1->data.item.type == type_street_turn_restriction_only && tmp2 && (tmp2->end->c.x != next->c.x || tmp2->end->c.y != next->c.y)) {
- dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x not allowed (only)\n",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
+ dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x not allowed (only)",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
return 0;
}
}
tmp1=tmp1->end_next;
}
- dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x allowed\n",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
+ dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x allowed",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
return 1;
}
@@ -2867,7 +2867,7 @@ route_graph_clone_segment(struct route_graph *this, struct route_graph_segment *
data.maxspeed=RSD_MAXSPEED(&s->data);
if (s->data.flags & AF_SEGMENTED)
data.offset=RSD_OFFSET(&s->data);
- dbg(lvl_debug,"cloning segment from %p (0x%x,0x%x) to %p (0x%x,0x%x)\n",start,start->c.x,start->c.y, end, end->c.x, end->c.y);
+ dbg(lvl_debug,"cloning segment from %p (0x%x,0x%x) to %p (0x%x,0x%x)",start,start->c.x,start->c.y, end, end->c.x, end->c.y);
route_graph_add_segment(this, start, end, &data);
}
@@ -2881,19 +2881,19 @@ route_graph_process_restriction_segment(struct route_graph *this, struct route_g
int dy=0;
c.x+=dx;
c.y+=dy;
- dbg(lvl_debug,"From %s %d,%d\n",item_to_name(s->data.item.type),dx,dy);
+ dbg(lvl_debug,"From %s %d,%d",item_to_name(s->data.item.type),dx,dy);
pn=route_graph_point_new(this, &c);
if (dir > 0) { /* going away */
- dbg(lvl_debug,"other 0x%x,0x%x\n",s->end->c.x,s->end->c.y);
+ dbg(lvl_debug,"other 0x%x,0x%x",s->end->c.x,s->end->c.y);
if (s->data.flags & AF_ONEWAY) {
- dbg(lvl_debug,"Not possible\n");
+ dbg(lvl_debug,"Not possible");
return;
}
route_graph_clone_segment(this, s, pn, s->end, AF_ONEWAYREV);
} else { /* coming in */
- dbg(lvl_debug,"other 0x%x,0x%x\n",s->start->c.x,s->start->c.y);
+ dbg(lvl_debug,"other 0x%x,0x%x",s->start->c.x,s->start->c.y);
if (s->data.flags & AF_ONEWAYREV) {
- dbg(lvl_debug,"Not possible\n");
+ dbg(lvl_debug,"Not possible");
return;
}
route_graph_clone_segment(this, s, s->start, pn, AF_ONEWAY);
@@ -2904,7 +2904,7 @@ route_graph_process_restriction_segment(struct route_graph *this, struct route_g
tmp->data.item.type != type_street_turn_restriction_only &&
!(tmp->data.flags & AF_ONEWAYREV) && is_turn_allowed(p, s, tmp)) {
route_graph_clone_segment(this, tmp, pn, tmp->end, AF_ONEWAY);
- dbg(lvl_debug,"To start %s\n",item_to_name(tmp->data.item.type));
+ dbg(lvl_debug,"To start %s",item_to_name(tmp->data.item.type));
}
tmp=tmp->start_next;
}
@@ -2914,7 +2914,7 @@ route_graph_process_restriction_segment(struct route_graph *this, struct route_g
tmp->data.item.type != type_street_turn_restriction_only &&
!(tmp->data.flags & AF_ONEWAY) && is_turn_allowed(p, s, tmp)) {
route_graph_clone_segment(this, tmp, tmp->start, pn, AF_ONEWAYREV);
- dbg(lvl_debug,"To end %s\n",item_to_name(tmp->data.item.type));
+ dbg(lvl_debug,"To end %s",item_to_name(tmp->data.item.type));
}
tmp=tmp->end_next;
}
@@ -2925,7 +2925,7 @@ route_graph_process_restriction_point(struct route_graph *this, struct route_gra
{
struct route_graph_segment *tmp;
tmp=p->start;
- dbg(lvl_debug,"node 0x%x,0x%x\n",p->c.x,p->c.y);
+ dbg(lvl_debug,"node 0x%x,0x%x",p->c.x,p->c.y);
while (tmp) {
if (tmp->data.item.type != type_street_turn_restriction_no &&
tmp->data.item.type != type_street_turn_restriction_only)
@@ -2947,7 +2947,7 @@ route_graph_process_restrictions(struct route_graph *this)
{
struct route_graph_point *curr;
int i;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
for (i = 0 ; i < HASH_SIZE ; i++) {
curr=this->hash[i];
while (curr) {
@@ -2970,7 +2970,7 @@ route_graph_process_restrictions(struct route_graph *this)
static void
route_graph_build_done(struct route_graph *rg, int cancel)
{
- dbg(lvl_debug,"cancel=%d\n",cancel);
+ dbg(lvl_debug,"cancel=%d",cancel);
if (rg->idle_ev)
event_remove_idle(rg->idle_ev);
if (rg->idle_cb)
@@ -3039,7 +3039,7 @@ route_graph_build(struct mapset *ms, struct coord *c, int count, struct callback
{
struct route_graph *ret=g_new0(struct route_graph, 1);
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret->sel=route_calc_selection(c, count, profile);
ret->h=mapset_open(ms);
@@ -3244,7 +3244,7 @@ route_find_nearest_street(struct vehicleprofile *vehicleprofile, struct mapset *
ret->lp=lp;
ret->pos=pos;
ret->street=sd;
- dbg(lvl_debug,"dist=%d id 0x%x 0x%x pos=%d\n", dist, item->id_hi, item->id_lo, pos);
+ dbg(lvl_debug,"dist=%d id 0x%x 0x%x pos=%d", dist, item->id_hi, item->id_lo, pos);
} else {
street_data_free(sd);
}
@@ -3258,7 +3258,7 @@ route_find_nearest_street(struct vehicleprofile *vehicleprofile, struct mapset *
if (!ret->street || mindist > max_dist*max_dist) {
if (ret->street) {
street_data_free(ret->street);
- dbg(lvl_debug,"Much too far %d > %d\n", mindist, max_dist);
+ dbg(lvl_debug,"Much too far %d > %d", mindist, max_dist);
}
g_free(ret);
ret = NULL;
@@ -3482,7 +3482,7 @@ rm_coord_get(void *priv_data, struct coord *c, int count)
c[i] = seg->c[mr->last_coord++];
rc++;
}
- dbg(lvl_debug,"return %d\n",rc);
+ dbg(lvl_debug,"return %d",rc);
return rc;
}
@@ -3512,7 +3512,7 @@ rp_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
switch (attr_type) {
case attr_any: // works only with rg_points for now
while (mr->attr_next != attr_none) {
- dbg(lvl_debug,"querying %s\n", attr_to_name(mr->attr_next));
+ dbg(lvl_debug,"querying %s", attr_to_name(mr->attr_next));
if (rp_attr_get(priv_data, mr->attr_next, attr))
return 1;
}
@@ -3707,7 +3707,7 @@ static struct map_rect_priv *
rm_rect_new(struct map_priv *priv, struct map_selection *sel)
{
struct map_rect_priv * mr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#if 0
if (! route_get_pos(priv->route))
return NULL;
@@ -3751,7 +3751,7 @@ rp_rect_new(struct map_priv *priv, struct map_selection *sel)
{
struct map_rect_priv * mr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (! priv->route->graph)
return NULL;
mr=g_new0(struct map_rect_priv, 1);
@@ -4115,7 +4115,7 @@ route_set_attr(struct route *this_, struct attr *attr)
}
break;
default:
- dbg(lvl_error,"unsupported attribute: %s\n",attr_to_name(attr->type));
+ dbg(lvl_error,"unsupported attribute: %s",attr_to_name(attr->type));
return 0;
}
if (attr_updated)
@@ -4138,7 +4138,7 @@ route_add_attr(struct route *this_, struct attr *attr)
int
route_remove_attr(struct route *this_, struct attr *attr)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
switch (attr->type) {
case attr_callback:
callback_list_remove(this_->cbl2, attr->u.callback);
@@ -4186,7 +4186,7 @@ route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, stru
case attr_vehicle:
attr->u.vehicle=this_->v;
ret=(this_->v != NULL);
- dbg(lvl_debug,"get vehicle %p\n",this_->v);
+ dbg(lvl_debug,"get vehicle %p",this_->v);
break;
case attr_vehicleprofile:
attr->u.vehicleprofile=this_->vehicleprofile;
@@ -4203,7 +4203,7 @@ route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, stru
attr->u.num+=path->path_time;
path=path->next;
}
- dbg(lvl_debug,"path_time %ld\n",attr->u.num);
+ dbg(lvl_debug,"path_time %ld",attr->u.num);
} else
ret=0;
break;
diff --git a/navit/script.c b/navit/script.c
index 2c6719cdc..e0e05e4be 100644
--- a/navit/script.c
+++ b/navit/script.c
@@ -40,10 +40,10 @@ script_run(struct script *scr)
struct attr *xml_text=attr_search(scr->attrs, NULL, attr_xml_text);
int error;
if (!xml_text || !xml_text->u.str) {
- dbg(lvl_error,"no text\n");
+ dbg(lvl_error,"no text");
return;
}
- dbg(lvl_debug,"running '%s'\n",xml_text->u.str);
+ dbg(lvl_debug,"running '%s'",xml_text->u.str);
command_evaluate_to_void(&scr->parent, xml_text->u.str, &error);
}
@@ -52,7 +52,7 @@ script_set_attr_int(struct script *scr, struct attr *attr)
{
switch (attr->type) {
case attr_refresh_cond:
- dbg(lvl_debug,"refresh_cond\n");
+ dbg(lvl_debug,"refresh_cond");
if (scr->cs)
command_saved_destroy(scr->cs);
scr->cs=command_saved_attr_new(attr->u.str, &scr->parent, scr->cb, 0);
@@ -79,14 +79,14 @@ script_new(struct attr *parent, struct attr **attrs)
scr->parent=*parent;
while (attrs && *attrs)
script_set_attr_int(scr, *attrs++);
- dbg(lvl_debug,"return %p\n",scr);
+ dbg(lvl_debug,"return %p",scr);
return scr;
}
static void
script_destroy(struct script *scr)
{
- dbg(lvl_debug,"enter %p\n",scr);
+ dbg(lvl_debug,"enter %p",scr);
if (scr->timeout)
event_remove_timeout(scr->timeout);
if (scr->cs)
diff --git a/navit/search.c b/navit/search.c
index 139feef58..34b7be0fc 100644
--- a/navit/search.c
+++ b/navit/search.c
@@ -138,7 +138,7 @@ search_list_level(enum attr_type attr_type)
case attr_postal:
return -1;
default:
- dbg(lvl_error,"unknown search '%s'\n",attr_to_name(attr_type));
+ dbg(lvl_error,"unknown search '%s'",attr_to_name(attr_type));
return -1;
}
}
@@ -225,10 +225,10 @@ search_phrase_used(struct phrase *p, GList *used_phrases)
{
while (used_phrases) {
struct phrase *pu=used_phrases->data;
- dbg(lvl_debug,"'%s'-'%s' vs '%s'-'%s'\n",p->start,p->end,pu->start,pu->end);
+ dbg(lvl_debug,"'%s'-'%s' vs '%s'-'%s'",p->start,p->end,pu->start,pu->end);
if (p->start < pu->end && p->end > pu->start)
return 1;
- dbg(lvl_debug,"unused\n");
+ dbg(lvl_debug,"unused");
used_phrases=g_list_next(used_phrases);
}
return 0;
@@ -255,7 +255,7 @@ search_by_address_attr(GList *results, struct search_list *sl, GList *phrases, G
int count=0,wordcount_all=wordcount+p->wordcount;
struct search_list_result *slr;
attr.u.str=search_phrase_str(p);
- dbg(lvl_debug,"%s phrase '%s'\n",attr_to_name(attr_type),attr.u.str);
+ dbg(lvl_debug,"%s phrase '%s'",attr_to_name(attr_type),attr.u.str);
search_list_search(sl, &attr, 0);
while ((slr=search_list_get_result(sl))) {
if (attr_type != attr_country_all) {
@@ -265,7 +265,7 @@ search_by_address_attr(GList *results, struct search_list *sl, GList *phrases, G
}
count++;
}
- dbg(lvl_debug,"%d results wordcount %d\n",count,wordcount_all);
+ dbg(lvl_debug,"%d results wordcount %d",count,wordcount_all);
if (count) {
GList *used=g_list_prepend(g_list_copy(exclude), tmp->data);
enum attr_type new_attr_type=attr_none;
@@ -348,7 +348,7 @@ search_list_search(struct search_list *this_, struct attr *search_attr, int part
{
struct search_list_level *le;
int level;
- dbg(lvl_info,"Starting search for '=%s' of type %s\n", search_attr->u.str, attr_to_name(search_attr->type));
+ dbg(lvl_info,"Starting search for '=%s' of type %s", search_attr->u.str, attr_to_name(search_attr->type));
search_address_results_free(this_);
if (search_attr->type == attr_address) {
search_by_address(this_, search_attr->u.str);
@@ -392,7 +392,7 @@ search_list_select(struct search_list *this_, enum attr_type attr_type, int id,
curr=le->list;
if (mode > 0 || !id)
le->selected=mode;
- //dbg(lvl_debug,"enter level=%d %d %d %p\n", level, id, mode, curr);
+ //dbg(lvl_debug,"enter level=%d %d %d %p", level, id, mode, curr);
num = 0;
while (curr) {
num++;
@@ -401,13 +401,13 @@ search_list_select(struct search_list *this_, enum attr_type attr_type, int id,
slc->selected=mode;
if (id) {
le->last=curr;
- //dbg(lvl_debug,"found\n");
+ //dbg(lvl_debug,"found");
return slc;
}
}
curr=g_list_next(curr);
}
- //dbg(lvl_debug,"not found\n");
+ //dbg(lvl_debug,"not found");
return NULL;
}
@@ -566,7 +566,7 @@ search_list_town_new(struct item *item)
ret->itemt=*item;
ret->common.item=ret->common.unique=*item;
if (item_attr_get(item, attr_town_streets_item, &attr)) {
- dbg(lvl_debug,"town_assoc 0x%x 0x%x\n", attr.u.item->id_hi, attr.u.item->id_lo);
+ dbg(lvl_debug,"town_assoc 0x%x 0x%x", attr.u.item->id_hi, attr.u.item->id_lo);
ret->common.unique=*attr.u.item;
}
search_list_common_new(item, &ret->common);
@@ -760,7 +760,7 @@ search_postal_merge(char *mask, char *new)
{
int i;
char *ret=NULL;
- dbg(lvl_debug,"enter %s %s\n", mask, new);
+ dbg(lvl_debug,"enter %s %s", mask, new);
if (!new)
return NULL;
if (!mask)
@@ -777,7 +777,7 @@ search_postal_merge(char *mask, char *new)
while (mask[i])
ret[i++]='.';
}
- dbg(lvl_debug,"merged %s with %s as %s\n", mask, new, ret);
+ dbg(lvl_debug,"merged %s with %s as %s", mask, new, ret);
return ret;
}
@@ -861,21 +861,21 @@ search_list_get_result(struct search_list *this_)
return ret;
}
- //dbg(lvl_debug,"enter\n");
+ //dbg(lvl_debug,"enter");
le=&this_->levels[level];
- //dbg(lvl_debug,"le=%p\n", le);
+ //dbg(lvl_debug,"le=%p", le);
for (;;)
{
- //dbg(lvl_debug,"le->search=%p\n", le->search);
+ //dbg(lvl_debug,"le->search=%p", le->search);
if (! le->search)
{
- //dbg(lvl_debug,"partial=%d level=%d\n", le->partial, level);
+ //dbg(lvl_debug,"partial=%d level=%d", le->partial, level);
if (! level)
le->parent=NULL;
else
{
leu=&this_->levels[level-1];
- //dbg(lvl_debug,"leu->curr=%p\n", leu->curr);
+ //dbg(lvl_debug,"leu->curr=%p", leu->curr);
for (;;)
{
//dbg(lvl_debug,"*********########");
@@ -897,23 +897,23 @@ search_list_get_result(struct search_list *this_)
}
if (le->parent)
{
- //dbg(lvl_debug,"mapset_search_new with item(%d,%d)\n", le->parent->item.id_hi, le->parent->item.id_lo);
+ //dbg(lvl_debug,"mapset_search_new with item(%d,%d)", le->parent->item.id_hi, le->parent->item.id_lo);
}
- //dbg(lvl_debug,"############## attr=%s\n", attr_to_name(le->attr->type));
+ //dbg(lvl_debug,"############## attr=%s", attr_to_name(le->attr->type));
le->search=mapset_search_new(this_->ms, &le->parent->item, le->attr, le->partial);
le->hash=g_hash_table_new(search_item_hash_hash, search_item_hash_equal);
}
- //dbg(lvl_debug,"le->search=%p\n", le->search);
+ //dbg(lvl_debug,"le->search=%p", le->search);
if (!this_->item)
{
//dbg(lvl_debug,"sssss 1");
this_->item=mapset_search_get_item(le->search);
- //dbg(lvl_debug,"sssss 1 %p\n",this_->item);
+ //dbg(lvl_debug,"sssss 1 %p",this_->item);
}
if (this_->item)
{
void *p=NULL;
- //dbg(lvl_debug,"id_hi=%d id_lo=%d\n", this_->item->id_hi, this_->item->id_lo);
+ //dbg(lvl_debug,"id_hi=%d id_lo=%d", this_->item->id_hi, this_->item->id_lo);
if (this_->postal)
{
struct attr postal;
@@ -929,7 +929,7 @@ search_list_get_result(struct search_list *this_)
this_->result.town=NULL;
this_->result.street=NULL;
this_->result.c=NULL;
- //dbg(lvl_debug,"case x LEVEL start %d\n",level);
+ //dbg(lvl_debug,"case x LEVEL start %d",level);
switch (level)
{
case 0:
@@ -965,13 +965,13 @@ search_list_get_result(struct search_list *this_)
this_->item=NULL;
break;
case 3:
- dbg(lvl_debug,"case 3 HOUSENUMBER\n");
+ dbg(lvl_debug,"case 3 HOUSENUMBER");
has_street_name=0;
// if this housenumber has a streetname tag, set the name now
if (item_attr_get(this_->item, attr_street_name, &attr2))
{
- dbg(lvl_debug,"streetname: %s\n",attr2.u.str);
+ dbg(lvl_debug,"streetname: %s",attr2.u.str);
has_street_name=1;
}
@@ -988,7 +988,7 @@ search_list_get_result(struct search_list *this_)
{
this_->item=NULL;
} else {
- dbg(lvl_debug,"interpolation!\n");
+ dbg(lvl_debug,"interpolation!");
}
if(le->parent && has_street_name) {
diff --git a/navit/search_houseno_interpol.c b/navit/search_houseno_interpol.c
index 604fcf93c..fe575b73d 100644
--- a/navit/search_houseno_interpol.c
+++ b/navit/search_houseno_interpol.c
@@ -79,7 +79,7 @@ house_number_interpolation_clear_all(struct house_number_interpolation *inter)
static char *
search_next_house_number_curr_interpol_with_ends(struct house_number_interpolation *inter)
{
- dbg(lvl_debug,"interpolate %s-%s %s\n",inter->first,inter->last,inter->curr);
+ dbg(lvl_debug,"interpolate %s-%s %s",inter->first,inter->last,inter->curr);
if (!inter->first || !inter->last)
return NULL;
if (!inter->curr)
@@ -97,7 +97,7 @@ search_next_house_number_curr_interpol_with_ends(struct house_number_interpolati
inter->curr=NULL;
}
}
- dbg(lvl_debug,"interpolate result %s\n",inter->curr);
+ dbg(lvl_debug,"interpolate result %s",inter->curr);
return inter->curr;
}
@@ -141,7 +141,7 @@ search_house_number_interpolation_split(char *str, struct house_number_interpola
strncpy(first, str, len);
first[len]='\0';
last=g_strdup(pos+1);
- dbg(lvl_debug,"%s = %s - %s\n",str, first, last);
+ dbg(lvl_debug,"%s = %s - %s",str, first, last);
if (atoi(first) > atoi(last)) {
inter->first=last;
inter->last=first;
@@ -158,7 +158,7 @@ search_house_number_coordinate(struct item *item, struct house_number_interpolat
{
struct pcoord *ret=g_new(struct pcoord, 1);
ret->pro = map_projection(item->map);
- dbg(lvl_debug,"%s\n",item_to_name(item->type));
+ dbg(lvl_debug,"%s",item_to_name(item->type));
if (!inter) {
struct coord c;
if (item_coord_get(item, &c, 1)) {
@@ -183,29 +183,29 @@ search_house_number_coordinate(struct item *item, struct house_number_interpolat
if (count) {
int i,distance_sum=0,hn_distance;
int *distances=g_alloca(sizeof(int)*(count-1));
- dbg(lvl_debug,"count=%d hn_length=%d hn_pos=%d (%s of %s-%s)\n",count,hn_length,hn_pos,inter->curr,inter->first,inter->last);
+ dbg(lvl_debug,"count=%d hn_length=%d hn_pos=%d (%s of %s-%s)",count,hn_length,hn_pos,inter->curr,inter->first,inter->last);
if (!hn_length) {
hn_length=2;
hn_pos=1;
}
if (count == max)
- dbg(lvl_error,"coordinate overflow\n");
+ dbg(lvl_error,"coordinate overflow");
for (i = 0 ; i < count-1 ; i++) {
distances[i]=navit_sqrt(transform_distance_sq(&c[i],&c[i+1]));
distance_sum+=distances[i];
- dbg(lvl_debug,"distance[%d]=%d\n",i,distances[i]);
+ dbg(lvl_debug,"distance[%d]=%d",i,distances[i]);
}
- dbg(lvl_debug,"sum=%d\n",distance_sum);
+ dbg(lvl_debug,"sum=%d",distance_sum);
#if 0
hn_distance=distance_sum*hn_pos/hn_length;
#else
hn_distance=(distance_sum*hn_pos+distance_sum*inter_increment/2)/(hn_length+inter_increment);
#endif
- dbg(lvl_debug,"hn_distance=%d\n",hn_distance);
+ dbg(lvl_debug,"hn_distance=%d",hn_distance);
i=0;
while (i < count-1 && hn_distance > distances[i])
hn_distance-=distances[i++];
- dbg(lvl_debug,"remaining distance=%d from %d\n",hn_distance,distances[i]);
+ dbg(lvl_debug,"remaining distance=%d from %d",hn_distance,distances[i]);
ret->x=(c[i+1].x-c[i].x)*hn_distance/distances[i]+c[i].x;
ret->y=(c[i+1].y-c[i].y)*hn_distance/distances[i]+c[i].y;
}
diff --git a/navit/speech.c b/navit/speech.c
index cabd998dc..d1ebcc276 100644
--- a/navit/speech.c
+++ b/navit/speech.c
@@ -41,25 +41,25 @@ speech_new(struct attr *parent, struct attr **attrs)
attr=attr_search(attrs, NULL, attr_type);
if (! attr) {
- dbg(lvl_error,"type missing\n");
+ dbg(lvl_error,"type missing");
return NULL;
}
- dbg(lvl_debug,"type='%s'\n", attr->u.str);
+ dbg(lvl_debug,"type='%s'", attr->u.str);
speech_new=plugin_get_category_speech(attr->u.str);
- dbg(lvl_debug,"new=%p\n", speech_new);
+ dbg(lvl_debug,"new=%p", speech_new);
if (! speech_new) {
- dbg(lvl_error,"wrong type '%s'\n", attr->u.str);
+ dbg(lvl_error,"wrong type '%s'", attr->u.str);
return NULL;
}
this_=(struct speech *)navit_object_new(attrs, &speech_func, sizeof(struct speech));
this_->priv=speech_new(&this_->meth, this_->attrs, parent);
- dbg(lvl_debug, "say=%p\n", this_->meth.say);
- dbg(lvl_debug,"priv=%p\n", this_->priv);
+ dbg(lvl_debug, "say=%p", this_->meth.say);
+ dbg(lvl_debug,"priv=%p", this_->priv);
if (! this_->priv) {
speech_destroy(this_);
return NULL;
}
- dbg(lvl_debug,"return %p\n", this_);
+ dbg(lvl_debug,"return %p", this_);
return this_;
}
@@ -75,7 +75,7 @@ speech_destroy(struct speech *this_)
int
speech_say(struct speech *this_, const char *text)
{
- dbg(lvl_debug, "this_=%p text='%s' calling %p\n", this_, text, this_->meth.say);
+ dbg(lvl_debug, "this_=%p text='%s' calling %p", this_, text, this_->meth.say);
return (this_->meth.say)(this_->priv, text);
}
diff --git a/navit/speech/android/speech_android.c b/navit/speech/android/speech_android.c
index e9a206ebf..901abbc26 100644
--- a/navit/speech/android/speech_android.c
+++ b/navit/speech/android/speech_android.c
@@ -41,7 +41,7 @@ speech_android_say(struct speech_priv *this, const char *text)
int i;
string = (*jnienv)->NewStringUTF(jnienv, str);
- dbg(lvl_debug,"enter %s\n",str);
+ dbg(lvl_debug,"enter %s",str);
(*jnienv)->CallVoidMethod(jnienv, this->NavitSpeech, this->NavitSpeech_say, string);
(*jnienv)->DeleteLocalRef(jnienv, string);
g_free(str);
@@ -66,20 +66,20 @@ speech_android_init(struct speech_priv *ret)
char *class="org/navitproject/navit/NavitSpeech2";
if (!android_find_class_global(class, &ret->NavitSpeechClass)) {
- dbg(lvl_error,"No class found\n");
+ dbg(lvl_error,"No class found");
return 0;
}
- dbg(lvl_debug,"at 3\n");
+ dbg(lvl_debug,"at 3");
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitSpeechClass, "<init>", "(Lorg/navitproject/navit/Navit;)V");
if (cid == NULL) {
- dbg(lvl_error,"no method found\n");
+ dbg(lvl_error,"no method found");
return 0; /* exception thrown */
}
if (!android_find_method(ret->NavitSpeechClass, "say", "(Ljava/lang/String;)V", &ret->NavitSpeech_say))
return 0;
- dbg(lvl_debug,"at 4 android_activity=%p\n",android_activity);
+ dbg(lvl_debug,"at 4 android_activity=%p",android_activity);
ret->NavitSpeech=(*jnienv)->NewObject(jnienv, ret->NavitSpeechClass, cid, android_activity);
- dbg(lvl_debug,"result=%p\n",ret->NavitSpeech);
+ dbg(lvl_debug,"result=%p",ret->NavitSpeech);
if (!ret->NavitSpeech)
return 0;
if (ret->NavitSpeech)
@@ -96,7 +96,7 @@ speech_android_new(struct speech_methods *meth, struct attr **attrs, struct attr
if (android_version < 4)
this->flags=3;
if (!speech_android_init(this)) {
- dbg(lvl_error,"Failed to init speech %p\n",this->NavitSpeechClass);
+ dbg(lvl_error,"Failed to init speech %p",this->NavitSpeechClass);
g_free(this);
this=NULL;
}
diff --git a/navit/speech/cmdline/speech_cmdline.c b/navit/speech/cmdline/speech_cmdline.c
index 490811ce5..256fb2adf 100644
--- a/navit/speech/cmdline/speech_cmdline.c
+++ b/navit/speech/cmdline/speech_cmdline.c
@@ -63,7 +63,7 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco
{
GList *loop_samples=samples,*result=NULL,*recursion_result;
int shortest_result_length=INT_MAX;
- dbg(lvl_debug,"searching samples for text: '%s'\n",text);
+ dbg(lvl_debug,"searching samples for text: '%s'",text);
while (loop_samples) {
char *sample_name=loop_samples->data;
int sample_name_len;
@@ -77,7 +77,7 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco
const char *remaining_text=text+sample_name_len;
while (*remaining_text == ' ' || *remaining_text == ',')
remaining_text++;
- dbg(lvl_debug,"sample '%s' matched; remaining text: '%s'\n",sample_name,remaining_text);
+ dbg(lvl_debug,"sample '%s' matched; remaining text: '%s'",sample_name,remaining_text);
if (*remaining_text) {
recursion_result=speech_cmdline_search(samples, suffix_len, remaining_text, decode);
if (recursion_result && g_list_length(recursion_result) < shortest_result_length) {
@@ -141,15 +141,15 @@ speechd_say(struct speech_priv *this, const char *text)
argl=speech_cmdline_search(this->samples, strlen(this->sample_suffix), text, !!(this->flags & 1));
samplesmode=1;
listlen=g_list_length(argl);
- dbg(lvl_debug,"For text: '%s', found %d samples.\n",text,listlen);
+ dbg(lvl_debug,"For text: '%s', found %d samples.",text,listlen);
if (!listlen){
- dbg(lvl_error,"No matching samples found. Cannot speak text: '%s'\n",text);
+ dbg(lvl_error,"No matching samples found. Cannot speak text: '%s'",text);
}
} else {
listlen=1;
}
if(listlen>0) {
- dbg(lvl_debug,"Speaking text '%s'\n",text);
+ dbg(lvl_debug,"Speaking text '%s'",text);
int argc;
char**argv;
int j;
@@ -168,7 +168,7 @@ speechd_say(struct speech_priv *this, const char *text)
while(l) {
char *new_arg;
new_arg=g_strdup_printf("%s/%s",this->sample_dir,(char *)l->data);
- dbg(lvl_debug,"new_arg %s\n",new_arg);
+ dbg(lvl_debug,"new_arg %s",new_arg);
argv[j++]=g_strdup_printf(cmdv[i],new_arg);
g_free(new_arg);
l=g_list_next(l);
@@ -246,7 +246,7 @@ speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *paren
int len=strlen(name);
if (len > suffix_len) {
if (!strcmp(name+len-suffix_len, this->sample_suffix)) {
- dbg(lvl_debug,"found %s\n",name);
+ dbg(lvl_debug,"found %s",name);
this->samples=g_list_prepend(this->samples, g_strdup(name));
}
}
diff --git a/navit/speech/espeak/speak.c b/navit/speech/espeak/speak.c
index 329a05d01..301b4b37e 100644
--- a/navit/speech/espeak/speak.c
+++ b/navit/speech/espeak/speak.c
@@ -166,11 +166,11 @@ static BOOL initialise(void)
{
if(result == -1)
{
- dbg(lvl_error, "Failed to load espeak-data\n");
+ dbg(lvl_error, "Failed to load espeak-data");
return FALSE;
}
else
- dbg(lvl_error, "Wrong version of espeak-data 0x%x (expects 0x%x) at %s\n",result,version_phdata,path_home);
+ dbg(lvl_error, "Wrong version of espeak-data 0x%x (expects 0x%x) at %s",result,version_phdata,path_home);
}
LoadConfig();
SetVoiceStack(NULL);
@@ -214,7 +214,7 @@ static void start_speaking(struct speech_priv* sp_priv)
static LRESULT CALLBACK speech_message_handler( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
- dbg(lvl_debug, "message_handler called\n");
+ dbg(lvl_debug, "message_handler called");
switch (uMsg)
{
@@ -234,7 +234,7 @@ static LRESULT CALLBACK speech_message_handler( HWND hwnd, UINT uMsg, WPARAM wPa
{
WAVEHDR *WaveHeader = (WAVEHDR *)lParam;
struct speech_priv* sp_priv;
- dbg(lvl_info, "Wave buffer done\n");
+ dbg(lvl_info, "Wave buffer done");
sp_priv = (struct speech_priv*)WaveHeader->dwUser;
sp_priv->free_buffers = g_list_append(sp_priv->free_buffers, WaveHeader);
@@ -282,7 +282,7 @@ static void speech_message_dispatcher( struct speech_priv * sp_priv)
{
if (bRet == -1)
{
- dbg(lvl_error, "Error getting message from queue\n");
+ dbg(lvl_error, "Error getting message from queue");
break;
}
else
@@ -336,7 +336,7 @@ static DWORD startThread( LPVOID sp_priv)
if (!RegisterClass(&wc))
{
- dbg(lvl_error, "Window registration for message queue failed\n");
+ dbg(lvl_error, "Window registration for message queue failed");
return 1;
}
@@ -361,7 +361,7 @@ static DWORD startThread( LPVOID sp_priv)
if (hwnd == NULL)
{
- dbg(lvl_error, "Window creation failed: %d\n", GetLastError());
+ dbg(lvl_error, "Window creation failed: %d", GetLastError());
return 1;
}
@@ -371,7 +371,7 @@ static DWORD startThread( LPVOID sp_priv)
if(!waveout_open(this))
{
- dbg(lvl_error, "Can't open wave output\n");
+ dbg(lvl_error, "Can't open wave output");
return 1;
}
@@ -387,11 +387,11 @@ static int
espeak_say(struct speech_priv *this, const char *text)
{
char *phrase = g_strdup(text);
- dbg(lvl_debug, "Speak: '%s'\n", text);
+ dbg(lvl_debug, "Speak: '%s'", text);
if (!PostMessage(this->h_queue, msg_say, (WPARAM)this, (LPARAM)phrase))
{
- dbg(lvl_error, "PostThreadMessage 'say' failed\n");
+ dbg(lvl_error, "PostThreadMessage 'say' failed");
}
return 0;
@@ -440,7 +440,7 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
strcpy(path_home,path->u.str);
else
sprintf(path_home,"%s/espeak-data",getenv("NAVIT_SHAREDIR"));
- dbg(lvl_debug,"path_home set to %s\n",path_home);
+ dbg(lvl_debug,"path_home set to %s",path_home);
if ( !initialise() )
{
@@ -467,12 +467,12 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
}
file1=g_strdup_printf("%s/voices/%s",path_home,lang_full);
file2=g_strdup_printf("%s/voices/%s/%s",path_home,lang,lang_full);
- dbg(lvl_debug,"Testing %s and %s\n",file1,file2);
+ dbg(lvl_debug,"Testing %s and %s",file1,file2);
if (file_exists(file1) || file_exists(file2))
lang_str=g_strdup(lang_full);
else
lang_str=g_strdup(lang);
- dbg(lvl_debug,"Language full %s lang %s result %s\n",lang_full,lang,lang_str);
+ dbg(lvl_debug,"Language full %s lang %s result %s",lang_full,lang,lang_str);
g_free(lang_full);
g_free(lang);
g_free(file1);
@@ -481,12 +481,12 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
}
if(lang_str && SetVoiceByName(lang_str) != EE_OK)
{
- dbg(lvl_error, "Error setting language to: '%s',falling back to default\n", lang_str);
+ dbg(lvl_error, "Error setting language to: '%s',falling back to default", lang_str);
g_free(lang_str);
lang_str=NULL;
}
if(!lang_str && SetVoiceByName("default") != EE_OK) {
- dbg(lvl_error, "Error setting language to default\n");
+ dbg(lvl_error, "Error setting language to default");
}
diff --git a/navit/speech/iphone/speech_iphone.m b/navit/speech/iphone/speech_iphone.m
index c77b6fbc2..854ae097b 100644
--- a/navit/speech/iphone/speech_iphone.m
+++ b/navit/speech/iphone/speech_iphone.m
@@ -33,11 +33,11 @@ struct speech_priv {
static int
speech_iphone_say(struct speech_priv *this, const char *text)
{
- dbg(0,"enter %s\n",text);
+ dbg(0,"enter %s",text);
NSString *s=[[NSString alloc]initWithUTF8String: text];
[this->speech startSpeakingString:s toURL:nil];
[s release];
- dbg(0,"ok\n");
+ dbg(0,"ok");
return 1;
}
@@ -60,7 +60,7 @@ speech_iphone_new(struct speech_methods *meth, struct attr **attrs, struct attr
*meth=speech_iphone_meth;
this=g_new0(struct speech_priv,1);
this->speech=[[NSClassFromString(@"VSSpeechSynthesizer") alloc] init];
- dbg(0,"this->speech=%p\n",this->speech);
+ dbg(0,"this->speech=%p",this->speech);
[this->speech setRate:(float)1.0];
return this;
}
@@ -69,6 +69,6 @@ speech_iphone_new(struct speech_methods *meth, struct attr **attrs, struct attr
void
plugin_init(void)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
plugin_register_category_speech("iphone", speech_iphone_new);
}
diff --git a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
index da2c6b3e1..1360bdcaf 100644
--- a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
+++ b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
@@ -41,7 +41,7 @@ Qt5EspeakAudioOut::Qt5EspeakAudioOut(int samplerate, const char* category)
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
if (!info.isFormatSupported(format)) {
dbg(lvl_error,
- "Raw audio format not supported by backend, cannot play audio.\n");
+ "Raw audio format not supported by backend, cannot play audio.");
return;
}
@@ -54,7 +54,7 @@ Qt5EspeakAudioOut::Qt5EspeakAudioOut(int samplerate, const char* category)
* systems with
* really low memory.*/
audio->setBufferSize((samplerate * 1 /*ch*/ * 2 /*samplezize*/) * 5 /*seconds*/);
- dbg(lvl_debug, "Buffer size is: %d\n", audio->bufferSize());
+ dbg(lvl_debug, "Buffer size is: %d", audio->bufferSize());
if (category != NULL)
audio->setCategory(QString(category));
@@ -76,7 +76,7 @@ Qt5EspeakAudioOut::~Qt5EspeakAudioOut()
void Qt5EspeakAudioOut::handleStateChanged(QAudio::State newState)
{
- dbg(lvl_debug, "Enter %d\n", newState);
+ dbg(lvl_debug, "Enter %d", newState);
switch (newState) {
case QAudio::ActiveState:
break;
@@ -88,21 +88,21 @@ void Qt5EspeakAudioOut::handleStateChanged(QAudio::State newState)
/*remove all data that was already read*/
data->remove(0, buffer->pos());
buffer->seek(0);
- dbg(lvl_debug, "Size %d\n", data->size());
+ dbg(lvl_debug, "Size %d", data->size());
break;
}
}
void Qt5EspeakAudioOut::resume(int state)
{
- dbg(lvl_debug, "Enter %d\n", state);
+ dbg(lvl_debug, "Enter %d", state);
if (audio->state() != QAudio::ActiveState)
audio->start(buffer);
}
void Qt5EspeakAudioOut::addSamples(short* wav, int numsamples)
{
- dbg(lvl_debug, "Enter (%d samples)\n", numsamples);
+ dbg(lvl_debug, "Enter (%d samples)", numsamples);
/*remove all data that was already read (if any)*/
data->remove(0, buffer->pos());
@@ -110,7 +110,7 @@ void Qt5EspeakAudioOut::addSamples(short* wav, int numsamples)
if (numsamples > 0) {
data->append((const char*)wav, numsamples * sizeof(short));
- dbg(lvl_debug, "%ld samples in buffer\n",
+ dbg(lvl_debug, "%ld samples in buffer",
(long int)(buffer->size() / sizeof(short)));
emit call_resume(numsamples);
}
diff --git a/navit/speech/qt5_espeak/qt5_espeak.cpp b/navit/speech/qt5_espeak/qt5_espeak.cpp
index 8d108eae6..266fde624 100755
--- a/navit/speech/qt5_espeak/qt5_espeak.cpp
+++ b/navit/speech/qt5_espeak/qt5_espeak.cpp
@@ -59,7 +59,7 @@ struct speech_priv {
int qt5_espeak_SynthCallback(short* wav, int numsamples, espeak_EVENT* events)
{
struct speech_priv* pr = NULL;
- dbg(lvl_debug, "Callback %d samples\n", numsamples);
+ dbg(lvl_debug, "Callback %d samples", numsamples);
if (events != NULL)
pr = (struct speech_priv*)events->user_data;
if ((pr != NULL) && (pr->audio != NULL)) {
@@ -91,7 +91,7 @@ qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs)
sr->path_home = NULL;
#endif
}
- dbg(lvl_debug, "path_home set to %s\n", sr->path_home);
+ dbg(lvl_debug, "path_home set to %s", sr->path_home);
#if INTERNAL_ESPEAK
/*internal espeak is configured to support only synchronous modes */
sr->sample_rate = espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, BUFFERLENGTH, sr->path_home, 0);
@@ -101,10 +101,10 @@ qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs)
sr->sample_rate = espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, BUFFERLENGTH, sr->path_home, 0);
#endif
if (sr->sample_rate == EE_INTERNAL_ERROR) {
- dbg(lvl_error, "Init failed %d\n", sr->sample_rate);
+ dbg(lvl_error, "Init failed %d", sr->sample_rate);
return 1;
}
- dbg(lvl_error, "Sample rate is %d\n", sr->sample_rate);
+ dbg(lvl_error, "Sample rate is %d", sr->sample_rate);
espeak_SetSynthCallback(qt5_espeak_SynthCallback);
return TRUE;
@@ -132,13 +132,13 @@ qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs)
strtolower(lang_str, lang_env);
/* extract language code from LANG environment */
- dbg(lvl_debug, "%s\n", lang_str);
+ dbg(lvl_debug, "%s", lang_str);
country = strchr(lang_str, '_');
- dbg(lvl_debug, "%s\n", country);
+ dbg(lvl_debug, "%s", country);
if (country) {
lang_str[country - lang_str] = '\0';
}
- dbg(lvl_debug, "espeak lang: %s\n", lang_str);
+ dbg(lvl_debug, "espeak lang: %s", lang_str);
}
}
/*TODO (golden water tap): expose all those values as attrs */
@@ -152,7 +152,7 @@ qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs)
if (lang_str != NULL)
g_free(lang_str);
if (error != EE_OK) {
- dbg(lvl_error, "Unable to set Language\n");
+ dbg(lvl_error, "Unable to set Language");
return false;
}
return true;
@@ -179,11 +179,11 @@ static int
qt5_espeak_say(struct speech_priv* sr, const char* text)
{
espeak_ERROR error;
- dbg(lvl_debug, "Say \"%s\"\n", text);
+ dbg(lvl_debug, "Say \"%s\"", text);
error = espeak_Synth(text, strlen(text), 0, POS_CHARACTER, 0,
espeakCHARS_UTF8, NULL, sr);
if (error != EE_OK)
- dbg(lvl_error, "Unable to speak! error == %d\n", error);
+ dbg(lvl_error, "Unable to speak! error == %d", error);
return 0;
}
@@ -192,7 +192,7 @@ qt5_espeak_say(struct speech_priv* sr, const char* text)
static void
qt5_espeak_destroy(struct speech_priv* sr)
{
- dbg(lvl_debug, "Enter\n");
+ dbg(lvl_debug, "Enter");
if (sr->path_home != NULL)
g_free(sr->path_home);
@@ -215,7 +215,7 @@ qt5_espeak_new(struct speech_methods* meth, struct attr** attrs,
struct attr* parent)
{
struct speech_priv* sr = NULL;
- dbg(lvl_debug, "Enter\n");
+ dbg(lvl_debug, "Enter");
/* allocate handle */
sr = g_new0(struct speech_priv, 1);
@@ -229,17 +229,17 @@ qt5_espeak_new(struct speech_methods* meth, struct attr** attrs,
/* init espeak library */
if (!(sr->espeak_ok = qt5_espeak_init_espeak(sr, attrs))) {
- dbg(lvl_error, "Unable to initialize espeak library\n");
+ dbg(lvl_error, "Unable to initialize espeak library");
}
/* init espeak voice and language */
if (!(sr->espeak_ok = qt5_espeak_init_language(sr, attrs))) {
- dbg(lvl_error, "Unable to initialize espeak language\n");
+ dbg(lvl_error, "Unable to initialize espeak language");
}
/* init qt5 audio using default category*/
if (!(sr->audio_ok = qt5_espeak_init_audio(sr, NULL))) {
- dbg(lvl_error, "Unable to initialize audio\n");
+ dbg(lvl_error, "Unable to initialize audio");
}
return sr;
}
@@ -247,6 +247,6 @@ qt5_espeak_new(struct speech_methods* meth, struct attr** attrs,
/* initialize this as plugin */
void plugin_init(void)
{
- dbg(lvl_debug, "Enter\n");
+ dbg(lvl_debug, "Enter");
plugin_register_category_speech("qt5_espeak", qt5_espeak_new);
}
diff --git a/navit/start_apple.m b/navit/start_apple.m
index 356d34408..ca41b5b68 100644
--- a/navit/start_apple.m
+++ b/navit/start_apple.m
@@ -30,7 +30,7 @@ main(int argc, char **argv)
NSString *appFolderPath = [[NSBundle mainBundle] resourcePath];
NSString *locale = [[NSLocale currentLocale] localeIdentifier];
char *lang=g_strdup_printf("%s.UTF-8",[locale UTF8String]);
- dbg(0,"lang %s\n",lang);
+ dbg(0,"lang %s",lang);
setenv("LANG",lang,0);
setlocale(LC_ALL, NULL);
@@ -40,7 +40,7 @@ main(int argc, char **argv)
argv[0]=g_strdup_printf("%s/bin/navit",s);
setenv("NAVIT_USER_DATADIR",user,0);
- dbg(0,"calling main_real\n");
+ dbg(0,"calling main_real");
ret=main_real(argc, argv);
g_free(argv[0]);
g_free(user);
diff --git a/navit/start_real.c b/navit/start_real.c
index 16e0d5edb..7be0e371c 100644
--- a/navit/start_real.c
+++ b/navit/start_real.c
@@ -179,12 +179,12 @@ int main_real(int argc, char * const* argv)
for (;;) {
if (li == NULL) {
// We have not found an existing config file from all possibilities
- dbg(lvl_error, "%s", _("No config file navit.xml, navit.xml.local found\n"));
+ dbg(lvl_error, "%s", _("No config file navit.xml, navit.xml.local found"));
return 4;
}
// Try the next config file possibility from the list
config_file = li->data;
- dbg(lvl_debug,"trying %s\n",config_file);
+ dbg(lvl_debug,"trying %s",config_file);
if (file_exists(config_file)) {
break;
}
@@ -192,14 +192,14 @@ int main_real(int argc, char * const* argv)
li = g_list_next(li);
}
- dbg(lvl_debug,"Loading %s\n",config_file);
+ dbg(lvl_debug,"Loading %s",config_file);
if (!config_load(config_file, &error)) {
- dbg(lvl_error, _("Error parsing config file '%s': %s\n"), config_file, error ? error->message : "");
+ dbg(lvl_error, _("Error parsing config file '%s': %s"), config_file, error ? error->message : "");
} else {
- dbg(lvl_info, _("Using config file '%s'\n"), config_file);
+ dbg(lvl_info, _("Using config file '%s'"), config_file);
}
if (! config) {
- dbg(lvl_error, _("Error: No configuration found in config file '%s'\n"), config_file);
+ dbg(lvl_error, _("Error: No configuration found in config file '%s'"), config_file);
}
while (li) {
g_free(li->data);
@@ -207,7 +207,7 @@ int main_real(int argc, char * const* argv)
}
g_list_free(list);
if (! (config && config_get_attr(config, attr_navit, &navit, NULL))) {
- dbg(lvl_error, "%s", _("Internal initialization failed, exiting. Check previous error messages.\n"));
+ dbg(lvl_error, "%s", _("Internal initialization failed, exiting. Check previous error messages."));
exit(5);
}
conf.type=attr_config;
@@ -222,7 +222,7 @@ int main_real(int argc, char * const* argv)
}
fclose_ret = fclose(f);
if (fclose_ret != 0) {
- dbg(lvl_error, "Could not close the specified startup file: %s\n", startup_file);
+ dbg(lvl_error, "Could not close the specified startup file: %s", startup_file);
}
} else {
dbg(lvl_error, "Could not open the specified startup file: %s", startup_file);
diff --git a/navit/support/libc/stat.c b/navit/support/libc/stat.c
index 586dcf714..e66a90737 100644
--- a/navit/support/libc/stat.c
+++ b/navit/support/libc/stat.c
@@ -120,13 +120,13 @@ _stat (const char *path, struct _stat *st)
size_t len;
int exec;
- dbg(lvl_debug,"path=%s\n",path);
+ dbg(lvl_debug,"path=%s",path);
mbstowcs (pathw, path, MAX_PATH);
- dbg(lvl_debug,"wide path=%S\n",pathw);
+ dbg(lvl_debug,"wide path=%S",pathw);
if((h = FindFirstFileW (pathw, &fd)) == INVALID_HANDLE_VALUE)
{
DWORD dwError = GetLastError ();
- dbg(lvl_error,"no file\n");
+ dbg(lvl_error,"no file");
if(dwError == ERROR_NO_MORE_FILES)
/* Convert error to something more sensible. */
SetLastError (ERROR_FILE_NOT_FOUND);
@@ -139,7 +139,7 @@ _stat (const char *path, struct _stat *st)
exec = (len >= 4
&& strcasecmp (path + len - 4, ".exe") == 0);
ret = __stat_by_file_info (&sfi, st, exec);
- dbg(lvl_debug,"ret=%d\n",ret);
+ dbg(lvl_debug,"ret=%d",ret);
FindClose (h);
return ret;
}
diff --git a/navit/support/win32/serial_io.c b/navit/support/win32/serial_io.c
index 2eba8ece1..56966bcf7 100644
--- a/navit/support/win32/serial_io.c
+++ b/navit/support/win32/serial_io.c
@@ -51,7 +51,7 @@ int serial_io_init( const char* port, const char* strsettings )
0,
NULL
);
- dbg(lvl_warning, "return (fd) : '-1' : serial_io_init error : '%s'\n", lpMsgBuf);
+ dbg(lvl_warning, "return (fd) : '-1' : serial_io_init error : '%s'", lpMsgBuf);
LocalFree( lpMsgBuf ); // Free the buffer.
return -1;
@@ -72,7 +72,7 @@ int serial_io_init( const char* port, const char* strsettings )
SetCommTimeouts(hCom, &sCT);
- dbg(lvl_debug, "serial_io_init return (fd) : '%d'\n", (int)hCom);
+ dbg(lvl_debug, "serial_io_init return (fd) : '%d'", (int)hCom);
return (int)hCom;
}
@@ -94,12 +94,12 @@ int serial_io_init( const char* port, const char* strsettings )
int serial_io_read( int fd, char * buffer, int buffer_size )
{
DWORD dwBytesIn = 0;
- dbg(lvl_debug, "serial_io_read fd = %d buffer_size = %d\n", fd, buffer_size);
+ dbg(lvl_debug, "serial_io_read fd = %d buffer_size = %d", fd, buffer_size);
if (fd <= 0)
{
- dbg(lvl_debug, "serial_io_read return (dwBytesIn) : '0'\n");
+ dbg(lvl_debug, "serial_io_read return (dwBytesIn) : '0'");
*buffer = 0;
return 0;
}
@@ -117,11 +117,11 @@ int serial_io_read( int fd, char * buffer, int buffer_size )
}
if (dwBytesIn > 0)
{
- dbg(lvl_debug,"GPS < %s\n",buffer );
+ dbg(lvl_debug,"GPS < %s",buffer );
}
buffer[buffer_size - 1] = 0;
- dbg(lvl_info, "serial_io_read return (dwBytesIn) : '%d'\n", dwBytesIn);
+ dbg(lvl_info, "serial_io_read return (dwBytesIn) : '%d'", dwBytesIn);
return dwBytesIn;
}
@@ -139,7 +139,7 @@ int serial_io_read( int fd, char * buffer, int buffer_size )
int serial_io_write(int fd, const char * buffer)
{
DWORD dwBytesOut = 0;
- dbg(lvl_debug, "serial_io_write fd = %d buffer = '%s'\n",fd, buffer);
+ dbg(lvl_debug, "serial_io_write fd = %d buffer = '%s'",fd, buffer);
WriteFile((HANDLE)fd, buffer, strlen(buffer), &dwBytesOut, NULL);
@@ -157,7 +157,7 @@ int serial_io_write(int fd, const char * buffer)
**/
void serial_io_shutdown(int fd )
{
- dbg(lvl_debug, "serial_io_shutdown fd = %d\n",fd);
+ dbg(lvl_debug, "serial_io_shutdown fd = %d",fd);
if (fd > 0)
{
diff --git a/navit/support/wordexp/glob.c b/navit/support/wordexp/glob.c
index 8337367dd..fabceb6f2 100644
--- a/navit/support/wordexp/glob.c
+++ b/navit/support/wordexp/glob.c
@@ -130,7 +130,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl
strcat(path, "/");
strcat(path, path2);
if (!strlen(pattern)) {
- dbg(lvl_debug,"found %s\n",path);
+ dbg(lvl_debug,"found %s",path);
pglob->gl_pathv=realloc(pglob->gl_pathv, (pglob->gl_pathc+1)*sizeof(char *));
if (!pglob->gl_pathv) {
pglob->gl_pathc=0;
@@ -139,7 +139,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl
pglob->gl_pathv[pglob->gl_pathc++]=path;
return 0;
}
- dbg(lvl_debug,"searching for %s in %s\n",pattern,path);
+ dbg(lvl_debug,"searching for %s in %s",pattern,path);
flen=strcspn(pattern,"/");
next=pattern+flen;
if (*next == '/')
@@ -150,7 +150,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl
if (glob_requires_match(fname, 0)) {
DIR *dh;
struct dirent *de;
- dbg(lvl_debug,"in dir %s search for %s\n",path,fname);
+ dbg(lvl_debug,"in dir %s search for %s",path,fname);
dh=opendir(path);
if (dh) {
while ((de=readdir(dh))) {
diff --git a/navit/track.c b/navit/track.c
index 577ffe6ab..cd788fe89 100644
--- a/navit/track.c
+++ b/navit/track.c
@@ -155,7 +155,7 @@ tracking_process_cdf(struct cdf_data *cdf, struct pcoord *pin, struct pcoord *po
int speed_num,i;
if (cdf->hist_size == 0) {
- dbg(lvl_warning,"No CDF.\n");
+ dbg(lvl_warning,"No CDF.");
*pout = *pin;
*dirout = dirin;
return;
@@ -338,7 +338,7 @@ tracking_get_attr(struct tracking *_this, enum attr_type type, struct attr *attr
struct tracking_line *tl;
int result=0;
- dbg(lvl_debug,"enter %s\n",attr_to_name(type));
+ dbg(lvl_debug,"enter %s",attr_to_name(type));
if (_this->attr) {
attr_free(_this->attr);
_this->attr=NULL;
@@ -471,7 +471,7 @@ tracking_doupdate_lines(struct tracking *tr, struct coord *pc, enum projection p
struct coord_geo g;
struct coord cc;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
h=mapset_open(tr->ms);
while ((m=mapset_next(h,2))) {
cc.x = pc->x;
@@ -501,7 +501,7 @@ tracking_doupdate_lines(struct tracking *tr, struct coord *pc, enum projection p
map_rect_destroy(mr);
}
mapset_close(h);
- dbg(lvl_debug, "exit\n");
+ dbg(lvl_debug, "exit");
}
@@ -509,7 +509,7 @@ void
tracking_flush(struct tracking *tr)
{
struct tracking_line *tl=tr->lines,*next;
- dbg(lvl_debug,"enter(tr=%p)\n", tr);
+ dbg(lvl_debug,"enter(tr=%p)", tr);
while (tl) {
next=tl->next;
@@ -603,7 +603,7 @@ tracking_value(struct tracking *tr, struct tracking_line *t, int offset, struct
{
int value=0;
struct street_data *sd=t->street;
- dbg(lvl_info, "%d: (0x%x,0x%x)-(0x%x,0x%x)\n", offset, sd->c[offset].x, sd->c[offset].y, sd->c[offset+1].x, sd->c[offset+1].y);
+ dbg(lvl_info, "%d: (0x%x,0x%x)-(0x%x,0x%x)", offset, sd->c[offset].x, sd->c[offset].y, sd->c[offset+1].x, sd->c[offset+1].y);
if (flags & 1) {
struct coord c1, c2, cp;
c1.x = sd->c[offset].x;
@@ -672,7 +672,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
if (!vehicle_get_attr(tr->vehicle, attr_position_speed, &speed_attr, NULL) ||
!vehicle_get_attr(tr->vehicle, attr_position_direction, &direction_attr, NULL) ||
!vehicle_get_attr(tr->vehicle, attr_position_coord_geo, &coord_geo, NULL) ||
- dbg(lvl_error,"failed to get position data %d %d %d %d\n",
+ dbg(lvl_error,"failed to get position data %d %d %d %d",
vehicle_get_attr(tr->vehicle, attr_position_speed, &speed_attr, NULL),
vehicle_get_attr(tr->vehicle, attr_position_direction, &direction_attr, NULL),
vehicle_get_attr(tr->vehicle, attr_position_coord_geo, &coord_geo, NULL),
@@ -691,46 +691,46 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
if (!vehicleprofile_get_attr(vehicleprofile,attr_static_speed,&static_speed,NULL) || !vehicleprofile_get_attr(vehicleprofile,attr_static_distance,&static_distance,NULL)) {
static_speed.u.num=3;
static_distance.u.num=10;
- dbg(lvl_debug,"Using defaults for static position detection\n");
+ dbg(lvl_debug,"Using defaults for static position detection");
}
- dbg(lvl_info,"Static speed: %ld, static distance: %ld\n",static_speed.u.num, static_distance.u.num);
+ dbg(lvl_info,"Static speed: %ld, static distance: %ld",static_speed.u.num, static_distance.u.num);
speed=*speed_attr.u.numd;
direction=*direction_attr.u.numd;
tr->valid=attr_position_valid_valid;
transform_from_geo(pro, coord_geo.u.coord_geo, &tr->curr_in);
if ((speed < static_speed.u.num && transform_distance(pro, &tr->last_in, &tr->curr_in) < static_distance.u.num )) {
- dbg(lvl_debug,"static speed %f coord 0x%x,0x%x vs 0x%x,0x%x\n",speed,tr->last_in.x,tr->last_in.y, tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"static speed %f coord 0x%x,0x%x vs 0x%x,0x%x",speed,tr->last_in.x,tr->last_in.y, tr->curr_in.x, tr->curr_in.y);
tr->valid=attr_position_valid_static;
tr->speed=0;
return;
}
if (tr->tunnel) {
tr->curr_in=tr->curr_out;
- dbg(lvl_debug,"tunnel extrapolation speed %f dir %f\n",tr->speed,tr->direction);
- dbg(lvl_debug,"old 0x%x,0x%x\n",tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"tunnel extrapolation speed %f dir %f",tr->speed,tr->direction);
+ dbg(lvl_debug,"old 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
speed=tr->speed;
direction=tr->curr_line->angle[tr->pos];
transform_project(pro, &tr->curr_in, tr->speed*tr->tunnel_extrapolation/36, tr->direction, &tr->curr_in);
- dbg(lvl_debug,"new 0x%x,0x%x\n",tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"new 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
} else if (vehicle_get_attr(tr->vehicle, attr_lag, &lag, NULL) && lag.u.num > 0) {
double espeed;
time=iso8601_to_secs(time_attr.u.str);
int edirection;
if (time-tr->time == 1) {
- dbg(lvl_debug,"extrapolating speed from %f and %f (%f)\n",tr->speed, speed, speed-tr->speed);
+ dbg(lvl_debug,"extrapolating speed from %f and %f (%f)",tr->speed, speed, speed-tr->speed);
espeed=speed+(speed-tr->speed)*lag.u.num/10;
- dbg(lvl_debug,"extrapolating angle from %f and %f (%d)\n",tr->direction, direction, tracking_angle_diff(direction,tr->direction,360));
+ dbg(lvl_debug,"extrapolating angle from %f and %f (%d)",tr->direction, direction, tracking_angle_diff(direction,tr->direction,360));
edirection=direction+tracking_angle_diff(direction,tr->direction,360)*lag.u.num/10;
} else {
- dbg(lvl_debug,"no speed and direction extrapolation\n");
+ dbg(lvl_debug,"no speed and direction extrapolation");
espeed=speed;
edirection=direction;
}
- dbg(lvl_debug,"lag %ld speed %f direction %d\n",lag.u.num,espeed,edirection);
- dbg(lvl_debug,"old 0x%x,0x%x\n",tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"lag %ld speed %f direction %d",lag.u.num,espeed,edirection);
+ dbg(lvl_debug,"old 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
transform_project(pro, &tr->curr_in, espeed*lag.u.num/36, edirection, &tr->curr_in);
- dbg(lvl_debug,"new 0x%x,0x%x\n",tr->curr_in.x, tr->curr_in.y);
tr->time=time;
+ dbg(lvl_debug,"new 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
}
tr->pro=pro;
#if 0
@@ -744,11 +744,11 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
tr->last[0]=tr->curr[0];
tr->last[1]=tr->curr[1];
if (!tr->lines || transform_distance(pro, &tr->last_updated, &tr->curr_in) > 500) {
- dbg(lvl_debug, "update\n");
+ dbg(lvl_debug, "update");
tracking_flush(tr);
tracking_doupdate_lines(tr, &tr->curr_in, pro);
tr->last_updated=tr->curr_in;
- dbg(lvl_debug,"update end\n");
+ dbg(lvl_debug,"update end");
}
tr->street_direction=0;
@@ -767,7 +767,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
tr->curr[0]=sd->c[i];
tr->curr[1]=sd->c[i+1];
tr->direction_matched=t->angle[i];
- dbg(lvl_debug,"lpnt.x=0x%x,lpnt.y=0x%x pos=%d %d+%d+%d+%d=%d\n", lpnt.x, lpnt.y, i,
+ dbg(lvl_debug,"lpnt.x=0x%x,lpnt.y=0x%x pos=%d %d+%d+%d+%d=%d", lpnt.x, lpnt.y, i,
transform_distance_line_sq(&sd->c[i], &sd->c[i+1], &cin, &lpnt_tmp),
tracking_angle_delta(tr, tr->curr_angle, t->angle[i], 0)*tr->angle_pref,
tracking_is_connected(tr, tr->last, &sd->c[i]) ? tr->connected_pref : 0,
@@ -788,7 +788,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
}
t=t->next;
}
- dbg(lvl_debug,"tr->curr_line=%p min=%d\n", tr->curr_line, min);
+ dbg(lvl_debug,"tr->curr_line=%p min=%d", tr->curr_line, min);
if (!tr->curr_line || min > tr->offroad_limit_pref) {
tr->curr_out=tr->curr_in;
tr->coord_geo_valid=0;
@@ -800,7 +800,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
} else if (tr->tunnel) {
tr->speed=0;
}
- dbg(lvl_debug,"found 0x%x,0x%x\n", tr->curr_out.x, tr->curr_out.y);
+ dbg(lvl_debug,"found 0x%x,0x%x", tr->curr_out.x, tr->curr_out.y);
callback_list_call_attr_0(tr->callback_list, attr_position_coord_geo);
}
@@ -987,7 +987,7 @@ tracking_map_item_coord_get(void *priv_data, struct coord *c, int count)
struct map_rect_priv *this=priv_data;
enum projection pro;
int ret=0;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
while (this->ccount < 2 && count > 0) {
pro = map_projection(this->curr->street->item.map);
if (projection_mg != pro) {
@@ -996,7 +996,7 @@ tracking_map_item_coord_get(void *priv_data, struct coord *c, int count)
c ,projection_mg);
} else
*c=this->curr->street->c[this->ccount+this->coord];
- dbg(lvl_debug,"coord %d 0x%x,0x%x\n",this->ccount,c->x,c->y);
+ dbg(lvl_debug,"coord %d 0x%x,0x%x",this->ccount,c->x,c->y);
this->ccount++;
ret++;
c++;
@@ -1174,7 +1174,7 @@ tracking_map_get_item(struct map_rect_priv *priv)
priv->item.type=type_tracking_10;
else
priv->item.type=type_tracking_0;
- dbg(lvl_debug,"item %d %d points\n", priv->coord, priv->curr->street->count);
+ dbg(lvl_debug,"item %d %d points", priv->coord, priv->curr->street->count);
tracking_map_item_coord_rewind(priv);
tracking_map_item_attr_rewind(priv);
return ret;
diff --git a/navit/transform.c b/navit/transform.c
index 8a6713ab6..573eb3022 100644
--- a/navit/transform.c
+++ b/navit/transform.c
@@ -126,7 +126,7 @@ transform_setup_matrix(struct transformation *t)
int scale=t->scale;
int order_dir=-1;
- dbg(lvl_debug,"yaw=%d pitch=%d center=0x%x,0x%x\n", t->yaw, t->pitch, t->map_center.x, t->map_center.y);
+ dbg(lvl_debug,"yaw=%d pitch=%d center=0x%x,0x%x", t->yaw, t->pitch, t->map_center.x, t->map_center.y);
t->znear=1 << POST_SHIFT;
t->zfar=300*t->znear;
t->scale_shift=0;
@@ -144,7 +144,7 @@ transform_setup_matrix(struct transformation *t)
scale >>= 1;
}
fac=(1 << POST_SHIFT) * (1 << t->scale_shift) / t->scale;
- dbg(lvl_debug,"scale_shift=%d order=%d scale=%f fac=%f\n", t->scale_shift, t->order,t->scale,fac);
+ dbg(lvl_debug,"scale_shift=%d order=%d scale=%f fac=%f", t->scale_shift, t->order,t->scale,fac);
t->m00=rollc*yawc*fac;
t->m01=rollc*yaws*fac;
@@ -161,7 +161,7 @@ transform_setup_matrix(struct transformation *t)
if (t->pitch) {
t->ddd=1;
t->offz=t->screen_dist;
- dbg(lvl_debug,"near %d far %d\n",t->znear,t->zfar);
+ dbg(lvl_debug,"near %d far %d",t->znear,t->zfar);
t->xscale=t->xscale3d;
t->yscale=t->yscale3d;
t->wscale=t->wscale3d;
@@ -218,7 +218,7 @@ transform_set_hog(struct transformation *this_, int hog)
#ifdef ENABLE_ROLL
this_->hog=hog;
#else
- dbg(lvl_error,"not supported\n");
+ dbg(lvl_error,"not supported");
#endif
}
@@ -502,7 +502,7 @@ transform_rotate(struct transformation *t, struct coord c)
result.y=c.x*t->m10+c.y*t->m11+HOG(*t)*t->m12;
result.z=(c.x*t->m20+c.y*t->m21+HOG(*t)*t->m22);
result.z+=t->offz << POST_SHIFT;
- dbg(lvl_debug, "result: (%d,%d,%d)\n", result.x,result.y,result.z);
+ dbg(lvl_debug, "result: (%d,%d,%d)", result.x,result.y,result.z);
return result;
}
@@ -511,11 +511,11 @@ transform_z_clip(struct coord_3d c, struct coord_3d c_old, int zlimit)
{
struct coord_3d result;
float clip_factor = ((float)zlimit-c.z)/(c_old.z-c.z);
- dbg(lvl_debug,"in (%d,%d,%d) - (%d,%d,%d)\n", c.x,c.y,c.z, c_old.x,c_old.y,c_old.z);
+ dbg(lvl_debug,"in (%d,%d,%d) - (%d,%d,%d)", c.x,c.y,c.z, c_old.x,c_old.y,c_old.z);
result.x=c.x+(c_old.x-c.x)*clip_factor;
result.y=c.y+(c_old.y-c.y)*clip_factor;
result.z=zlimit;
- dbg(lvl_debug,"clip result: (%d,%d,%d)\n", result.x, result.y, result.z);
+ dbg(lvl_debug,"clip result: (%d,%d,%d)", result.x, result.y, result.z);
return result;
}
@@ -524,7 +524,7 @@ transform_project_onto_view_plane(struct transformation *t, struct coord_3d c)
{
struct point result;
#if 0
- dbg(lvl_debug,"z=%d\n",c.z);
+ dbg(lvl_debug,"z=%d",c.z);
#endif
result.x = (long long)c.x*t->xscale/c.z;
result.y = (long long)c.y*t->yscale/c.z;
@@ -581,9 +581,9 @@ transform(struct transformation *t, enum projection required_projection, struct
int zlimit=t->znear;
struct z_clip_result clip_result, clip_result_old={{0,0}, -1, 0, 0};
int i,result_idx = 0,result_idx_last=0;
- dbg(lvl_debug,"count=%d\n", count);
+ dbg(lvl_debug,"count=%d", count);
for (i=0; i < count; i++) {
- dbg(lvl_debug, "input coord %d: (%d, %d)\n", i, input[i].x, input[i].y);
+ dbg(lvl_debug, "input coord %d: (%d, %d)", i, input[i].x, input[i].y);
#if 0 /* doesn't work as wanted */
if (i && input[i].x == input[0].x && input[i].y == input[0].y && result_idx && !width_result) {
result[result_idx++]=result[0];
@@ -612,7 +612,7 @@ transform(struct transformation *t, enum projection required_projection, struct
}
screen_point.x+=t->offx;
screen_point.y+=t->offy;
- dbg(lvl_debug,"result: (%d, %d)\n", screen_point.x, screen_point.y);
+ dbg(lvl_debug,"result: (%d, %d)", screen_point.x, screen_point.y);
if (i != 0 && i != count-1 &&
(input[i+1].x != input[0].x || input[i+1].y != input[0].y)) {
@@ -623,7 +623,7 @@ transform(struct transformation *t, enum projection required_projection, struct
result[result_idx]=screen_point;
if (width_result) {
if (t->ddd) {
- dbg(lvl_debug,"width %d * %d / %d\n",width,t->wscale,clip_result.clipped_coord.z);
+ dbg(lvl_debug,"width %d * %d / %d",width,t->wscale,clip_result.clipped_coord.z);
width_result[result_idx]=width*t->wscale/clip_result.clipped_coord.z;
} else
width_result[result_idx]=width;
@@ -679,7 +679,7 @@ static int
transform_reverse_near_far(struct transformation *t, struct point *p, struct coord *c, int near, int far)
{
double xc,yc;
- dbg(lvl_debug,"%d,%d\n",p->x,p->y);
+ dbg(lvl_debug,"%d,%d",p->x,p->y);
if (t->ddd) {
struct coord_geo_cart nearc,farc,nears,fars,intersection;
transform_screen_to_3d(t, p, near, &nearc);
@@ -781,9 +781,9 @@ transform_get_selection(struct transformation *this_, enum projection pro, int o
dbg(lvl_debug,"%f,%f", g.lat, g.lng);
transform_to_geo(this_->pro, &curri->u.c_rect.rl, &g);
transform_from_geo(pro, &g, &curro->u.c_rect.rl);
- dbg(lvl_debug,": - %f,%f\n", g.lat, g.lng);
+ dbg(lvl_debug,": - %f,%f", g.lat, g.lng);
}
- dbg(lvl_debug,"transform rect for %d is %d,%d - %d,%d\n", pro, curro->u.c_rect.lu.x, curro->u.c_rect.lu.y, curro->u.c_rect.rl.x, curro->u.c_rect.rl.y);
+ dbg(lvl_debug,"transform rect for %d is %d,%d - %d,%d", pro, curro->u.c_rect.lu.x, curro->u.c_rect.lu.y, curro->u.c_rect.rl.x, curro->u.c_rect.rl.y);
curro->order+=order;
#if 0
curro->u.c_rect.lu.x-=500;
@@ -849,7 +849,7 @@ transform_set_roll(struct transformation *this_,int roll)
this_->roll=roll;
transform_setup_matrix(this_);
#else
- dbg(lvl_error,"not supported\n");
+ dbg(lvl_error,"not supported");
#endif
}
@@ -971,7 +971,7 @@ transform_setup_source_rect(struct transformation *t)
if (transform_zplane_intersection(&cg[edgenodes[i*2]], &cg[edgenodes[i*2+1]], HOG(*t), &tmp) == 1) {
c.x=tmp.x*(1 << t->scale_shift)+t->map_center.x;
c.y=tmp.y*(1 << t->scale_shift)+t->map_center.y;
- dbg(lvl_debug,"intersection with edge %d at 0x%x,0x%x\n",i,c.x,c.y);
+ dbg(lvl_debug,"intersection with edge %d at 0x%x,0x%x",i,c.x,c.y);
if (valid)
coord_rect_extend(&msm->u.c_rect, &c);
else {
@@ -979,20 +979,20 @@ transform_setup_source_rect(struct transformation *t)
msm->u.c_rect.rl=c;
valid=1;
}
- dbg(lvl_debug,"rect 0x%x,0x%x - 0x%x,0x%x\n",msm->u.c_rect.lu.x,msm->u.c_rect.lu.y,msm->u.c_rect.rl.x,msm->u.c_rect.rl.y);
+ dbg(lvl_debug,"rect 0x%x,0x%x - 0x%x,0x%x",msm->u.c_rect.lu.x,msm->u.c_rect.lu.y,msm->u.c_rect.rl.x,msm->u.c_rect.rl.y);
}
}
} else {
for (i = 0 ; i < 4 ; i++) {
transform_reverse(t, &screen_pnt[i], &screen[i]);
- dbg(lvl_debug,"map(%d) %d,%d=0x%x,0x%x\n", i,screen_pnt[i].x, screen_pnt[i].y, screen[i].x, screen[i].y);
+ dbg(lvl_debug,"map(%d) %d,%d=0x%x,0x%x", i,screen_pnt[i].x, screen_pnt[i].y, screen[i].x, screen[i].y);
}
msm->u.c_rect.lu.x=min4(screen[0].x,screen[1].x,screen[2].x,screen[3].x);
msm->u.c_rect.rl.x=max4(screen[0].x,screen[1].x,screen[2].x,screen[3].x);
msm->u.c_rect.rl.y=min4(screen[0].y,screen[1].y,screen[2].y,screen[3].y);
msm->u.c_rect.lu.y=max4(screen[0].y,screen[1].y,screen[2].y,screen[3].y);
}
- dbg(lvl_debug,"%dx%d\n", msm->u.c_rect.rl.x-msm->u.c_rect.lu.x,
+ dbg(lvl_debug,"%dx%d", msm->u.c_rect.rl.x-msm->u.c_rect.lu.x,
msm->u.c_rect.lu.y-msm->u.c_rect.rl.y);
*msm_last=msm;
msm_last=&msm->next;
@@ -1017,7 +1017,7 @@ transform_set_scale(struct transformation *t, long scale)
int
transform_get_order(struct transformation *t)
{
- dbg(lvl_debug,"order %d\n", t->order);
+ dbg(lvl_debug,"order %d", t->order);
return t->order;
}
@@ -1137,7 +1137,7 @@ transform_distance(enum projection pro, struct coord *c1, struct coord *c2)
} else if (pro == projection_garmin) {
return transform_distance_garmin(c1, c2);
} else {
- dbg(lvl_error,"Unknown projection: %d\n", pro);
+ dbg(lvl_error,"Unknown projection: %d", pro);
return 0;
}
}
@@ -1153,7 +1153,7 @@ transform_project(enum projection pro, struct coord *c, int distance, int angle,
res->y=c->y+distance*cos(angle*M_PI/180)*scale;
break;
default:
- dbg(lvl_error,"Unsupported projection: %d\n", pro);
+ dbg(lvl_error,"Unsupported projection: %d", pro);
return;
}
diff --git a/navit/util.c b/navit/util.c
index 79c92379e..33d663978 100644
--- a/navit/util.c
+++ b/navit/util.c
@@ -62,7 +62,7 @@ navit_utf8_strcasecmp(const char *s1, const char *s2)
s1_folded=g_utf8_casefold(s1,-1);
s2_folded=g_utf8_casefold(s2,-1);
cmpres=strcmp(s1_folded,s2_folded);
- dbg(lvl_debug,"Compared %s with %s, got %d\n",s1_folded,s2_folded,cmpres);
+ dbg(lvl_debug,"Compared %s with %s, got %d",s1_folded,s2_folded,cmpres);
g_free(s1_folded);
g_free(s2_folded);
return cmpres;
@@ -509,7 +509,7 @@ spawn_process(char **argv)
pid_t pid;
sigset_t set, old;
- dbg(lvl_debug,"spawning process for '%s'\n", argv[0]);
+ dbg(lvl_debug,"spawning process for '%s'", argv[0]);
sigemptyset(&set);
sigaddset(&set,SIGCHLD);
spawn_process_sigmask(SIG_BLOCK,&set,&old);
@@ -550,7 +550,7 @@ spawn_process(char **argv)
args=newSysString(cmdline);
cmd = newSysString(argv[0]);
dwRet=CreateProcess(cmd, args, NULL, NULL, 0, 0, NULL, NULL, NULL, &(r->pr));
- dbg(lvl_debug, "CreateProcess(%s,%s), PID=%i\n",argv[0],cmdline,r->pr.dwProcessId);
+ dbg(lvl_debug, "CreateProcess(%s,%s), PID=%i",argv[0],cmdline,r->pr.dwProcessId);
g_free(cmd);
#else
TCHAR* args;
@@ -560,7 +560,7 @@ spawn_process(char **argv)
cmdline=spawn_process_compose_cmdline(argv);
args=newSysString(cmdline);
dwRet=CreateProcess(NULL, args, NULL, NULL, 0, 0, NULL, NULL, &startupInfo, &(r->pr));
- dbg(lvl_debug, "CreateProcess(%s), PID=%i\n",cmdline,r->pr.dwProcessId);
+ dbg(lvl_debug, "CreateProcess(%s), PID=%i",cmdline,r->pr.dwProcessId);
#endif
g_free(cmdline);
g_free(args);
@@ -570,7 +570,7 @@ spawn_process(char **argv)
{
char *cmdline=spawn_process_compose_cmdline(argv);
int status;
- dbg(lvl_error,"Unblocked spawn_process isn't availiable on this platform.\n");
+ dbg(lvl_error,"Unblocked spawn_process isn't availiable on this platform.");
status=system(cmdline);
g_free(cmdline);
r->status=status;
@@ -593,7 +593,7 @@ spawn_process(char **argv)
int spawn_process_check_status(struct spawn_process_info *pi, int block)
{
if(pi==NULL) {
- dbg(lvl_error,"Trying to get process status of NULL, assuming process is terminated.\n");
+ dbg(lvl_error,"Trying to get process status of NULL, assuming process is terminated.");
return 255;
}
#ifdef HAVE_API_WIN32_BASE
@@ -633,9 +633,9 @@ int spawn_process_check_status(struct spawn_process_info *pi, int block)
pi->status=WEXITSTATUS(status);
return pi->status;
if(WIFSTOPPED(status)) {
- dbg(lvl_debug,"child is stopped by %i signal\n",WSTOPSIG(status));
+ dbg(lvl_debug,"child is stopped by %i signal",WSTOPSIG(status));
} else if (WIFSIGNALED(status)) {
- dbg(lvl_debug,"child terminated by signal %i\n",WEXITSTATUS(status));
+ dbg(lvl_debug,"child terminated by signal %i",WEXITSTATUS(status));
pi->status=255;
return 255;
}
@@ -647,12 +647,12 @@ int spawn_process_check_status(struct spawn_process_info *pi, int block)
} else {
if(pi->status!=-1) // Signal handler has changed pi->status while in this function
return pi->status;
- dbg(lvl_error,"waitpid() indicated error, reporting process termination.\n");
+ dbg(lvl_error,"waitpid() indicated error, reporting process termination.");
return 255;
}
}
#else
- dbg(lvl_error, "Non-blocking spawn_process isn't availiable for this platform, repoting process exit status.\n");
+ dbg(lvl_error, "Non-blocking spawn_process isn't availiable for this platform, repoting process exit status.");
return pi->status;
#endif
#endif
diff --git a/navit/vehicle.c b/navit/vehicle.c
index 26dc457cb..61ada2059 100644
--- a/navit/vehicle.c
+++ b/navit/vehicle.c
@@ -112,10 +112,10 @@ vehicle_new(struct attr *parent, struct attr **attrs)
char *type, *colon;
struct pcoord center;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
if (!source) {
- dbg(lvl_error, "incomplete vehicle definition: missing attribute 'source'\n");
+ dbg(lvl_error, "incomplete vehicle definition: missing attribute 'source'");
return NULL;
}
@@ -123,11 +123,11 @@ vehicle_new(struct attr *parent, struct attr **attrs)
colon = strchr(type, ':');
if (colon)
*colon = '\0';
- dbg(lvl_debug, "source='%s' type='%s'\n", source->u.str, type);
+ dbg(lvl_debug, "source='%s' type='%s'", source->u.str, type);
vehicletype_new = plugin_get_category_vehicle(type);
if (!vehicletype_new) {
- dbg(lvl_error, "invalid source '%s': unknown type '%s'\n", source->u.str, type);
+ dbg(lvl_error, "invalid source '%s': unknown type '%s'", source->u.str, type);
g_free(type);
return NULL;
}
@@ -138,7 +138,7 @@ vehicle_new(struct attr *parent, struct attr **attrs)
this_->cbl = callback_list_new();
this_->priv = vehicletype_new(&this_->meth, this_->cbl, attrs);
if (!this_->priv) {
- dbg(lvl_error, "vehicletype_new failed\n");
+ dbg(lvl_error, "vehicletype_new failed");
callback_list_destroy(this_->cbl);
g_free(this_);
return NULL;
@@ -151,7 +151,7 @@ vehicle_new(struct attr *parent, struct attr **attrs)
this_->trans=transform_new(&center, 16, 0);
vehicle_set_default_name(this_);
- dbg(lvl_debug, "leave\n");
+ dbg(lvl_debug, "leave");
this_->log_to_cb=g_hash_table_new(NULL,NULL);
return this_;
}
@@ -164,7 +164,7 @@ vehicle_new(struct attr *parent, struct attr **attrs)
void
vehicle_destroy(struct vehicle *this_)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (this_->animate_callback) {
callback_destroy(this_->animate_callback);
event_remove_timeout(this_->animate_timer);
@@ -374,8 +374,8 @@ vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int
{
if (angle < 0)
angle+=360;
- dbg(lvl_debug,"enter this=%p gra=%p pnt=%p dir=%d speed=%d\n", this_, gra, pnt, angle, speed);
- dbg(lvl_debug,"point %d,%d\n", pnt->x, pnt->y);
+ dbg(lvl_debug,"enter this=%p gra=%p pnt=%p dir=%d speed=%d", this_, gra, pnt, angle, speed);
+ dbg(lvl_debug,"point %d,%d", pnt->x, pnt->y);
this_->cursor_pnt=*pnt;
this_->angle=angle;
this_->speed=speed;
@@ -414,7 +414,7 @@ static void vehicle_set_default_name(struct vehicle *this_)
// Safe cast: attr_generic_set_attr does not modify its parameter.
default_name.u.str=(char*)_("Unnamed vehicle");
this_->attrs=attr_generic_set_attr(this_->attrs, &default_name);
- dbg(lvl_error, "Incomplete vehicle definition: missing attribute 'name'. Default name set.\n");
+ dbg(lvl_error, "Incomplete vehicle definition: missing attribute 'name'. Default name set.");
}
}
@@ -449,7 +449,7 @@ vehicle_draw_do(struct vehicle *this_)
while (*attr) {
if ((*attr)->type == attr_itemgra) {
struct itemgra *itm=(*attr)->u.itemgra;
- dbg(lvl_debug,"speed %d-%d %d\n", itm->speed_range.min, itm->speed_range.max, speed);
+ dbg(lvl_debug,"speed %d-%d %d", itm->speed_range.min, itm->speed_range.max, speed);
if (speed >= itm->speed_range.min && speed <= itm->speed_range.max &&
angle >= itm->angle_range.min && angle <= itm->angle_range.max &&
sequence >= itm->sequence_range.min && sequence <= itm->sequence_range.max) {
@@ -670,7 +670,7 @@ vehicle_log_binfile(struct vehicle *this_, struct log *log)
buffer_new=g_malloc((buffer[0]+3)*sizeof(int));
memcpy(buffer_new, buffer, (buffer[0]+1)*sizeof(int));
}
- dbg(lvl_debug,"c=0x%x,0x%x\n",c.x,c.y);
+ dbg(lvl_debug,"c=0x%x,0x%x",c.x,c.y);
buffer_new[buffer_new[0]+1]=c.x;
buffer_new[buffer_new[0]+2]=c.y;
buffer_new[0]+=2;
diff --git a/navit/vehicle/android/vehicle_android.c b/navit/vehicle/android/vehicle_android.c
index 4165b9b31..14e9d0f8a 100644
--- a/navit/vehicle/android/vehicle_android.c
+++ b/navit/vehicle/android/vehicle_android.c
@@ -72,7 +72,7 @@ struct vehicle_priv {
static void
vehicle_android_destroy(struct vehicle_priv *priv)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
g_free(priv);
}
@@ -88,7 +88,7 @@ static int
vehicle_android_position_attr_get(struct vehicle_priv *priv,
enum attr_type type, struct attr *attr)
{
- dbg(lvl_debug,"enter %s\n",attr_to_name(type));
+ dbg(lvl_debug,"enter %s",attr_to_name(type));
switch (type) {
case attr_position_fix_type:
attr->u.num = priv->fix_type;
@@ -125,7 +125,7 @@ vehicle_android_position_attr_get(struct vehicle_priv *priv,
default:
return 0;
}
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
attr->type = type;
return 1;
}
@@ -147,7 +147,7 @@ static void
vehicle_android_position_callback(struct vehicle_priv *v, jobject location) {
time_t tnow;
struct tm *tm;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
v->geo.lat = (*jnienv)->CallDoubleMethod(jnienv, location, v->Location_getLatitude);
v->geo.lng = (*jnienv)->CallDoubleMethod(jnienv, location, v->Location_getLongitude);
@@ -158,7 +158,7 @@ vehicle_android_position_callback(struct vehicle_priv *v, jobject location) {
tnow=(*jnienv)->CallLongMethod(jnienv, location, v->Location_getTime)/1000;
tm = gmtime(&tnow);
strftime(v->fixiso8601, sizeof(v->fixiso8601), "%Y-%m-%dT%TZ", tm);
- dbg(lvl_debug,"lat %f lon %f time %s\n",v->geo.lat,v->geo.lng,v->fixiso8601);
+ dbg(lvl_debug,"lat %f lon %f time %s",v->geo.lat,v->geo.lng,v->fixiso8601);
if (v->valid != attr_position_valid_valid) {
v->valid = attr_position_valid_valid;
callback_list_call_attr_0(v->cbl, attr_position_valid);
@@ -240,16 +240,16 @@ vehicle_android_init(struct vehicle_priv *ret)
return 0;
if (!android_find_class_global("org/navitproject/navit/NavitVehicle", &ret->NavitVehicleClass))
return 0;
- dbg(lvl_debug,"at 3\n");
+ dbg(lvl_debug,"at 3");
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitVehicleClass, "<init>", "(Landroid/content/Context;III)V");
if (cid == NULL) {
- dbg(lvl_error,"no method found\n");
+ dbg(lvl_error,"no method found");
return 0; /* exception thrown */
}
- dbg(lvl_debug, "at 4 android_activity=%p\n", android_activity);
+ dbg(lvl_debug, "at 4 android_activity=%p", android_activity);
ret->NavitVehicle=(*jnienv)->NewObject(jnienv, ret->NavitVehicleClass, cid, android_activity,
(int) ret->pcb, (int) ret->scb, (int) ret->fcb);
- dbg(lvl_debug,"result=%p\n",ret->NavitVehicle);
+ dbg(lvl_debug,"result=%p",ret->NavitVehicle);
if (!ret->NavitVehicle)
return 0;
if (ret->NavitVehicle)
@@ -273,7 +273,7 @@ vehicle_android_new_android(struct vehicle_methods *meth,
{
struct vehicle_priv *ret;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
ret->pcb = callback_new_1(callback_cast(vehicle_android_position_callback), ret);
@@ -284,7 +284,7 @@ vehicle_android_new_android(struct vehicle_methods *meth,
ret->sats_used = 0;
*meth = vehicle_android_methods;
vehicle_android_init(ret);
- dbg(lvl_debug, "return\n");
+ dbg(lvl_debug, "return");
return ret;
}
@@ -296,7 +296,7 @@ vehicle_android_new_android(struct vehicle_methods *meth,
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("android", vehicle_android_new_android);
}
diff --git a/navit/vehicle/demo/vehicle_demo.c b/navit/vehicle/demo/vehicle_demo.c
index 1e2991300..036e97e27 100644
--- a/navit/vehicle/demo/vehicle_demo.c
+++ b/navit/vehicle/demo/vehicle_demo.c
@@ -170,7 +170,7 @@ vehicle_demo_set_attr_do(struct vehicle_priv *priv, struct attr *attr)
callback_list_call_attr_0(priv->cbl, attr_position_valid);
}
priv->position_set=1;
- dbg(lvl_debug,"position_set %f %f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_debug,"position_set %f %f", priv->geo.lat, priv->geo.lng);
break;
case attr_profilename:
case attr_source:
@@ -180,7 +180,7 @@ vehicle_demo_set_attr_do(struct vehicle_priv *priv, struct attr *attr)
// Ignore; used by Navit's infrastructure, but not relevant for this vehicle.
break;
default:
- dbg(lvl_error,"unsupported attribute %s\n",attr_to_name(attr->type));
+ dbg(lvl_error,"unsupported attribute %s",attr_to_name(attr->type));
return 0;
}
return 1;
@@ -209,7 +209,7 @@ vehicle_demo_timer(struct vehicle_priv *priv)
struct item *item=NULL;
len = (priv->config_speed * priv->interval / 1000)/ 3.6;
- dbg(lvl_debug, "###### Entering simulation loop\n");
+ dbg(lvl_debug, "###### Entering simulation loop");
if (!priv->config_speed)
return;
if (priv->route)
@@ -228,10 +228,10 @@ vehicle_demo_timer(struct vehicle_priv *priv)
item=map_rect_get_item(mr);
if (item && item_coord_get(item, &pos, 1)) {
priv->position_set=0;
- dbg(lvl_debug, "current pos=0x%x,0x%x\n", pos.x, pos.y);
- dbg(lvl_debug, "last pos=0x%x,0x%x\n", priv->last.x, priv->last.y);
+ dbg(lvl_debug, "current pos=0x%x,0x%x", pos.x, pos.y);
+ dbg(lvl_debug, "last pos=0x%x,0x%x", priv->last.x, priv->last.y);
if (priv->last.x == pos.x && priv->last.y == pos.y) {
- dbg(lvl_warning, "endless loop\n");
+ dbg(lvl_warning, "endless loop");
}
priv->last = pos;
while (item && priv->config_speed) {
@@ -239,9 +239,9 @@ vehicle_demo_timer(struct vehicle_priv *priv)
item=map_rect_get_item(mr);
continue;
}
- dbg(lvl_debug, "next pos=0x%x,0x%x\n", c.x, c.y);
+ dbg(lvl_debug, "next pos=0x%x,0x%x", c.x, c.y);
slen = transform_distance(projection_mg, &pos, &c);
- dbg(lvl_debug, "len=%d slen=%d\n", len, slen);
+ dbg(lvl_debug, "len=%d slen=%d", len, slen);
if (slen < len) {
len -= slen;
pos = c;
@@ -258,9 +258,9 @@ vehicle_demo_timer(struct vehicle_priv *priv)
ci.x = pos.x;
ci.y = pos.y;
priv->speed=0;
- dbg(lvl_debug,"destination reached\n");
+ dbg(lvl_debug,"destination reached");
}
- dbg(lvl_debug, "ci=0x%x,0x%x\n", ci.x, ci.y);
+ dbg(lvl_debug, "ci=0x%x,0x%x", ci.x, ci.y);
transform_to_geo(projection_mg, &ci,
&priv->geo);
if (priv->valid != attr_position_valid_valid) {
@@ -288,7 +288,7 @@ vehicle_demo_new(struct vehicle_methods
{
struct vehicle_priv *ret;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
ret->interval=1000;
@@ -306,7 +306,7 @@ vehicle_demo_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("demo", vehicle_demo_new);
}
diff --git a/navit/vehicle/file/vehicle_file.c b/navit/vehicle/file/vehicle_file.c
index 868af4f57..114fd2874 100644
--- a/navit/vehicle/file/vehicle_file.c
+++ b/navit/vehicle/file/vehicle_file.c
@@ -154,7 +154,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv)
int rc = 0;
int dwBytes;
- dbg(lvl_debug, "enter, *priv='%x', priv->source='%s'\n", priv, priv->source);
+ dbg(lvl_debug, "enter, *priv='%x', priv->source='%s'", priv, priv->source);
if ( priv->no_data_count > 5 )
{
@@ -200,7 +200,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv)
priv->no_data_count = 0;
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
if (rc > 1)
- dbg(lvl_error, "Can not keep with gps data delay is %d seconds\n", rc - 1);
+ dbg(lvl_error, "Can not keep with gps data delay is %d seconds", rc - 1);
}
}
@@ -208,7 +208,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv)
{
priv->no_data_count++;
}
- dbg(lvl_info, "leave, return '1', priv->no_data_count='%d'\n", priv->no_data_count);
+ dbg(lvl_info, "leave, return '1', priv->no_data_count='%d'", priv->no_data_count);
return 1;
}
#endif
@@ -266,7 +266,7 @@ vehicle_file_open(struct vehicle_priv *priv)
struct sockaddr_in sin;
p=strchr(s,':');
if (!p) {
- dbg(lvl_error,"port number missing in %s\n",s);
+ dbg(lvl_error,"port number missing in %s",s);
g_free(s);
return 0;
}
@@ -274,14 +274,14 @@ vehicle_file_open(struct vehicle_priv *priv)
sin.sin_family=AF_INET;
sin.sin_port=ntohs(atoi(p));
if (!inet_aton(s, &sin.sin_addr)) {
- dbg(lvl_error,"failed to parse %s\n",s);
+ dbg(lvl_error,"failed to parse %s",s);
g_free(s);
return 0;
}
priv->fd = socket(PF_INET, SOCK_STREAM, 0);
if (priv->fd != -1) {
if (connect(priv->fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- dbg(lvl_error,"failed to connect to %s:%s\n",s,p);
+ dbg(lvl_error,"failed to connect to %s:%s",s,p);
g_free(s);
return 0;
}
@@ -315,7 +315,7 @@ vehicle_file_open(struct vehicle_priv *priv)
g_free( raw_setting_str );
priv->file_type = file_type_serial;
// Add the callback
- dbg(lvl_info, "Add the callback ...\n", priv->source);
+ dbg(lvl_info, "Add the callback ...", priv->source);
priv->timeout_callback=callback_new_1(callback_cast(vehicle_win32_serial_track), priv);
#else
//TODO - add linux serial
@@ -332,7 +332,7 @@ vehicle_file_open(struct vehicle_priv *priv)
static void
vehicle_file_close(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "enter, priv->fd='%d'\n", priv->fd);
+ dbg(lvl_debug, "enter, priv->fd='%d'", priv->fd);
vehicle_file_disable_watch(priv);
#ifdef _WIN32
if(priv->file_type == file_type_serial)
@@ -369,7 +369,7 @@ vehicle_file_close(struct vehicle_priv *priv)
static int
vehicle_file_enable_watch_timer(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
vehicle_file_enable_watch(priv);
return FALSE;
@@ -425,10 +425,10 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
int valid=0;
int ret = 0;
- dbg(lvl_info, "enter: buffer='%s'\n", buffer);
+ dbg(lvl_info, "enter: buffer='%s'", buffer);
for (;;) {
if (len < 4) {
- dbg(lvl_error, "'%s' too short\n", buffer);
+ dbg(lvl_error, "'%s' too short", buffer);
return ret;
}
if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') {
@@ -439,22 +439,22 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
break;
}
if (buffer[0] != '$') {
- dbg(lvl_error, "no leading $ in '%s'\n", buffer);
+ dbg(lvl_error, "no leading $ in '%s'", buffer);
return ret;
}
if (buffer[len - 3] != '*') {
- dbg(lvl_error, "no *XX in '%s'\n", buffer);
+ dbg(lvl_error, "no *XX in '%s'", buffer);
return ret;
}
for (i = 1; i < len - 3; i++) {
csum ^= (unsigned char) (buffer[i]);
}
if (!sscanf(buffer + len - 2, "%x", &bcsum) && priv->checksum_ignore != 2) {
- dbg(lvl_error, "no checksum in '%s'\n", buffer);
+ dbg(lvl_error, "no checksum in '%s'", buffer);
return ret;
}
if (bcsum != csum && priv->checksum_ignore == 0) {
- dbg(lvl_error, "wrong checksum in '%s was %x should be %x'\n", buffer,bcsum,csum);
+ dbg(lvl_error, "wrong checksum in '%s was %x should be %x'", buffer,bcsum,csum);
return ret;
}
@@ -463,7 +463,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(lvl_error, "nmea buffer overflow (len %zu), discarding '%s'\n", priv->nmea_data_buf?strlen(priv->nmea_data_buf):-1,buffer);
+ dbg(lvl_error, "nmea buffer overflow (len %zu), discarding '%s'", priv->nmea_data_buf?strlen(priv->nmea_data_buf):-1,buffer);
}
i = 0;
p = buffer;
@@ -510,7 +510,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
strncpy(priv->fixtime, item[1], sizeof(priv->fixtime));
}
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else {
if (priv->valid == attr_position_valid_valid)
@@ -550,7 +550,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
if (valid) {
priv->direction = g_ascii_strtod( item[1], NULL );
priv->speed = g_ascii_strtod( item[7], NULL );
- dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->direction, priv->speed);
+ dbg(lvl_info,"direction %lf, speed %2.1lf", priv->direction, priv->speed);
}
}
if (!strncmp(&buffer[3], "RMC", 3)) {
@@ -600,7 +600,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
strncpy(priv->fixtime, item[1], sizeof(priv->fixtime));
}
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else {
if (priv->valid == attr_position_valid_valid)
@@ -672,7 +672,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
*/
if (item[1]) {
priv->magnetic_direction = g_ascii_strtod( item[1], NULL );
- dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction);
+ dbg(lvl_debug,"magnetic %d", priv->magnetic_direction);
}
}
return ret;
@@ -688,7 +688,7 @@ vehicle_file_io(struct vehicle_priv *priv)
{
int size, rc = 0;
char *str, *tok;
- dbg(lvl_debug, "vehicle_file_io : enter\n");
+ dbg(lvl_debug, "vehicle_file_io : enter");
if (priv->process_statefile) {
unsigned char *data;
@@ -721,12 +721,12 @@ vehicle_file_io(struct vehicle_priv *priv)
}
priv->buffer_pos += size;
priv->buffer[priv->buffer_pos] = '\0';
- dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size,
+ dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size,
priv->buffer_pos, priv->buffer);
str = priv->buffer;
while ((tok = strchr(str, '\n'))) {
*tok++ = '\0';
- dbg(lvl_debug, "line='%s'\n", str);
+ dbg(lvl_debug, "line='%s'", str);
rc +=vehicle_file_parse(priv, str);
str = tok;
if (priv->file_type == file_type_file && rc)
@@ -737,11 +737,11 @@ vehicle_file_io(struct vehicle_priv *priv)
size = priv->buffer + priv->buffer_pos - str;
memmove(priv->buffer, str, size + 1);
priv->buffer_pos = size;
- dbg(lvl_debug, "now pos=%d buffer='%s'\n",
+ dbg(lvl_debug, "now pos=%d buffer='%s'",
priv->buffer_pos, priv->buffer);
} else if (priv->buffer_pos == buffer_size - 1) {
dbg(lvl_debug,
- "Overflow. Most likely wrong baud rate or no nmea protocol\n");
+ "Overflow. Most likely wrong baud rate or no nmea protocol");
priv->buffer_pos = 0;
}
if (rc)
@@ -756,7 +756,7 @@ vehicle_file_io(struct vehicle_priv *priv)
static void
vehicle_file_enable_watch(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
#ifdef _WIN32
// add an event : don't use glib timers and g_timeout_add
if (priv->file_type == file_type_serial)
@@ -764,7 +764,7 @@ vehicle_file_enable_watch(struct vehicle_priv *priv)
if (priv->timeout_callback != NULL)
priv->timeout = event_add_timeout(500, 1, priv->timeout_callback);
else
- dbg(lvl_warning, "error : watch not enabled : priv->timeout_callback is null\n"); }
+ dbg(lvl_warning, "error : watch not enabled : priv->timeout_callback is null"); }
else
#endif
{
@@ -781,7 +781,7 @@ vehicle_file_enable_watch(struct vehicle_priv *priv)
static void
vehicle_file_disable_watch(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "vehicle_file_disable_watch : enter\n");
+ dbg(lvl_debug, "vehicle_file_disable_watch : enter");
#ifdef _WIN32
if(priv->file_type == file_type_serial)
{
@@ -893,7 +893,7 @@ vehicle_file_position_attr_get(struct vehicle_priv *priv,
attr->u.str=priv->fixiso8601;
break;
case attr_position_sat_item:
- dbg(lvl_debug,"at here\n");
+ dbg(lvl_debug,"at here");
priv->sat_item.id_lo++;
if (priv->sat_item.id_lo > priv->current_count) {
priv->sat_item.id_lo=0;
@@ -988,7 +988,7 @@ vehicle_file_new_file(struct vehicle_methods
struct attr *checksum_ignore;
struct attr *state_file;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
if(source == NULL){
@@ -1048,7 +1048,7 @@ vehicle_file_new_file(struct vehicle_methods
ret->on_eof=1;
if (on_eof && !g_ascii_strcasecmp(on_eof->u.str, "exit"))
ret->on_eof=2;
- dbg(lvl_debug,"on_eof=%d\n", ret->on_eof);
+ dbg(lvl_debug,"on_eof=%d", ret->on_eof);
*meth = vehicle_file_methods;
ret->cb=callback_new_1(callback_cast(vehicle_file_io), ret);
ret->cbt=callback_new_1(callback_cast(vehicle_file_enable_watch_timer), ret);
@@ -1065,15 +1065,15 @@ vehicle_file_new_file(struct vehicle_methods
ret->no_data_count = 0;
#endif
- dbg(lvl_debug, "vehicle_file_new_file:open\n");
+ dbg(lvl_debug, "vehicle_file_new_file:open");
if (!vehicle_file_open(ret)) {
- dbg(lvl_error, "Failed to open '%s'\n", ret->source);
+ dbg(lvl_error, "Failed to open '%s'", ret->source);
}
vehicle_file_enable_watch(ret);
// vehicle_file_destroy(ret);
// return NULL;
- dbg(lvl_debug, "leave\n");
+ dbg(lvl_debug, "leave");
return ret;
}
@@ -1082,7 +1082,7 @@ vehicle_file_new_file(struct vehicle_methods
*/
void plugin_init(void)
{
- dbg(lvl_debug, "vehicle_file:plugin_init:enter\n");
+ dbg(lvl_debug, "vehicle_file:plugin_init:enter");
plugin_register_category_vehicle("file", vehicle_file_new_file);
plugin_register_category_vehicle("pipe", vehicle_file_new_file);
plugin_register_category_vehicle("socket", vehicle_file_new_file);
diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c
index 975d9c68a..285e05ccb 100644
--- a/navit/vehicle/gpsd/vehicle_gpsd.c
+++ b/navit/vehicle/gpsd/vehicle_gpsd.c
@@ -105,12 +105,12 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len,
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer);
+ dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer);
}
}
}
- dbg(lvl_debug,"data->set="LONGLONG_HEX_FMT"\n", (unsigned long long)data->set);
+ dbg(lvl_debug,"data->set="LONGLONG_HEX_FMT"", (unsigned long long)data->set);
if (data->set & SPEED_SET) {
priv->speed = data->fix.speed * MPS_TO_KPH;
if(!isnan(data->fix.speed))
@@ -178,12 +178,12 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len,
}
#ifdef HAVE_LIBGPS19
if (data->set & DOP_SET) {
- dbg(lvl_debug, "pdop : %g\n", data->dop.pdop);
+ dbg(lvl_debug, "pdop : %g", data->dop.pdop);
priv->hdop = data->dop.pdop;
data->set &= ~DOP_SET;
#else
if (data->set & PDOP_SET) {
- dbg(lvl_debug, "pdop : %g\n", data->pdop);
+ dbg(lvl_debug, "pdop : %g", data->pdop);
priv->hdop = data->hdop;
data->set &= ~PDOP_SET;
#endif
@@ -191,7 +191,7 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len,
if (data->set & LATLON_SET) {
priv->geo.lat = data->fix.latitude;
priv->geo.lng = data->fix.longitude;
- dbg(lvl_debug,"lat=%f lng=%f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_debug,"lat=%f lng=%f", priv->geo.lat, priv->geo.lng);
g_free(priv->nmea_data);
priv->nmea_data=priv->nmea_data_buf;
priv->nmea_data_buf=NULL;
@@ -201,7 +201,7 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len,
if (! isnan(data->fix.speed) && priv->fix_type > 0) {
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
}
- dbg(lvl_info,"speed ok\n");
+ dbg(lvl_info,"speed ok");
}
/**
@@ -219,7 +219,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv)
*colon = '\0';
port=colon+1;
}
- dbg(lvl_debug,"Trying to connect to %s:%s\n",source+7,port?port:"default");
+ dbg(lvl_debug,"Trying to connect to %s:%s",source+7,port?port:"default");
#if GPSD_API_MAJOR_VERSION >= 5
/* gps_open returns 0 on success */
@@ -228,7 +228,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv)
priv->gps = gps_open(source + 7, port);
if(!priv->gps) {
#endif
- dbg(lvl_error,"gps_open failed for '%s'. Retrying in %d seconds. Have you started gpsd?\n", priv->source, priv->retry_interval);
+ dbg(lvl_error,"gps_open failed for '%s'. Retrying in %d seconds. Have you started gpsd?", priv->source, priv->retry_interval);
g_free(source);
return TRUE;
}
@@ -252,7 +252,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv)
if (!priv->gps->gps_fd) {
dbg(lvl_error,"Warning: gps_fd is 0, most likely you have used a gps.h incompatible to libgps");
}
- dbg(lvl_debug,"Connected to gpsd fd=%d evwatch=%p\n", priv->gps->gps_fd, priv->evwatch);
+ dbg(lvl_debug,"Connected to gpsd fd=%d evwatch=%p", priv->gps->gps_fd, priv->evwatch);
event_remove_timeout(priv->retry_timer2);
priv->retry_timer2=NULL;
return FALSE;
@@ -271,11 +271,11 @@ vehicle_gpsd_open(struct vehicle_priv *priv)
memset(&priv->context, 0, sizeof(gpsbt_t));
if(gpsbt_start(NULL, 0, 0, 0, errstr, sizeof(errstr),
0, &priv->context) < 0) {
- dbg(lvl_error,"Error connecting to GPS with gpsbt: (%d) %s (%s)\n",
+ dbg(lvl_error,"Error connecting to GPS with gpsbt: (%d) %s (%s)",
errno, strerror(errno), errstr);
}
sleep(1); /* give gpsd time to start */
- dbg(lvl_debug,"gpsbt_start: completed\n");
+ dbg(lvl_debug,"gpsbt_start: completed");
#endif
priv->retry_timer2=NULL;
if (vehicle_gpsd_try_open(priv))
@@ -324,7 +324,7 @@ vehicle_gpsd_close(struct vehicle_priv *priv)
static void
vehicle_gpsd_io(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (priv->gps) {
vehicle_last = priv;
#if GPSD_API_MAJOR_VERSION >= 5
@@ -333,7 +333,7 @@ vehicle_gpsd_io(struct vehicle_priv *priv)
* No point in processing old GPS reports. */
while((read_result=gps_read(priv->gps))>0);
if(read_result==-1) {
- dbg(lvl_error,"gps_poll failed\n");
+ dbg(lvl_error,"gps_poll failed");
vehicle_gpsd_close(priv);
vehicle_gpsd_open(priv);
}
@@ -344,7 +344,7 @@ vehicle_gpsd_io(struct vehicle_priv *priv)
}
#else
if (gps_poll(priv->gps)) {
- dbg(lvl_error,"gps_poll failed\n");
+ dbg(lvl_error,"gps_poll failed");
vehicle_gpsd_close(priv);
vehicle_gpsd_open(priv);
}
@@ -445,7 +445,7 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods
struct vehicle_priv *ret;
struct attr *source, *query, *retry_int;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
ret = g_new0(struct vehicle_priv, 1);
#if GPSD_API_MAJOR_VERSION >= 5
@@ -458,16 +458,16 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods
} else {
ret->gpsd_query = g_strdup("w+x\n");
}
- dbg(lvl_debug,"Format string for gpsd_query: %s\n",ret->gpsd_query);
+ dbg(lvl_debug,"Format string for gpsd_query: %s",ret->gpsd_query);
retry_int = attr_search(attrs, NULL, attr_retry_interval);
if (retry_int) {
ret->retry_interval = retry_int->u.num;
if (ret->retry_interval < MIN_RETRY_INTERVAL) {
- dbg(lvl_error, "Retry interval %d too small, setting to %d\n", ret->retry_interval, MIN_RETRY_INTERVAL);
+ dbg(lvl_error, "Retry interval %d too small, setting to %d", ret->retry_interval, MIN_RETRY_INTERVAL);
ret->retry_interval = MIN_RETRY_INTERVAL;
}
} else {
- dbg(lvl_debug, "Retry interval not defined, setting to %d\n", DEFAULT_RETRY_INTERVAL);
+ dbg(lvl_debug, "Retry interval not defined, setting to %d", DEFAULT_RETRY_INTERVAL);
ret->retry_interval = DEFAULT_RETRY_INTERVAL;
}
ret->cbl = cbl;
@@ -480,6 +480,6 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("gpsd", vehicle_gpsd_new_gpsd);
}
diff --git a/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c b/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c
index ebdf08707..dd7b99ef0 100644
--- a/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c
+++ b/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c
@@ -122,7 +122,7 @@ vehicle_gpsd_dbus_open(struct vehicle_priv *priv)
priv->connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
}
if (!priv->connection) {
- dbg(lvl_error,"Failed to open connection to %s message bus: %s\n", priv->address?priv->address:"session",error.message);
+ dbg(lvl_error,"Failed to open connection to %s message bus: %s", priv->address?priv->address:"session",error.message);
dbus_error_free(&error);
return 0;
}
@@ -130,12 +130,12 @@ vehicle_gpsd_dbus_open(struct vehicle_priv *priv)
dbus_bus_add_match(priv->connection,"type='signal',interface='org.gpsd'",&error);
dbus_connection_flush(priv->connection);
if (dbus_error_is_set(&error)) {
- dbg(lvl_error,"Failed to add match to connection: %s\n", error.message);
+ dbg(lvl_error,"Failed to add match to connection: %s", error.message);
vehicle_gpsd_dbus_close(priv);
return 0;
}
if (!dbus_connection_add_filter(priv->connection, vehicle_gpsd_dbus_filter, priv, NULL)) {
- dbg(lvl_error,"Failed to add filter to connection\n");
+ dbg(lvl_error,"Failed to add filter to connection");
vehicle_gpsd_dbus_close(priv);
return 0;
}
@@ -195,7 +195,7 @@ vehicle_gpsd_dbus_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int
switch (attr->type) {
case attr_source:
if (strncmp(vehicle_gpsd_dbus_prefix,attr->u.str,strlen(vehicle_gpsd_dbus_prefix))) {
- dbg(lvl_error,"source must start with '%s'\n", vehicle_gpsd_dbus_prefix);
+ dbg(lvl_error,"source must start with '%s'", vehicle_gpsd_dbus_prefix);
return 0;
}
g_free(priv->source);
@@ -251,6 +251,6 @@ vehicle_gpsd_dbus_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("gpsd_dbus", vehicle_gpsd_dbus_new);
}
diff --git a/navit/vehicle/gypsy/vehicle_gypsy.c b/navit/vehicle/gypsy/vehicle_gypsy.c
index 16175f2e8..db3acf588 100644
--- a/navit/vehicle/gypsy/vehicle_gypsy.c
+++ b/navit/vehicle/gypsy/vehicle_gypsy.c
@@ -292,7 +292,7 @@ vehicle_gypsy_try_open(gpointer *data)
}
vehicle_last = priv;
- dbg(lvl_debug,"gypsy connected to %d\n", source+8);
+ dbg(lvl_debug,"gypsy connected to %d", source+8);
g_free(source);
return FALSE;
}
@@ -463,11 +463,11 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth,
dbus_message_unref(message);
dbus_connection_unref(conn);
} else {
- dbg(lvl_error,"failed to connect to session bus\n");
+ dbg(lvl_error,"failed to connect to session bus");
}
}
#endif
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
ret = g_new0(struct vehicle_priv, 1);
ret->have_cords = 0;
@@ -477,11 +477,11 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth,
if (retry_int) {
ret->retry_interval = retry_int->u.num;
if (ret->retry_interval < MIN_RETRY_INTERVAL) {
- dbg(lvl_error, "Retry interval %d too small, setting to %d\n", ret->retry_interval, MIN_RETRY_INTERVAL);
+ dbg(lvl_error, "Retry interval %d too small, setting to %d", ret->retry_interval, MIN_RETRY_INTERVAL);
ret->retry_interval = MIN_RETRY_INTERVAL;
}
} else {
- dbg(lvl_error, "Retry interval not defined, setting to %d\n", DEFAULT_RETRY_INTERVAL);
+ dbg(lvl_error, "Retry interval not defined, setting to %d", DEFAULT_RETRY_INTERVAL);
ret->retry_interval = DEFAULT_RETRY_INTERVAL;
}
ret->cbl = cbl;
@@ -498,6 +498,6 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth,
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("gypsy", vehicle_gypsy_new_gypsy);
}
diff --git a/navit/vehicle/iphone/vehicle_iphone.c b/navit/vehicle/iphone/vehicle_iphone.c
index f8ce5b644..28ac0beff 100644
--- a/navit/vehicle/iphone/vehicle_iphone.c
+++ b/navit/vehicle/iphone/vehicle_iphone.c
@@ -127,7 +127,7 @@ vehicle_iphone_update(void *arg,
strcpy(priv->str_time, str_time);
priv->radius = radius;
- dbg(lvl_debug,"position_get lat:%f lng:%f (spd:%f dir:%f time:%s)\n", priv->geo.lat, priv->geo.lng, priv->speed, priv->direction, priv->str_time);
+ dbg(lvl_debug,"position_get lat:%f lng:%f (spd:%f dir:%f time:%s)", priv->geo.lat, priv->geo.lng, priv->speed, priv->direction, priv->str_time);
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
}
@@ -141,7 +141,7 @@ vehicle_iphone_new(struct vehicle_methods
struct vehicle_priv *ret;
struct attr *interval,*speed,*position_coord_geo;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
ret->interval=1000;
@@ -154,7 +154,7 @@ vehicle_iphone_new(struct vehicle_methods
if ((position_coord_geo=attr_search(attrs, NULL, attr_position_coord_geo))) {
ret->geo=*(position_coord_geo->u.coord_geo);
ret->position_set=1;
- dbg(lvl_debug,"position_set %f %f\n", ret->geo.lat, ret->geo.lng);
+ dbg(lvl_debug,"position_set %f %f", ret->geo.lat, ret->geo.lng);
}
*meth = vehicle_iphone_methods;
ret->str_time[0] = '\0';
@@ -168,6 +168,6 @@ vehicle_iphone_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("iphone", vehicle_iphone_new);
}
diff --git a/navit/vehicle/maemo/vehicle_maemo.c b/navit/vehicle/maemo/vehicle_maemo.c
index 015f1c8e3..2ff6296d5 100644
--- a/navit/vehicle/maemo/vehicle_maemo.c
+++ b/navit/vehicle/maemo/vehicle_maemo.c
@@ -72,7 +72,7 @@ static void vehicle_maemo_callback(LocationGPSDevice *device, gpointer user_data
priv->sats_used=device->satellites_in_use;
callback_list_call_attr_0(priv->cbl, attr_position_sats);
- dbg(lvl_debug,"Got update with %u/%u satellites\n",priv->sats_used,priv->sats);
+ dbg(lvl_debug,"Got update with %u/%u satellites",priv->sats_used,priv->sats);
if (device->fix) {
switch(device->fix->mode) {
@@ -91,28 +91,28 @@ static void vehicle_maemo_callback(LocationGPSDevice *device, gpointer user_data
priv->geo.lng=device->fix->longitude;
priv->hdop=device->fix->eph/100;
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
- dbg(lvl_debug,"Position: %f %f with error %f meters\n",priv->geo.lat,priv->geo.lng,priv->hdop);
+ dbg(lvl_debug,"Position: %f %f with error %f meters",priv->geo.lat,priv->geo.lng,priv->hdop);
}
if (device->fix->fields & LOCATION_GPS_DEVICE_SPEED_SET) {
priv->speed=device->fix->speed;
callback_list_call_attr_0(priv->cbl, attr_position_speed);
- dbg(lvl_debug,"Speed: %f\n ",priv->speed);
+ dbg(lvl_debug,"Speed: %f ",priv->speed);
}
if (device->fix->fields & LOCATION_GPS_DEVICE_TRACK_SET) {
priv->direction=device->fix->track;
- dbg(lvl_debug,"Direction: %f\n",priv->direction);
+ dbg(lvl_debug,"Direction: %f",priv->direction);
}
if (device->fix->fields & LOCATION_GPS_DEVICE_TIME_SET) {
priv->fix_time=device->fix->time;
- dbg(lvl_debug,"Time: %f\n",priv->fix_time);
+ dbg(lvl_debug,"Time: %f",priv->fix_time);
}
if (device->fix->fields & LOCATION_GPS_DEVICE_ALTITUDE_SET) {
priv->height=device->fix->altitude;
- dbg(lvl_debug,"Elevation: %f\n",priv->height);
+ dbg(lvl_debug,"Elevation: %f",priv->height);
}
}
@@ -124,19 +124,19 @@ static void vehicle_maemo_error(LocationGPSDControl *control, LocationGPSDContro
{
switch (error) {
case LOCATION_ERROR_USER_REJECTED_DIALOG:
- dbg(lvl_error,"User didn't enable requested methods\n");
+ dbg(lvl_error,"User didn't enable requested methods");
break;
case LOCATION_ERROR_USER_REJECTED_SETTINGS:
- dbg(lvl_error,"User changed settings, which disabled location\n");
+ dbg(lvl_error,"User changed settings, which disabled location");
break;
case LOCATION_ERROR_BT_GPS_NOT_AVAILABLE:
- dbg(lvl_error,"Problems with BT GPS\n");
+ dbg(lvl_error,"Problems with BT GPS");
break;
case LOCATION_ERROR_METHOD_NOT_ALLOWED_IN_OFFLINE_MODE:
- dbg(lvl_error,"Requested method is not allowed in offline mode\n");
+ dbg(lvl_error,"Requested method is not allowed in offline mode");
break;
case LOCATION_ERROR_SYSTEM:
- dbg(lvl_error,"System error\n");
+ dbg(lvl_error,"System error");
break;
}
}
@@ -153,54 +153,54 @@ vehicle_maemo_open(struct vehicle_priv *priv)
if (!strcasecmp(priv->source+8,"cwp")) {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_CWP, NULL);
- dbg(lvl_debug,"Method set: CWP\n");
+ dbg(lvl_debug,"Method set: CWP");
} else if (!strcasecmp(priv->source+8,"acwp")) {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_ACWP, NULL);
- dbg(lvl_debug,"Method set: ACWP\n");
+ dbg(lvl_debug,"Method set: ACWP");
} else if (!strcasecmp(priv->source+8,"gnss")) {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_GNSS, NULL);
- dbg(lvl_debug,"Method set: GNSS\n");
+ dbg(lvl_debug,"Method set: GNSS");
} else if (!strcasecmp(priv->source+8,"agnss")) {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_AGNSS, NULL);
- dbg(lvl_debug,"Method set: AGNSS\n");
+ dbg(lvl_debug,"Method set: AGNSS");
} else {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_USER_SELECTED, NULL);
- dbg(lvl_debug,"Method set: ANY\n");
+ dbg(lvl_debug,"Method set: ANY");
}
switch (priv->retry_interval) {
case 2:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_2S, NULL);
- dbg(lvl_debug,"Interval set: 2s\n");
+ dbg(lvl_debug,"Interval set: 2s");
break;
case 5:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_5S, NULL);
- dbg(lvl_debug,"Interval set: 5s\n");
+ dbg(lvl_debug,"Interval set: 5s");
break;
case 10:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_10S, NULL);
- dbg(lvl_debug,"Interval set: 10s\n");
+ dbg(lvl_debug,"Interval set: 10s");
break;
case 20:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_20S, NULL);
- dbg(lvl_debug,"Interval set: 20s\n");
+ dbg(lvl_debug,"Interval set: 20s");
break;
case 30:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_30S, NULL);
- dbg(lvl_debug,"Interval set: 30s\n");
+ dbg(lvl_debug,"Interval set: 30s");
break;
case 60:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_60S, NULL);
- dbg(lvl_debug,"Interval set: 60s\n");
+ dbg(lvl_debug,"Interval set: 60s");
break;
case 120:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_120S, NULL);
- dbg(lvl_debug,"Interval set: 120s\n");
+ dbg(lvl_debug,"Interval set: 120s");
break;
case 1:
default:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_1S, NULL);
- dbg(lvl_debug,"Interval set: 1s\n");
+ dbg(lvl_debug,"Interval set: 1s");
break;
}
@@ -230,41 +230,41 @@ vehicle_maemo_position_attr_get(struct vehicle_priv *priv,
struct attr * active=NULL;
switch (type) {
case attr_position_fix_type:
- dbg(lvl_debug,"Attr requested: position_fix_type\n");
+ dbg(lvl_debug,"Attr requested: position_fix_type");
attr->u.num = priv->fix_type;
break;
case attr_position_height:
- dbg(lvl_debug,"Attr requested: position_height\n");
+ dbg(lvl_debug,"Attr requested: position_height");
attr->u.numd = &priv->height;
break;
case attr_position_speed:
- dbg(lvl_debug,"Attr requested: position_speed\n");
+ dbg(lvl_debug,"Attr requested: position_speed");
attr->u.numd = &priv->speed;
break;
case attr_position_direction:
- dbg(lvl_debug,"Attr requested: position_direction\n");
+ dbg(lvl_debug,"Attr requested: position_direction");
attr->u.numd = &priv->direction;
break;
case attr_position_hdop:
- dbg(lvl_debug,"Attr requested: position_hdop\n");
+ dbg(lvl_debug,"Attr requested: position_hdop");
attr->u.numd = &priv->hdop;
break;
case attr_position_sats:
- dbg(lvl_debug,"Attr requested: position_sats\n");
+ dbg(lvl_debug,"Attr requested: position_sats");
attr->u.num = priv->sats;
break;
case attr_position_sats_used:
- dbg(lvl_debug,"Attr requested: position_sats_used\n");
+ dbg(lvl_debug,"Attr requested: position_sats_used");
attr->u.num = priv->sats_used;
break;
case attr_position_coord_geo:
- dbg(lvl_debug,"Attr requested: position_coord_geo\n");
+ dbg(lvl_debug,"Attr requested: position_coord_geo");
attr->u.coord_geo = &priv->geo;
break;
case attr_position_time_iso8601:
{
struct tm tm;
- dbg(lvl_debug,"Attr requested: position_time_iso8601\n");
+ dbg(lvl_debug,"Attr requested: position_time_iso8601");
if (!priv->fix_time)
return 0;
if (gmtime_r(&priv->fix_time, &tm)) {
@@ -276,7 +276,7 @@ vehicle_maemo_position_attr_get(struct vehicle_priv *priv,
}
break;
case attr_active:
- dbg(lvl_debug,"Attr requested: position_active\n");
+ dbg(lvl_debug,"Attr requested: position_active");
active = attr_search(priv->attrs,NULL,attr_active);
if(active != NULL) {
attr->u.num=active->u.num;
@@ -304,7 +304,7 @@ vehicle_maemo_new_maemo(struct vehicle_methods
struct vehicle_priv *ret;
struct attr *source, *retry_int;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
ret = g_new0(struct vehicle_priv, 1);
ret->source = g_strdup(source->u.str);
@@ -312,13 +312,13 @@ vehicle_maemo_new_maemo(struct vehicle_methods
if (retry_int) {
ret->retry_interval = retry_int->u.num;
if (ret->retry_interval !=1 && ret->retry_interval !=2 && ret->retry_interval !=5 && ret->retry_interval !=10 && ret->retry_interval !=20 && ret->retry_interval !=30 && ret->retry_interval !=60 && ret->retry_interval !=120 ) {
- dbg(lvl_error, "Retry interval %d invalid, setting to 1\n", ret->retry_interval,1);
+ dbg(lvl_error, "Retry interval %d invalid, setting to 1", ret->retry_interval,1);
ret->retry_interval = 1;
}
} else {
ret->retry_interval = 1;
}
- dbg(lvl_debug,"source: %s, interval: %u\n",ret->source,ret->retry_interval);
+ dbg(lvl_debug,"source: %s, interval: %u",ret->source,ret->retry_interval);
ret->cbl = cbl;
*meth = vehicle_maemo_methods;
ret->attrs = attrs;
@@ -329,6 +329,6 @@ vehicle_maemo_new_maemo(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("maemo", vehicle_maemo_new_maemo);
}
diff --git a/navit/vehicle/null/vehicle_null.c b/navit/vehicle/null/vehicle_null.c
index 6b723f9ff..1005328f6 100644
--- a/navit/vehicle/null/vehicle_null.c
+++ b/navit/vehicle/null/vehicle_null.c
@@ -67,7 +67,7 @@ struct vehicle_priv {
static void
vehicle_null_destroy(struct vehicle_priv *priv)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
g_free(priv);
}
@@ -83,7 +83,7 @@ static int
vehicle_null_position_attr_get(struct vehicle_priv *priv,
enum attr_type type, struct attr *attr)
{
- dbg(lvl_debug,"enter %s\n",attr_to_name(type));
+ dbg(lvl_debug,"enter %s",attr_to_name(type));
switch (type) {
#if 0
case attr_position_fix_type:
@@ -122,7 +122,7 @@ vehicle_null_position_attr_get(struct vehicle_priv *priv,
default:
return 0;
}
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
attr->type = type;
return 1;
}
@@ -170,11 +170,11 @@ vehicle_null_new_null(struct vehicle_methods *meth,
{
struct vehicle_priv *ret;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
*meth = vehicle_null_methods;
- dbg(lvl_debug, "return\n");
+ dbg(lvl_debug, "return");
return ret;
}
@@ -186,6 +186,6 @@ vehicle_null_new_null(struct vehicle_methods *meth,
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("null", vehicle_null_new_null);
}
diff --git a/navit/vehicle/qt5/vehicle_qt5.cpp b/navit/vehicle/qt5/vehicle_qt5.cpp
index fc8a6635a..6d263a649 100644
--- a/navit/vehicle/qt5/vehicle_qt5.cpp
+++ b/navit/vehicle/qt5/vehicle_qt5.cpp
@@ -63,14 +63,14 @@ QNavitGeoReceiver::QNavitGeoReceiver(QObject* parent, struct vehicle_priv* c)
}
void QNavitGeoReceiver::satellitesInUseUpdated(const QList<QGeoSatelliteInfo>& sats)
{
- dbg(lvl_debug, "Sats in use: %d\n", sats.count());
+ dbg(lvl_debug, "Sats in use: %d", sats.count());
priv->sats_used = sats.count();
callback_list_call_attr_0(priv->cbl, attr_position_sats_used);
}
void QNavitGeoReceiver::satellitesInViewUpdated(const QList<QGeoSatelliteInfo>& sats)
{
- dbg(lvl_debug, "Sats in view: %d\n", sats.count());
+ dbg(lvl_debug, "Sats in view: %d", sats.count());
priv->sats = sats.count();
callback_list_call_attr_0(priv->cbl, attr_position_qual);
}
@@ -81,23 +81,23 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info)
/* ignore stale view */
if (info.coordinate().isValid()) {
if (info.timestamp().toUTC().secsTo(QDateTime::currentDateTimeUtc()) > 20) {
- dbg(lvl_debug, "Ignoring old FIX\n");
+ dbg(lvl_debug, "Ignoring old FIX");
return;
}
}
if (info.hasAttribute(QGeoPositionInfo::HorizontalAccuracy)) {
- dbg(lvl_debug, "Horizontal acc (%f)\n", info.attribute(QGeoPositionInfo::HorizontalAccuracy));
+ dbg(lvl_debug, "Horizontal acc (%f)", info.attribute(QGeoPositionInfo::HorizontalAccuracy));
priv->radius = info.attribute(QGeoPositionInfo::HorizontalAccuracy);
callback_list_call_attr_0(priv->cbl, attr_position_radius);
}
if (info.hasAttribute(QGeoPositionInfo::GroundSpeed)) {
- dbg(lvl_debug, "Got ground speed (%f)\n", info.attribute(QGeoPositionInfo::GroundSpeed));
+ dbg(lvl_debug, "Got ground speed (%f)", info.attribute(QGeoPositionInfo::GroundSpeed));
priv->speed = info.attribute(QGeoPositionInfo::GroundSpeed) * 3.6;
callback_list_call_attr_0(priv->cbl, attr_position_speed);
}
if (info.hasAttribute(QGeoPositionInfo::Direction)) {
- dbg(lvl_debug, "Direction (%f)\n", info.attribute(QGeoPositionInfo::Direction));
+ dbg(lvl_debug, "Direction (%f)", info.attribute(QGeoPositionInfo::Direction));
priv->direction = info.attribute(QGeoPositionInfo::Direction);
callback_list_call_attr_0(priv->cbl, attr_position_direction);
}
@@ -115,19 +115,19 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info)
}
if (info.coordinate().isValid()) {
- dbg(lvl_debug, "Got valid coordinate (lat %f, lon %f)\n", info.coordinate().latitude(), info.coordinate().longitude());
+ dbg(lvl_debug, "Got valid coordinate (lat %f, lon %f)", info.coordinate().latitude(), info.coordinate().longitude());
priv->geo.lat = info.coordinate().latitude();
priv->geo.lng = info.coordinate().longitude();
priv->have_coords = 1;
if (info.coordinate().type() == QGeoCoordinate::Coordinate3D) {
- dbg(lvl_debug, "Got valid altitude (alt %f)\n", info.coordinate().altitude());
+ dbg(lvl_debug, "Got valid altitude (alt %f)", info.coordinate().altitude());
priv->height = info.coordinate().altitude();
}
- //dbg(lvl_debug, "Time %s\n", info.timestamp().toUTC().toString().toLatin1().data());
+ //dbg(lvl_debug, "Time %s", info.timestamp().toUTC().toString().toLatin1().data());
priv->fix_time = info.timestamp().toUTC().toTime_t();
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
} else {
- dbg(lvl_debug, "Got invalid coordinate\n");
+ dbg(lvl_debug, "Got invalid coordinate");
priv->have_coords = 0;
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
}
@@ -142,7 +142,7 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info)
static void
vehicle_qt5_destroy(struct vehicle_priv* priv)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (priv->receiver != NULL)
delete priv->receiver;
if (priv->source != NULL)
@@ -163,7 +163,7 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv,
enum attr_type type, struct attr* attr)
{
struct attr* active = NULL;
- dbg(lvl_debug, "enter %s\n", attr_to_name(type));
+ dbg(lvl_debug, "enter %s", attr_to_name(type));
switch (type) {
case attr_position_valid:
attr->u.num = priv->have_coords;
@@ -205,9 +205,9 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv,
priv->fix_time = 0;
return 0;
}
- //dbg(lvl_debug,"Fix Time: %s\n", priv->fixiso8601);
+ //dbg(lvl_debug,"Fix Time: %s", priv->fixiso8601);
} else {
- //dbg(lvl_debug,"Fix Time: 0\n");
+ //dbg(lvl_debug,"Fix Time: 0");
return 0;
}
break;
@@ -224,7 +224,7 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv,
default:
return 0;
}
- dbg(lvl_debug, "ok\n");
+ dbg(lvl_debug, "ok");
attr->type = type;
return 1;
}
@@ -271,7 +271,7 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth,
{
struct vehicle_priv* ret;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
*meth = vehicle_null_methods;
@@ -279,16 +279,16 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth,
ret->source = QGeoPositionInfoSource::createDefaultSource(NULL);
ret->satellites = QGeoSatelliteInfoSource::createDefaultSource(NULL);
if (ret->source == NULL) {
- dbg(lvl_error, "Got NO QGeoPositionInfoSource\n");
+ dbg(lvl_error, "Got NO QGeoPositionInfoSource");
} else {
- dbg(lvl_debug, "Using %s\n", ret->source->sourceName().toLatin1().data());
+ dbg(lvl_debug, "Using %s", ret->source->sourceName().toLatin1().data());
ret->receiver = new QNavitGeoReceiver(NULL, ret);
ret->satellites->setUpdateInterval(1000);
ret->satellites->startUpdates();
ret->source->setUpdateInterval(500);
ret->source->startUpdates();
}
- dbg(lvl_debug, "return\n");
+ dbg(lvl_debug, "return");
return ret;
}
@@ -299,6 +299,6 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth,
*/
void plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("qt5", vehicle_qt5_new_qt5);
}
diff --git a/navit/vehicle/webos/bluetooth.c b/navit/vehicle/webos/bluetooth.c
index 343d2ec5c..31e3a575e 100644
--- a/navit/vehicle/webos/bluetooth.c
+++ b/navit/vehicle/webos/bluetooth.c
@@ -25,10 +25,10 @@ static void
mlPDL_ServiceCall_callback(struct callback_list *cbl, char *service, char *parameters/*, struct callback *fail_cb*/)
{
PDL_Err err;
- dbg(lvl_debug,"PDL_ServiceCall(%s) parameters(%s)\n",service,parameters);
+ dbg(lvl_debug,"PDL_ServiceCall(%s) parameters(%s)",service,parameters);
err = PDL_ServiceCall(service, parameters);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCall to (%s) with (%s) failed with (%d): (%s)\n", service, parameters, err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCall to (%s) with (%s) failed with (%d): (%s)", service, parameters, err, PDL_GetError());
}
callback_list_destroy(cbl);
@@ -50,7 +50,7 @@ mlPDL_ServiceCall(const char *service, const char *parameters/*, struct callback
callback_list_add(cbl, cb);
-dbg(lvl_debug,"event_call_callback(%p)\n",cbl);
+dbg(lvl_debug,"event_call_callback(%p)",cbl);
event_call_callback(cbl);
}
@@ -65,10 +65,10 @@ mlPDL_ServiceCallWithCallback_callback(struct callback_list *cbl,
PDL_bool removeAfterResponse)
{
PDL_Err err;
- dbg(lvl_debug,"PDL_ServiceCallWithCallback(%s) parameters(%s)\n",service,parameters);
+ dbg(lvl_debug,"PDL_ServiceCallWithCallback(%s) parameters(%s)",service,parameters);
err = PDL_ServiceCallWithCallback(service, parameters, callback, user, removeAfterResponse);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback to (%s) with (%s) failed with (%d): (%s)\n", service, parameters, err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCallWithCallback to (%s) with (%s) failed with (%d): (%s)", service, parameters, err, PDL_GetError());
}
callback_list_destroy(cbl);
@@ -94,7 +94,7 @@ mlPDL_ServiceCallWithCallback(const char *service,
callback_list_add(cbl, cb);
- dbg(lvl_debug,"event_call_callback(%p)\n",cbl);
+ dbg(lvl_debug,"event_call_callback(%p)",cbl);
event_call_callback(cbl);
}
@@ -107,11 +107,11 @@ vehicle_webos_init_pdl_locationtracking_callback(struct vehicle_priv *priv, stru
priv->gps_type = param ? GPS_TYPE_INT: GPS_TYPE_NONE;
- dbg(lvl_debug,"Calling PDL_EnableLocationTracking(%i)\n",param);
+ dbg(lvl_debug,"Calling PDL_EnableLocationTracking(%i)",param);
err = PDL_EnableLocationTracking(param);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)", err, PDL_GetError());
// vehicle_webos_close(priv);
// return 0;
}
@@ -146,10 +146,10 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
int valid=0;
int ret = 0;
- dbg(lvl_info, "enter: buffer='%s'\n", buffer);
+ dbg(lvl_info, "enter: buffer='%s'", buffer);
for (;;) {
if (len < 4) {
- dbg(lvl_error, "'%s' too short\n", buffer);
+ dbg(lvl_error, "'%s' too short", buffer);
return ret;
}
if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') {
@@ -160,22 +160,22 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
break;
}
if (buffer[0] != '$') {
- dbg(lvl_error, "no leading $ in '%s'\n", buffer);
+ dbg(lvl_error, "no leading $ in '%s'", buffer);
return ret;
}
if (buffer[len - 3] != '*') {
- dbg(lvl_error, "no *XX in '%s'\n", buffer);
+ dbg(lvl_error, "no *XX in '%s'", buffer);
return ret;
}
for (i = 1; i < len - 3; i++) {
csum ^= (unsigned char) (buffer[i]);
}
if (!sscanf(buffer + len - 2, "%x", &bcsum) /*&& priv->checksum_ignore != 2*/) {
- dbg(lvl_error, "no checksum in '%s'\n", buffer);
+ dbg(lvl_error, "no checksum in '%s'", buffer);
return ret;
}
if (bcsum != csum /*&& priv->checksum_ignore == 0*/) {
- dbg(lvl_error, "wrong checksum in '%s was %x should be %x'\n", buffer,bcsum,csum);
+ dbg(lvl_error, "wrong checksum in '%s was %x should be %x'", buffer,bcsum,csum);
return ret;
}
@@ -184,7 +184,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer);
+ dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer);
}
i = 0;
p = buffer;
@@ -203,7 +203,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
priv->delta = 0; // (unsigned int)difftime(tv.tv_sec, priv->fix_time);
// priv->fix_time = tv.tv_sec;
-// dbg(lvl_info,"delta(%i)\n",priv->delta);
+// dbg(lvl_info,"delta(%i)",priv->delta);
// }
if (!strncmp(&buffer[3], "GGA", 3)) {
@@ -230,7 +230,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
if (!g_strcasecmp(item[5],"W"))
priv->geo.lng=-priv->geo.lng;
priv->valid=attr_position_valid_valid;
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else
priv->valid=attr_position_valid_invalid;
@@ -275,7 +275,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
if (valid) {
priv->track = g_ascii_strtod( item[1], NULL );
priv->speed = g_ascii_strtod( item[7], NULL );
- dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->track, priv->speed);
+ dbg(lvl_info,"direction %lf, speed %2.1lf", priv->track, priv->speed);
}
}
if (!strncmp(&buffer[3], "RMC", 3)) {
@@ -380,7 +380,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
*/
if (item[1]) {
priv->magnetic_direction = g_ascii_strtod( item[1], NULL );
- dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction);
+ dbg(lvl_debug,"magnetic %d", priv->magnetic_direction);
}
}
return ret;
@@ -396,14 +396,14 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user)
//PDL_Err err;
size = PDL_GetParamInt(params, "dataLength");
if (size > buffer_size) {
- dbg(lvl_error, "read returned too much data\n");
+ dbg(lvl_error, "read returned too much data");
return;
}
char buffer[buffer_size];
PDL_GetParamString(params,"data",buffer,buffer_size);
- dbg(lvl_debug,"data(%s) dataLength(%i)\n",buffer,size);
+ dbg(lvl_debug,"data(%s) dataLength(%i)",buffer,size);
memmove(priv->buffer + priv->buffer_pos, buffer, size);
@@ -411,12 +411,12 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user)
priv->buffer_pos += size;
priv->buffer[priv->buffer_pos] = '\0';
- dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size,
+ dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size,
priv->buffer_pos, priv->buffer);
str = priv->buffer;
while ((tok = strchr(str, '\n'))) {
*tok++ = '\0';
- dbg(lvl_debug, "line='%s'\n", str);
+ dbg(lvl_debug, "line='%s'", str);
rc += vehicle_webos_parse_nmea(priv, str);
str = tok;
// if (priv->file_type == file_type_file && rc)
@@ -427,10 +427,10 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user)
size = priv->buffer + priv->buffer_pos - str;
memmove(priv->buffer, str, size + 1);
priv->buffer_pos = size;
- dbg(lvl_debug,"now pos=%d buffer='%s'\n",
+ dbg(lvl_debug,"now pos=%d buffer='%s'",
priv->buffer_pos, priv->buffer);
} else if (priv->buffer_pos == buffer_size - 1) {
- dbg(lvl_error,"Overflow. Most likely wrong baud rate or no nmea protocol\n");
+ dbg(lvl_error,"Overflow. Most likely wrong baud rate or no nmea protocol");
priv->buffer_pos = 0;
}
if (rc) {
@@ -466,7 +466,7 @@ vehicle_webos_spp_init_read(struct vehicle_priv *priv, unsigned int length)
);
#if 0
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)", err, PDL_GetError());
vehicle_webos_close(priv);
return;
}
@@ -481,7 +481,7 @@ vehicle_webos_spp_handle_open(PDL_ServiceParameters *params, void *user)
if (!priv->buffer)
priv->buffer = g_malloc(buffer_size);
- dbg(lvl_debug,"instanceId(%i)\n",priv->spp_instance_id);
+ dbg(lvl_debug,"instanceId(%i)",priv->spp_instance_id);
priv->gps_type = GPS_TYPE_BT;
@@ -497,27 +497,27 @@ vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user)
char parameters[128];
const char *params_json = PDL_GetParamJson(params);
- dbg(lvl_info,"params_json(%s)\n", params_json);
+ dbg(lvl_info,"params_json(%s)", params_json);
if (PDL_ParamExists(params, "errorText")) {
PDL_GetParamString(params, "errorText", notification, sizeof(notification));
- dbg(lvl_error,"errorText(%s)\n",notification);
+ dbg(lvl_error,"errorText(%s)",notification);
return;
}
PDL_GetParamString(params, "notification", notification, sizeof(notification));
notification[sizeof(notification)-1] = '\0';
- dbg(lvl_warning,"notification(%s) %i\n",notification,PDL_ParamExists(params, "notification"));
+ dbg(lvl_warning,"notification(%s) %i",notification,PDL_ParamExists(params, "notification"));
if(strcmp(notification,"notifnservicenames") == 0) {
int instance_id = PDL_GetParamInt(params, "instanceId");
- dbg(lvl_debug,"instanceId(%i)\n", instance_id);
+ dbg(lvl_debug,"instanceId(%i)", instance_id);
cJSON *root = cJSON_Parse(params_json);
if (!root) {
- dbg(lvl_error,"parsing json failed\n");
+ dbg(lvl_error,"parsing json failed");
return;
}
@@ -544,7 +544,7 @@ vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user)
PDL_TRUE);
}
else {
- dbg(lvl_error,"notifnconnected error(%i)\n",PDL_GetParamInt(params,"error"));
+ dbg(lvl_error,"notifnconnected error(%i)",PDL_GetParamInt(params,"error"));
}
}
else if(strcmp(notification,"notifndisconnected") == 0) {
@@ -563,7 +563,7 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr)
{
char parameters[128];
- dbg(lvl_debug,"subscribeNotifications\n");
+ dbg(lvl_debug,"subscribeNotifications");
mlPDL_ServiceCallWithCallback("palm://com.palm.bluetooth/spp/subscribenotifications",
"{\"subscribe\":true}",
(PDL_ServiceCallbackFunc)vehicle_webos_spp_notify,
@@ -571,7 +571,7 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr)
PDL_FALSE);
#if 0
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError());
vehicle_webos_close(priv);
return;
}
@@ -581,7 +581,7 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr)
mlPDL_ServiceCall("palm://com.palm.bluetooth/spp/connect", parameters);
#if 0
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)", err, PDL_GetError());
vehicle_webos_close(priv);
return;
}
@@ -598,38 +598,38 @@ vehicle_webos_bt_gap_callback(PDL_ServiceParameters *params, void *param)
char *device_addr = NULL;
cJSON *root;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
PDL_Err err;
err = PDL_GetParamInt(params, "errorCode");
if (err != PDL_NOERROR) {
- dbg(lvl_error,"BT GAP Callback errorCode %d\n", err);
+ dbg(lvl_error,"BT GAP Callback errorCode %d", err);
return /*PDL_EOTHER*/;
}
params_json = PDL_GetParamJson(params);
- dbg(lvl_info,"params_json(%s)\n",params_json);
+ dbg(lvl_info,"params_json(%s)",params_json);
root = cJSON_Parse(params_json);
if (!root) {
- dbg(lvl_error,"parsing json failed\n");
+ dbg(lvl_error,"parsing json failed");
return;
}
cJSON *trusted_devices = cJSON_GetObjectItem(root, "trusteddevices");
unsigned int i,c = cJSON_GetArraySize(trusted_devices);
- dbg(lvl_debug, "trusted_devices(%i)\n",c);
+ dbg(lvl_debug, "trusted_devices(%i)",c);
for(i=0; i < c && !device_addr; i++) {
cJSON *device = cJSON_GetArrayItem(trusted_devices,i);
char *name = cJSON_GetObjectItem(device, "name")->valuestring;
char *address = cJSON_GetObjectItem(device, "address")->valuestring;
char *status = cJSON_GetObjectItem(device, "status")->valuestring;
- dbg(lvl_debug,"i(%i) name(%s) address(%s) status(%s)\n",i,name,address,status);
+ dbg(lvl_debug,"i(%i) name(%s) address(%s) status(%s)",i,name,address,status);
if (/*strncmp(status, "connected",9) == 0 && */strstr(name, "GPS") != NULL) {
- dbg(lvl_debug,"choose name(%s) address(%s)\n",name,address);
+ dbg(lvl_debug,"choose name(%s) address(%s)",name,address);
device_addr = g_strdup(address);
break;
}
@@ -649,7 +649,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv)
{
// Try to connect to BT GPS, or use PDL method
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
PDL_Err err;
err = PDL_ServiceCallWithCallback("palm://com.palm.bluetooth/gap/gettrusteddevices",
@@ -658,7 +658,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv)
priv,
PDL_TRUE);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError());
vehicle_webos_close(priv);
return 0;
}
@@ -668,7 +668,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv)
void
vehicle_webos_bt_close(struct vehicle_priv *priv)
{
- dbg(lvl_debug,"XXX\n");
+ dbg(lvl_debug,"XXX");
char parameters[128];
if (priv->spp_instance_id) {
snprintf(parameters, sizeof(parameters), "{\"instanceId\":%i}", priv->spp_instance_id);
diff --git a/navit/vehicle/webos/vehicle_webos.c b/navit/vehicle/webos/vehicle_webos.c
index c4bdcbaf2..8ba477305 100644
--- a/navit/vehicle/webos/vehicle_webos.c
+++ b/navit/vehicle/webos/vehicle_webos.c
@@ -59,7 +59,7 @@ vehicle_webos_callback(PDL_ServiceParameters *params, void *priv)
err = PDL_GetParamInt(params, "errorCode");
if (err != 0) {
- dbg(lvl_error,"Location Callback errorCode %d\n", err);
+ dbg(lvl_error,"Location Callback errorCode %d", err);
return /*PDL_EOTHER*/;
}
@@ -93,14 +93,14 @@ vehicle_webos_gps_update(struct vehicle_priv *priv, PDL_Location *location)
gettimeofday(&tv,NULL);
priv->delta = (int)difftime(tv.tv_sec, priv->fix_time);
- dbg(lvl_info,"delta(%i)\n",priv->delta);
+ dbg(lvl_info,"delta(%i)",priv->delta);
priv->fix_time = tv.tv_sec;
priv->geo.lat = location->latitude;
/* workaround for webOS GPS bug following */
priv->geo.lng = (priv->pdk_version >= 200 && location->longitude >= -1 && location->longitude <= 1) ?
-location->longitude : location->longitude;
- dbg(lvl_info,"Location: %f %f %f %.12g %.12g +-%fm\n",
+ dbg(lvl_info,"Location: %f %f %f %.12g %.12g +-%fm",
location->altitude,
location->velocity,
location->heading,
@@ -134,7 +134,7 @@ vehicle_webos_timeout_callback(struct vehicle_priv *priv)
int delta = (int)difftime(tv.tv_sec, priv->fix_time);
if (delta >= priv->delta*2) {
- dbg(lvl_warning, "GPS timeout triggered cb(%p) delta(%d)\n", priv->timeout_cb, delta);
+ dbg(lvl_warning, "GPS timeout triggered cb(%p) delta(%d)", priv->timeout_cb, delta);
priv->delta = -1;
@@ -165,7 +165,7 @@ vehicle_webos_open(struct vehicle_priv *priv)
PDL_Err err;
priv->pdk_version = PDL_GetPDKVersion();
- dbg(lvl_debug,"pdk_version(%d)\n", priv->pdk_version);
+ dbg(lvl_debug,"pdk_version(%d)", priv->pdk_version);
if (priv->pdk_version <= 100) {
// Use Location Service via callback interface
@@ -175,7 +175,7 @@ vehicle_webos_open(struct vehicle_priv *priv)
priv,
PDL_FALSE);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError());
vehicle_webos_close(priv);
return 0;
}
@@ -184,7 +184,7 @@ vehicle_webos_open(struct vehicle_priv *priv)
PDL_Err err;
err = PDL_EnableLocationTracking(PDL_TRUE);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)", err, PDL_GetError());
// vehicle_webos_close(priv);
// return 0;
}
@@ -214,15 +214,15 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv,
{
switch (type) {
case attr_position_height:
- dbg(lvl_info,"Altitude: %f\n", priv->altitude);
+ dbg(lvl_info,"Altitude: %f", priv->altitude);
attr->u.numd = &priv->altitude;
break;
case attr_position_speed:
- dbg(lvl_info,"Speed: %f\n", priv->speed);
+ dbg(lvl_info,"Speed: %f", priv->speed);
attr->u.numd = &priv->speed;
break;
case attr_position_direction:
- dbg(lvl_info,"Direction: %f\n", priv->track);
+ dbg(lvl_info,"Direction: %f", priv->track);
attr->u.numd = &priv->track;
break;
case attr_position_magnetic_direction:
@@ -246,11 +246,11 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv,
}
break;
case attr_position_coord_geo:
- dbg(lvl_info,"Coord: %.12g %.12g\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info,"Coord: %.12g %.12g", priv->geo.lat, priv->geo.lng);
attr->u.coord_geo = &priv->geo;
break;
case attr_position_radius:
- dbg(lvl_info,"Radius: %f\n", priv->radius);
+ dbg(lvl_info,"Radius: %f", priv->radius);
attr->u.numd = &priv->radius;
break;
case attr_position_time_iso8601:
@@ -265,10 +265,10 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv,
priv->fix_time = 0;
return 0;
}
- dbg(lvl_info,"Fix Time: %d %s\n", priv->fix_time, priv->fixiso8601);
+ dbg(lvl_info,"Fix Time: %d %s", priv->fix_time, priv->fixiso8601);
}
else {
- dbg(lvl_info,"Fix Time: %d\n", priv->fix_time);
+ dbg(lvl_info,"Fix Time: %d", priv->fix_time);
return 0;
}
@@ -326,7 +326,7 @@ vehicle_webos_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int init
switch (attr->type) {
case attr_source:
if (strncmp(vehicle_webos_prefix,attr->u.str,strlen(vehicle_webos_prefix))) {
- dbg(lvl_warning,"source must start with '%s'\n", vehicle_webos_prefix);
+ dbg(lvl_warning,"source must start with '%s'", vehicle_webos_prefix);
return 0;
}
g_free(priv->source);
@@ -388,7 +388,7 @@ vehicle_webos_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("webos", vehicle_webos_new);
}
diff --git a/navit/vehicle/wince/vehicle_wince.c b/navit/vehicle/wince/vehicle_wince.c
index 49f90b1f5..8ab59fdce 100644
--- a/navit/vehicle/wince/vehicle_wince.c
+++ b/navit/vehicle/wince/vehicle_wince.c
@@ -156,7 +156,7 @@ static void initBth(struct vehicle_priv *priv)
priv->BthSetMode = (PFN_BthSetMode)GetProcAddress(priv->hBthDll, TEXT("BthSetMode") );
if( priv->BthSetMode && priv->BthSetMode(1) == ERROR_SUCCESS )
{
- dbg(lvl_debug, "bluetooth activated\n");
+ dbg(lvl_debug, "bluetooth activated");
succeeded = TRUE;
}
}
@@ -164,13 +164,13 @@ static void initBth(struct vehicle_priv *priv)
}
else
{
- dbg(lvl_error, "Bluetooth library notfound\n");
+ dbg(lvl_error, "Bluetooth library notfound");
}
if ( !succeeded )
{
- dbg(lvl_warning, "Bluetooth already enabled or failed to enable it.\n");
+ dbg(lvl_warning, "Bluetooth already enabled or failed to enable it.");
priv->BthSetMode = NULL;
if ( priv->hBthDll )
{
@@ -188,7 +188,7 @@ static int initDevice(struct vehicle_priv *priv)
if ( priv->file_type == file_type_device )
{
- dbg(lvl_debug, "Init Device\n");
+ dbg(lvl_debug, "Init Device");
/* GPD0 is the control port for the GPS driver */
hGPS = CreateFile(L"GPD0:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hGPS != INVALID_HANDLE_VALUE) {
@@ -209,7 +209,7 @@ static int initDevice(struct vehicle_priv *priv)
NULL, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE)
{
Sleep(1000);
- dbg(lvl_debug, "Waiting to connect to %s\n", priv->source);
+ dbg(lvl_debug, "Waiting to connect to %s", priv->source);
}
GetCommTimeouts (priv->m_hGPSDevice, &commTiming);
commTiming.ReadIntervalTimeout = 20;
@@ -240,11 +240,11 @@ static int initDevice(struct vehicle_priv *priv)
}
else
{
- dbg(lvl_debug, "Open File\n");
+ dbg(lvl_debug, "Open File");
priv->m_hGPSDevice = CreateFileW( A2W(priv->source),
GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
if ( priv->m_hGPSDevice == INVALID_HANDLE_VALUE) {
- dbg(lvl_error, "Could not open %s\n", priv->source);
+ dbg(lvl_error, "Could not open %s", priv->source);
return 0;
}
}
@@ -274,7 +274,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam)
DWORD bytes_read;
int waitcounter;
- dbg(lvl_debug, "GPS Port:[%s]\n", priv->source);
+ dbg(lvl_debug, "GPS Port:[%s]", priv->source);
priv->thread_up = 1;
if ( !initDevice(priv) ) {
@@ -282,7 +282,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam)
}
while (priv->is_running)
{
- dbg(lvl_debug,"readfile\n");
+ dbg(lvl_debug,"readfile");
waitcounter = 0;
status = ReadFile(priv->m_hGPSDevice,
chunk_buffer, sizeof(chunk_buffer),
@@ -290,7 +290,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam)
if ( !status )
{
- dbg(lvl_error,"Error reading file/device. Try again.\n");
+ dbg(lvl_error,"Error reading file/device. Try again.");
initDevice(priv);
continue;
}
@@ -300,24 +300,24 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam)
/* TODO (rikky#1#): should use blocking */
if ( priv->file_type != file_type_file )
{
- dbg(lvl_debug, "GPS data comes too fast. Have to wait here\n");
+ dbg(lvl_debug, "GPS data comes too fast. Have to wait here");
}
Sleep(50);
waitcounter++;
if ( waitcounter % 8 == 0 )
{
- dbg(lvl_debug, "Remind them of the data\n");
+ dbg(lvl_debug, "Remind them of the data");
event_call_callback(priv->priv_cbl);
}
if(waitcounter % 200 == 0) {
- dbg(lvl_error,"Will main thread ever be ready for the GPS data? Already %d intervals gone.\n",waitcounter);
+ dbg(lvl_error,"Will main thread ever be ready for the GPS data? Already %d intervals gone.",waitcounter);
}
}
if(waitcounter>2)
- dbg(lvl_debug,"Sent GPS data to the main thread after %d intervals delay.\n",waitcounter);
+ dbg(lvl_debug,"Sent GPS data to the main thread after %d intervals delay.",waitcounter);
g_mutex_lock(&priv->lock);
memcpy(priv->read_buffer + priv->read_buffer_pos , chunk_buffer, bytes_read );
@@ -358,11 +358,11 @@ vehicle_wince_available_ports(void)
regdevtype_length = sizeof(devicetype);
if ( RegQueryValueEx( hkSubResult, L"Key", NULL, NULL, (LPBYTE)devicetype, &regdevtype_length) == ERROR_SUCCESS )
{
- dbg(lvl_debug, "Found device '%s' (%s)\n", W2A(devicename), W2A(devicetype));
+ dbg(lvl_debug, "Found device '%s' (%s)", W2A(devicename), W2A(devicetype));
}
else
{
- dbg(lvl_debug, "Found device '%s'\n", W2A(devicename));
+ dbg(lvl_debug, "Found device '%s'", W2A(devicename));
}
}
RegCloseKey(hkSubResult);
@@ -412,7 +412,7 @@ vehicle_wince_open(struct vehicle_priv *priv)
char* strport;
char* strsettings;
- dbg(lvl_debug, "enter vehicle_wince_open, priv->source='%s'\n", priv->source);
+ dbg(lvl_debug, "enter vehicle_wince_open, priv->source='%s'", priv->source);
if (priv->source ) {
@@ -431,7 +431,7 @@ vehicle_wince_open(struct vehicle_priv *priv)
*strsettings = '\0';
strsettings++;
- dbg(lvl_debug, "serial('%s', '%s')\n", strport, strsettings );
+ dbg(lvl_debug, "serial('%s', '%s')", strport, strsettings );
}
if (raw_setting_str)
g_free( raw_setting_str );
@@ -456,10 +456,10 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
int valid=0;
int ret = 0;
- dbg(lvl_info, "enter: buffer='%s'\n", buffer);
+ dbg(lvl_info, "enter: buffer='%s'", buffer);
for (;;) {
if (len < 4) {
- dbg(lvl_error, "'%s' too short\n", buffer);
+ dbg(lvl_error, "'%s' too short", buffer);
return ret;
}
if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') {
@@ -470,22 +470,22 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
break;
}
if (buffer[0] != '$') {
- dbg(lvl_error, "no leading $ in '%s'\n", buffer);
+ dbg(lvl_error, "no leading $ in '%s'", buffer);
return ret;
}
if (buffer[len - 3] != '*') {
- dbg(lvl_error, "no *XX in '%s'\n", buffer);
+ dbg(lvl_error, "no *XX in '%s'", buffer);
return ret;
}
for (i = 1; i < len - 3; i++) {
csum ^= (unsigned char) (buffer[i]);
}
if (!sscanf(buffer + len - 2, "%x", &bcsum) && priv->checksum_ignore != 2) {
- dbg(lvl_error, "no checksum in '%s'\n", buffer);
+ dbg(lvl_error, "no checksum in '%s'", buffer);
return ret;
}
if (bcsum != csum && priv->checksum_ignore == 0) {
- dbg(lvl_error, "wrong checksum in '%s'\n", buffer);
+ dbg(lvl_error, "wrong checksum in '%s'", buffer);
return ret;
}
@@ -494,7 +494,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer);
+ dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer);
}
i = 0;
p = buffer;
@@ -541,7 +541,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
strncpy(priv->fixtime, item[1], sizeof(priv->fixtime));
}
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else {
if (priv->valid == attr_position_valid_valid)
@@ -575,7 +575,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
if (valid) {
priv->direction = g_ascii_strtod( item[1], NULL );
priv->speed = g_ascii_strtod( item[7], NULL );
- dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->direction, priv->speed);
+ dbg(lvl_info,"direction %lf, speed %2.1lf", priv->direction, priv->speed);
}
}
if (!strncmp(&buffer[3], "RMC", 3)) {
@@ -625,7 +625,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
strncpy(priv->fixtime, item[1], sizeof(priv->fixtime));
}
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else {
if (priv->valid == attr_position_valid_valid)
@@ -697,7 +697,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
*/
if (item[1]) {
priv->magnetic_direction = g_ascii_strtod( item[1], NULL );
- dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction);
+ dbg(lvl_debug,"magnetic %d", priv->magnetic_direction);
}
}
return ret;
@@ -709,7 +709,7 @@ vehicle_wince_io(struct vehicle_priv *priv)
int size, rc = 0;
char *str, *tok;
- dbg(lvl_debug, "vehicle_file_io : enter\n");
+ dbg(lvl_debug, "vehicle_file_io : enter");
size = read_win32(priv, priv->buffer + priv->buffer_pos, buffer_size - priv->buffer_pos - 1);
@@ -730,12 +730,12 @@ vehicle_wince_io(struct vehicle_priv *priv)
}
priv->buffer_pos += size;
priv->buffer[priv->buffer_pos] = '\0';
- dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size,
+ dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size,
priv->buffer_pos, priv->buffer);
str = priv->buffer;
while ((tok = strchr(str, '\n'))) {
*tok++ = '\0';
- dbg(lvl_debug, "line='%s'\n", str);
+ dbg(lvl_debug, "line='%s'", str);
rc +=vehicle_wince_parse(priv, str);
str = tok;
if (priv->file_type == file_type_file && rc)
@@ -746,7 +746,7 @@ vehicle_wince_io(struct vehicle_priv *priv)
size = priv->buffer + priv->buffer_pos - str;
memmove(priv->buffer, str, size + 1);
priv->buffer_pos = size;
- dbg(lvl_info, "now pos=%d buffer='%s'\n",
+ dbg(lvl_info, "now pos=%d buffer='%s'",
priv->buffer_pos, priv->buffer);
} else if (priv->buffer_pos == buffer_size - 1) {
dbg(lvl_error,
@@ -876,7 +876,7 @@ vehicle_wince_position_attr_get(struct vehicle_priv *priv,
attr->u.str=priv->fixiso8601;
break;
case attr_position_sat_item:
- dbg(lvl_debug,"at here\n");
+ dbg(lvl_debug,"at here");
priv->sat_item.id_lo++;
if (priv->sat_item.id_lo > priv->current_count) {
priv->sat_item.id_lo=0;
@@ -967,7 +967,7 @@ vehicle_wince_new(struct vehicle_methods
struct attr *handle_bluetooth;
char *cp;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
ret = g_new0(struct vehicle_priv, 1);
ret->fd = -1;
@@ -1006,7 +1006,7 @@ vehicle_wince_new(struct vehicle_methods
ret->on_eof=1;
if (on_eof && !g_strcasecmp(on_eof->u.str, "exit"))
ret->on_eof=2;
- dbg(lvl_debug,"on_eof=%d\n", ret->on_eof);
+ dbg(lvl_debug,"on_eof=%d", ret->on_eof);
*meth = vehicle_wince_methods;
ret->priv_cbl = callback_list_new();
callback_list_add(ret->priv_cbl, callback_new_1(callback_cast(vehicle_wince_io), ret));
@@ -1026,7 +1026,7 @@ vehicle_wince_new(struct vehicle_methods
vehicle_wince_enable_watch(ret);
return ret;
}
- dbg(lvl_error, "Failed to open '%s'\n", ret->source);
+ dbg(lvl_error, "Failed to open '%s'", ret->source);
vehicle_wince_destroy(ret);
return NULL;
}
@@ -1037,7 +1037,7 @@ vehicle_wince_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("wince", vehicle_wince_new);
plugin_register_category_vehicle("file", vehicle_wince_new);
}
diff --git a/navit/vehicleprofile.c b/navit/vehicleprofile.c
index 9da721d26..32723bacc 100644
--- a/navit/vehicleprofile.c
+++ b/navit/vehicleprofile.c
@@ -30,7 +30,7 @@
static void
vehicleprofile_set_attr_do(struct vehicleprofile *this_, struct attr *attr)
{
- dbg(lvl_debug,"%s:%ld\n", attr_to_name(attr->type), attr->u.num);
+ dbg(lvl_debug,"%s:%ld", attr_to_name(attr->type), attr->u.num);
switch (attr->type) {
case attr_flags:
this_->flags=attr->u.num;
@@ -154,7 +154,7 @@ vehicleprofile_apply_roadprofile(struct vehicleprofile *this_, struct navit_obje
struct navit_object *newrp;
struct attr_iter *iter=rp->func->iter_new(NULL);
struct attr attr;
- dbg(lvl_debug,"patching roadprofile\n");
+ dbg(lvl_debug,"patching roadprofile");
newrp=oldrp->func->dup(oldrp);
while (rp->func->get_attr(rp, attr_any, &attr, iter))
newrp->func->set_attr(newrp, &attr);
@@ -177,7 +177,7 @@ vehicleprofile_apply_attrs(struct vehicleprofile *this_, struct navit_object *ob
struct attr attr;
struct attr_iter *iter=obj->func->iter_new(NULL);
while (obj->func->get_attr(obj, attr_any, &attr, iter)) {
- dbg(lvl_debug,"%s\n",attr_to_name(attr.type));
+ dbg(lvl_debug,"%s",attr_to_name(attr.type));
if (attr.type == attr_roadprofile)
vehicleprofile_apply_roadprofile(this_, attr.u.navit_object, is_option);
else if (attr.type != attr_profile_option)
@@ -190,7 +190,7 @@ static void
vehicleprofile_debug_roadprofile(gpointer key, gpointer value, gpointer user_data)
{
struct roadprofile *rp=value;
- dbg(lvl_debug,"type %s avg %d weight %d max %d\n",item_to_name((int)(long)key),rp->speed,rp->route_weight,rp->maxspeed);
+ dbg(lvl_debug,"type %s avg %d weight %d max %d",item_to_name((int)(long)key),rp->speed,rp->route_weight,rp->maxspeed);
}
static void
@@ -198,7 +198,7 @@ vehicleprofile_update(struct vehicleprofile *this_)
{
struct attr_iter *iter=vehicleprofile_attr_iter_new();
struct attr profile_option;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
vehicleprofile_clear(this_);
vehicleprofile_apply_attrs(this_, (struct navit_object *)this_, 0);
while (vehicleprofile_get_attr(this_, attr_profile_option, &profile_option, iter)) {
@@ -206,13 +206,13 @@ vehicleprofile_update(struct vehicleprofile *this_)
if (!profile_option.u.navit_object->func->get_attr(profile_option.u.navit_object, attr_active, &active, NULL))
active.u.num=0;
if (profile_option.u.navit_object->func->get_attr(profile_option.u.navit_object, attr_name, &name, NULL))
- dbg(lvl_debug,"%p %s %ld\n",profile_option.u.navit_object,name.u.str,active.u.num);
+ dbg(lvl_debug,"%p %s %ld",profile_option.u.navit_object,name.u.str,active.u.num);
if (active.u.num)
vehicleprofile_apply_attrs(this_, profile_option.u.navit_object, 1);
}
vehicleprofile_attr_iter_destroy(iter);
- dbg(lvl_debug,"result l %d w %d h %d wg %d awg %d pen %d\n",this_->length,this_->width,this_->height,this_->weight,this_->axle_weight,this_->through_traffic_penalty);
- dbg(lvl_debug,"m %d fwd 0x%x rev 0x%x flags 0x%x max %d stsp %d stdst %d dg %d\n",this_->mode,this_->flags_forward_mask,this_->flags_reverse_mask, this_->flags, this_->maxspeed_handling, this_->static_speed, this_->static_distance, this_->dangerous_goods);
+ dbg(lvl_debug,"result l %d w %d h %d wg %d awg %d pen %d",this_->length,this_->width,this_->height,this_->weight,this_->axle_weight,this_->through_traffic_penalty);
+ dbg(lvl_debug,"m %d fwd 0x%x rev 0x%x flags 0x%x max %d stsp %d stdst %d dg %d",this_->mode,this_->flags_forward_mask,this_->flags_reverse_mask, this_->flags, this_->maxspeed_handling, this_->static_speed, this_->static_distance, this_->dangerous_goods);
g_hash_table_foreach(this_->roadprofile_hash, vehicleprofile_debug_roadprofile, NULL);
}
diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c
index 36f7965cc..0af3551b4 100644
--- a/navit/xmlconfig.c
+++ b/navit/xmlconfig.c
@@ -118,7 +118,7 @@ static struct attr ** convert_to_attrs(struct xmlstate *state, struct attr_fixme
if (! strcmp(name, attr_fixme[0])) {
name=attr_fixme[1];
if (fixme_count++ < 10)
- dbg(lvl_error,"Please change attribute '%s' to '%s' in <%s />\n", attr_fixme[0], attr_fixme[1], fixme->element);
+ dbg(lvl_error,"Please change attribute '%s' to '%s' in <%s />", attr_fixme[0], attr_fixme[1], fixme->element);
break;
}
attr_fixme+=2;
@@ -128,12 +128,12 @@ static struct attr ** convert_to_attrs(struct xmlstate *state, struct attr_fixme
if (ret[count])
count++;
else if (strcmp(*attribute_name,"enabled") && strcmp(*attribute_name,"xmlns:xi"))
- dbg(lvl_error,"failed to create attribute '%s' with value '%s'\n", *attribute_name,*attribute_value);
+ dbg(lvl_error,"failed to create attribute '%s' with value '%s'", *attribute_name,*attribute_value);
attribute_name++;
attribute_value++;
}
ret[count]=NULL;
- dbg(lvl_debug,"ret=%p\n", ret);
+ dbg(lvl_debug,"ret=%p", ret);
return ret;
}
@@ -209,7 +209,7 @@ xmlconfig_announce(struct xmlstate *state)
if (itype!=type_none) {
navigation_set_announce(state->parent->element_attr.u.data, itype, level);
} else {
- dbg(lvl_error, "Invalid type for announcement: %s\n",tok);
+ dbg(lvl_error, "Invalid type for announcement: %s",tok);
}
str=NULL;
}
@@ -586,7 +586,7 @@ start_element(xml_context *context,
const char *parent_name=NULL;
char *s,*sep="",*possible_parents;
struct attr *parent_attr;
- dbg(lvl_info,"name='%s' parent='%s'\n", element_name, *parent ? (*parent)->element:NULL);
+ dbg(lvl_info,"name='%s' parent='%s'", element_name, *parent ? (*parent)->element:NULL);
if (!strcmp(element_name,"xml"))
return;
@@ -604,7 +604,7 @@ start_element(xml_context *context,
if (!strcmp(element_name,element_fixme[0])) {
element_name=element_fixme[1];
if (fixme_count++ < 10)
- dbg(lvl_error,"Please change <%s /> to <%s /> in config file\n", element_fixme[0], element_fixme[1]);
+ dbg(lvl_error,"Please change <%s /> to <%s /> in config file", element_fixme[0], element_fixme[1]);
}
element_fixme+=2;
}
@@ -676,7 +676,7 @@ start_element(xml_context *context,
return;
new->element_attr.type=attr_from_name(element_name);
if (new->element_attr.type == attr_none)
- dbg(lvl_error,"failed to create object of type '%s'\n", element_name);
+ dbg(lvl_error,"failed to create object of type '%s'", element_name);
if (new->element_attr.type == attr_tracking)
new->element_attr.type=attr_trackingo;
if (new->parent && new->parent->object_func && new->parent->object_func->add_attr)
@@ -697,7 +697,7 @@ end_element (xml_context *context,
if (!strcmp(element_name,"xml"))
return;
- dbg(lvl_info,"name='%s'\n", element_name);
+ dbg(lvl_info,"name='%s'", element_name);
curr=*state;
if (curr->object_func && curr->object_func->init)
curr->object_func->init(curr->element_attr.u.data);
@@ -752,27 +752,27 @@ xinclude(xml_context *context, const gchar **attribute_names, const gchar **attr
doc_new.level=doc_old->level+1;
doc_new.user_data=doc_old->user_data;
if (! href) {
- dbg(lvl_debug,"no href, using '%s'\n", doc_old->href);
+ dbg(lvl_debug,"no href, using '%s'", doc_old->href);
doc_new.href=doc_old->href;
if (file_exists(doc_new.href)) {
parse_file(&doc_new, error);
} else {
- dbg(lvl_error,"Unable to include %s\n",doc_new.href);
+ dbg(lvl_error,"Unable to include %s",doc_new.href);
}
} else {
- dbg(lvl_debug,"expanding '%s'\n", href);
+ dbg(lvl_debug,"expanding '%s'", href);
we=file_wordexp_new(href);
we_files=file_wordexp_get_array(we);
count=file_wordexp_get_count(we);
- dbg(lvl_debug,"%d results\n", count);
+ dbg(lvl_debug,"%d results", count);
if (file_exists(we_files[0])) {
for (i = 0 ; i < count ; i++) {
- dbg(lvl_debug,"result[%d]='%s'\n", i, we_files[i]);
+ dbg(lvl_debug,"result[%d]='%s'", i, we_files[i]);
doc_new.href=we_files[i];
parse_file(&doc_new, error);
}
} else {
- dbg(lvl_error,"Unable to include %s\n",we_files[0]);
+ dbg(lvl_error,"Unable to include %s",we_files[0]);
}
file_wordexp_destroy(we);
@@ -787,7 +787,7 @@ strncmp_len(const char *s1, int s1len, const char *s2)
char c[s1len+1];
strncpy(c, s1, s1len);
c[s1len]='\0';
- dbg(lvl_debug,"'%s' vs '%s'\n", c, s2);
+ dbg(lvl_debug,"'%s' vs '%s'", c, s2);
#endif
ret=strncmp(s1, s2, s1len);
@@ -832,7 +832,7 @@ xpointer_test(const char *test, int len, struct xistate *elem)
strncpy(test2, test, len);
test2[len]='\0';
- dbg(lvl_debug,"%s\n", test2);
+ dbg(lvl_debug,"%s", test2);
#endif
if (!len)
return 0;
@@ -886,7 +886,7 @@ xpointer_xpointer_match(const char *xpointer, int len, struct xistate *first)
{
const char *c;
int s;
- dbg(lvl_info,"%s\n", xpointer);
+ dbg(lvl_info,"%s", xpointer);
if (xpointer[0] != '/')
return 0;
c=xpointer+1;
@@ -1067,12 +1067,12 @@ xml_parse_text(const char *document, void *data,
context = g_markup_parse_context_new (&parser, 0, data, NULL);
if (!document){
- dbg(lvl_error, "FATAL: No XML data supplied (looks like incorrect configuration for internal GUI).\n");
+ dbg(lvl_error, "FATAL: No XML data supplied (looks like incorrect configuration for internal GUI).");
exit(1);
}
result = g_markup_parse_context_parse (context, document, strlen(document), NULL);
if (!result){
- dbg(lvl_error, "FATAL: Cannot parse data as XML: '%s'\n", document);
+ dbg(lvl_error, "FATAL: Cannot parse data as XML: '%s'", document);
exit(1);
}
g_markup_parse_context_free (context);
@@ -1115,7 +1115,7 @@ parse_file(struct xmldocument *document, xmlerror **error)
gboolean result;
char *xmldir,*newxmldir,*xmlfile,*newxmlfile,*sep;
- dbg(lvl_debug,"enter filename='%s'\n", document->href);
+ dbg(lvl_debug,"enter filename='%s'", document->href);
#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 12
#define G_MARKUP_TREAT_CDATA_AS_TEXT 0
#endif
@@ -1159,7 +1159,7 @@ parse_file(struct xmldocument *document, xmlerror **error)
unsetenv("XMLFILE");
g_free(newxmldir);
g_free(newxmlfile);
- dbg(lvl_debug,"return %d\n", result);
+ dbg(lvl_debug,"return %d", result);
return result;
}
@@ -1219,7 +1219,7 @@ gboolean config_load(const char *filename, xmlerror **error)
item_create_hash();
initStatic();
- dbg(lvl_debug,"enter filename='%s'\n", filename);
+ dbg(lvl_debug,"enter filename='%s'", filename);
memset(&document, 0, sizeof(document));
document.href=filename;
document.user_data=&curr;
@@ -1230,7 +1230,7 @@ gboolean config_load(const char *filename, xmlerror **error)
}
attr_destroy_hash();
item_destroy_hash();
- dbg(lvl_debug,"return %d\n", result);
+ dbg(lvl_debug,"return %d", result);
return result;
}
@@ -1264,7 +1264,7 @@ struct navit_object *
navit_object_ref(struct navit_object *obj)
{
obj->refcount++;
- dbg(lvl_debug,"refcount %s %p %d\n",attr_to_name(obj->func->type),obj,obj->refcount);
+ dbg(lvl_debug,"refcount %s %p %d",attr_to_name(obj->func->type),obj,obj->refcount);
return obj;
}
@@ -1273,7 +1273,7 @@ navit_object_unref(struct navit_object *obj)
{
if (obj) {
obj->refcount--;
- dbg(lvl_debug,"refcount %s %p %d\n",attr_to_name(obj->func->type),obj,obj->refcount);
+ dbg(lvl_debug,"refcount %s %p %d",attr_to_name(obj->func->type),obj,obj->refcount);
if (obj->refcount <= 0 && obj->func && obj->func->destroy)
obj->func->destroy(obj);
}
@@ -1336,7 +1336,7 @@ navit_object_callbacks(struct navit_object *obj, struct attr *attr)
int
navit_object_set_attr(struct navit_object *obj, struct attr *attr)
{
- dbg(lvl_debug, "enter, obj=%p, attr=%p (%s)\n", obj, attr, attr_to_name(attr->type));
+ dbg(lvl_debug, "enter, obj=%p, attr=%p (%s)", obj, attr, attr_to_name(attr->type));
obj->attrs=attr_generic_set_attr(obj->attrs, attr);
navit_object_callbacks(obj, attr);
return 1;
@@ -1345,7 +1345,7 @@ navit_object_set_attr(struct navit_object *obj, struct attr *attr)
int
navit_object_add_attr(struct navit_object *obj, struct attr *attr)
{
- dbg(lvl_debug, "enter, obj=%p, attr=%p (%s)\n", obj, attr, attr_to_name(attr->type));
+ dbg(lvl_debug, "enter, obj=%p, attr=%p (%s)", obj, attr, attr_to_name(attr->type));
if (attr->type == attr_callback) {
struct callback_list *cbl;
if (obj->attrs && obj->attrs[0] && obj->attrs[0]->type == attr_callback_list)