summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2018-10-15 00:09:41 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2018-10-16 21:49:42 +0200
commit0dba8d303d5788539a5582a48444e8ecb5575b4f (patch)
tree32ee4c626753b2c8153f5798b28f0ddc57196881
parent03a986ea61ec565b5e366b950759d4ad753d3aea (diff)
downloadlibsigrokdecode-0dba8d303d5788539a5582a48444e8ecb5575b4f.tar.gz
libsigrokdecode-0dba8d303d5788539a5582a48444e8ecb5575b4f.zip
instance.c: Avoid 4 unneeded forward declarations.
-rw-r--r--instance.c65
1 files changed, 30 insertions, 35 deletions
diff --git a/instance.c b/instance.c
index 99caabb..99c5012 100644
--- a/instance.c
+++ b/instance.c
@@ -30,11 +30,6 @@
extern SRD_PRIV GSList *sessions;
-static void srd_inst_join_decode_thread(struct srd_decoder_inst *di);
-static void srd_inst_reset_state(struct srd_decoder_inst *di);
-static void oldpins_array_seed(struct srd_decoder_inst *di);
-static void oldpins_array_free(struct srd_decoder_inst *di);
-
/** @endcond */
/**
@@ -51,6 +46,36 @@ static void oldpins_array_free(struct srd_decoder_inst *di);
* @{
*/
+static void oldpins_array_seed(struct srd_decoder_inst *di)
+{
+ size_t count;
+ GArray *arr;
+
+ if (!di)
+ return;
+ if (di->old_pins_array)
+ return;
+
+ count = di->dec_num_channels;
+ arr = g_array_sized_new(FALSE, TRUE, sizeof(uint8_t), count);
+ g_array_set_size(arr, count);
+ memset(arr->data, SRD_INITIAL_PIN_SAME_AS_SAMPLE0, count);
+ di->old_pins_array = arr;
+}
+
+static void oldpins_array_free(struct srd_decoder_inst *di)
+{
+ if (!di)
+ return;
+ if (!di->old_pins_array)
+ return;
+
+ srd_dbg("%s: Releasing initial pin state.", di->inst_id);
+
+ g_array_free(di->old_pins_array, TRUE);
+ di->old_pins_array = NULL;
+}
+
/**
* Set one or more options in a decoder instance.
*
@@ -626,36 +651,6 @@ SRD_API int srd_inst_initial_pins_set_all(struct srd_decoder_inst *di, GArray *i
return SRD_OK;
}
-static void oldpins_array_seed(struct srd_decoder_inst *di)
-{
- size_t count;
- GArray *arr;
-
- if (!di)
- return;
- if (di->old_pins_array)
- return;
-
- count = di->dec_num_channels;
- arr = g_array_sized_new(FALSE, TRUE, sizeof(uint8_t), count);
- g_array_set_size(arr, count);
- memset(arr->data, SRD_INITIAL_PIN_SAME_AS_SAMPLE0, count);
- di->old_pins_array = arr;
-}
-
-static void oldpins_array_free(struct srd_decoder_inst *di)
-{
- if (!di)
- return;
- if (!di->old_pins_array)
- return;
-
- srd_dbg("%s: Releasing initial pin state.", di->inst_id);
-
- g_array_free(di->old_pins_array, TRUE);
- di->old_pins_array = NULL;
-}
-
/** @private */
SRD_PRIV int srd_inst_start(struct srd_decoder_inst *di)
{