]> err.no Git - mapper/commitdiff
Code cleanups
authorKaj-Michael Lang <milang@onion.tal.org>
Tue, 9 Oct 2007 12:37:19 +0000 (15:37 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Tue, 9 Oct 2007 12:37:19 +0000 (15:37 +0300)
src/file.c
src/map.c
src/path.c
src/poi.c
src/track.c

index e84f30c0b0ebdb002a43a9e818c0fba5b1919f66..f640920497d0558013cf2f21e9d525ce8be98f3b 100644 (file)
@@ -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;
 }
index 71f24b64781c32210604de9f7ccdaa1d2752eb16..23996b4cbce153ec3c3fa3f05c56809a4219a639 100644 (file)
--- 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;
 }
 
index f4ee62d52b48c0eb048682b9875ef0afec1f56e1..9dcbd211db16dc230d16a4652221d3f94a686977 100644 (file)
@@ -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__);
 }
index 23b277de19c209f710ff6a614c6b7ac8ba8772c5..0d639fb5595b34ba75a53df79c90f6ade31808a5 100644 (file)
--- 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;
 }
index f883b2818369e39428ed7d14cc00c7ab71eac485..786acba19ddca668967dd994af2b746f498281ca 100644 (file)
@@ -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);