printf("\n");
/* TODO: Error handling. */
- srd_init();
+ srd_init(NULL);
printf("Supported protocol decoders:\n");
for (l = srd_list_decoders(); l; l = l->next) {
{
const struct sr_device_instance *sdi;
- sr_device_get_info(device, SR_DI_INSTANCE, (const void **) &sdi);
+ sr_device_get_info(device, SR_DI_INSTANCE, (const void **)&sdi);
if (sdi->vendor && sdi->vendor[0])
printf("%s ", sdi->vendor);
print_device_line(device);
if (sr_device_get_info(device, SR_DI_TRIGGER_TYPES,
- (const void **) &charopts) == SR_OK) {
+ (const void **)&charopts) == SR_OK) {
printf("Supported triggers: ");
while (*charopts) {
printf("%c ", *charopts);
if (hwo->capability == SR_HWCAP_PATTERN_MODE) {
printf(" %s", hwo->shortname);
if (sr_device_get_info(device, SR_DI_PATTERNMODES,
- (const void **) &stropts) == SR_OK) {
+ (const void **)&stropts) == SR_OK) {
printf(" - supported modes:\n");
for (i = 0; stropts[i]; i++)
printf(" %s\n", stropts[i]);
printf(" %s", hwo->shortname);
/* Supported samplerates */
if (sr_device_get_info(device, SR_DI_SAMPLERATES,
- (const void **) &samplerates) != SR_OK) {
+ (const void **)&samplerates) != SR_OK) {
printf("\n");
continue;
}
return 0;
}
-void show_pd_annotation(struct srd_proto_data *pdata)
+void show_pd_annotation(struct srd_proto_data *pdata, void *user_data)
{
int i;
char **annotations;
+ /* 'user_data' is not used in this specific callback. */
+ (void)user_data;
+
if (pdata->ann_format != 0) {
/* CLI only shows the default annotation format. */
return;
const uint64_t *samplerate;
sr_device_get_info(device, SR_DI_CUR_SAMPLERATE,
- (const void **) &samplerate);
- limit_samples = (*samplerate) * time_msec / (uint64_t) 1000;
+ (const void **)&samplerate);
+ limit_samples = (*samplerate) * time_msec / (uint64_t)1000;
}
if (limit_samples == 0) {
printf("Not enough time at this samplerate.\n");
return 1;
if (opt_pds) {
- if (srd_init() != SRD_OK) {
+ if (srd_init(NULL) != SRD_OK) {
printf("Failed to initialize sigrokdecode\n");
return 1;
}
return 1;
}
if (srd_register_callback(SRD_OUTPUT_ANN,
- show_pd_annotation) != SRD_OK) {
+ show_pd_annotation, NULL) != SRD_OK) {
printf("Failed to register protocol decoder callback\n");
return 1;
}