diff options
author | Josep Torra Valles <josep@fluendo.com> | 2006-10-16 18:22:47 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2006-10-16 18:22:47 +0000 |
commit | c4e7ebfe356a19362b261b285af171be525156c1 (patch) | |
tree | b0da2130a117e9128597f90dedeed9337063f65b /ext | |
parent | afef1cdc2a521b17d6af508497984350fde1175d (diff) |
Fix a bunch of problems discovered by the Forte compiler, mostly type mixups and pointer arithmetics with void pointe...
Original commit message from CVS:
Patch by: Josep Torra Valles <josep at fluendo com>
* ext/cairo/gsttimeoverlay.c: (gst_cairo_time_overlay_transform):
* ext/esd/esdsink.c: (gst_esdsink_write):
* ext/flac/gstflacdec.c: (gst_flac_dec_length),
(gst_flac_dec_read_seekable), (gst_flac_dec_chain),
(gst_flac_dec_send_newsegment):
* ext/flac/gstflacenc.c: (gst_flac_enc_seek_callback),
(gst_flac_enc_tell_callback):
* ext/jpeg/smokecodec.c: (find_best_size), (smokecodec_encode),
(smokecodec_parse_header), (smokecodec_decode):
* gst/avi/gstavimux.c: (gst_avi_mux_write_avix_index):
* gst/debug/efence.c: (gst_fenced_buffer_alloc):
* gst/goom/Makefile.am:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c: (gst_icydemux_typefind_or_forward):
* gst/rtsp/gstrtspsrc.c:
* gst/rtsp/rtspconnection.c: (rtsp_connection_read):
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_change_state):
* sys/sunaudio/gstsunaudiomixertrack.h:
Fix a bunch of problems discovered by the Forte compiler, mostly type
mixups and pointer arithmetics with void pointers. Fixes #362603.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/cairo/gsttimeoverlay.c | 2 | ||||
-rw-r--r-- | ext/esd/esdsink.c | 2 | ||||
-rw-r--r-- | ext/flac/gstflacdec.c | 10 | ||||
-rw-r--r-- | ext/flac/gstflacenc.c | 6 | ||||
-rw-r--r-- | ext/jpeg/smokecodec.c | 50 |
5 files changed, 31 insertions, 39 deletions
diff --git a/ext/cairo/gsttimeoverlay.c b/ext/cairo/gsttimeoverlay.c index 404e6f70..ff6d2fce 100644 --- a/ext/cairo/gsttimeoverlay.c +++ b/ext/cairo/gsttimeoverlay.c @@ -186,7 +186,7 @@ gst_cairo_time_overlay_transform (GstBaseTransform * trans, GstBuffer * in, int i, j; unsigned char *image; cairo_text_extents_t extents; - gpointer dest, src; + guint8 *dest, *src; cairo_surface_t *font_surface; cairo_t *text_cairo; GstFlowReturn ret = GST_FLOW_OK; diff --git a/ext/esd/esdsink.c b/ext/esd/esdsink.c index 3a868d44..7fdfafca 100644 --- a/ext/esd/esdsink.c +++ b/ext/esd/esdsink.c @@ -403,7 +403,7 @@ gst_esdsink_write (GstAudioSink * asink, gpointer data, guint length) goto write_error; to_write -= done; - data += done; + data = (char *) data + done; } return length; diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 8a352910..1cf238ea 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -642,11 +642,11 @@ gst_flac_dec_length (const FLAC__SeekableStreamDecoder * decoder, flacdec = GST_FLAC_DEC (client_data); if (!(peer = gst_pad_get_peer (flacdec->sinkpad))) - return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR; + return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; gst_pad_query_duration (peer, &fmt, &len); gst_object_unref (peer); if (fmt != GST_FORMAT_BYTES || len == -1) - return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR; + return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; *length = len; @@ -696,7 +696,7 @@ gst_flac_dec_read_seekable (const FLAC__SeekableStreamDecoder * decoder, if (gst_pad_pull_range (flacdec->sinkpad, flacdec->offset, *bytes, &buf) != GST_FLOW_OK) - return FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR; + return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR; GST_DEBUG ("Read %d bytes at %" G_GUINT64_FORMAT, GST_BUFFER_SIZE (buf), flacdec->offset); @@ -1101,7 +1101,7 @@ gst_flac_dec_sink_event (GstPad * pad, GstEvent * event) static GstFlowReturn gst_flac_dec_chain (GstPad * pad, GstBuffer * buf) { - FLAC__SeekableStreamDecoderState s; + FLAC__StreamDecoderState s; GstFlacDec *dec; gboolean got_audio_frame; @@ -1486,7 +1486,7 @@ gst_flac_dec_send_newsegment (GstFlacDec * flacdec, gboolean update) { GstSegment *s = &flacdec->segment; GstFormat target_format = GST_FORMAT_TIME; - gint64 stop_time = GST_CLOCK_TIME_NONE; + gint64 stop_time = -1; gint64 start_time = 0; /* segment is in DEFAULT format, but we want to send a TIME newsegment */ diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c index b13d7719..90888fb4 100644 --- a/ext/flac/gstflacenc.c +++ b/ext/flac/gstflacenc.c @@ -501,7 +501,7 @@ gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder, flacenc = GST_FLAC_ENC (client_data); if (flacenc->stopped) - return FLAC__STREAM_ENCODER_OK; + return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK; event = gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, absolute_byte_offset, GST_BUFFER_OFFSET_NONE, 0); @@ -525,7 +525,7 @@ gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder, flacenc->offset = absolute_byte_offset; - return FLAC__STREAM_ENCODER_OK; + return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK; } static FLAC__StreamEncoderWriteStatus @@ -585,7 +585,7 @@ gst_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder * encoder, *absolute_byte_offset = flacenc->offset; - return FLAC__STREAM_ENCODER_OK; + return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK; } static gboolean diff --git a/ext/jpeg/smokecodec.c b/ext/jpeg/smokecodec.c index 887e5c20..7fdda082 100644 --- a/ext/jpeg/smokecodec.c +++ b/ext/jpeg/smokecodec.c @@ -36,15 +36,7 @@ #include "smokecodec.h" #include "smokeformat.h" -#ifndef WIN32 -//#define DEBUG(a...) printf( a ); -#define DEBUG(a,...) -#else #include <gst/gstinfo.h> -#define DEBUG GST_DEBUG -#endif - - struct _SmokeCodecInfo { @@ -297,14 +289,14 @@ find_best_size (int blocks, unsigned int *width, unsigned int *height) w = sqchng; h = sqchng; - DEBUG ("guess: %d %d\n", w, h); + GST_DEBUG ("guess: %d %d", w, h); free = w * h - blocks; best = free; bestw = w; while (w < 256) { - DEBUG ("current: %d %d\n", w, h); + GST_DEBUG ("current: %d %d", w, h); if (free < best) { best = free; bestw = w; @@ -468,7 +460,7 @@ smokecodec_encode (SmokeCodecInfo * info, STORE16 (out, IDX_NUM_BLOCKS, blocks); out[IDX_FLAGS] = (flags & 0xff); - DEBUG ("blocks %d, encoding %d\n", blocks, encoding); + GST_DEBUG ("blocks %d, encoding %d", blocks, encoding); info->jdest.next_output_byte = &out[blocks * 2 + OFFS_PICT]; info->jdest.free_in_buffer = (*outsize) - OFFS_PICT; @@ -479,7 +471,7 @@ smokecodec_encode (SmokeCodecInfo * info, if (!(flags & SMOKECODEC_KEYFRAME)) find_best_size (encoding, &blocks_w, &blocks_h); - DEBUG ("best: %d %d\n", blocks_w, blocks_h); + GST_DEBUG ("best: %d %d", blocks_w, blocks_h); info->cinfo.image_width = blocks_w * DCTSIZE * 2; info->cinfo.image_height = blocks_h * DCTSIZE * 2; @@ -492,9 +484,9 @@ smokecodec_encode (SmokeCodecInfo * info, info->minquality) * blocks) / max; } - DEBUG ("set q %d %d %d\n", quality, encoding, max); + GST_DEBUG ("set q %d %d %d", quality, encoding, max); jpeg_set_quality (&info->cinfo, quality, TRUE); - DEBUG ("start\n"); + GST_DEBUG ("start"); jpeg_start_compress (&info->cinfo, TRUE); for (i = 0; i < encoding; i++) { @@ -523,11 +515,11 @@ smokecodec_encode (SmokeCodecInfo * info, put (ip, op, DCTSIZE, DCTSIZE, width / 2, 256 * DCTSIZE); if ((i % blocks_w) == (blocks_w - 1) || (i == encoding - 1)) { - DEBUG ("write %d\n", pos); + GST_DEBUG ("write %d", pos); jpeg_write_raw_data (&info->cinfo, info->line, 2 * DCTSIZE); } } - DEBUG ("finish\n"); + GST_DEBUG ("finish"); jpeg_finish_compress (&info->cinfo); } @@ -535,7 +527,7 @@ smokecodec_encode (SmokeCodecInfo * info, STORE16 (out, IDX_SIZE, size); *outsize = size + blocks * 2 + OFFS_PICT; - DEBUG ("outsize %d\n", *outsize); + GST_DEBUG ("outsize %d", *outsize); // and decode in reference frame again if (info->refdec) { @@ -596,7 +588,7 @@ smokecodec_parse_header (SmokeCodecInfo * info, if (info->width != *width || info->height != *height || info->fps_num != *fps_num || info->fps_denom != *fps_denom) { - DEBUG ("new width: %d %d\n", *width, *height); + GST_DEBUG ("new width: %d %d", *width, *height); info->reference = realloc (info->reference, 3 * ((*width) * (*height)) / 2); info->width = *width; @@ -627,7 +619,7 @@ smokecodec_decode (SmokeCodecInfo * info, &fps_num, &fps_denom); READ16 (in, IDX_NUM_BLOCKS, blocks); - DEBUG ("blocks %d\n", blocks); + GST_DEBUG ("blocks %d", blocks); if (flags & SMOKECODEC_KEYFRAME) decoding = width / (DCTSIZE * 2) * height / (DCTSIZE * 2); @@ -638,9 +630,9 @@ smokecodec_decode (SmokeCodecInfo * info, info->jsrc.next_input_byte = &in[blocks * 2 + OFFS_PICT]; info->jsrc.bytes_in_buffer = insize - (blocks * 2 + OFFS_PICT); - DEBUG ("header %02x %d\n", in[blocks * 2 + OFFS_PICT], insize); + GST_DEBUG ("header %02x %d", in[blocks * 2 + OFFS_PICT], insize); res = jpeg_read_header (&info->dinfo, TRUE); - DEBUG ("header %d %d %d\n", res, info->dinfo.image_width, + GST_DEBUG ("header %d %d %d", res, info->dinfo.image_width, info->dinfo.image_height); blocks_w = info->dinfo.image_width / (2 * DCTSIZE); @@ -649,7 +641,7 @@ smokecodec_decode (SmokeCodecInfo * info, info->dinfo.output_width = info->dinfo.image_width; info->dinfo.output_height = info->dinfo.image_height; - DEBUG ("start\n"); + GST_DEBUG ("start"); info->dinfo.do_fancy_upsampling = FALSE; info->dinfo.do_block_smoothing = FALSE; info->dinfo.out_color_space = JCS_YCbCr; @@ -660,10 +652,10 @@ smokecodec_decode (SmokeCodecInfo * info, blockptr = 0; for (i = 0; i < blocks_h; i++) { - DEBUG ("read\n"); + GST_DEBUG ("read"); jpeg_read_raw_data (&info->dinfo, info->line, 2 * DCTSIZE); - DEBUG ("copy %d\n", blocks_w); + GST_DEBUG ("copy %d", blocks_w); for (j = 0; j < blocks_w; j++) { int pos; int x, y; @@ -676,7 +668,7 @@ smokecodec_decode (SmokeCodecInfo * info, x = pos % (width / (DCTSIZE * 2)); y = pos / (width / (DCTSIZE * 2)); - DEBUG ("block %d %d %d\n", pos, x, y); + GST_DEBUG ("block %d %d %d", pos, x, y); ip = info->compbuf[0] + j * (DCTSIZE * 2); op = info->reference + (x * (DCTSIZE * 2)) + @@ -693,20 +685,20 @@ smokecodec_decode (SmokeCodecInfo * info, (y * DCTSIZE * width / 2); put (ip, op, DCTSIZE, DCTSIZE, 256 * DCTSIZE, width / 2); - DEBUG ("block done %d %d %d\n", pos, x, y); + GST_DEBUG ("block done %d %d %d", pos, x, y); blockptr++; if (blockptr >= decoding) break; } } - DEBUG ("finish\n"); + GST_DEBUG ("finish"); jpeg_finish_decompress (&info->dinfo); } - DEBUG ("copy\n"); + GST_DEBUG ("copy"); if (out != info->reference) memcpy (out, info->reference, 3 * (width * height) / 2); - DEBUG ("copy done\n"); + GST_DEBUG ("copy done"); return SMOKECODEC_OK; } |