Changeset 70e2404 in subsurface


Ignore:
Timestamp:
Jan 12, 2017, 2:15:53 PM (2 months ago)
Author:
Subsurface <dirk@…>
Branches:
master
Children:
983561b
Parents:
d11dfd2
git-author:
Anton Lundin <glance@…> (12/29/16 06:41:44)
git-committer:
Subsurface <dirk@…> (01/12/17 14:15:53)
Message:

Stop accessing the internals of dc_descriptor_t

This removes our own declaration of dc_descriptor_t and all our accesses
to its internals, and switches to use the libdivecomputer functions to
access those instead.

Signed-off-by: Anton Lundin <glance@…>

Location:
core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/libdivecomputer.c

    r00629c86 r70e2404  
    10801080        dc_parser_t *parser = NULL;
    10811081
    1082         switch (data->descriptor->type) {
     1082        switch (dc_descriptor_get_type(data->descriptor)) {
    10831083        case DC_FAMILY_UWATEC_ALADIN:
    10841084        case DC_FAMILY_UWATEC_MEMOMOUSE:
     
    10871087        case DC_FAMILY_UWATEC_SMART:
    10881088        case DC_FAMILY_UWATEC_MERIDIAN:
    1089                 rc = uwatec_smart_parser_create (&parser, data->context, data->descriptor->model, 0, 0);
     1089                rc = uwatec_smart_parser_create (&parser, data->context, dc_descriptor_get_model(data->descriptor), 0, 0);
    10901090                break;
    10911091        case DC_FAMILY_HW_OSTC:
     
    11211121        // Do not parse Aladin/Memomouse headers as they are fakes
    11221122        // Do not return on error, we can still parse the samples
    1123         if (data->descriptor->type != DC_FAMILY_UWATEC_ALADIN && data->descriptor->type != DC_FAMILY_UWATEC_MEMOMOUSE) {
     1123        if (dc_descriptor_get_type(data->descriptor) != DC_FAMILY_UWATEC_ALADIN && dc_descriptor_get_type(data->descriptor) != DC_FAMILY_UWATEC_MEMOMOUSE) {
    11241124                rc = libdc_header_parser (parser, data, dive);
    11251125                if (rc != DC_STATUS_SUCCESS) {
  • core/libdivecomputer.h

    r00629c86 r70e2404  
    1818extern "C" {
    1919#endif
    20 
    21 struct dc_descriptor_t {
    22         const char *vendor;
    23         const char *product;
    24         dc_family_t type;
    25         unsigned int model;
    26 };
    2720
    2821/* don't forget to include the UI toolkit specific display-XXX.h first
  • core/ostctools.c

    rd11dfd2 r70e2404  
    2121        if (data_descriptor) {
    2222                dev_data->descriptor = data_descriptor;
    23                 dev_data->vendor = copy_string(data_descriptor->vendor);
    24                 dev_data->model = copy_string(data_descriptor->product);
     23                dev_data->vendor = copy_string(dc_descriptor_get_vendor(data_descriptor));
     24                dev_data->model = copy_string(dc_descriptor_get_product(data_descriptor));
    2525        } else {
    2626                return 0;
Note: See TracChangeset for help on using the changeset viewer.