changeset 34492:1495455e6d22

Move static keyword to the beginning of function declarations. This fixes a number of warnings with -Wextra.
author diego
date Thu, 19 Jan 2012 14:36:15 +0000
parents 220e2f980b73
children da31318562d9
files drivers/tdfx_vid.c libmenu/menu.c libmpdemux/mpeg_hdr.c m_option.h stream/stream.h sub/sub.c vidix/nvidia_vid.c
diffstat 7 files changed, 63 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/drivers/tdfx_vid.c	Thu Jan 19 14:36:11 2012 +0000
+++ b/drivers/tdfx_vid.c	Thu Jan 19 14:36:15 2012 +0000
@@ -351,7 +351,7 @@
   cfg->screen_start = tdfx_inl(VIDDESKSTART);
 }
 
-inline static u32 tdfx_vid_make_format(int src,u16 stride,u32 fmt) {
+static inline u32 tdfx_vid_make_format(int src, u16 stride, u32 fmt) {
   u32 r = stride & 0xFFF3;
   u32 tdfx_fmt = 0;
 
--- a/libmenu/menu.c	Thu Jan 19 14:36:11 2012 +0000
+++ b/libmenu/menu.c	Thu Jan 19 14:36:15 2012 +0000
@@ -374,7 +374,7 @@
 
 typedef void (*draw_alpha_f)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride);
 
-inline static draw_alpha_f get_draw_alpha(uint32_t fmt) {
+static inline draw_alpha_f get_draw_alpha(uint32_t fmt) {
   switch(fmt) {
   case IMGFMT_BGR12:
   case IMGFMT_RGB12:
--- a/libmpdemux/mpeg_hdr.c	Thu Jan 19 14:36:11 2012 +0000
+++ b/libmpdemux/mpeg_hdr.c	Thu Jan 19 14:36:15 2012 +0000
@@ -309,7 +309,7 @@
   return v2;
 }
 
-inline static int read_golomb_s(unsigned char *buffer, unsigned int *init)
+static inline int read_golomb_s(unsigned char *buffer, unsigned int *init)
 {
   unsigned int v = read_golomb(buffer, init);
   return (v & 1) ? ((v + 1) >> 1) : -(v >> 1);
--- a/m_option.h	Thu Jan 19 14:36:11 2012 +0000
+++ b/m_option.h	Thu Jan 19 14:36:15 2012 +0000
@@ -490,13 +490,13 @@
 const m_option_t* m_option_list_find(const m_option_t* list,const char* name);
 
 /// Helper to parse options, see \ref m_option_type::parse.
-inline static int
+static inline int
 m_option_parse(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
   return opt->type->parse(opt,name,param,dst,src);
 }
 
 /// Helper to print options, see \ref m_option_type::print.
-inline static  char*
+static inline  char*
 m_option_print(const m_option_t* opt, const void* val_ptr) {
   if(opt->type->print)
     return opt->type->print(opt,val_ptr);
@@ -505,14 +505,14 @@
 }
 
 /// Helper around \ref m_option_type::save.
-inline static  void
+static inline  void
 m_option_save(const m_option_t* opt,void* dst, const void* src) {
   if(opt->type->save)
     opt->type->save(opt,dst,src);
 }
 
 /// Helper around \ref m_option_type::set.
-inline static  void
+static inline  void
 m_option_set(const m_option_t* opt,void* dst, const void* src) {
   if(opt->type->set)
     opt->type->set(opt,dst,src);
@@ -528,7 +528,7 @@
 }
 
 /// Helper around \ref m_option_type::free.
-inline static void
+static inline void
 m_option_free(const m_option_t* opt,void* dst) {
   if(opt->type->free)
     opt->type->free(dst);
--- a/stream/stream.h	Thu Jan 19 14:36:11 2012 +0000
+++ b/stream/stream.h	Thu Jan 19 14:36:15 2012 +0000
@@ -191,7 +191,8 @@
 #endif
 int stream_write_buffer(stream_t *s, unsigned char *buf, int len);
 
-inline static int stream_read_char(stream_t *s){
+static inline int stream_read_char(stream_t *s)
+{
   return (s->buf_pos<s->buf_len)?s->buffer[s->buf_pos++]:
     (cache_stream_fill_buffer(s)?s->buffer[s->buf_pos++]:-256);
 //  if(s->buf_pos<s->buf_len) return s->buffer[s->buf_pos++];
@@ -200,14 +201,16 @@
 //  return 0; // EOF
 }
 
-inline static unsigned int stream_read_word(stream_t *s){
+static inline unsigned int stream_read_word(stream_t *s)
+{
   int x,y;
   x=stream_read_char(s);
   y=stream_read_char(s);
   return (x<<8)|y;
 }
 
-inline static unsigned int stream_read_dword(stream_t *s){
+static inline unsigned int stream_read_dword(stream_t *s)
+{
   unsigned int y;
   y=stream_read_char(s);
   y=(y<<8)|stream_read_char(s);
@@ -218,14 +221,16 @@
 
 #define stream_read_fourcc stream_read_dword_le
 
-inline static unsigned int stream_read_word_le(stream_t *s){
+static inline unsigned int stream_read_word_le(stream_t *s)
+{
   int x,y;
   x=stream_read_char(s);
   y=stream_read_char(s);
   return (y<<8)|x;
 }
 
-inline static unsigned int stream_read_dword_le(stream_t *s){
+static inline unsigned int stream_read_dword_le(stream_t *s)
+{
   unsigned int y;
   y=stream_read_char(s);
   y|=stream_read_char(s)<<8;
@@ -234,7 +239,8 @@
   return y;
 }
 
-inline static uint64_t stream_read_qword(stream_t *s){
+static inline uint64_t stream_read_qword(stream_t *s)
+{
   uint64_t y;
   y = stream_read_char(s);
   y=(y<<8)|stream_read_char(s);
@@ -247,14 +253,16 @@
   return y;
 }
 
-inline static uint64_t stream_read_qword_le(stream_t *s){
+static inline uint64_t stream_read_qword_le(stream_t *s)
+{
   uint64_t y;
   y = stream_read_dword_le(s);
   y|=(uint64_t)stream_read_dword_le(s)<<32;
   return y;
 }
 
-inline static unsigned int stream_read_int24(stream_t *s){
+static inline unsigned int stream_read_int24(stream_t *s)
+{
   unsigned int y;
   y = stream_read_char(s);
   y=(y<<8)|stream_read_char(s);
@@ -262,7 +270,8 @@
   return y;
 }
 
-inline static int stream_read(stream_t *s,char* mem,int total){
+static inline int stream_read(stream_t *s, char *mem, int total)
+{
   int len=total;
   while(len>0){
     int x;
@@ -280,20 +289,24 @@
 }
 
 uint8_t *stream_read_until(stream_t *s, uint8_t *mem, int max, uint8_t term, int utf16);
-inline static uint8_t *stream_read_line(stream_t *s, uint8_t *mem, int max, int utf16)
+static inline uint8_t *stream_read_line(stream_t *s, uint8_t *mem,
+                                        int max, int utf16)
 {
   return stream_read_until(s, mem, max, '\n', utf16);
 }
 
-inline static int stream_eof(stream_t *s){
+static inline int stream_eof(stream_t *s)
+{
   return s->eof;
 }
 
-inline static off_t stream_tell(stream_t *s){
+static inline off_t stream_tell(stream_t *s)
+{
   return s->pos+s->buf_pos-s->buf_len;
 }
 
-inline static int stream_seek(stream_t *s,off_t pos){
+static inline int stream_seek(stream_t *s, off_t pos)
+{
 
   mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%"PRIX64"\n", pos);
 
@@ -314,7 +327,8 @@
   return cache_stream_seek_long(s,pos);
 }
 
-inline static int stream_skip(stream_t *s,off_t len){
+static inline int stream_skip(stream_t *s, off_t len)
+{
   if( len<0 || (len>2*STREAM_BUFFER_SIZE && (s->flags & MP_STREAM_SEEK_FW)) ) {
     // negative or big skip!
     return stream_seek(s,stream_tell(s)+len);
--- a/sub/sub.c	Thu Jan 19 14:36:11 2012 +0000
+++ b/sub/sub.c	Thu Jan 19 14:36:15 2012 +0000
@@ -165,7 +165,13 @@
 }
 
 // renders the buffer
-inline static void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
+static inline void vo_draw_text_from_buffer(mp_osd_obj_t* obj,
+                                            void (*draw_alpha)(int x0, int y0,
+                                                               int w, int h,
+                                                               unsigned char *src,
+                                                               unsigned char *srca,
+                                                               int stride))
+{
     if (obj->allocated > 0) {
 	draw_alpha(obj->bbox.x1,obj->bbox.y1,
 		   obj->bbox.x2-obj->bbox.x1,
@@ -190,7 +196,8 @@
   return c;
 }
 
-inline static void vo_update_text_osd(mp_osd_obj_t* obj,int dxs,int dys){
+static inline void vo_update_text_osd(mp_osd_obj_t *obj, int dxs, int dys)
+{
 	const char *cp=vo_osd_text;
 	int x=20;
 	int h=0;
@@ -235,8 +242,11 @@
   nav_hl.ey = ey;
 }
 
-inline static void vo_update_nav (mp_osd_obj_t *obj, int dxs, int dys, int left_border, int top_border,
-                      int right_border, int bottom_border, int orig_w, int orig_h) {
+static inline void vo_update_nav(mp_osd_obj_t *obj, int dxs, int dys,
+                                 int left_border, int top_border,
+                                 int right_border, int bottom_border,
+                                 int orig_w, int orig_h)
+{
   int len;
   int sx = nav_hl.sx, sy = nav_hl.sy;
   int ex = nav_hl.ex, ey = nav_hl.ey;
@@ -298,7 +308,7 @@
 	bs+= srcskip;
     }
 }
-inline static void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys)
+static inline void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys)
 {
     int h=0,w=0,i,j,font,flashon;
     int wm,hm;
@@ -527,7 +537,8 @@
 //
 //  the above schema is rescalled to n=elems bars
 
-inline static void vo_update_text_progbar(mp_osd_obj_t* obj,int dxs,int dys){
+static inline void vo_update_text_progbar(mp_osd_obj_t *obj, int dxs, int dys)
+{
 
     obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE;
 
@@ -667,7 +678,8 @@
 
 subtitle* vo_sub=NULL;
 
-inline static void vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){
+static inline void vo_update_text_sub(mp_osd_obj_t *obj, int dxs, int dys)
+{
    unsigned char *t;
    int c,i,j,l,x,y,font,prevc,counter;
    int k;
@@ -1037,7 +1049,7 @@
 
 }
 
-inline static void vo_update_spudec_sub(mp_osd_obj_t* obj, int dxs, int dys)
+static inline void vo_update_spudec_sub(mp_osd_obj_t* obj, int dxs, int dys)
 {
   unsigned int bbox[4];
   spudec_calc_bbox(vo_spudec, dxs, dys, bbox);
@@ -1048,7 +1060,12 @@
   obj->flags |= OSDFLAG_BBOX;
 }
 
-inline static void vo_draw_spudec_sub(mp_osd_obj_t* obj, void (*draw_alpha)(int x0, int y0, int w, int h, unsigned char* src, unsigned char* srca, int stride))
+static inline void vo_draw_spudec_sub(mp_osd_obj_t *obj,
+                                      void (*draw_alpha)(int x0, int y0,
+                                                         int w, int h,
+                                                         unsigned char *src,
+                                                         unsigned char *srca,
+                                                         int stride))
 {
   spudec_draw_scaled(vo_spudec, obj->dxs, obj->dys, draw_alpha);
 }
--- a/vidix/nvidia_vid.c	Thu Jan 19 14:36:11 2012 +0000
+++ b/vidix/nvidia_vid.c	Thu Jan 19 14:36:15 2012 +0000
@@ -982,7 +982,7 @@
     return 0;
 }
 
-inline static int is_supported_fourcc(uint32_t fourcc)
+static inline int is_supported_fourcc(uint32_t fourcc)
 {
 	if	(fourcc == IMGFMT_UYVY || fourcc == IMGFMT_YUY2)
 		return 1;