code cleanup

This commit is contained in:
Bert Vermeulen 2011-01-11 23:49:32 +01:00
parent a61b0e6a35
commit 78ed642035
1 changed files with 7 additions and 1 deletions

View File

@ -112,8 +112,8 @@ static int init(struct output *o, int default_spl)
} }
snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING); snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
num_probes = g_slist_length(o->device->probes);
if (o->device->plugin) { if (o->device->plugin) {
num_probes = g_slist_length(o->device->probes);
samplerate = *((uint64_t *) o->device->plugin->get_device_info( samplerate = *((uint64_t *) o->device->plugin->get_device_info(
o->device->plugin_index, DI_CUR_SAMPLERATE)); o->device->plugin_index, DI_CUR_SAMPLERATE));
if (!(samplerate_s = sigrok_samplerate_string(samplerate))) { if (!(samplerate_s = sigrok_samplerate_string(samplerate))) {
@ -154,6 +154,8 @@ static int event(struct output *o, int event_type, char **data_out,
switch (event_type) { switch (event_type) {
case DF_TRIGGER: case DF_TRIGGER:
ctx->mark_trigger = ctx->spl_cnt; ctx->mark_trigger = ctx->spl_cnt;
*data_out = NULL;
*length_out = 0;
break; break;
case DF_END: case DF_END:
outsize = ctx->num_enabled_probes outsize = ctx->num_enabled_probes
@ -166,6 +168,10 @@ static int event(struct output *o, int event_type, char **data_out,
free(o->internal); free(o->internal);
o->internal = NULL; o->internal = NULL;
break; break;
default:
*data_out = NULL;
*length_out = 0;
break;
} }
return SIGROK_OK; return SIGROK_OK;