summaryrefslogtreecommitdiff
path: root/navit/vehicle.c
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-11-22 22:34:19 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-11-22 22:34:19 +0000
commit2a6aa9b917249f44e4aa27d88e255f61eb171d6a (patch)
tree0ad46b248e42f96e93b54874aa3b073ad1273aa1 /navit/vehicle.c
parent05edfdebd6b83267121b11538abafe39bff266e7 (diff)
downloadnavit-2a6aa9b917249f44e4aa27d88e255f61eb171d6a.tar.gz
Refactor:core:Introduce enum for debug levels, and use it everywhere.|First part of #1269.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5960 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/vehicle.c')
-rw-r--r--navit/vehicle.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/navit/vehicle.c b/navit/vehicle.c
index c18460095..19ad1020e 100644
--- a/navit/vehicle.c
+++ b/navit/vehicle.c
@@ -109,10 +109,10 @@ vehicle_new(struct attr *parent, struct attr **attrs)
char *type, *colon;
struct pcoord center;
- dbg(1, "enter\n");
+ dbg(lvl_warning, "enter\n");
source = attr_search(attrs, NULL, attr_source);
if (!source) {
- dbg(0, "incomplete vehicle definition: missing attribute 'source'\n");
+ dbg(lvl_error, "incomplete vehicle definition: missing attribute 'source'\n");
return NULL;
}
@@ -120,11 +120,11 @@ vehicle_new(struct attr *parent, struct attr **attrs)
colon = strchr(type, ':');
if (colon)
*colon = '\0';
- dbg(1, "source='%s' type='%s'\n", source->u.str, type);
+ dbg(lvl_warning, "source='%s' type='%s'\n", source->u.str, type);
vehicletype_new = plugin_get_vehicle_type(type);
if (!vehicletype_new) {
- dbg(0, "invalid source '%s': unknown type '%s'\n", source->u.str, type);
+ dbg(lvl_error, "invalid source '%s': unknown type '%s'\n", source->u.str, type);
g_free(type);
return NULL;
}
@@ -135,7 +135,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(0, "vehicletype_new failed\n");
+ dbg(lvl_error, "vehicletype_new failed\n");
callback_list_destroy(this_->cbl);
g_free(this_);
return NULL;
@@ -148,7 +148,7 @@ vehicle_new(struct attr *parent, struct attr **attrs)
this_->trans=transform_new(&center, 16, 0);
vehicle_set_default_name(this_);
- dbg(1, "leave\n");
+ dbg(lvl_warning, "leave\n");
this_->log_to_cb=g_hash_table_new(NULL,NULL);
return this_;
}
@@ -161,7 +161,7 @@ vehicle_new(struct attr *parent, struct attr **attrs)
void
vehicle_destroy(struct vehicle *this_)
{
- dbg(0,"enter\n");
+ dbg(lvl_error,"enter\n");
if (this_->animate_callback) {
callback_destroy(this_->animate_callback);
event_remove_timeout(this_->animate_timer);
@@ -373,8 +373,8 @@ vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int
{
if (angle < 0)
angle+=360;
- dbg(1,"enter this=%p gra=%p pnt=%p lazy=%d dir=%d speed=%d\n", this_, gra, pnt, lazy, angle, speed);
- dbg(1,"point %d,%d\n", pnt->x, pnt->y);
+ dbg(lvl_warning,"enter this=%p gra=%p pnt=%p lazy=%d dir=%d speed=%d\n", this_, gra, pnt, lazy, angle, speed);
+ dbg(lvl_warning,"point %d,%d\n", pnt->x, pnt->y);
this_->cursor_pnt=*pnt;
this_->angle=angle;
this_->speed=speed;
@@ -413,7 +413,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(0, "Incomplete vehicle definition: missing attribute 'name'. Default name set.\n");
+ dbg(lvl_error, "Incomplete vehicle definition: missing attribute 'name'. Default name set.\n");
}
}
@@ -448,7 +448,7 @@ vehicle_draw_do(struct vehicle *this_, int lazy)
while (*attr) {
if ((*attr)->type == attr_itemgra) {
struct itemgra *itm=(*attr)->u.itemgra;
- dbg(1,"speed %d-%d %d\n", itm->speed_range.min, itm->speed_range.max, speed);
+ dbg(lvl_warning,"speed %d-%d %d\n", 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) {
@@ -669,7 +669,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(1,"c=0x%x,0x%x\n",c.x,c.y);
+ dbg(lvl_warning,"c=0x%x,0x%x\n",c.x,c.y);
buffer_new[buffer_new[0]+1]=c.x;
buffer_new[buffer_new[0]+2]=c.y;
buffer_new[0]+=2;