Its backend, input_module.cleanup(), is now also a void function.
SR_API struct sr_dev_inst *sr_input_dev_inst_get(const struct sr_input *in);
SR_API int sr_input_send(const struct sr_input *in, GString *buf);
SR_API int sr_input_end(const struct sr_input *in);
-SR_API int sr_input_free(const struct sr_input *in);
+SR_API void sr_input_free(const struct sr_input *in);
/*--- output/output.c -------------------------------------------------------*/
return ret;
}
-static int cleanup(struct sr_input *in)
+static void cleanup(struct sr_input *in)
{
struct context *inc;
if (inc->sample_buffer)
g_free(inc->sample_buffer);
-
- return SR_OK;
}
static struct sr_option options[] = {
*
* @since 0.4.0
*/
-SR_API int sr_input_free(const struct sr_input *in)
+SR_API void sr_input_free(const struct sr_input *in)
{
- int ret;
-
if (!in)
- return SR_ERR_ARG;
+ return;
- ret = SR_OK;
if (in->module->cleanup)
- ret = in->module->cleanup((struct sr_input *)in);
+ in->module->cleanup((struct sr_input *)in);
if (in->sdi)
sr_dev_inst_free(in->sdi);
if (in->buf->len > 64) {
/* That seems more than just some sub-unitsize leftover... */
sr_warn("Found %d unprocessed bytes at free time.", in->buf->len);
}
- if (in->buf)
- g_string_free(in->buf, TRUE);
+ g_string_free(in->buf, TRUE);
g_free(in->priv);
g_free((gpointer)in);
-
- return ret;
}
return ret;
}
-static int cleanup(struct sr_input *in)
+static void cleanup(struct sr_input *in)
{
struct context *inc;
inc = in->priv;
g_slist_free_full(inc->channels, free_channel);
-
- return SR_OK;
}
static struct sr_option options[] = {
* @retval SR_OK Success
* @retval other Negative error code.
*/
- int (*cleanup) (struct sr_input *in);
+ void (*cleanup) (struct sr_input *in);
};
/** Output module instance. */