From: Kaj-Michael Lang Date: Tue, 9 Oct 2007 12:37:19 +0000 (+0300) Subject: Code cleanups X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d43971a28be79b39bae2c44bce912c2340d7adcb;p=mapper Code cleanups --- diff --git a/src/file.c b/src/file.c index e84f30c..f640920 100644 --- a/src/file.c +++ b/src/file.c @@ -142,7 +142,6 @@ open_file(gchar ** bytes_out, GnomeVFSHandle ** handle_out, gint * size_out, { GtkWidget *dialog; gboolean success = FALSE; - printf("%s()\n", __PRETTY_FUNCTION__); dialog = hildon_file_chooser_dialog_new(GTK_WINDOW(_window), chooser_action); @@ -220,6 +219,5 @@ open_file(gchar ** bytes_out, GnomeVFSHandle ** handle_out, gint * size_out, gtk_widget_destroy(dialog); - vprintf("%s(): return %d\n", __PRETTY_FUNCTION__, success); return success; } diff --git a/src/map.c b/src/map.c index 71f24b6..23996b4 100644 --- a/src/map.c +++ b/src/map.c @@ -578,18 +578,14 @@ if (_center_mode>0) * IT IS AN ERROR FOR BOTH POINTS TO INDICATE A BREAK. */ void -map_render_segment(GdkGC * gc_norm, GdkGC * gc_alt, - guint unitx1, guint unity1, guint unitx2, guint unity2) +map_render_segment(GdkGC * gc_norm, GdkGC * gc_alt, guint unitx1, guint unity1, guint unitx2, guint unity2) { - vprintf("%s()\n", __PRETTY_FUNCTION__); - if (!unity1) { guint x2, y2; x2 = unit2bufx(unitx2); y2 = unit2bufy(unity2); /* Make sure this circle will be visible. */ - if ((x2 < BUF_WIDTH_PIXELS) - && (y2 < BUF_HEIGHT_PIXELS)) + if ((x2 < BUF_WIDTH_PIXELS) && (y2 < BUF_HEIGHT_PIXELS)) gdk_draw_arc(_map_pixmap, gc_alt, FALSE, /* FALSE: not filled. */ x2 - _draw_width, y2 - _draw_width, 2 * _draw_width, 2 * _draw_width, 0, /* start at 0 degrees. */ 360 * 64); @@ -598,8 +594,7 @@ map_render_segment(GdkGC * gc_norm, GdkGC * gc_alt, x1 = unit2bufx(unitx1); y1 = unit2bufy(unity1); /* Make sure this circle will be visible. */ - if ((x1 < BUF_WIDTH_PIXELS) - && ((unsigned)y1 < BUF_HEIGHT_PIXELS)) + if ((x1 < BUF_WIDTH_PIXELS) && ((unsigned)y1 < BUF_HEIGHT_PIXELS)) gdk_draw_arc(_map_pixmap, gc_alt, FALSE, /* FALSE: not filled. */ x1 - _draw_width, y1 - _draw_width, 2 * _draw_width, 2 * _draw_width, 0, /* start at 0 degrees. */ 360 * 64); @@ -616,8 +611,6 @@ map_render_segment(GdkGC * gc_norm, GdkGC * gc_alt, || (y1 < 0 && y2 < 0))) gdk_draw_line(_map_pixmap, gc_norm, x1, y1, x2, y2); } - - vprintf("%s(): return\n", __PRETTY_FUNCTION__); } /** @@ -632,7 +625,6 @@ map_render_path(Path * path, GdkGC ** gc) { Point *curr; WayPoint *wcurr; - printf("%s()\n", __PRETTY_FUNCTION__); /* gc is a pointer to the first GC to use (for plain points). (gc + 1) * is a pointer to the GC to use for waypoints, and (gc + 2) is a pointer @@ -658,15 +650,11 @@ map_render_path(Path * path, GdkGC ** gc) wcurr++; } } - - vprintf("%s(): return\n", __PRETTY_FUNCTION__); } void map_render_paths() { - printf("%s()\n", __PRETTY_FUNCTION__); - if ((_show_tracks & ROUTES_MASK) && _route.head != _route.tail) { map_render_path(&_route, _gc + COLORABLE_ROUTE); @@ -685,8 +673,6 @@ map_render_paths() } if (_show_tracks & TRACKS_MASK) map_render_path(&_track, _gc + COLORABLE_TRACK); - - vprintf("%s(): return\n", __PRETTY_FUNCTION__); } static @@ -722,7 +708,6 @@ gboolean map_follow_move(GtkWidget * widget, GdkEventMotion * event) gboolean map_key_zoom_timeout() { - printf("%s()\n", __PRETTY_FUNCTION__); if (_key_zoom_new < _zoom) { /* We're currently zooming in (_zoom is decreasing). */ guint test = _key_zoom_new - _curr_repo->view_zoom_steps; @@ -745,7 +730,6 @@ map_key_zoom_timeout() snprintf(buffer, sizeof(buffer), "%s %d", _("Zoom to Level"), _key_zoom_new); MACRO_BANNER_SHOW_INFO(_window, buffer); } - vprintf("%s(): return\n", __PRETTY_FUNCTION__); return TRUE; } @@ -861,10 +845,6 @@ map_scale_draw(GdkEventExpose *event) gboolean map_cb_expose(GtkWidget * widget, GdkEventExpose * event) { -g_printf("%s(%d, %d, %d, %d)\n", __PRETTY_FUNCTION__, - event->area.x, event->area.y, - event->area.width, event->area.height); - gdk_draw_drawable(GDK_DRAWABLE(_map_widget->window), _gc[COLORABLE_MARK], _map_pixmap, @@ -1048,8 +1028,6 @@ return FALSE; gboolean map_cb_button_press(GtkWidget * widget, GdkEventButton * event) { - printf("%s()\n", __PRETTY_FUNCTION__); - _cmenu_position_x = event->x + 0.5; _cmenu_position_y = event->y + 0.5; @@ -1081,7 +1059,6 @@ map_cb_button_press(GtkWidget * widget, GdkEventButton * event) } /* Return FALSE to allow context menu to work. */ - vprintf("%s(): return FALSE\n", __PRETTY_FUNCTION__); return FALSE; } diff --git a/src/path.c b/src/path.c index f4ee62d..9dcbd21 100644 --- a/src/path.c +++ b/src/path.c @@ -10,8 +10,6 @@ void path_resize(Path * path, guint size) { -printf("%s()\n", __PRETTY_FUNCTION__); - if (path->head + size != path->cap) { Point *old_head = path->head; WayPoint *curr; @@ -26,20 +24,15 @@ if (path->head + size != path->cap) { path->head + (curr->point - old_head); } } -vprintf("%s(): return\n", __PRETTY_FUNCTION__); } void path_wresize(Path * path, guint wsize) { -printf("%s()\n", __PRETTY_FUNCTION__); - if (path->whead + wsize != path->wcap) { WayPoint *old_whead = path->whead; path->whead = g_renew(WayPoint, old_whead, wsize); path->wtail = path->whead + (path->wtail - old_whead); path->wcap = path->whead + wsize; } - -vprintf("%s(): return\n", __PRETTY_FUNCTION__); } diff --git a/src/poi.c b/src/poi.c index 23b277d..0d639fb 100644 --- a/src/poi.c +++ b/src/poi.c @@ -310,7 +310,6 @@ poi_category *cc; if (SQLITE_OK != sqlite3_bind_int(poisql.select_cat, 1, cat_id) || SQLITE_ROW != sqlite3_step(poisql.select_cat)) { - vprintf("%s(): return FALSE\n", __PRETTY_FUNCTION__); sqlite3_reset(poisql.select_cat); return FALSE; } @@ -533,7 +532,6 @@ poi_category_generate_store() { GtkTreeIter iter; GtkListStore *store; -printf("%s()\n", __PRETTY_FUNCTION__); store = gtk_list_store_new(CAT_NUM_COLUMNS, G_TYPE_UINT, @@ -553,6 +551,5 @@ while (SQLITE_ROW == sqlite3_step(poisql.selall_cat)) { sqlite3_reset(poisql.selall_cat); sqlite3_clear_bindings(poisql.selall_cat); -vprintf("%s(): return %p\n", __PRETTY_FUNCTION__, store); return store; } diff --git a/src/track.c b/src/track.c index f883b28..786acba 100644 --- a/src/track.c +++ b/src/track.c @@ -140,10 +140,9 @@ if (abs((gint)_pos.unitx-_track.tail->unitx) > _draw_width || abs((gint)_pos.uni /* Instead of calling map_render_paths(), we'll draw the new line * ourselves and call gtk_widget_queue_draw_area(). */ map_render_segment(_gc[COLORABLE_TRACK], - _gc[COLORABLE_TRACK_BREAK], - _track.tail->unitx, - _track.tail->unity, _pos.unitx, - _pos.unity); + _gc[COLORABLE_TRACK_BREAK], + _track.tail->unitx, _track.tail->unity, + _pos.unitx, _pos.unity); if (time && _track.tail->unity) { tx1 = unit2x(_track.tail->unitx);