summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-10-15 18:12:22 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-10-15 18:12:22 +0000
commitc5074d5d02b80835abc61930362436d1e4487196 (patch)
tree32caeee4afa04a4a5069da6f37ebaa5763dd61aa
parent1023835a3a987c1d668dcb8ec87c26d93f356d7e (diff)
downloadnavit-c5074d5d02b80835abc61930362436d1e4487196.tar.gz
Fix:Core:Replace g_warning with dbg(0, some wince fixes
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1476 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--navit/navit/callback.c2
-rw-r--r--navit/navit/graphics.c2
-rw-r--r--navit/navit/main.c4
-rw-r--r--navit/navit/navit.c14
-rw-r--r--navit/navit/plugin.c27
-rw-r--r--navit/navit/start.c2
-rw-r--r--navit/navit/vehicle.c7
7 files changed, 40 insertions, 18 deletions
diff --git a/navit/navit/callback.c b/navit/navit/callback.c
index d1b0fd843..dbbd45ed0 100644
--- a/navit/navit/callback.c
+++ b/navit/navit/callback.c
@@ -157,7 +157,7 @@ callback_call(struct callback *cb, int pcount, void **p)
break;
}
} else {
- g_warning("too many parameters for callback (%d+%d)\n", cb->pcount, pcount);
+ dbg(0,"too many parameters for callback (%d+%d)\n", cb->pcount, pcount);
}
}
diff --git a/navit/navit/graphics.c b/navit/navit/graphics.c
index 5b2da6e5e..36d6aef82 100644
--- a/navit/navit/graphics.c
+++ b/navit/navit/graphics.c
@@ -738,7 +738,7 @@ static void xdisplay_draw_elements(struct graphics *gra, GHashTable *display_lis
img=graphics_image_new(gra, icon);
g_free(icon);
if (! img)
- g_warning("failed to load icon '%s'\n", e->u.icon.src);
+ dbg(0,"failed to load icon '%s'\n", e->u.icon.src);
}
if (img) {
p.x=di->pnt[0].x - img->hot.x;
diff --git a/navit/navit/main.c b/navit/navit/main.c
index bb78186d1..c20c763eb 100644
--- a/navit/navit/main.c
+++ b/navit/navit/main.c
@@ -52,7 +52,7 @@ struct map_data *map_data_default;
static void sigchld(int sig)
{
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__CEGCC__)
int status;
while (waitpid(-1, &status, WNOHANG) > 0);
#endif
@@ -67,7 +67,7 @@ gchar *get_home_directory(void)
homedir = getenv("HOME");
if (!homedir)
{
- g_warning("Could not find home directory. Using current directory as home directory.");
+ dbg(0,"Could not find home directory. Using current directory as home directory.");
homedir = ".";
} else {
homedir=g_strdup(homedir);
diff --git a/navit/navit/navit.c b/navit/navit/navit.c
index b33e7781b..f0b7f282b 100644
--- a/navit/navit/navit.c
+++ b/navit/navit/navit.c
@@ -152,7 +152,7 @@ navit_get_mapset(struct navit *this_)
if(this_->mapsets){
return this_->mapsets->data;
} else {
- g_warning("No mapsets enabled! Is it on purpose? Navit can't draw a map. Please check your navit.xml\n");
+ dbg(0,"No mapsets enabled! Is it on purpose? Navit can't draw a map. Please check your navit.xml\n");
}
exit(-1);
}
@@ -473,7 +473,7 @@ navit_set_gui(struct navit *this_, struct gui *gui)
if (! main_loop_gui) {
main_loop_gui=this_->gui;
} else {
- g_warning("gui with main loop already active, ignoring this instance");
+ dbg(0,"gui with main loop already active, ignoring this instance");
return 0;
}
}
@@ -1202,12 +1202,12 @@ navit_init(struct navit *this_)
struct navit_vehicle *nv;
if (!this_->gui) {
- g_warning("no gui\n");
+ dbg(0,"no gui\n");
navit_destroy(this_);
return;
}
if (!this_->gra) {
- g_warning("no graphics\n");
+ dbg(0,"no graphics\n");
navit_destroy(this_);
return;
}
@@ -1215,9 +1215,9 @@ navit_init(struct navit *this_)
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);
- g_warning("failed to connect graphics '%s' to gui '%s'\n", attr_type_graphics.u.str, attr_type_gui.u.str);
- g_warning(" Please see http://wiki.navit-project.org/index.php/Failed_to_connect_graphics_to_gui\n");
- g_warning(" for explanations and solutions\n");
+ dbg(0,"failed to connect graphics '%s' to gui '%s'\n", attr_type_graphics.u.str, attr_type_gui.u.str);
+ dbg(0," Please see http://wiki.navit-project.org/index.php/Failed_to_connect_graphics_to_gui\n");
+ dbg(0," for explanations and solutions\n");
navit_destroy(this_);
return;
diff --git a/navit/navit/plugin.c b/navit/navit/plugin.c
index e9695e2cf..7665fcb56 100644
--- a/navit/navit/plugin.c
+++ b/navit/navit/plugin.c
@@ -19,8 +19,10 @@
#include <string.h>
#include <glib.h>
-#include <gmodule.h>
#include "config.h"
+#ifdef USE_PLUGINS
+#include <gmodule.h>
+#endif
#include "plugin.h"
#include "file.h"
#define PLUGIN_C
@@ -33,7 +35,9 @@ struct plugin {
int lazy;
int ondemand;
char *name;
+#ifdef USE_PLUGINS
GModule *mod;
+#endif
void (*init)(void);
};
@@ -45,6 +49,7 @@ struct plugins {
struct plugin *
plugin_new(char *plugin)
{
+#ifdef USE_PLUGINS
struct plugin *ret;
if (! g_module_supported()) {
return NULL;
@@ -52,27 +57,30 @@ plugin_new(char *plugin)
ret=g_new0(struct plugin, 1);
ret->name=g_strdup(plugin);
return ret;
-
+#else
+ return NULL;
+#endif
}
int
plugin_load(struct plugin *pl)
{
+#ifdef USE_PLUGINS
gpointer init;
GModule *mod;
if (pl->mod) {
- g_warning("can't load '%s', already loaded\n", pl->name);
+ dbg(0,"can't load '%s', already loaded\n", pl->name);
return 0;
}
mod=g_module_open(pl->name, G_MODULE_BIND_LOCAL | (pl->lazy ? G_MODULE_BIND_LAZY : 0));
if (! mod) {
- g_warning("can't load '%s', Error '%s'\n", pl->name, g_module_error());
+ dbg(0,"can't load '%s', Error '%s'\n", pl->name, g_module_error());
return 0;
}
if (!g_module_symbol(mod, "plugin_init", &init)) {
- g_warning("can't load '%s', plugin_init not found\n", pl->name);
+ dbg(0,"can't load '%s', plugin_init not found\n", pl->name);
g_module_close(mod);
return 0;
} else {
@@ -80,6 +88,9 @@ plugin_load(struct plugin *pl)
pl->init=init;
}
return 1;
+#else
+ return 0;
+#endif
}
char *
@@ -106,11 +117,13 @@ plugin_set_lazy(struct plugin *pl, int lazy)
pl->lazy=lazy;
}
+#ifdef USE_PLUGINS
static int
plugin_get_ondemand(struct plugin *pl)
{
return pl->ondemand;
}
+#endif
static void
plugin_set_ondemand(struct plugin *pl, int ondemand)
@@ -127,8 +140,10 @@ plugin_call_init(struct plugin *pl)
void
plugin_unload(struct plugin *pl)
{
+#ifdef USE_PLUGINS
g_module_close(pl->mod);
pl->mod=NULL;
+#endif
}
void
@@ -180,7 +195,7 @@ plugins_add_path(struct plugins *pls, struct attr **attrs) {
if (! (pl=g_hash_table_lookup(pls->hash, name))) {
pl=plugin_new(name);
if (! pl) {
- g_warning("failed to create plugin '%s'\n", name);
+ dbg(0,"failed to create plugin '%s'\n", name);
continue;
}
g_hash_table_insert(pls->hash, plugin_get_name(pl), pl);
diff --git a/navit/navit/start.c b/navit/navit/start.c
index a7233a155..759f7c2fd 100644
--- a/navit/navit/start.c
+++ b/navit/navit/start.c
@@ -54,7 +54,7 @@ get_home_directory(void)
homedir = getenv("HOME");
if (!homedir)
{
- g_warning("Could not find home directory. Using current directory as home directory.");
+ dbg(0,"Could not find home directory. Using current directory as home directory.");
homedir = ".";
} else {
homedir=g_strdup(homedir);
diff --git a/navit/navit/vehicle.c b/navit/navit/vehicle.c
index d4e5f9c99..ceef666a0 100644
--- a/navit/navit/vehicle.c
+++ b/navit/navit/vehicle.c
@@ -53,15 +53,22 @@ vehicle_log_gpx(struct vehicle *this_, struct log *log)
{
struct attr pos_attr;
char buffer[256];
+#ifndef __CEGCC__
GTimeVal time;
g_get_current_time(&time);
+#endif
if (!this_->meth.position_attr_get)
return;
if (!this_->meth.position_attr_get(this_->priv, attr_position_coord_geo, &pos_attr))
return;
+#ifndef __CEGCC__
sprintf(buffer,"<trkpt lat=\"%f\" lon=\"%f\">\n\t<time>%s</time>\n</trkpt>\n",
pos_attr.u.coord_geo->lat, pos_attr.u.coord_geo->lng, g_time_val_to_iso8601(&time));
+#else
+ sprintf(buffer,"<trkpt lat=\"%f\" lon=\"%f\">\n</trkpt>\n",
+ pos_attr.u.coord_geo->lat, pos_attr.u.coord_geo->lng);
+#endif
log_write(log, buffer, strlen(buffer));
}