#define GET_NUM_DIGITS(x, num) { \
typeof((x)) _tmp = PARA_ABS(x); \
*num = 1; \
- if ((x)) \
+ if ((_tmp)) \
while ((_tmp) > 9) { \
(_tmp) /= 10; \
(*num)++; \
return ret;
}
+/**
+ * Write a list of audio-file related status items with empty values.
+ *
+ * \param buf Result pointer.
+ *
+ * This is used by vss when currently no audio file is open.
+ */
void make_empty_status_items(char *buf)
{
sprintf(buf,
prepare_ls_row);
if (ret < 0)
goto out;
- ret = opts->num_patterns? -E_NO_MATCH : 0;
if (!opts->num_matching_paths)
goto out;
ret = sort_matching_paths(opts);
afs_event(AUDIO_FILE_ADD, &msg, aft_row);
out:
if (ret < 0)
- ret = para_printf(&msg, "%s\n", para_strerror(-ret));
+ para_printf(&msg, "%s\n", para_strerror(-ret));
if (msg.offset)
pass_buffer_as_shm(msg.buf, msg.offset, &fd);
free(msg.buf);
struct osl_row *row, const char *name, void *data)
{
struct com_rm_action_data *crd = data;
- int ret, ret2;
+ int ret;
if (crd->flags & RM_FLAG_VERBOSE) {
ret = para_printf(&crd->pb, "removing %s\n", name);
afs_event(AUDIO_FILE_REMOVE, &crd->pb, row);
ret = osl_del_row(audio_file_table, row);
if (ret < 0)
- ret2 = para_printf(&crd->pb, "%s: %s\n", name,
- para_strerror(-ret));
+ para_printf(&crd->pb, "%s: %s\n", name, para_strerror(-ret));
else
crd->num_removed++;
return ret;
pmd.fnmatch_flags |= FNM_PATHNAME;
ret = for_each_matching_row(&pmd);
if (ret < 0) {
- ret = para_printf(&crd.pb, "%s\n", para_strerror(-ret));
+ para_printf(&crd.pb, "%s\n", para_strerror(-ret));
return;
}
if (!crd.num_removed && !(crd.flags & RM_FLAG_FORCE))
ret = for_each_matching_row(&pmd);
out:
if (ret < 0)
- ret = para_printf(&cad.pb, "%s\n", para_strerror(-ret));
+ para_printf(&cad.pb, "%s\n", para_strerror(-ret));
else if (cad.flags & CPSI_FLAG_VERBOSE) {
if (cad.num_copied)
- ret = para_printf(&cad.pb, "copied requested afsi from %s "
- "to %u files\n",
- source_path, cad.num_copied);
+ para_printf(&cad.pb, "copied requested afsi from %s "
+ "to %u files\n", source_path, cad.num_copied);
else
- ret = para_printf(&cad.pb, "nothing copied\n");
+ para_printf(&cad.pb, "nothing copied\n");
}
if (cad.pb.offset)
pass_buffer_as_shm(cad.pb.buf, cad.pb.offset, &fd);