diff options
-rw-r--r-- | src/input/librtsp/rtsp.c | 4 | ||||
-rw-r--r-- | src/input/mms.c | 4 | ||||
-rw-r--r-- | src/input/pnm.c | 4 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/error_resilience.c | 8 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/h263.c | 11 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/motion_est.c | 5 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ratecontrol.c | 65 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/svq1.c | 5 | ||||
-rw-r--r-- | src/libreal/audio_decoder.c | 23 | ||||
-rw-r--r-- | src/libreal/xine_decoder.c | 35 | ||||
-rw-r--r-- | src/libspucc/cc_decoder.c | 18 | ||||
-rw-r--r-- | src/video_out/alphablend.c | 4 | ||||
-rw-r--r-- | src/video_out/video_out_pgx64.c | 6 | ||||
-rw-r--r-- | src/xine-utils/memcpy.c | 1 | ||||
-rw-r--r-- | src/xine-utils/xine_buffer.c | 25 | ||||
-rw-r--r-- | src/xine-utils/xineutils.h | 6 |
16 files changed, 130 insertions, 94 deletions
diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c index c8706a187..f12190260 100644 --- a/src/input/librtsp/rtsp.c +++ b/src/input/librtsp/rtsp.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: rtsp.c,v 1.4 2002/12/17 10:33:35 holstsn Exp $ + * $Id: rtsp.c,v 1.5 2002/12/22 00:35:05 komadori Exp $ * * a minimalistic implementation of rtsp protocol, * *not* RFC 2326 compilant yet. @@ -188,7 +188,7 @@ static ssize_t read_stream(int fd, void *buf, size_t count) { return -1; } - ret=read (fd, buf+total, count-total); + ret=read (fd, ((uint8_t*)buf)+total, count-total); if (ret<=0) { printf ("rtsp: read error.\n"); diff --git a/src/input/mms.c b/src/input/mms.c index 2efc62a01..5a9a341ca 100644 --- a/src/input/mms.c +++ b/src/input/mms.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: mms.c,v 1.16 2002/12/12 23:48:03 tmattern Exp $ + * $Id: mms.c,v 1.17 2002/12/22 00:35:04 komadori Exp $ * * based on work from major mms * utility functions to handle communication with an mms server @@ -125,7 +125,7 @@ static ssize_t read_timeout(int fd, void *buf, size_t count) { return -1; } - ret=read (fd, buf+total, count-total); + ret=read (fd, ((uint8_t*)buf)+total, count-total); if (ret<=0) { printf ("mms: read error.\n"); diff --git a/src/input/pnm.c b/src/input/pnm.c index d24008a4f..0a4339f85 100644 --- a/src/input/pnm.c +++ b/src/input/pnm.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: pnm.c,v 1.5 2002/12/16 23:29:59 miguelfreitas Exp $ + * $Id: pnm.c,v 1.6 2002/12/22 00:35:04 komadori Exp $ * * pnm protocol implementation * based upon code from joschka @@ -275,7 +275,7 @@ static ssize_t rm_read(int fd, void *buf, size_t count) { return -1; } - ret=read (fd, buf+total, count-total); + ret=read (fd, ((uint8_t*)buf)+total, count-total); if (ret<=0) { printf ("input_pnm: read error.\n"); diff --git a/src/libffmpeg/libavcodec/error_resilience.c b/src/libffmpeg/libavcodec/error_resilience.c index 3cb8d40bc..5a8df74d2 100644 --- a/src/libffmpeg/libavcodec/error_resilience.c +++ b/src/libffmpeg/libavcodec/error_resilience.c @@ -18,6 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <alloca.h> + #include "avcodec.h" #include "dsputil.h" #include "mpegvideo.h" @@ -295,14 +297,16 @@ static void v_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri } static void guess_mv(MpegEncContext *s){ - UINT8 fixed[s->mb_num]; + UINT8 *fixed; #define MV_FROZEN 3 #define MV_CHANGED 2 #define MV_UNCHANGED 1 const int mb_width = s->mb_width; const int mb_height= s->mb_height; int i, depth, num_avail; - + + fixed = alloca(s->mb_num); + num_avail=0; for(i=0; i<s->mb_num; i++){ int f=0; diff --git a/src/libffmpeg/libavcodec/h263.c b/src/libffmpeg/libavcodec/h263.c index 98b29ad0b..0d0799bb5 100644 --- a/src/libffmpeg/libavcodec/h263.c +++ b/src/libffmpeg/libavcodec/h263.c @@ -3887,7 +3887,7 @@ static void mpeg4_decode_sprite_trajectory(MpegEncContext * s) int a= 2<<s->sprite_warping_accuracy; int rho= 3-s->sprite_warping_accuracy; int r=16/a; - const int vop_ref[4][2]= {{0,0}, {s->width,0}, {0, s->height}, {s->width, s->height}}; // only true for rectangle shapes + int vop_ref[4][2]; int d[4][2]={{0,0}, {0,0}, {0,0}, {0,0}}; int sprite_ref[4][2]; int virtual_ref[2][2]; @@ -3897,6 +3897,15 @@ static void mpeg4_decode_sprite_trajectory(MpegEncContext * s) int h= s->height; int min_ab; + vop_ref[0][0] = 0; + vop_ref[0][1] = 0; + vop_ref[1][0] = s->width; + vop_ref[1][1] = 0; + vop_ref[2][0] = 0; + vop_ref[2][1] = s->height; + vop_ref[3][0] = s->width; + vop_ref[3][1] = s->height; + for(i=0; i<s->num_sprite_warping_points; i++){ int length; int x=0, y=0; diff --git a/src/libffmpeg/libavcodec/motion_est.c b/src/libffmpeg/libavcodec/motion_est.c index fa6c3ee6b..547f4cdc5 100644 --- a/src/libffmpeg/libavcodec/motion_est.c +++ b/src/libffmpeg/libavcodec/motion_est.c @@ -417,7 +417,7 @@ static inline int snake_search(MpegEncContext * s, int *best, int dmin, static int x_dir[8]= {1,1,0,-1,-1,-1, 0, 1}; static int y_dir[8]= {0,1,1, 1, 0,-1,-1,-1}; int fails=0; - int last_d[2]={dmin, dmin}; + int last_d[2]; /*static int good=0; static int bad=0; @@ -429,6 +429,9 @@ if(256*256*256*64%point==0) printf("%d %d %d\n", good, bad, point); }*/ + last_d[0] = dmin; + last_d[1] = dmin; + for(;;){ int x= best[0]; int y= best[1]; diff --git a/src/libffmpeg/libavcodec/ratecontrol.c b/src/libffmpeg/libavcodec/ratecontrol.c index caea09b24..63c45c82a 100644 --- a/src/libffmpeg/libavcodec/ratecontrol.c +++ b/src/libffmpeg/libavcodec/ratecontrol.c @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <math.h> +#include <alloca.h> #include "common.h" #include "avcodec.h" #include "dsputil.h" @@ -229,33 +230,8 @@ static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_f const double mb_num= s->mb_num; int i; - double const_values[]={ - M_PI, - M_E, - rce->i_tex_bits*rce->qscale, - rce->p_tex_bits*rce->qscale, - (rce->i_tex_bits + rce->p_tex_bits)*(double)rce->qscale, - rce->mv_bits/mb_num, - rce->pict_type == B_TYPE ? (rce->f_code + rce->b_code)*0.5 : rce->f_code, - rce->i_count/mb_num, - rce->mc_mb_var_sum/mb_num, - rce->mb_var_sum/mb_num, - rce->pict_type == I_TYPE, - rce->pict_type == P_TYPE, - rce->pict_type == B_TYPE, - rcc->qscale_sum[pict_type] / (double)rcc->frame_count[pict_type], - s->qcompress, -/* rcc->last_qscale_for[I_TYPE], - rcc->last_qscale_for[P_TYPE], - rcc->last_qscale_for[B_TYPE], - rcc->next_non_b_qscale,*/ - rcc->i_cplx_sum[I_TYPE] / (double)rcc->frame_count[I_TYPE], - rcc->i_cplx_sum[P_TYPE] / (double)rcc->frame_count[P_TYPE], - rcc->p_cplx_sum[P_TYPE] / (double)rcc->frame_count[P_TYPE], - rcc->p_cplx_sum[B_TYPE] / (double)rcc->frame_count[B_TYPE], - (rcc->i_cplx_sum[pict_type] + rcc->p_cplx_sum[pict_type]) / (double)rcc->frame_count[pict_type], - 0 - }; + double const_values[20]; + char *const_names[]={ "PI", "E", @@ -294,6 +270,32 @@ static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_f NULL }; + const_values[0] = M_PI; + const_values[1] = M_E; + const_values[2] = rce->i_tex_bits*rce->qscale; + const_values[3] = rce->p_tex_bits*rce->qscale; + const_values[4] = (rce->i_tex_bits + rce->p_tex_bits)*(double)rce->qscale; + const_values[5] = rce->mv_bits/mb_num; + const_values[6] = rce->pict_type == B_TYPE ? (rce->f_code + rce->b_code)*0.5 : rce->f_code; + const_values[7] = rce->i_count/mb_num; + const_values[8] = rce->mc_mb_var_sum/mb_num; + const_values[9] = rce->mb_var_sum/mb_num; + const_values[10] = rce->pict_type == I_TYPE; + const_values[11] = rce->pict_type == P_TYPE; + const_values[12] = rce->pict_type == B_TYPE; + const_values[13] = rcc->qscale_sum[pict_type] / (double)rcc->frame_count[pict_type]; + const_values[14] = s->qcompress; + /*const_values[] = rcc->last_qscale_for[I_TYPE]; + const_values[] = rcc->last_qscale_for[P_TYPE]; + const_values[] = rcc->last_qscale_for[B_TYPE]; + const_values[] = rcc->next_non_b_qscale;*/ + const_values[15] = rcc->i_cplx_sum[I_TYPE] / (double)rcc->frame_count[I_TYPE]; + const_values[16] = rcc->i_cplx_sum[P_TYPE] / (double)rcc->frame_count[P_TYPE]; + const_values[17] = rcc->p_cplx_sum[P_TYPE] / (double)rcc->frame_count[P_TYPE]; + const_values[18] = rcc->p_cplx_sum[B_TYPE] / (double)rcc->frame_count[B_TYPE]; + const_values[19] = (rcc->i_cplx_sum[pict_type] + rcc->p_cplx_sum[pict_type]) / (double)rcc->frame_count[pict_type]; + const_values[20] = 0; + bits= ff_eval(s->avctx->rc_eq, const_values, const_names, func1, func1_names, NULL, NULL, rce); rcc->pass1_rc_eq_output_sum+= bits; @@ -471,12 +473,15 @@ static void adaptive_quantization(MpegEncContext *s, double q){ const float p_masking = s->avctx->p_masking; float bits_sum= 0.0; float cplx_sum= 0.0; - float cplx_tab[s->mb_num]; - float bits_tab[s->mb_num]; + float *cplx_tab; + float *bits_tab; const int qmin= 2; //s->avctx->mb_qmin; const int qmax= 31; //s->avctx->mb_qmax; Picture * const pic= &s->current_picture; - + + cplx_tab = alloca(s->mb_num * sizeof(float)); + bits_tab = alloca(s->mb_num * sizeof(float)); + for(i=0; i<s->mb_num; i++){ float temp_cplx= sqrt(pic->mc_mb_var[i]); float spat_cplx= sqrt(pic->mb_var[i]); diff --git a/src/libffmpeg/libavcodec/svq1.c b/src/libffmpeg/libavcodec/svq1.c index 86ebd7382..6abccf403 100644 --- a/src/libffmpeg/libavcodec/svq1.c +++ b/src/libffmpeg/libavcodec/svq1.c @@ -26,6 +26,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <alloca.h> #include "common.h" #include "avcodec.h" @@ -1136,7 +1137,9 @@ static int svq1_decode_frame(AVCodecContext *avctx, current += 16*linesize; } } else { - svq1_pmv_t pmv[width/8+3]; + svq1_pmv_t *pmv; + + pmv = alloca((width/8+3) * sizeof(svq1_pmv_t)); /* delta frame */ memset (pmv, 0, ((width / 8) + 3) * sizeof(svq1_pmv_t)); diff --git a/src/libreal/audio_decoder.c b/src/libreal/audio_decoder.c index a94ef2dd6..a58e33a19 100644 --- a/src/libreal/audio_decoder.c +++ b/src/libreal/audio_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_decoder.c,v 1.15 2002/12/21 18:59:46 miguelfreitas Exp $ + * $Id: audio_decoder.c,v 1.16 2002/12/22 00:35:05 komadori Exp $ * * thin layer to use real binary-only codecs in xine * @@ -318,17 +318,16 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) { } { - ra_init_t init_data={ - samples_per_sec, - bits_per_sample, - num_channels, - 100, /* ??? */ - subpacket_size, /* subpacket size */ - coded_frame_size, /* coded frame size */ - data_len, /* codec data length */ - extras /* extras */ - }; - + ra_init_t init_data; + + init_data.samplerate = samples_per_sec; + init_data.bits = bits_per_sample; + init_data.channels = num_channels; + init_data.unk1 = 100; /* ??? */ + init_data.subpacket_size = subpacket_size; /* subpacket size */ + init_data.coded_frame_size = coded_frame_size; /* coded frame size */ + init_data.codec_data_length = data_len; /* codec data length */ + init_data.extras = extras; /* extras */ #ifdef LOG printf ("libareal: init_data:\n"); diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c index d051c3386..6ad52f877 100644 --- a/src/libreal/xine_decoder.c +++ b/src/libreal/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.21 2002/12/21 18:59:46 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.22 2002/12/22 00:35:05 komadori Exp $ * * thin layer to use real binary-only codecs in xine * @@ -230,11 +230,18 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) { /* setup rv30 codec (codec sub-type and image dimensions): */ if (init_data.format>=0x20200002){ - unsigned long cmsg24[4]={this->width,this->height, - this->width,this->height}; - unsigned long cmsg_data[3]={0x24,1+((init_data.subformat>>16)&7), - (unsigned long) &cmsg24}; - + unsigned long cmsg24[4]; + unsigned long cmsg_data[3]; + + cmsg24[0]=this->width; + cmsg24[1]=this->height; + cmsg24[2]=this->width; + cmsg24[3]=this->height; + + cmsg_data[0]=0x24; + cmsg_data[1]=1+((init_data.subformat>>16)&7); + cmsg_data[2]=(unsigned long)&cmsg24; + #ifdef LOG printf ("libreal: cmsg24:\n"); hexdump (cmsg24, sizeof (cmsg24)); @@ -306,14 +313,14 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) vo_frame_t *img; unsigned long transform_out[5]; - unsigned long transform_in[6]={ - this->chunk_buffer_size,/* length of the packet (sub-packets appended) */ - 0, /* unknown, seems to be unused */ - this->num_chunks-1, /* number of sub-packets - 1 */ - this->chunk_tab, /* table of sub-packet offsets */ - 0, /* unknown, seems to be unused */ - this->pts/90 /* timestamp (the integer value from the stream) */ - }; + unsigned long transform_in[6]; + + transform_in[0] = this->chunk_buffer_size; /* length of the packet (sub-packets appended) */ + transform_in[1] = 0; /* unknown, seems to be unused */ + transform_in[2] = this->num_chunks-1; /* number of sub-packets - 1 */ + transform_in[3] = this->chunk_tab; /* table of sub-packet offsets */ + transform_in[4] = 0; /* unknown, seems to be unused */ + transform_in[5] = this->pts/90; /* timestamp (the integer value from the stream) */ #ifdef LOG printf ("libreal: got %d chunks in buffer and new frame is starting\n", diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c index 2820671ae..2dbc4c56d 100644 --- a/src/libspucc/cc_decoder.c +++ b/src/libspucc/cc_decoder.c @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: cc_decoder.c,v 1.17 2002/09/04 23:31:09 guenter Exp $ + * $Id: cc_decoder.c,v 1.18 2002/12/22 00:35:05 komadori Exp $ * * stuff needed to provide closed captioning decoding and display * @@ -230,8 +230,8 @@ char *cc_schemes[NUM_CC_PALETTES + 1] = { /* mapping from PAC row code to actual CC row */ static int rowdata[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6, 7, 8, 9}; -#warning "FIXME: do real TM" -/* ¶ must be mapped as a music note in the captioning font */ +/* FIXME: do real TM */ +/* must be mapped as a music note in the captioning font */ static char specialchar[] = {'®','°','½','¿','T','¢','£','¶','à', TRANSP_SPACE,'è','â','ê','î','ô','û'}; @@ -266,7 +266,7 @@ struct cc_renderer_s { not yet displayed. So we remember the vpts of the show event, and use that as the vpts of the hide event upon an osd free. */ -#warning "FIXME: bug in OSD or SPU?" +/*FIXME: bug in OSD or SPU?*/ int64_t display_vpts; /* vpts of currently displayed caption */ /* this variable is an even worse hack: in some rare cases, the pts @@ -379,7 +379,11 @@ static void get_font_metrics(osd_renderer_t *renderer, renderer->set_font(testc, (char *) fontname, font_size); for (c = 32; c < 256; c++) { int tw, th; - char buf[2] = { (char) c, '\0' }; + char buf[2]; + + buf[0] = (char)c; + buf[1] = '\0'; + renderer->get_text_size(testc, buf, &tw, &th); *maxw = MAX(*maxw, tw); *maxh = MAX(*maxh, th); @@ -630,7 +634,7 @@ static void ccrow_render(cc_renderer_t *renderer, cc_row_t *this, int rownum) /* make caption background a uniform box. Without this line, the */ /* background is uneven for superscript characters. */ /* Also pad left & right ends of caption to make it more readable */ -#warning "FIXME: There may be off-by one errors in the rendering - check with Miguel" +/*FIXME: There may be off-by one errors in the rendering - check with Miguel*/ if (seg == 0) box_x1 -= renderer->max_char_width; if (seg == num_seg - 1) @@ -791,7 +795,7 @@ static void ccmem_init(cc_memory_t *this) static void ccmem_exit(cc_memory_t *this) { -#warning "FIXME: anything to deallocate?" +/*FIXME: anything to deallocate?*/ } diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c index b0ef47813..9275db9f8 100644 --- a/src/video_out/alphablend.c +++ b/src/video_out/alphablend.c @@ -1,5 +1,5 @@ -//TOAST_SPU will define ALL spu entries - no matter the tranparency -//#define TOAST_SPU +/*TOAST_SPU will define ALL spu entries - no matter the tranparency*/ +/*#define TOAST_SPU*/ /* #define PRIV_CLUT */ /* Currently only blend_yuv(..) works */ /* diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c index 9dc0e754b..44bc0029c 100644 --- a/src/video_out/video_out_pgx64.c +++ b/src/video_out/video_out_pgx64.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_pgx64.c,v 1.22 2002/12/21 12:56:49 miguelfreitas Exp $ + * $Id: video_out_pgx64.c,v 1.23 2002/12/22 00:35:05 komadori Exp $ * * video_out_pgx64.c, Sun PGX64/PGX24 output plugin for xine * @@ -131,7 +131,7 @@ typedef struct { GC gc; int fbfd; - void *fbbase; + uint8_t *fbbase; volatile uint32_t *fbregs; uint32_t top, fb_width, fb_height; @@ -669,7 +669,7 @@ static pgx64_driver_t* init_driver(pgx64_driver_class_t *class) pgx64_driver_t *this; char *devname; int fbfd; - void *baseaddr; + uint8_t *baseaddr; struct fbgattr attr; printf("video_out_pgx64: PGX64 video output plugin - By Robin Kay\n"); diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c index e10cd43ee..a04b9437f 100644 --- a/src/xine-utils/memcpy.c +++ b/src/xine-utils/memcpy.c @@ -401,7 +401,6 @@ static unsigned long long int rdtsc(int config_flags) { /* FIXME: implement an equivalent for using optimized memcpy on other architectures */ -#warning "Using rdtsc() hack (via times(NULL))" return times(NULL); } #endif diff --git a/src/xine-utils/xine_buffer.c b/src/xine-utils/xine_buffer.c index d179b1f66..2ab70ea56 100644 --- a/src/xine-utils/xine_buffer.c +++ b/src/xine-utils/xine_buffer.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_buffer.c,v 1.1 2002/12/15 01:47:59 holstsn Exp $ + * $Id: xine_buffer.c,v 1.2 2002/12/22 00:35:05 komadori Exp $ * * * generic dynamic buffer functions. The goals @@ -99,7 +99,7 @@ typedef struct { #define CHECK_MAGIC(x) if (*(((uint8_t *)x)-1)!=XINE_BUFFER_MAGIC) \ {printf("xine_buffer: FATAL: xine_buffer_header not recognized!\n");exit(1);} -#define GET_HEADER(x) ((xine_buffer_header_t *)(x-XINE_BUFFER_HEADER_SIZE)) +#define GET_HEADER(x) ((xine_buffer_header_t*)(((uint8_t*)x)-XINE_BUFFER_HEADER_SIZE)) /* reallocs buf, if smaller than size. */ #define GROW_TO(buf, to_size) \ @@ -107,8 +107,7 @@ typedef struct { int new_size = (to_size) + GET_HEADER(buf)->chunk_size - \ ((to_size) % GET_HEADER(buf)->chunk_size);\ \ - buf = realloc(buf-XINE_BUFFER_HEADER_SIZE, new_size+XINE_BUFFER_HEADER_SIZE);\ - buf += XINE_BUFFER_HEADER_SIZE;\ + buf = ((uint8_t*)realloc(((uint8_t*)buf)-XINE_BUFFER_HEADER_SIZE, new_size+XINE_BUFFER_HEADER_SIZE)) + XINE_BUFFER_HEADER_SIZE;\ GET_HEADER(buf)->size=new_size; } /* @@ -119,7 +118,7 @@ typedef struct { */ void *xine_buffer_init(int chunk_size) { - void *data=xine_xmalloc(chunk_size+XINE_BUFFER_HEADER_SIZE); + uint8_t *data=xine_xmalloc(chunk_size+XINE_BUFFER_HEADER_SIZE); xine_buffer_header_t *header=(xine_buffer_header_t*)data; header->size=chunk_size; @@ -146,7 +145,7 @@ void *_xine_buffer_free(void *buf) { CHECK_MAGIC(buf); #endif - free(buf-XINE_BUFFER_HEADER_SIZE); + free(((uint8_t*)buf)-XINE_BUFFER_HEADER_SIZE); return NULL; } @@ -156,7 +155,7 @@ void *_xine_buffer_free(void *buf) { */ void *xine_buffer_dup(void *buf) { - void *new; + uint8_t *new; #ifdef CHECKS if (!buf) { @@ -168,9 +167,9 @@ void *xine_buffer_dup(void *buf) { CHECK_MAGIC(buf); #endif - new=xine_xmalloc(GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE); +new=xine_xmalloc(GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE); - xine_fast_memcpy(new, buf-XINE_BUFFER_HEADER_SIZE, + xine_fast_memcpy(new, ((uint8_t*)buf)-XINE_BUFFER_HEADER_SIZE, GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE); return new+XINE_BUFFER_HEADER_SIZE; @@ -195,7 +194,7 @@ void *_xine_buffer_copyin(void *buf, int index, void *data, int len) { GROW_TO(buf, index+len); - xine_fast_memcpy(buf+index, data, len); + xine_fast_memcpy(((uint8_t*)buf)+index, data, len); return buf; } @@ -224,7 +223,7 @@ void xine_buffer_copyout(void *buf, int index, void *data, int len) { return; len = GET_HEADER(buf)->size - index; } - xine_fast_memcpy(data, buf+index, len); + xine_fast_memcpy(data, ((uint8_t*)buf)+index, len); } /* @@ -246,7 +245,7 @@ void *_xine_buffer_set(void *buf, int index, uint8_t b, int len) { GROW_TO(buf, index+len); - memset(buf+index, b, len); + memset(((uint8_t*)buf)+index, b, len); return buf; } @@ -295,7 +294,7 @@ void *_xine_buffer_strcpy(void *buf, int index, char *data) { GROW_TO(buf, index+strlen(data)+1); - strcpy(buf+index, data); + strcpy(((char*)buf)+index, data); return buf; } diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 0c3fb722f..b3bff7e70 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.29 2002/12/15 01:47:59 holstsn Exp $ + * $Id: xineutils.h,v 1.30 2002/12/22 00:35:05 komadori Exp $ * */ #ifndef XINEUTILS_H @@ -37,6 +37,10 @@ extern "C" { #include "xmlparser.h" #include "xine_buffer.h" +#ifdef __SUNPRO_C +#define inline +#endif + /* * debugable mutexes */ |