static int save_afd(struct audio_file_data *afd)
{
size_t size = sizeof(*afd) + sizeof_chunk_table(&afd->afhi);
static int save_afd(struct audio_file_data *afd)
{
size_t size = sizeof(*afd) + sizeof_chunk_table(&afd->afhi);
#define GET_NUM_DIGITS(x, num) { \
typeof((x)) _tmp = PARA_ABS(x); \
*num = 1; \
#define GET_NUM_DIGITS(x, num) { \
typeof((x)) _tmp = PARA_ABS(x); \
*num = 1; \
GET_NUM_DIGITS(d->afsi.num_played, &num_digits);
w->num_played_width = PARA_MAX(w->num_played_width, num_digits);
/* get the number of chars to print this amount of time */
GET_NUM_DIGITS(d->afsi.num_played, &num_digits);
w->num_played_width = PARA_MAX(w->num_played_width, num_digits);
/* get the number of chars to print this amount of time */
- tmp = get_duration_width(d->afhi.seconds_total);
- w->duration_width = PARA_MAX(w->duration_width, tmp);
+ num_digits = get_duration_width(d->afhi.seconds_total);
+ w->duration_width = PARA_MAX(w->duration_width, num_digits);
GET_NUM_DIGITS(d->afsi.amp, &num_digits);
w->amp_width = PARA_MAX(w->amp_width, num_digits);
if (options->flags & LS_FLAG_ADMISSIBLE_ONLY) {
GET_NUM_DIGITS(d->afsi.amp, &num_digits);
w->amp_width = PARA_MAX(w->amp_width, num_digits);
if (options->flags & LS_FLAG_ADMISSIBLE_ONLY) {
struct afs_info default_afsi = {.last_played = 0};
struct para_buffer msg = {.max_size = SHMMAX,
.max_size_handler = pass_buffer_as_shm, .private_data = &fd};
struct afs_info default_afsi = {.last_played = 0};
struct para_buffer msg = {.max_size = SHMMAX,
.max_size_handler = pass_buffer_as_shm, .private_data = &fd};
- uint16_t afhi_offset = read_u16(buf + CAB_AFHI_OFFSET_POS);
- uint16_t chunks_offset = read_u16(buf + CAB_CHUNKS_OFFSET_POS);
+ afhi_offset = read_u16(buf + CAB_AFHI_OFFSET_POS);
+ chunks_offset = read_u16(buf + CAB_CHUNKS_OFFSET_POS);
if (pad->flags & ADD_FLAG_VERBOSE) {
send_ret = send_va_buffer(pad->fd, "adding %s\n", path);
if (send_ret < 0)
if (pad->flags & ADD_FLAG_VERBOSE) {
send_ret = send_va_buffer(pad->fd, "adding %s\n", path);
if (send_ret < 0)
struct osl_row *row, const char *name, void *data)
{
struct com_rm_action_data *crd = data;
struct osl_row *row, const char *name, void *data)
{
struct com_rm_action_data *crd = data;
if (crd->flags & RM_FLAG_VERBOSE) {
ret = para_printf(&crd->pb, "removing %s\n", name);
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)
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));
struct pattern_match_data pmd = {
.table = audio_file_table,
.loop_col_num = AFTCOL_HASH,
struct pattern_match_data pmd = {
.table = audio_file_table,
.loop_col_num = AFTCOL_HASH,
- 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);