From: Uwe Hermann Date: Wed, 2 Apr 2014 16:29:36 +0000 (+0200) Subject: sr_dev_inst_new(): Use NULL (not "") if version unknown/nonexisting. X-Git-Tag: libsigrok-0.3.0~85 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=55f98c65332cf08ff3f87480f07f8419fe49fab6;p=libsigrok.git sr_dev_inst_new(): Use NULL (not "") if version unknown/nonexisting. Unify the whole code-base to use NULL there, not a mix of "" and NULL. --- diff --git a/hardware/appa-55ii/api.c b/hardware/appa-55ii/api.c index 76460783..38c23b7c 100644 --- a/hardware/appa-55ii/api.c +++ b/hardware/appa-55ii/api.c @@ -96,7 +96,7 @@ static GSList *scan(GSList *options) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "APPA", "55II", ""))) + if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "APPA", "55II", NULL))) goto scan_cleanup; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 24d099c1..dbd4ddf9 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -36,7 +36,6 @@ #define USB_DESCRIPTION "ASIX SIGMA" #define USB_VENDOR_NAME "ASIX" #define USB_MODEL_NAME "SIGMA" -#define USB_MODEL_VERSION "" #define TRIGGER_TYPE "rf10" #define NUM_CHANNELS 16 @@ -458,7 +457,7 @@ static GSList *scan(GSList *options) /* Register SIGMA device. */ if (!(sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, USB_VENDOR_NAME, - USB_MODEL_NAME, USB_MODEL_VERSION))) { + USB_MODEL_NAME, NULL))) { sr_err("%s: sdi was NULL", __func__); goto free; } diff --git a/hardware/brymen-dmm/api.c b/hardware/brymen-dmm/api.c index ca4a742c..41a31812 100644 --- a/hardware/brymen-dmm/api.c +++ b/hardware/brymen-dmm/api.c @@ -75,7 +75,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Brymen", "BM85x", ""))) + if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Brymen", "BM85x", NULL))) goto scan_cleanup; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/hardware/conrad-digi-35-cpu/api.c b/hardware/conrad-digi-35-cpu/api.c index 2f24d189..01adcef8 100644 --- a/hardware/conrad-digi-35-cpu/api.c +++ b/hardware/conrad-digi-35-cpu/api.c @@ -95,7 +95,7 @@ static GSList *scan(GSList *options) sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", ""))) + if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL))) return NULL; sdi->conn = serial; diff --git a/hardware/gmc-mh-1x-2x/api.c b/hardware/gmc-mh-1x-2x/api.c index 09ed9c15..3c0a7aaf 100644 --- a/hardware/gmc-mh-1x-2x/api.c +++ b/hardware/gmc-mh-1x-2x/api.c @@ -224,7 +224,7 @@ static GSList *scan_1x_2x_rs232(GSList *options) if (model != METRAHIT_NONE) { sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model)); if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, - gmc_model_str(model), ""))) + gmc_model_str(model), NULL))) return NULL; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { sr_err("Device context malloc failed."); diff --git a/hardware/mic-985xx/api.c b/hardware/mic-985xx/api.c index 2709c530..7b0d680c 100644 --- a/hardware/mic-985xx/api.c +++ b/hardware/mic-985xx/api.c @@ -87,7 +87,7 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx) /* TODO: Fill in version from protocol response. */ if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, mic_devs[idx].vendor, - mic_devs[idx].device, ""))) + mic_devs[idx].device, NULL))) goto scan_cleanup; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index 96138743..136d2a7c 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -392,7 +392,7 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm) sr_info("Found device on port %s.", conn); if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, dmms[dmm].vendor, - dmms[dmm].device, ""))) + dmms[dmm].device, NULL))) goto scan_cleanup; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/hardware/teleinfo/api.c b/hardware/teleinfo/api.c index 0a490729..931e5994 100644 --- a/hardware/teleinfo/api.c +++ b/hardware/teleinfo/api.c @@ -92,7 +92,7 @@ static GSList *scan(GSList *options) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "EDF", "Teleinfo", ""))) + if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "EDF", "Teleinfo", NULL))) goto scan_cleanup; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {