Kamil Ignacak
2016-05-03 08:48:37 UTC
Hello,
While working on a copy of Viking I've found few places in code that I
think may be improved. Can you please take a look?
1.
src/viktrwlayer.c:2193
g_array_index(dp->vtl->track_gc, GdkGC *, 11)
I think that the value '11' is invalid, because in my builds the
following message apears in terminal:
"(viking:3814): Gdk-CRITICAL **: IA__gdk_draw_arc: assertion 'GDK_IS_GC
(gc)' failed"
Since this line is supposed to draw a stop, perhaps
VIK_TRW_LAYER_TRACK_GC_STOP should be used instead.
2.
src/vikviewport.c:1641
vik_coord_load_from_utm ( &test, VIK_VIEWPORT_DRAWMODE_UTM, &u );
Strictly speaking the second argument to the function should be
VIK_COORD_UTM. Both names evaluate to zero, so this works.
3.
src/viktrwlayer.c:3324
GHashTable *vik_trw_layer_get_waypoints_iters ( VikTrwLayer *vtl )
{
return vtl->waypoints;
}
Shouldn't this function return vtl->waypoints_iters?
4.
src/viktrwlayer.c:2178
src/viktrwlayer.c:2365
if ( (!dp->one_zone && !dp->lat_lon) ...
Shouldn't these conditions for drawing a trackpoint and a waypoint be
the same? Currently they are not, second term of each condition is:
((!dp->one_zone) || tp->coord.utm_zone == dp->center->utm_zone)
vs.
( dp->lat_lon || wp->coord.utm_zone == dp->center->utm_zone )
From my understanding (!dp->one_zone) != dp->lat_lon.
Am I mistaken?
Best regards,
Kamil
While working on a copy of Viking I've found few places in code that I
think may be improved. Can you please take a look?
1.
src/viktrwlayer.c:2193
g_array_index(dp->vtl->track_gc, GdkGC *, 11)
I think that the value '11' is invalid, because in my builds the
following message apears in terminal:
"(viking:3814): Gdk-CRITICAL **: IA__gdk_draw_arc: assertion 'GDK_IS_GC
(gc)' failed"
Since this line is supposed to draw a stop, perhaps
VIK_TRW_LAYER_TRACK_GC_STOP should be used instead.
2.
src/vikviewport.c:1641
vik_coord_load_from_utm ( &test, VIK_VIEWPORT_DRAWMODE_UTM, &u );
Strictly speaking the second argument to the function should be
VIK_COORD_UTM. Both names evaluate to zero, so this works.
3.
src/viktrwlayer.c:3324
GHashTable *vik_trw_layer_get_waypoints_iters ( VikTrwLayer *vtl )
{
return vtl->waypoints;
}
Shouldn't this function return vtl->waypoints_iters?
4.
src/viktrwlayer.c:2178
src/viktrwlayer.c:2365
if ( (!dp->one_zone && !dp->lat_lon) ...
Shouldn't these conditions for drawing a trackpoint and a waypoint be
the same? Currently they are not, second term of each condition is:
((!dp->one_zone) || tp->coord.utm_zone == dp->center->utm_zone)
vs.
( dp->lat_lon || wp->coord.utm_zone == dp->center->utm_zone )
From my understanding (!dp->one_zone) != dp->lat_lon.
Am I mistaken?
Best regards,
Kamil