]> sigrok.org Git - libsigrok.git/commitdiff
Minor whitespace and cosmetic fixes.
authorUwe Hermann <redacted>
Tue, 22 Dec 2015 18:36:19 +0000 (19:36 +0100)
committerUwe Hermann <redacted>
Thu, 7 Jan 2016 22:50:17 +0000 (23:50 +0100)
src/hardware/korad-kaxxxxp/protocol.c
src/hardware/maynuo-m97/protocol.c
src/hardware/norma-dmm/api.c
src/session_file.c

index 93f1414650fa9e15551e3eebfc4fa96ca0608606..60c4545581fbe92e6675dcc441059683823fd62f 100644 (file)
@@ -88,7 +88,7 @@ SR_PRIV int korad_kaxxxxp_set_value(struct sr_serial_dev_inst *serial,
        give_device_time_to_process(devc);
 
        msg[20] = 0;
-       switch(devc->target){
+       switch (devc->target) {
        case KAXXXXP_CURRENT:
        case KAXXXXP_VOLTAGE:
        case KAXXXXP_STATUS:
@@ -158,7 +158,7 @@ SR_PRIV int korad_kaxxxxp_query_value(struct sr_serial_dev_inst *serial,
 
        give_device_time_to_process(devc);
 
-       switch(devc->target){
+       switch (devc->target) {
        case KAXXXXP_CURRENT:
                /* Read current from device. */
                ret = korad_kaxxxxp_send_cmd(serial, "IOUT1?");
index a85989f260e8d3457115e747b8976b4d18f5a3d0..085d379f1c36635a0c07876329c4c8529bd5b924 100644 (file)
@@ -103,7 +103,7 @@ SR_PRIV int maynuo_m97_get_model_version(struct sr_modbus_dev_inst *modbus,
 
 SR_PRIV const char *maynuo_m97_mode_to_str(enum maynuo_m97_mode mode)
 {
-       switch(mode) {
+       switch (mode) {
        case CC:             return "CC";
        case CV:             return "CV";
        case CW:             return "CP";
index 6dc9ed87da25ffe21b512ff36a16ad8edff78f6f..9e0be393113987ce81fe730082618f17177f9efe 100644 (file)
@@ -46,10 +46,7 @@ SR_PRIV struct sr_dev_driver siemens_b102x_driver_info;
 
 static const char *get_brandstr(struct sr_dev_driver *drv)
 {
-       if (drv == &norma_dmm_driver_info)
-               return "Norma";
-       else
-               return "Siemens";
+       return (drv == &norma_dmm_driver_info) ? "Norma" : "Siemens";
 }
 
 static const char *get_typestr(int type, struct sr_dev_driver *drv)
@@ -59,12 +56,13 @@ static const char *get_typestr(int type, struct sr_dev_driver *drv)
                {"DM920", "B1025"},
                {"DM930", "B1026"},
                {"DM940", "B1027"},
-               {"DM950", "B1028"}};
+               {"DM950", "B1028"},
+       };
 
        if ((type < 1) || (type > 5))
                return "Unknown type!";
 
-       return nameref[type-1][(drv == &siemens_b102x_driver_info)];
+       return nameref[type - 1][(drv == &siemens_b102x_driver_info)];
 }
 
 static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
@@ -80,11 +78,10 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
        struct sr_config *src;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
-       int len, cnt;
+       int len, cnt, auxtype;
        const char *conn, *serialcomm;
        char *buf;
        char req[10];
-       int auxtype;
 
        devices = NULL;
        drvc = drv->context;
@@ -131,7 +128,7 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
                        continue;
                buf[BUF_MAX - 1] = '\0';
 
-               /* Match ID string, e.g. "1834 065 V1.06,IF V1.02" (DM950) */
+               /* Match ID string, e.g. "1834 065 V1.06,IF V1.02" (DM950). */
                if (g_regex_match_simple("^1834 [^,]*,IF V*", (char *)buf, 0, 0)) {
                        auxtype = xgittoint(buf[7]);
                        sr_spew("%s %s DMM %s detected!", get_brandstr(drv), get_typestr(auxtype, drv), buf + 9);
index 467c581283a0e55899003f469dea476bcd1e07c9..149e6d1a0237000c93e85b793310603ca85fd8e2 100644 (file)
@@ -284,7 +284,7 @@ SR_API int sr_session_load(struct sr_context *ctx, const char *filename,
                                                                FALSE, channelname);
                                        }
                                } else if (!strncmp(keys[j], "probe", 5)) {
-                                       tmp_u64 = g_ascii_strtoull(keys[j]+5, NULL, 10);
+                                       tmp_u64 = g_ascii_strtoull(keys[j] + 5, NULL, 10);
                                        if (!sdi || tmp_u64 == 0 || tmp_u64 > G_MAXINT) {
                                                ret = SR_ERR_DATA;
                                                break;