This option is new in gcc-4, so do not activate it by default.
# invalid option for gcc-3.3.3
# DEBUG_CPPFLAGS += -Wextra
# DEBUG_CPPFLAGS += -Wold-style-definition
+# DEBUG_CPPFLAGS += -Wdeclaration-after-statement
# many warnings about trivial stuff
# CPPFLAGS += -Wconversion
static void aacdec_open(struct filter_node *fn)
{
- fn->private_data = para_calloc(sizeof(struct private_aacdec_data));
- struct private_aacdec_data *padd = fn->private_data;
+ struct private_aacdec_data *padd = para_calloc(sizeof(*padd));
+ fn->private_data = padd;
fn->bufsize = AAC_OUTBUF_SIZE;
fn->buf = para_calloc(fn->bufsize);
padd->handle = aac_open();
static int save_afd(struct audio_file_data *afd)
{
size_t size = sizeof(*afd) + sizeof_chunk_table(&afd->afhi);
-
- PARA_DEBUG_LOG("size: %zu\n", size);
int shmid, ret = shm_new(size);
void *shm_afd;
char *buf;
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, chunks_offset;
hash = (HASH_TYPE *)buf + CAB_HASH_OFFSET;
hash_to_asc(hash, asc);;
goto out;
}
/* no hs or force mode, child must have sent afhi */
- 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);
objs[AFTCOL_AFHI].data = buf + afhi_offset;
objs[AFTCOL_AFHI].size = chunks_offset - afhi_offset;
};
int ret;
char *source_path = (char *)query->data + sizeof(cad.flags);
-
- ret = get_afsi_of_path(source_path, &cad.source_afsi);
- if (ret < 0)
- goto out;
struct pattern_match_data pmd = {
.table = audio_file_table,
.loop_col_num = AFTCOL_HASH,
.data = &cad,
.action = copy_selector_info
};
+
+ ret = get_afsi_of_path(source_path, &cad.source_afsi);
+ if (ret < 0)
+ goto out;
ret = for_each_matching_row(&pmd);
out:
if (ret < 0)
__malloc static void *alsa_parse_config(const char *options)
{
+ int ret;
struct alsa_write_args_info *conf
= para_calloc(sizeof(struct alsa_write_args_info));
+
PARA_INFO_LOG("options: %s, %zd\n", options, strcspn(options, " \t"));
- int ret = alsa_cmdline_parser_string(options, conf, "alsa_write");
+ ret = alsa_cmdline_parser_string(options, conf, "alsa_write");
if (ret)
goto err_out;
PARA_INFO_LOG("help given: %d\n", conf->help_given);
struct osl_object objs[NUM_ATT_COLUMNS];
struct osl_row *row;
unsigned char bitnum;
- len = strlen(p);
struct addatt_event_data aed;
+ len = strlen(p);
if (!len || p[len - 1] == '-' || p[len - 1] == '+') {
ret2 = para_printf(&pb, "invalid attribute name: %s\n", p);
if (ret2 < 0)
__malloc static void *file_write_parse_config(const char *options)
{
- PARA_INFO_LOG("options: %s\n", options);
struct file_write_args_info *conf
= para_calloc(sizeof(struct file_write_args_info));
int ret = file_cmdline_parser_string(options, conf, "file_write");
+
PARA_INFO_LOG("conf->filename_given: %d\n", conf->filename_given);
if (!ret)
return conf;
static void mp3dec_open(struct filter_node *fn)
{
- fn->private_data = para_calloc(sizeof(struct private_mp3dec_data));
- struct private_mp3dec_data *pmd = fn->private_data;
+ struct private_mp3dec_data *pmd = para_calloc(sizeof(*pmd));
+ fn->private_data = pmd;
mad_stream_init(&pmd->stream);
mad_frame_init(&pmd->frame);
mad_synth_init(&pmd->synth);
*/
int para_lseek(int fd, off_t *offset, int whence)
{
- *offset = lseek(fd, *offset, whence);
int ret = -E_LSEEK;
+
+ *offset = lseek(fd, *offset, whence);
if (*offset == -1)
return ret;
return 1;
goto out;
rollback: /* rollback all changes made, ignore further errors */
for (i--; i >= 0; i--) {
+ enum osl_storage_type st;
+
cd = get_column_description(t->desc, i);
- enum osl_storage_type st = cd->storage_type;
+ st = cd->storage_type;
if (st == OSL_NO_STORAGE)
continue;
*/
int rb_rank(struct rb_node *node, unsigned *rank)
{
- *rank = 1;
struct rb_node *parent;
+ *rank = 1;
if (!node)
return -1;
if (node->rb_left)
*/
__must_check __malloc void *para_malloc(size_t size)
{
- assert(size);
- void *p = malloc(size);
+ void *p;
+ assert(size);
+ p = malloc(size);
if (!p) {
PARA_EMERG_LOG("malloc failed (size = %zu), aborting\n",
size);