1. Agreed
2. Agreed
4. Agreed - One of these lines is unnecessary.
I think Ill probably remove the g_strdup() line and keep the 
vik_track_set_name() line.

3. It does seem wrong, but I not sure how it's used exactly.
I think the Filter 'vik_datasource_bfilter_polygon_interface' uses the shell 
command.

To use such a filter:
a. Load a track (ideally with some waypoints).
b. Right click on the Track in the layers panel and select "Use with Filter' 
menu entry.
c. Right click on the TrackWaypoint layer in the layers panel. There is now a 
"Filter with <TrackName>"-> Waypoints Inside This or Waypoints Outside This 
menu options.

This seems to be working ATM (maybe partly by accident) so need more review to 
ensure using the right pointers/types as appropriate/intended.

Thanks once again for the feedback.
--
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.

________________________________________
From: Kamil Ignacak <acer...@wp.pl>
Sent: 03 September 2017 19:49:49
To: viking-devel@lists.sourceforge.net
Subject: [Viking-devel] Four possible problems in viking code

Hello,

I think that I've spotted four minor issues in the most recent code of
Viking, could you please take a look?


1. globals.c:225:

   tmp.b = VIK_GPX_EXPORT_WPT_SYM_NAME_TITLECASE;
   a_preferences_register(&io_prefs[2], tmp,
VIKING_PREFERENCES_IO_GROUP_KEY);

I think that the assignment should be made to tmp.u instead of tmp.i,
because the parameter registered here is of type VIK_LAYER_PARAM_UINT.
I'm guessing that current code works just fine because this parameter
has only two allowed values (TITLECASE=0 and LOWERCASE=1).



2. globals:329 (related to #1):
This line refers to ->b field:

   val = a_preferences_get(VIKING_PREFERENCES_IO_NAMESPACE
"gpx_export_wpt_sym_names")->b;

The problem is that the "gpx_export_wpt_sym_names" parameter is of type
VIK_LAYER_PARAM_UINT.



3. babel.c:465:

   return a_babel_convert_from_shellcommand ( vt,
process_options->shell_command, process_options->filename, cb,
user_data, download_options );

I think that the third function argument in this function call is invalid.
Function's prototype states that the argument is 'const char
*input_file_type'.
Function's body shows that the function expects the argument to hold
string suitable for gpsbabel's "-i" command line option.
I'm not sure how to verify this in running application, so I may be
totally incorrect here.



4. viktrack.c:203:

   vik_track_set_name(new_tr,tr->name);

This is a line from vik_track_copy(), we set a name of new track. The
problem is that we already did this in line 182:

   new_tr->name = g_strdup(tr->name);

There is no real error because call to vik_track_set_name() in line 203
doesn't cause memory leak, but (if I see this correctly) line 203 is
unnecessary.


Best regards,
Kamil

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to