]> sigrok.org Git - libsigrokdecode.git/commitdiff
sr/srd: Consistency fixes for callbacks.
authorUwe Hermann <redacted>
Wed, 29 Feb 2012 20:56:24 +0000 (21:56 +0100)
committerUwe Hermann <redacted>
Thu, 1 Mar 2012 22:49:25 +0000 (23:49 +0100)
 - Callback function pointer typedefs end with _t.

 - Variables holding callback functions are named 'cb' everywhere.

controller.c
sigrokdecode.h

index e49212ceab8d49a310446cac782ff01827506cea..ddac3baf16c7e18b904dfb4ce63818f43c19a681 100644 (file)
@@ -767,7 +767,7 @@ SRD_API int srd_session_feed(uint64_t start_samplenum, uint8_t *inbuf,
  * stack).
  *
  * @param output_type The output type this callback will receive. Only one
- * callback per output type can be registered.
+ *                    callback per output type can be registered.
  * @param cb The function to call.
  * @param user_data Unused.
  */
@@ -784,7 +784,7 @@ SRD_API int srd_register_callback(int output_type,
        }
 
        pd_cb->output_type = output_type;
-       pd_cb->callback = cb;
+       pd_cb->cb = cb;
        pd_cb->user_data = user_data;
        callbacks = g_slist_append(callbacks, pd_cb);
 
@@ -801,7 +801,7 @@ SRD_PRIV void *srd_find_callback(int output_type)
        for (l = callbacks; l; l = l->next) {
                pd_cb = l->data;
                if (pd_cb->output_type == output_type) {
-                       cb = pd_cb->callback;
+                       cb = pd_cb->cb;
                        break;
                }
        }
index 649cdc63e299ef76077c9e67418562fedbcad907..b70daced5f2e78b6f5defd66c4a043f547417e57 100644 (file)
@@ -178,7 +178,7 @@ typedef void (*srd_pd_output_callback_t)(struct srd_proto_data *pdata,
 
 struct srd_pd_callback {
        int output_type;
-       srd_pd_output_callback_t callback;
+       srd_pd_output_callback_t cb;
        void *user_data;
 };