From: Kaj-Michael Lang Date: Thu, 20 Sep 2007 06:23:37 +0000 (+0300) Subject: misc X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee2722b15e684870d99f39f6f1071118166e9bf3;p=mapper misc --- diff --git a/src/audio-note.c b/src/audio-note.c index 638b5e5..236afcc 100644 --- a/src/audio-note.c +++ b/src/audio-note.c @@ -34,6 +34,7 @@ static gboolean audio_create_pipeline(note_pipeline *np, gboolean rec) { np->pipeline=gst_pipeline_new("pipeline"); +g_assert(np->pipeline); if (rec==TRUE) { np->src=gst_element_factory_make(AUDIO_SRC, "source"); np->filter=gst_element_factory_make("wavenc", "filter"); @@ -43,6 +44,9 @@ if (rec==TRUE) { np->filter=gst_element_factory_make("wavenc", "filter"); np->sink=gst_element_factory_make(AUDIO_SINK, "sink"); } +g_assert(np->src); +g_assert(np->sink); +g_assert(np->filter); return TRUE; } diff --git a/src/track.c b/src/track.c index df8822d..f883b28 100644 --- a/src/track.c +++ b/src/track.c @@ -101,13 +101,11 @@ if (_track.head != _track.tail) { void track_show_distance_from_first() { -/* Find last zero point. */ if (_track.head != _track.tail) { track_show_distance_from(_track.head); } else { MACRO_BANNER_SHOW_INFO(_window, _("The current track is empty.")); } -printf("%s(): return\n", __PRETTY_FUNCTION__); } /** @@ -127,7 +125,7 @@ track_add(time_t time, gboolean newly_fixed) gboolean show_directions = TRUE; gint announce_thres_unsquared; -if (abs((gint) _pos.unitx - _track.tail->unitx) > _draw_width || abs((gint) _pos.unity - _track.tail->unity) > _draw_width) { +if (abs((gint)_pos.unitx-_track.tail->unitx) > _draw_width || abs((gint)_pos.unity-_track.tail->unity) > _draw_width) { /* If time != 0, update the nearest-waypoint data. */ if (time && _route.head != _route.tail && (newly_fixed ? (route_find_nearest_point(), TRUE) : route_update_nears(TRUE))) { @@ -178,13 +176,13 @@ if (abs((gint) _pos.unitx - _track.tail->unitx) > _draw_width || abs((gint) _pos KEEP_DISPLAY_ON(); } -announce_thres_unsquared = (20 + (guint) _gps.speed) * _announce_notice_ratio * 3; +announce_thres_unsquared=(20+(guint)_gps.speed)*_announce_notice_ratio*3; /* Check if we should announce upcoming waypoints. */ if (show_directions && time && _next_way_dist_squared < (announce_thres_unsquared * announce_thres_unsquared)) { if (_enable_voice && strcmp(_next_way->desc, _last_spoken_phrase)) { g_free(_last_spoken_phrase); - _last_spoken_phrase = g_strdup(_next_way->desc); + _last_spoken_phrase=g_strdup(_next_way->desc); speak_text(_last_spoken_phrase); } MACRO_BANNER_SHOW_INFO(_window, _next_way->desc); @@ -200,19 +198,19 @@ if (_track.tail->unity) { /* To mark a "waypoint" in a track, we'll add a (0, 0) point and then * another instance of the most recent track point. */ MACRO_PATH_INCREMENT_TAIL(_track); -*_track.tail = _point_null; +*_track.tail=_point_null; MACRO_PATH_INCREMENT_TAIL(_track); -*_track.tail = _track.tail[-2]; +*_track.tail=_track.tail[-2]; -/** Instead of calling map_render_paths(), we'll just add the waypoint - * ourselves. */ +/* Instead of calling map_render_paths(), we'll just add the waypoint ourselves. */ x1 = unit2bufx(_track.tail->unitx); y1 = unit2bufy(_track.tail->unity); /* Make sure this circle will be visible. */ if ((x1 < BUF_WIDTH_PIXELS) && ((unsigned)y1 < BUF_HEIGHT_PIXELS)) - gdk_draw_arc(_map_pixmap, _gc[COLORABLE_TRACK_BREAK], FALSE, /* FALSE: not filled. */ - x1 - _draw_width, y1 - _draw_width, 2 * _draw_width, 2 * _draw_width, 0, /* start at 0 degrees. */ - 360 * 64); + gdk_draw_arc(_map_pixmap, _gc[COLORABLE_TRACK_BREAK], FALSE, + x1 - _draw_width, y1 - _draw_width, + 2 * _draw_width, 2 * _draw_width, 0, + 360 * 64); } else { MACRO_BANNER_SHOW_INFO(_window, _("Break already inserted.")); } @@ -284,8 +282,6 @@ GtkWidget *label; GtkWidget *txt_scroll; GtkWidget *txt_desc; -printf("%s()\n", __PRETTY_FUNCTION__); - dialog = gtk_dialog_new_with_buttons(_("Insert Mark"), GTK_WINDOW(_window), GTK_DIALOG_MODAL, GTK_STOCK_OK,