Remove some boilerplate code from the cleanup functions.
Instead of freeing the object data structure in the backend specific cleanup function, the memory is now freed automatically in the base class function. This reduces the amount of boilerplate code in the backends. Backends that don't allocate any additional resources, do no longer require a cleanup function at all.
This commit is contained in:
parent
f1c0249053
commit
9bc14dca10
@ -162,9 +162,6 @@ atomics_cobalt_device_close (dc_device_t *abstract)
|
||||
libusb_exit (device->context);
|
||||
#endif
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,6 @@ static dc_status_t atomics_cobalt_parser_set_data (dc_parser_t *abstract, const
|
||||
static dc_status_t atomics_cobalt_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t atomics_cobalt_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t atomics_cobalt_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t atomics_cobalt_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t atomics_cobalt_parser_vtable = {
|
||||
DC_FAMILY_ATOMICS_COBALT,
|
||||
@ -56,7 +55,7 @@ static const dc_parser_vtable_t atomics_cobalt_parser_vtable = {
|
||||
atomics_cobalt_parser_get_datetime, /* datetime */
|
||||
atomics_cobalt_parser_get_field, /* fields */
|
||||
atomics_cobalt_parser_samples_foreach, /* samples_foreach */
|
||||
atomics_cobalt_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -86,16 +85,6 @@ atomics_cobalt_parser_create (dc_parser_t **out, dc_context_t *context)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
atomics_cobalt_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
atomics_cobalt_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -133,9 +133,6 @@ citizen_aqualand_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,6 @@ static dc_status_t citizen_aqualand_parser_set_data (dc_parser_t *abstract, cons
|
||||
static dc_status_t citizen_aqualand_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t citizen_aqualand_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t citizen_aqualand_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t citizen_aqualand_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t citizen_aqualand_parser_vtable = {
|
||||
DC_FAMILY_CITIZEN_AQUALAND,
|
||||
@ -48,7 +47,7 @@ static const dc_parser_vtable_t citizen_aqualand_parser_vtable = {
|
||||
citizen_aqualand_parser_get_datetime, /* datetime */
|
||||
citizen_aqualand_parser_get_field, /* fields */
|
||||
citizen_aqualand_parser_samples_foreach, /* samples_foreach */
|
||||
citizen_aqualand_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -74,16 +73,6 @@ citizen_aqualand_parser_create (dc_parser_t **out, dc_context_t *context)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
citizen_aqualand_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
citizen_aqualand_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -342,9 +342,6 @@ cressi_edy_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -43,7 +43,6 @@ static dc_status_t cressi_edy_parser_set_data (dc_parser_t *abstract, const unsi
|
||||
static dc_status_t cressi_edy_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t cressi_edy_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t cressi_edy_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t cressi_edy_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t cressi_edy_parser_vtable = {
|
||||
DC_FAMILY_CRESSI_EDY,
|
||||
@ -51,7 +50,7 @@ static const dc_parser_vtable_t cressi_edy_parser_vtable = {
|
||||
cressi_edy_parser_get_datetime, /* datetime */
|
||||
cressi_edy_parser_get_field, /* fields */
|
||||
cressi_edy_parser_samples_foreach, /* samples_foreach */
|
||||
cressi_edy_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -95,16 +94,6 @@ cressi_edy_parser_create (dc_parser_t **out, dc_context_t *context, unsigned int
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
cressi_edy_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
cressi_edy_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -150,9 +150,6 @@ cressi_leonardo_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,6 @@ static dc_status_t cressi_leonardo_parser_set_data (dc_parser_t *abstract, const
|
||||
static dc_status_t cressi_leonardo_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t cressi_leonardo_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t cressi_leonardo_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t cressi_leonardo_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t cressi_leonardo_parser_vtable = {
|
||||
DC_FAMILY_CRESSI_EDY,
|
||||
@ -49,7 +48,7 @@ static const dc_parser_vtable_t cressi_leonardo_parser_vtable = {
|
||||
cressi_leonardo_parser_get_datetime, /* datetime */
|
||||
cressi_leonardo_parser_get_field, /* fields */
|
||||
cressi_leonardo_parser_samples_foreach, /* samples_foreach */
|
||||
cressi_leonardo_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -75,16 +74,6 @@ cressi_leonardo_parser_create (dc_parser_t **out, dc_context_t *context)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
cressi_leonardo_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
cressi_leonardo_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
13
src/device.c
13
src/device.c
@ -327,17 +327,22 @@ dc_device_foreach (dc_device_t *device, dc_dive_callback_t callback, void *userd
|
||||
dc_status_t
|
||||
dc_device_close (dc_device_t *device)
|
||||
{
|
||||
dc_status_t status = DC_STATUS_SUCCESS;
|
||||
|
||||
if (device == NULL)
|
||||
return DC_STATUS_SUCCESS;
|
||||
|
||||
if (device->vtable->close == NULL)
|
||||
return DC_STATUS_UNSUPPORTED;
|
||||
|
||||
// Disable the cancellation callback.
|
||||
device->cancel_callback = NULL;
|
||||
device->cancel_userdata = NULL;
|
||||
|
||||
return device->vtable->close (device);
|
||||
if (device->vtable->close) {
|
||||
status = device->vtable->close (device);
|
||||
}
|
||||
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -229,9 +229,6 @@ diverite_nitekq_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,6 @@ static dc_status_t diverite_nitekq_parser_set_data (dc_parser_t *abstract, const
|
||||
static dc_status_t diverite_nitekq_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t diverite_nitekq_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t diverite_nitekq_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t diverite_nitekq_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t diverite_nitekq_parser_vtable = {
|
||||
DC_FAMILY_DIVERITE_NITEKQ,
|
||||
@ -60,7 +59,7 @@ static const dc_parser_vtable_t diverite_nitekq_parser_vtable = {
|
||||
diverite_nitekq_parser_get_datetime, /* datetime */
|
||||
diverite_nitekq_parser_get_field, /* fields */
|
||||
diverite_nitekq_parser_samples_foreach, /* samples_foreach */
|
||||
diverite_nitekq_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -97,16 +96,6 @@ diverite_nitekq_parser_create (dc_parser_t **out, dc_context_t *context)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
diverite_nitekq_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
diverite_nitekq_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -181,9 +181,6 @@ divesystem_idive_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,6 @@ static dc_status_t divesystem_idive_parser_set_data (dc_parser_t *abstract, cons
|
||||
static dc_status_t divesystem_idive_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t divesystem_idive_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t divesystem_idive_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t divesystem_idive_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t divesystem_idive_parser_vtable = {
|
||||
DC_FAMILY_DIVESYSTEM_IDIVE,
|
||||
@ -70,7 +69,7 @@ static const dc_parser_vtable_t divesystem_idive_parser_vtable = {
|
||||
divesystem_idive_parser_get_datetime, /* datetime */
|
||||
divesystem_idive_parser_get_field, /* fields */
|
||||
divesystem_idive_parser_samples_foreach, /* samples_foreach */
|
||||
divesystem_idive_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -120,16 +119,6 @@ divesystem_idive_parser_create2 (dc_parser_t **out, dc_context_t *context, unsig
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
divesystem_idive_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
divesystem_idive_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -287,9 +287,6 @@ hw_frog_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -195,9 +195,6 @@ hw_ostc_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -448,9 +448,6 @@ hw_ostc3_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,6 @@ static dc_status_t hw_ostc_parser_set_data (dc_parser_t *abstract, const unsigne
|
||||
static dc_status_t hw_ostc_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t hw_ostc_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t hw_ostc_parser_vtable = {
|
||||
DC_FAMILY_HW_OSTC,
|
||||
@ -105,7 +104,7 @@ static const dc_parser_vtable_t hw_ostc_parser_vtable = {
|
||||
hw_ostc_parser_get_datetime, /* datetime */
|
||||
hw_ostc_parser_get_field, /* fields */
|
||||
hw_ostc_parser_samples_foreach, /* samples_foreach */
|
||||
hw_ostc_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
static const hw_ostc_layout_t hw_ostc_layout_ostc = {
|
||||
@ -300,16 +299,6 @@ hw_ostc_parser_create (dc_parser_t **out, dc_context_t *context, unsigned int fr
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
hw_ostc_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
hw_ostc_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -181,9 +181,6 @@ mares_darwin_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,6 @@ static dc_status_t mares_darwin_parser_set_data (dc_parser_t *abstract, const un
|
||||
static dc_status_t mares_darwin_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t mares_darwin_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t mares_darwin_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t mares_darwin_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t mares_darwin_parser_vtable = {
|
||||
DC_FAMILY_MARES_DARWIN,
|
||||
@ -55,7 +54,7 @@ static const dc_parser_vtable_t mares_darwin_parser_vtable = {
|
||||
mares_darwin_parser_get_datetime, /* datetime */
|
||||
mares_darwin_parser_get_field, /* fields */
|
||||
mares_darwin_parser_samples_foreach, /* samples_foreach */
|
||||
mares_darwin_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -91,16 +90,6 @@ mares_darwin_parser_create (dc_parser_t **out, dc_context_t *context, unsigned i
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
mares_darwin_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
mares_darwin_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -332,9 +332,6 @@ mares_iconhd_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,6 @@ static dc_status_t mares_iconhd_parser_set_data (dc_parser_t *abstract, const un
|
||||
static dc_status_t mares_iconhd_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t mares_iconhd_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t mares_iconhd_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t mares_iconhd_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t mares_iconhd_parser_vtable = {
|
||||
DC_FAMILY_MARES_ICONHD,
|
||||
@ -68,7 +67,7 @@ static const dc_parser_vtable_t mares_iconhd_parser_vtable = {
|
||||
mares_iconhd_parser_get_datetime, /* datetime */
|
||||
mares_iconhd_parser_get_field, /* fields */
|
||||
mares_iconhd_parser_samples_foreach, /* samples_foreach */
|
||||
mares_iconhd_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
static dc_status_t
|
||||
@ -229,16 +228,6 @@ mares_iconhd_parser_create (dc_parser_t **out, dc_context_t *context, unsigned i
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
mares_iconhd_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
mares_iconhd_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -167,9 +167,6 @@ mares_nemo_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,6 @@ static dc_status_t mares_nemo_parser_set_data (dc_parser_t *abstract, const unsi
|
||||
static dc_status_t mares_nemo_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t mares_nemo_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t mares_nemo_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t mares_nemo_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t mares_nemo_parser_vtable = {
|
||||
DC_FAMILY_MARES_NEMO,
|
||||
@ -71,7 +70,7 @@ static const dc_parser_vtable_t mares_nemo_parser_vtable = {
|
||||
mares_nemo_parser_get_datetime, /* datetime */
|
||||
mares_nemo_parser_get_field, /* fields */
|
||||
mares_nemo_parser_samples_foreach, /* samples_foreach */
|
||||
mares_nemo_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -112,16 +111,6 @@ mares_nemo_parser_create (dc_parser_t **out, dc_context_t *context, unsigned int
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
mares_nemo_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
mares_nemo_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -189,9 +189,6 @@ mares_puck_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -662,9 +662,6 @@ oceanic_atom2_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -107,7 +107,6 @@ static dc_status_t oceanic_atom2_parser_set_data (dc_parser_t *abstract, const u
|
||||
static dc_status_t oceanic_atom2_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t oceanic_atom2_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t oceanic_atom2_parser_vtable = {
|
||||
DC_FAMILY_OCEANIC_ATOM2,
|
||||
@ -115,7 +114,7 @@ static const dc_parser_vtable_t oceanic_atom2_parser_vtable = {
|
||||
oceanic_atom2_parser_get_datetime, /* datetime */
|
||||
oceanic_atom2_parser_get_field, /* fields */
|
||||
oceanic_atom2_parser_samples_foreach, /* samples_foreach */
|
||||
oceanic_atom2_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -180,16 +179,6 @@ oceanic_atom2_parser_create (dc_parser_t **out, dc_context_t *context, unsigned
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
oceanic_atom2_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
oceanic_atom2_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -325,9 +325,6 @@ oceanic_veo250_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,6 @@ static dc_status_t oceanic_veo250_parser_set_data (dc_parser_t *abstract, const
|
||||
static dc_status_t oceanic_veo250_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t oceanic_veo250_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t oceanic_veo250_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t oceanic_veo250_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t oceanic_veo250_parser_vtable = {
|
||||
DC_FAMILY_OCEANIC_VEO250,
|
||||
@ -59,7 +58,7 @@ static const dc_parser_vtable_t oceanic_veo250_parser_vtable = {
|
||||
oceanic_veo250_parser_get_datetime, /* datetime */
|
||||
oceanic_veo250_parser_get_field, /* fields */
|
||||
oceanic_veo250_parser_samples_foreach, /* samples_foreach */
|
||||
oceanic_veo250_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -91,16 +90,6 @@ oceanic_veo250_parser_create (dc_parser_t **out, dc_context_t *context, unsigned
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
oceanic_veo250_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
oceanic_veo250_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -368,9 +368,6 @@ oceanic_vtpro_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -45,7 +45,6 @@ static dc_status_t oceanic_vtpro_parser_set_data (dc_parser_t *abstract, const u
|
||||
static dc_status_t oceanic_vtpro_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t oceanic_vtpro_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t oceanic_vtpro_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t oceanic_vtpro_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t oceanic_vtpro_parser_vtable = {
|
||||
DC_FAMILY_OCEANIC_VTPRO,
|
||||
@ -53,7 +52,7 @@ static const dc_parser_vtable_t oceanic_vtpro_parser_vtable = {
|
||||
oceanic_vtpro_parser_get_datetime, /* datetime */
|
||||
oceanic_vtpro_parser_get_field, /* fields */
|
||||
oceanic_vtpro_parser_samples_foreach, /* samples_foreach */
|
||||
oceanic_vtpro_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -84,16 +83,6 @@ oceanic_vtpro_parser_create (dc_parser_t **out, dc_context_t *context)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
oceanic_vtpro_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
oceanic_vtpro_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
11
src/parser.c
11
src/parser.c
@ -239,13 +239,18 @@ dc_parser_samples_foreach (dc_parser_t *parser, dc_sample_callback_t callback, v
|
||||
dc_status_t
|
||||
dc_parser_destroy (dc_parser_t *parser)
|
||||
{
|
||||
dc_status_t status = DC_STATUS_SUCCESS;
|
||||
|
||||
if (parser == NULL)
|
||||
return DC_STATUS_SUCCESS;
|
||||
|
||||
if (parser->vtable->destroy == NULL)
|
||||
return DC_STATUS_UNSUPPORTED;
|
||||
if (parser->vtable->destroy) {
|
||||
status = parser->vtable->destroy (parser);
|
||||
}
|
||||
|
||||
return parser->vtable->destroy (parser);
|
||||
free (parser);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -167,9 +167,6 @@ reefnet_sensus_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,6 @@ static dc_status_t reefnet_sensus_parser_set_data (dc_parser_t *abstract, const
|
||||
static dc_status_t reefnet_sensus_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t reefnet_sensus_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t reefnet_sensus_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t reefnet_sensus_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t reefnet_sensus_parser_vtable = {
|
||||
DC_FAMILY_REEFNET_SENSUS,
|
||||
@ -60,7 +59,7 @@ static const dc_parser_vtable_t reefnet_sensus_parser_vtable = {
|
||||
reefnet_sensus_parser_get_datetime, /* datetime */
|
||||
reefnet_sensus_parser_get_field, /* fields */
|
||||
reefnet_sensus_parser_samples_foreach, /* samples_foreach */
|
||||
reefnet_sensus_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -95,16 +94,6 @@ reefnet_sensus_parser_create (dc_parser_t **out, dc_context_t *context, unsigned
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
reefnet_sensus_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
reefnet_sensus_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -140,9 +140,6 @@ reefnet_sensuspro_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,6 @@ static dc_status_t reefnet_sensuspro_parser_set_data (dc_parser_t *abstract, con
|
||||
static dc_status_t reefnet_sensuspro_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t reefnet_sensuspro_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t reefnet_sensuspro_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t reefnet_sensuspro_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t reefnet_sensuspro_parser_vtable = {
|
||||
DC_FAMILY_REEFNET_SENSUSPRO,
|
||||
@ -59,7 +58,7 @@ static const dc_parser_vtable_t reefnet_sensuspro_parser_vtable = {
|
||||
reefnet_sensuspro_parser_get_datetime, /* datetime */
|
||||
reefnet_sensuspro_parser_get_field, /* fields */
|
||||
reefnet_sensuspro_parser_samples_foreach, /* samples_foreach */
|
||||
reefnet_sensuspro_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -94,16 +93,6 @@ reefnet_sensuspro_parser_create (dc_parser_t **out, dc_context_t *context, unsig
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
reefnet_sensuspro_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
reefnet_sensuspro_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -149,9 +149,6 @@ reefnet_sensusultra_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,6 @@ static dc_status_t reefnet_sensusultra_parser_set_data (dc_parser_t *abstract, c
|
||||
static dc_status_t reefnet_sensusultra_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t reefnet_sensusultra_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t reefnet_sensusultra_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t reefnet_sensusultra_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t reefnet_sensusultra_parser_vtable = {
|
||||
DC_FAMILY_REEFNET_SENSUSULTRA,
|
||||
@ -59,7 +58,7 @@ static const dc_parser_vtable_t reefnet_sensusultra_parser_vtable = {
|
||||
reefnet_sensusultra_parser_get_datetime, /* datetime */
|
||||
reefnet_sensusultra_parser_get_field, /* fields */
|
||||
reefnet_sensusultra_parser_samples_foreach, /* samples_foreach */
|
||||
reefnet_sensusultra_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -94,16 +93,6 @@ reefnet_sensusultra_parser_create (dc_parser_t **out, dc_context_t *context, uns
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
reefnet_sensusultra_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
reefnet_sensusultra_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -117,7 +117,6 @@ error_free:
|
||||
static dc_status_t
|
||||
shearwater_petrel_device_close (dc_device_t *abstract)
|
||||
{
|
||||
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||
shearwater_common_device_t *device = (shearwater_common_device_t *) abstract;
|
||||
|
||||
// Shutdown the device.
|
||||
@ -125,12 +124,7 @@ shearwater_petrel_device_close (dc_device_t *abstract)
|
||||
shearwater_common_transfer (device, request, sizeof (request), NULL, 0, NULL);
|
||||
|
||||
// Close the device.
|
||||
rc = shearwater_common_close (device);
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return rc;
|
||||
return shearwater_common_close (device);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -103,16 +103,9 @@ error_free:
|
||||
static dc_status_t
|
||||
shearwater_predator_device_close (dc_device_t *abstract)
|
||||
{
|
||||
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||
shearwater_common_device_t *device = (shearwater_common_device_t *) abstract;
|
||||
|
||||
// Close the device.
|
||||
rc = shearwater_common_close (device);
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return rc;
|
||||
return shearwater_common_close (device);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -67,7 +67,6 @@ static dc_status_t shearwater_predator_parser_set_data (dc_parser_t *abstract, c
|
||||
static dc_status_t shearwater_predator_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t shearwater_predator_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t shearwater_predator_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t shearwater_predator_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t shearwater_predator_parser_vtable = {
|
||||
DC_FAMILY_SHEARWATER_PREDATOR,
|
||||
@ -75,7 +74,7 @@ static const dc_parser_vtable_t shearwater_predator_parser_vtable = {
|
||||
shearwater_predator_parser_get_datetime, /* datetime */
|
||||
shearwater_predator_parser_get_field, /* fields */
|
||||
shearwater_predator_parser_samples_foreach, /* samples_foreach */
|
||||
shearwater_predator_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
static const dc_parser_vtable_t shearwater_petrel_parser_vtable = {
|
||||
@ -84,7 +83,7 @@ static const dc_parser_vtable_t shearwater_petrel_parser_vtable = {
|
||||
shearwater_predator_parser_get_datetime, /* datetime */
|
||||
shearwater_predator_parser_get_field, /* fields */
|
||||
shearwater_predator_parser_samples_foreach, /* samples_foreach */
|
||||
shearwater_predator_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -155,16 +154,6 @@ shearwater_petrel_parser_create (dc_parser_t **out, dc_context_t *context)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
shearwater_predator_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
shearwater_predator_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -223,9 +223,6 @@ suunto_d9_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +83,6 @@ static dc_status_t suunto_d9_parser_set_data (dc_parser_t *abstract, const unsig
|
||||
static dc_status_t suunto_d9_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t suunto_d9_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t suunto_d9_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t suunto_d9_parser_vtable = {
|
||||
DC_FAMILY_SUUNTO_D9,
|
||||
@ -91,7 +90,7 @@ static const dc_parser_vtable_t suunto_d9_parser_vtable = {
|
||||
suunto_d9_parser_get_datetime, /* datetime */
|
||||
suunto_d9_parser_get_field, /* fields */
|
||||
suunto_d9_parser_samples_foreach, /* samples_foreach */
|
||||
suunto_d9_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
static unsigned int
|
||||
@ -234,16 +233,6 @@ suunto_d9_parser_create (dc_parser_t **out, dc_context_t *context, unsigned int
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
suunto_d9_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
suunto_d9_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -143,9 +143,6 @@ suunto_eon_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,6 @@ static dc_status_t suunto_eon_parser_set_data (dc_parser_t *abstract, const unsi
|
||||
static dc_status_t suunto_eon_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t suunto_eon_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t suunto_eon_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t suunto_eon_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t suunto_eon_parser_vtable = {
|
||||
DC_FAMILY_SUUNTO_EON,
|
||||
@ -55,7 +54,7 @@ static const dc_parser_vtable_t suunto_eon_parser_vtable = {
|
||||
suunto_eon_parser_get_datetime, /* datetime */
|
||||
suunto_eon_parser_get_field, /* fields */
|
||||
suunto_eon_parser_samples_foreach, /* samples_foreach */
|
||||
suunto_eon_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
static dc_status_t
|
||||
@ -138,16 +137,6 @@ suunto_eon_parser_create (dc_parser_t **out, dc_context_t *context, int spyder)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
suunto_eon_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
suunto_eon_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -696,7 +696,6 @@ suunto_eonsteel_device_close(dc_device_t *abstract)
|
||||
|
||||
libusb_close(eon->handle);
|
||||
libusb_exit(eon->ctx);
|
||||
free(eon);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -1191,7 +1191,7 @@ suunto_eonsteel_parser_destroy(dc_parser_t *parser)
|
||||
suunto_eonsteel_parser_t *eon = (suunto_eonsteel_parser_t *) parser;
|
||||
|
||||
desc_free(eon->type_desc, MAXTYPE);
|
||||
free(parser);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@ -137,9 +137,6 @@ suunto_solution_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,6 @@ struct suunto_solution_parser_t {
|
||||
static dc_status_t suunto_solution_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size);
|
||||
static dc_status_t suunto_solution_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t suunto_solution_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t suunto_solution_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t suunto_solution_parser_vtable = {
|
||||
DC_FAMILY_SUUNTO_SOLUTION,
|
||||
@ -50,7 +49,7 @@ static const dc_parser_vtable_t suunto_solution_parser_vtable = {
|
||||
NULL, /* datetime */
|
||||
suunto_solution_parser_get_field, /* fields */
|
||||
suunto_solution_parser_samples_foreach, /* samples_foreach */
|
||||
suunto_solution_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -81,16 +80,6 @@ suunto_solution_parser_create (dc_parser_t **out, dc_context_t *context)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
suunto_solution_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
suunto_solution_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -169,9 +169,6 @@ suunto_vyper_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -175,9 +175,6 @@ suunto_vyper2_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,6 @@ static dc_status_t suunto_vyper_parser_set_data (dc_parser_t *abstract, const un
|
||||
static dc_status_t suunto_vyper_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t suunto_vyper_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t suunto_vyper_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t suunto_vyper_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t suunto_vyper_parser_vtable = {
|
||||
DC_FAMILY_SUUNTO_VYPER,
|
||||
@ -56,7 +55,7 @@ static const dc_parser_vtable_t suunto_vyper_parser_vtable = {
|
||||
suunto_vyper_parser_get_datetime, /* datetime */
|
||||
suunto_vyper_parser_get_field, /* fields */
|
||||
suunto_vyper_parser_samples_foreach, /* samples_foreach */
|
||||
suunto_vyper_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
static unsigned int
|
||||
@ -190,16 +189,6 @@ suunto_vyper_parser_create (dc_parser_t **out, dc_context_t *context)
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
suunto_vyper_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
suunto_vyper_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -150,9 +150,6 @@ uwatec_aladin_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -149,9 +149,6 @@ uwatec_memomouse_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,6 @@ static dc_status_t uwatec_memomouse_parser_set_data (dc_parser_t *abstract, cons
|
||||
static dc_status_t uwatec_memomouse_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t uwatec_memomouse_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t uwatec_memomouse_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t uwatec_memomouse_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t uwatec_memomouse_parser_vtable = {
|
||||
DC_FAMILY_UWATEC_MEMOMOUSE,
|
||||
@ -50,7 +49,7 @@ static const dc_parser_vtable_t uwatec_memomouse_parser_vtable = {
|
||||
uwatec_memomouse_parser_get_datetime, /* datetime */
|
||||
uwatec_memomouse_parser_get_field, /* fields */
|
||||
uwatec_memomouse_parser_samples_foreach, /* samples_foreach */
|
||||
uwatec_memomouse_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
|
||||
@ -80,16 +79,6 @@ uwatec_memomouse_parser_create (dc_parser_t **out, dc_context_t *context, unsign
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
uwatec_memomouse_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
uwatec_memomouse_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -260,9 +260,6 @@ uwatec_meridian_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -224,9 +224,6 @@ uwatec_smart_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -150,7 +150,6 @@ static dc_status_t uwatec_smart_parser_set_data (dc_parser_t *abstract, const un
|
||||
static dc_status_t uwatec_smart_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime);
|
||||
static dc_status_t uwatec_smart_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned int flags, void *value);
|
||||
static dc_status_t uwatec_smart_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t callback, void *userdata);
|
||||
static dc_status_t uwatec_smart_parser_destroy (dc_parser_t *abstract);
|
||||
|
||||
static const dc_parser_vtable_t uwatec_smart_parser_vtable = {
|
||||
DC_FAMILY_UWATEC_SMART,
|
||||
@ -158,7 +157,7 @@ static const dc_parser_vtable_t uwatec_smart_parser_vtable = {
|
||||
uwatec_smart_parser_get_datetime, /* datetime */
|
||||
uwatec_smart_parser_get_field, /* fields */
|
||||
uwatec_smart_parser_samples_foreach, /* samples_foreach */
|
||||
uwatec_smart_parser_destroy /* destroy */
|
||||
NULL /* destroy */
|
||||
};
|
||||
|
||||
static const
|
||||
@ -626,16 +625,6 @@ error_free:
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
uwatec_smart_parser_destroy (dc_parser_t *abstract)
|
||||
{
|
||||
// Free memory.
|
||||
free (abstract);
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static dc_status_t
|
||||
uwatec_smart_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsigned int size)
|
||||
{
|
||||
|
||||
@ -209,9 +209,6 @@ zeagle_n2ition3_device_close (dc_device_t *abstract)
|
||||
dc_status_set_error(&status, DC_STATUS_IO);
|
||||
}
|
||||
|
||||
// Free memory.
|
||||
free (device);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user