Commit ec459459 authored by conrad's avatar conrad

clean up handling of CFLAGS in Makefile.am throughout, set -std=c99 and get

rid of most compile errors (XXX: except delcarations for random, fileno, strsep)


git-svn-id: http://svn.annodex.net/liboggz/trunk@2955 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 42f41d2e
......@@ -286,17 +286,11 @@ AM_CONDITIONAL(HAVE_OGG, [test "x$HAVE_OGG" = "xyes"])
dnl Use -Wall if we have gcc.
dnl changequote(,)dnl
if test "x$ac_cv_prog_gcc" = xyes ; then
CFLAGS="$CFLAGS -Wall -g"
CFLAGS="$CFLAGS -Wall -g -std=c99 -Wdeclaration-after-statement"
fi
dnl changequote([,])dnl
case "$target_os" in
darwin* | rhapsody*)
dnl Disable -Wall and -pedantic for Apple Darwin/Rhapsody.
dnl System headers on these systems are broken.
temp_CFLAGS=`echo $CFLAGS | sed "s/-Wall -pedantic//"`
CFLAGS=$temp_CFLAGS
;;
linux* | solaris*)
SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
;;
......
## Process this file with automake to produce Makefile.in
AM_CFLAGS = -Wall -pedantic -g
INCLUDES = -I$(top_srcdir)/include @OGG_CFLAGS@
OGGZDIR = ../liboggz
......
## Process this file with automake to produce Makefile.in
AM_CFLAGS = -Wall -pedantic
INCLUDES = $(INCLTDL) -I$(top_srcdir)/include @OGG_CFLAGS@
EXTRA_DIST = Version_script.in
......
......@@ -679,8 +679,6 @@ auto_calc_vorbis(ogg_int64_t now, oggz_stream_t *stream, ogg_packet *op) {
*/
int mode;
int size;
int prev_bit;
int next_bit;
int result;
mode = (op->packet[0] >> 1) & ((1 << info->log2_num_modes) - 1);
......@@ -876,8 +874,8 @@ int oggz_auto_identify (OGGZ *oggz, ogg_page *og, long serialno) {
int
oggz_auto_get_granulerate (OGGZ * oggz, ogg_packet * op, long serialno,
void * user_data) {
OggzReadPacket read_packet;
void * user_data)
{
int content = 0;
content = oggz_stream_get_content(oggz, serialno);
......
......@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "oggz_private.h"
#include "oggz_vector.h"
......
......@@ -263,8 +263,7 @@ int oggz_has_metrics (OGGZ * oggz);
int oggz_purge (OGGZ * oggz);
int oggz_auto_get_granulerate (OGGZ * oggz, ogg_packet * op, long serialno,
void * user_data);
/* metric_internal */
int
oggz_set_granulerate (OGGZ * oggz, long serialno,
......@@ -276,10 +275,22 @@ oggz_get_granulerate (OGGZ * oggz, long serialno,
ogg_int64_t * granulerate_n,
ogg_int64_t * granulerate_d);
int oggz_set_granuleshift (OGGZ * oggz, long serialno, int granuleshift);
int oggz_get_granuleshift (OGGZ * oggz, long serialno);
/* oggz_auto */
int
oggz_auto_get_granulerate (OGGZ * oggz, ogg_packet * op, long serialno,
void * user_data);
int
oggz_auto_read_comments (OGGZ * oggz, oggz_stream_t * stream, long serialno,
ogg_packet * op);
int oggz_auto_identify (OGGZ *oggz, ogg_page *og, long serialno);
/* comments */
int oggz_comments_init (oggz_stream_t * stream);
int oggz_comments_free (oggz_stream_t * stream);
......
......@@ -40,7 +40,7 @@
typedef int (*OggzFunc) (void * data);
typedef int (*OggzFindFunc) (void * data, long serialno);
typedef int (*OggzCmpFunc) (void * a, void * b, void * user_data);
typedef int (*OggzCmpFunc) (const void * a, const void * b, void * user_data);
typedef struct _OggzVector OggzVector;
......@@ -141,7 +141,7 @@ oggz_vector_find_p (OggzVector * vector, const void * data)
void * d;
int i;
if (vector->compare == NULL) -1;
if (vector->compare == NULL) return NULL;
for (i = 0; i < vector->nr_elements; i++) {
d = vector->data[i].p;
......@@ -158,7 +158,7 @@ oggz_vector_find_index_p (OggzVector * vector, const void * data)
void * d;
int i;
if (vector->compare == NULL) -1;
if (vector->compare == NULL) return -1;
for (i = 0; i < vector->nr_elements; i++) {
d = vector->data[i].p;
......
......@@ -37,7 +37,7 @@ typedef void OggzVector;
typedef int (*OggzFunc) (void * data);
typedef int (*OggzFindFunc) (void * data, long serialno);
typedef int (*OggzCmpFunc) (void * a, void * b, void * user_data);
typedef int (*OggzCmpFunc) (const void * a, const void * b, void * user_data);
OggzVector *
oggz_vector_new (void);
......
## Process this file with automake to produce Makefile.in
AM_CFLAGS = -Wall -pedantic
INCLUDES = -I$(top_srcdir)/include @OGG_CFLAGS@
OGGZDIR = ../liboggz
......
## Process this file with automake to produce Makefile.in
AM_CFLAGS = -Wall -pedantic -g
EXTRA_DIST = oggzdiff
bin_SCRIPTS = oggzdiff
......
......@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <getopt.h>
#include <errno.h>
......
......@@ -188,7 +188,7 @@ ot_flac_info (unsigned char * data, long len)
samplerate = (ogg_int64_t) (data[27] << 12) | (data[28] << 4) |
((data[29] >> 4)&0xf);
channels = 1 + (data[29] >> 1)&0x7;
channels = 1 + ((data[29] >> 1)&0x7);
snprintf (buf, 60,
"\tAudio-Samplerate: %d Hz\n\tAudio-Channels: %d\n",
......@@ -272,7 +272,7 @@ ot_page_identify (OGGZ *oggz, const ogg_page * og, char ** info)
* stream content name using oggz_stream_get_content_type
*/
serial_no = ogg_page_serialno(og);
serial_no = ogg_page_serialno((ogg_page *)og);
content = oggz_stream_get_content(oggz, serial_no);
if (content == OGGZ_ERR_BAD_SERIALNO) return NULL;
......
......@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#ifdef HAVE_INTTYPES_H
......
......@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <fcntl.h>
#include <assert.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment