Add a default case for switch over dc_family_t

This adds a default case which just errors out for the switch over
dc_family_t instead of checking a uninitialized variable if this was
ever called with something else than one of the expected dc-family
types.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2015-04-29 23:47:56 +02:00 committed by Dirk Hohndel
parent a4c35f1d63
commit c38b7d3922

View file

@ -963,6 +963,9 @@ dc_status_t libdc_buffer_parser(struct dive *dive, device_data_t *data, unsigned
case DC_FAMILY_HW_OSTC3: case DC_FAMILY_HW_OSTC3:
rc = hw_ostc_parser_create (&parser, data->context, data->deviceid, 1); rc = hw_ostc_parser_create (&parser, data->context, data->deviceid, 1);
break; break;
default:
report_error("Device type not handled!");
return DC_STATUS_UNSUPPORTED;
} }
if (rc != DC_STATUS_SUCCESS) { if (rc != DC_STATUS_SUCCESS) {
report_error("Error creating parser."); report_error("Error creating parser.");