sr: demo: s/struct databag/struct context/.

This commit is contained in:
Uwe Hermann 2012-03-14 22:09:52 +01:00
parent ab331b679c
commit 455b26edba
1 changed files with 5 additions and 5 deletions

View File

@ -66,7 +66,7 @@ enum {
/* FIXME: Should not be global. */ /* FIXME: Should not be global. */
SR_PRIV GIOChannel *channels[2]; SR_PRIV GIOChannel *channels[2];
struct databag { struct context {
int pipe_fds[2]; int pipe_fds[2];
uint8_t sample_generator; uint8_t sample_generator;
uint8_t thread_running; uint8_t thread_running;
@ -285,7 +285,7 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value)
static void samples_generator(uint8_t *buf, uint64_t size, void *data) static void samples_generator(uint8_t *buf, uint64_t size, void *data)
{ {
static uint64_t p = 0; static uint64_t p = 0;
struct databag *ctx = data; struct context *ctx = data;
uint64_t i; uint64_t i;
/* TODO: Needed? */ /* TODO: Needed? */
@ -323,7 +323,7 @@ static void samples_generator(uint8_t *buf, uint64_t size, void *data)
/* Thread function */ /* Thread function */
static void thread_func(void *data) static void thread_func(void *data)
{ {
struct databag *ctx = data; struct context *ctx = data;
uint8_t buf[BUFSIZE]; uint8_t buf[BUFSIZE];
uint64_t nb_to_send = 0; uint64_t nb_to_send = 0;
int bytes_written; int bytes_written;
@ -414,10 +414,10 @@ static int hw_dev_acquisition_start(int dev_index, void *cb_data)
{ {
struct sr_datafeed_packet *packet; struct sr_datafeed_packet *packet;
struct sr_datafeed_header *header; struct sr_datafeed_header *header;
struct databag *ctx; struct context *ctx;
/* TODO: 'ctx' is never g_free()'d? */ /* TODO: 'ctx' is never g_free()'d? */
if (!(ctx = g_try_malloc(sizeof(struct databag)))) { if (!(ctx = g_try_malloc(sizeof(struct context)))) {
sr_err("demo: %s: ctx malloc failed", __func__); sr_err("demo: %s: ctx malloc failed", __func__);
return SR_ERR_MALLOC; return SR_ERR_MALLOC;
} }