From: Uwe Hermann Date: Fri, 12 Apr 2013 16:44:28 +0000 (+0200) Subject: rigol-ds1xx2: Whitespace, minor fix. X-Git-Tag: dsupstream~167 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=169dbe8577c2f7570f61799a064f95b39b3b6fe3;p=libsigrok.git rigol-ds1xx2: Whitespace, minor fix. Return SR_ERR_MALLOC for failed malloc, not SR_ERR. --- diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index 073dc1de..cdbdaad6 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -483,8 +483,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi) hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); break; case SR_CONF_COUPLING: - *data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling)); - break; + *data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling)); + break; case SR_CONF_VDIV: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); for (i = 0; i < ARRAY_SIZE(vdivs); i++) { diff --git a/hardware/rigol-ds1xx2/protocol.c b/hardware/rigol-ds1xx2/protocol.c index fcac2cf5..d95716d7 100644 --- a/hardware/rigol-ds1xx2/protocol.c +++ b/hardware/rigol-ds1xx2/protocol.c @@ -155,7 +155,7 @@ static int get_cfg_float(const struct sr_dev_inst *sdi, char *cmd, float *f) if (get_cfg(sdi, cmd, buf) != SR_OK) return SR_ERR; *f = strtof(buf, &e); - if (e == buf || (fpclassify(*f) & (FP_ZERO|FP_NORMAL)) == 0) { + if (e == buf || (fpclassify(*f) & (FP_ZERO | FP_NORMAL)) == 0) { sr_dbg("failed to parse response to '%s': '%s'", cmd, buf); return SR_ERR; } @@ -167,7 +167,7 @@ static int get_cfg_string(const struct sr_dev_inst *sdi, char *cmd, char **buf) { if (!(*buf = g_try_malloc0(256))) - return SR_ERR; + return SR_ERR_MALLOC; if (get_cfg(sdi, cmd, *buf) != SR_OK) return SR_ERR;