]> sigrok.org Git - libsigrok.git/commitdiff
Cosmetics.
authorUwe Hermann <redacted>
Sat, 15 Jan 2011 14:43:25 +0000 (15:43 +0100)
committerUwe Hermann <redacted>
Sat, 15 Jan 2011 14:57:54 +0000 (15:57 +0100)
backend.c
datastore.c
hwplugin.c
output/common.c
sigrok.h

index 9ce8c5b1ac3c6c1acbbacf63e6e71142696418e3..4edc78123b41269d5c8aba4e7902956ec53bcc78 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -25,6 +25,7 @@ int sigrok_init(void)
        return load_hwplugins();
 }
 
        return load_hwplugins();
 }
 
+/* TODO: Should return int to be able to report back error codes. */
 void sigrok_cleanup(void)
 {
        device_close_all();
 void sigrok_cleanup(void)
 {
        device_close_all();
index 9527ff00f811eff2dcc4175e874252aa10db2690..4ca23a4c8e858daa2100ee6f29bc99fc1310181b 100644 (file)
@@ -49,7 +49,7 @@ int datastore_destroy(struct datastore *ds)
 
        if (!ds)
                return SIGROK_ERR;
 
        if (!ds)
                return SIGROK_ERR;
-       
+
        for (chunk = ds->chunklist; chunk; chunk = chunk->next)
                g_free(chunk->data);
        g_slist_free(ds->chunklist);
        for (chunk = ds->chunklist; chunk; chunk = chunk->next)
                g_free(chunk->data);
        g_slist_free(ds->chunklist);
index 1ba4dbb0a623afc78fff2166130331bdd7790984..0a30aad0016263f5ecc0012ba6f0f7fb6c731ccd 100644 (file)
@@ -62,7 +62,6 @@ extern struct device_plugin asix_sigma_plugin_info;
 extern struct device_plugin link_mso19_plugin_info;
 #endif
 
 extern struct device_plugin link_mso19_plugin_info;
 #endif
 
-
 /* TODO: No linked list needed, this can be a simple array. */
 int load_hwplugins(void)
 {
 /* TODO: No linked list needed, this can be a simple array. */
 int load_hwplugins(void)
 {
index 39eb9a02a8f63f539cf414bb7db53a2e476ef4fe..c10d4d2be932d945d2559f8cbb17a2cf55d0ae91 100644 (file)
@@ -38,7 +38,7 @@ char *sigrok_samplerate_string(uint64_t samplerate)
        int r;
 
        o = malloc(30 + 1); /* Enough for a uint64_t as string + " GHz". */
        int r;
 
        o = malloc(30 + 1); /* Enough for a uint64_t as string + " GHz". */
-       if (o == NULL)
+       if (!o)
                return NULL;
 
        if (samplerate >= GHZ(1))
                return NULL;
 
        if (samplerate >= GHZ(1))
@@ -59,7 +59,6 @@ char *sigrok_samplerate_string(uint64_t samplerate)
        return o;
 }
 
        return o;
 }
 
-
 /**
  * Convert a numeric samplerate value to the "natural" string representation
  * of its period.
 /**
  * Convert a numeric samplerate value to the "natural" string representation
  * of its period.
@@ -76,7 +75,7 @@ char *sigrok_period_string(uint64_t frequency)
        int r;
 
        o = malloc(30 + 1); /* Enough for a uint64_t as string + " ms". */
        int r;
 
        o = malloc(30 + 1); /* Enough for a uint64_t as string + " ms". */
-       if (o == NULL)
+       if (!o)
                return NULL;
 
        if (frequency >= GHZ(1))
                return NULL;
 
        if (frequency >= GHZ(1))
@@ -96,4 +95,3 @@ char *sigrok_period_string(uint64_t frequency)
 
        return o;
 }
 
        return o;
 }
-
index 26bf9fcc089bf0068e135027fc83d5cd76c159ee..2f31a34b252421555525f752529b247da4e96da5 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -27,7 +27,6 @@
 #include <glib.h>
 #include <libusb.h>
 
 #include <glib.h>
 #include <libusb.h>
 
-
 /*
  * Status/error codes returned by libsigrok functions.
  *
 /*
  * Status/error codes returned by libsigrok functions.
  *
@@ -54,7 +53,6 @@
 #define MAX_NUM_PROBES 64
 #define MAX_PROBENAME_LEN 32
 
 #define MAX_NUM_PROBES 64
 #define MAX_PROBENAME_LEN 32
 
-
 /* Handy little macros */
 #define KHZ(n) ((n) * 1000)
 #define MHZ(n) ((n) * 1000000)
 /* Handy little macros */
 #define KHZ(n) ((n) * 1000)
 #define MHZ(n) ((n) * 1000000)
 #define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
 #endif
 
 #define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
 #endif
 
-
 typedef int (*receive_data_callback) (int fd, int revents, void *user_data);
 
 typedef int (*receive_data_callback) (int fd, int revents, void *user_data);
 
-
 /* Data types used by hardware plugins for set_configuration() */
 enum {
        T_UINT64,
 /* Data types used by hardware plugins for set_configuration() */
 enum {
        T_UINT64,
@@ -91,8 +87,6 @@ struct protocol {
        int stackindex;
 };
 
        int stackindex;
 };
 
-
-
 /* datafeed_packet.type values */
 enum {
        DF_HEADER,
 /* datafeed_packet.type values */
 enum {
        DF_HEADER,
@@ -119,8 +113,6 @@ struct datafeed_header {
        int num_logic_probes;
 };
 
        int num_logic_probes;
 };
 
-
-
 struct input {
        struct input_format *format;
        char *param;
 struct input {
        struct input_format *format;
        char *param;
@@ -135,8 +127,6 @@ struct input_format {
        int (*loadfile) (struct input *in, const char *filename);
 };
 
        int (*loadfile) (struct input *in, const char *filename);
 };
 
-
-
 struct output {
        struct output_format *format;
        struct device *device;
 struct output {
        struct output_format *format;
        struct device *device;
@@ -155,7 +145,6 @@ struct output_format {
                      uint64_t *length_out);
 };
 
                      uint64_t *length_out);
 };
 
-
 struct analyzer {
        char *name;
        char *filename;
 struct analyzer {
        char *name;
        char *filename;
@@ -165,7 +154,6 @@ struct analyzer {
         */
 };
 
         */
 };
 
-
 /* Size of a chunk in units */
 #define DATASTORE_CHUNKSIZE 512000
 
 /* Size of a chunk in units */
 #define DATASTORE_CHUNKSIZE 512000
 
@@ -176,7 +164,6 @@ struct datastore {
        GSList *chunklist;
 };
 
        GSList *chunklist;
 };
 
-
 /*
  * This represents a generic device connected to the system.
  * For device-specific information, ask the plugin. The plugin_index refers
 /*
  * This represents a generic device connected to the system.
  * For device-specific information, ask the plugin. The plugin_index refers
@@ -209,7 +196,6 @@ struct probe {
 
 extern GSList *devices;
 
 
 extern GSList *devices;
 
-
 /* Hardware plugin capabilities */
 enum {
        HWCAP_DUMMY,             /* Used to terminate lists */
 /* Hardware plugin capabilities */
 enum {
        HWCAP_DUMMY,             /* Used to terminate lists */
@@ -235,7 +221,6 @@ struct hwcap_option {
        char *shortname;
 };
 
        char *shortname;
 };
 
-
 struct sigrok_device_instance {
        int index;
        int status;
 struct sigrok_device_instance {
        int index;
        int status;