[MPlayer-dev-eng] [patch] make some functions static

Stefan Huehner stefan at huehner.org
Tue Jul 11 16:48:29 CEST 2006


Hi,

attached patch marks several function without a prototype which arent
used outside its sourcefile as static.

Regards,
Stefan

-------------- next part --------------
--- libass/ass_render.c	(working copy)
+++ libass/ass_render.c	(working copy)
@@ -1348,7 +1348,7 @@
 	}
 }
 
-int get_face_ascender(FT_Face face)
+static int get_face_ascender(FT_Face face)
 {
 	int v = face->size->metrics.ascender;
 	if (!v)
@@ -1356,7 +1356,7 @@
 	return v;
 }
 
-int get_face_descender(FT_Face face)
+static int get_face_descender(FT_Face face)
 {
 	int v = face->size->metrics.descender;
 	if (!v)
--- subreader.c	(working copy)
+++ subreader.c	(working copy)
@@ -95,7 +95,7 @@
     return NULL;
 }
 
-subtitle *sub_read_line_sami(stream_t* st, subtitle *current) {
+static subtitle *sub_read_line_sami(stream_t* st, subtitle *current) {
     static char line[LINE_LEN+1];
     static char *s = NULL, *slacktime_s;
     char text[LINE_LEN+1], *p=NULL, *q;
@@ -236,7 +236,7 @@
 }
 
 
-char *sub_readtext(char *source, char **dest) {
+static char *sub_readtext(char *source, char **dest) {
     int len=0;
     char *p=source;
     
@@ -258,7 +258,7 @@
     else return NULL;  // last text field
 }
 
-subtitle *sub_read_line_microdvd(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_microdvd(stream_t *st,subtitle *current) {
     char line[LINE_LEN+1];
     char line2[LINE_LEN+1];
     char *p, *next;
@@ -286,7 +286,7 @@
     return current;
 }
 
-subtitle *sub_read_line_mpl2(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_mpl2(stream_t *st,subtitle *current) {
     char line[LINE_LEN+1];
     char line2[LINE_LEN+1];
     char *p, *next;
@@ -312,7 +312,7 @@
     return current;
 }
 
-subtitle *sub_read_line_subrip(stream_t* st, subtitle *current) {
+static subtitle *sub_read_line_subrip(stream_t* st, subtitle *current) {
     char line[LINE_LEN+1];
     int a1,a2,a3,a4,b1,b2,b3,b4;
     char *p=NULL, *q=NULL;
@@ -342,7 +342,7 @@
     return current;
 }
 
-subtitle *sub_read_line_subviewer(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_subviewer(stream_t *st,subtitle *current) {
     char line[LINE_LEN+1];
     int a1,a2,a3,a4,b1,b2,b3,b4;
     char *p=NULL;
@@ -391,7 +391,7 @@
     return current;
 }
 
-subtitle *sub_read_line_subviewer2(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_subviewer2(stream_t *st,subtitle *current) {
     char line[LINE_LEN+1];
     int a1,a2,a3,a4;
     char *p=NULL;
@@ -424,7 +424,7 @@
 }
 
 
-subtitle *sub_read_line_vplayer(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_vplayer(stream_t *st,subtitle *current) {
 	char line[LINE_LEN+1];
 	int a1,a2,a3;
 	char *p=NULL, *next,separator;
@@ -470,7 +470,7 @@
 	return current;
 }
 
-subtitle *sub_read_line_rt(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_rt(stream_t *st,subtitle *current) {
 	//TODO: This format uses quite rich (sub/super)set of xhtml 
 	// I couldn't check it since DTD is not included.
 	// WARNING: full XML parses can be required for proper parsing 
@@ -520,7 +520,7 @@
     return current;
 }
 
-subtitle *sub_read_line_ssa(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_ssa(stream_t *st,subtitle *current) {
 /*
  * Sub Station Alpha v4 (and v2?) scripts have 9 commas before subtitle
  * other Sub Station Alpha scripts have only 8 commas before subtitle
@@ -592,7 +592,7 @@
 	return current;
 }
 
-void sub_pp_ssa(subtitle *sub) {
+static void sub_pp_ssa(subtitle *sub) {
 	int l=sub->lines;
 	char *so,*de,*start;
 
@@ -621,7 +621,7 @@
  *
  * by set, based on code by szabi (dunnowhat sub format ;-)
  */
-subtitle *sub_read_line_pjs(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_pjs(stream_t *st,subtitle *current) {
     char line[LINE_LEN+1];
     char text[LINE_LEN+1], *s, *d;
 
@@ -659,7 +659,7 @@
     return current;
 }
 
-subtitle *sub_read_line_mpsub(stream_t *st, subtitle *current) {
+static subtitle *sub_read_line_mpsub(stream_t *st, subtitle *current) {
 	char line[LINE_LEN+1];
 	float a,b;
 	int num=0;
@@ -704,7 +704,7 @@
 subtitle *previous_aqt_sub = NULL;
 #endif
 
-subtitle *sub_read_line_aqt(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_aqt(stream_t *st,subtitle *current) {
     char line[LINE_LEN+1];
     char *next;
     int i;
@@ -761,7 +761,7 @@
 subtitle *previous_subrip09_sub = NULL;
 #endif
 
-subtitle *sub_read_line_subrip09(stream_t *st,subtitle *current) {
+static subtitle *sub_read_line_subrip09(stream_t *st,subtitle *current) {
     char line[LINE_LEN+1];
     int a1,a2,a3;
     char * next=NULL;
@@ -813,7 +813,7 @@
     return current;
 }
 
-subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current)
+static subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current)
 {
     char line1[LINE_LEN], line2[LINE_LEN], directive[LINE_LEN], *p, *q;
     unsigned a1, a2, a3, a4, b1, b2, b3, b4, comment = 0;
@@ -1004,7 +1004,7 @@
     return current;
 }
 
-int sub_autodetect (stream_t* st, int *uses_time) {
+static int sub_autodetect (stream_t* st, int *uses_time) {
     char line[LINE_LEN+1];
     int i,j=0;
     char p;
@@ -1118,7 +1118,7 @@
 #define ICBUFFSIZE 512
 static char icbuffer[ICBUFFSIZE];
 
-subtitle* subcp_recode (subtitle *sub)
+static subtitle* subcp_recode (subtitle *sub)
 {
 	int l=sub->lines;
 	size_t ileft, oleft;
--- libmpcodecs/vf_remove_logo.c	(revision 19014)
+++ libmpcodecs/vf_remove_logo.c	(working copy)
@@ -174,7 +174,7 @@
  * of how MPlayer works, it cannot safely halt execution, but at least the user
  * will get an error message before the segfault happens.
  */
-void * safe_malloc(int size)
+static void * safe_malloc(int size)
 {
   void * answer = malloc(size);
   if (answer == NULL)
@@ -194,8 +194,7 @@
  * pixels. The results are returned by reference to posx1, posy1, posx2, and
  * posy2.
  */
-
-void calculate_bounding_rectangle(int * posx1, int * posy1, int * posx2, int * posy2, pgm_structure * filter)
+static void calculate_bounding_rectangle(int * posx1, int * posy1, int * posx2, int * posy2, pgm_structure * filter)
 {
   int x; /* Temporary variables to run  */
   int y; /* through each row or column. */
@@ -264,7 +263,7 @@
  * We call this function when our filter is done. It will free the memory
  * allocated to the masks and leave the variables in a safe state.
  */
-void destroy_masks(vf_instance_t * vf)
+static void destroy_masks(vf_instance_t * vf)
 {
   int a, b;
 
@@ -301,7 +300,7 @@
  * values. The values will not change during program execution once this function
  * is done.
  */
-void initialize_masks(vf_instance_t * vf)
+static void initialize_masks(vf_instance_t * vf)
 {
   int a, b, c;
 
@@ -349,7 +348,7 @@
  * to implement than a proper pythagorean distance since I'm using a modified
  * erosion algorithm to compute the distances.
  */
-void convert_mask_to_strength_mask(vf_instance_t * vf, pgm_structure * mask)
+static void convert_mask_to_strength_mask(vf_instance_t * vf, pgm_structure * mask)
 {
   int x, y; /* Used by our for loops to go through every single pixel in the picture one at a time. */
   int has_anything_changed = 1; /* Used by the main while() loop to know if anything changed on the last erosion. */
@@ -430,7 +429,7 @@
  * logo and blurs it. It does so by finding the average of all the pixels within
  * the mask and outside of the logo.
  */
-void get_blur(const vf_instance_t * const vf, unsigned int * const value_out, const pgm_structure * const logo_mask,
+static void get_blur(const vf_instance_t * const vf, unsigned int * const value_out, const pgm_structure * const logo_mask,
               const mp_image_t * const image, const int x, const int y, const int plane)
 {
   int mask_size; /* Mask size tells how large a circle to use. The radius is about (slightly larger than) mask size. */
@@ -486,7 +485,7 @@
 /**
  * \brief Free a pgm_structure. Undoes load_pgm(...).
  */
-void destroy_pgm(pgm_structure * to_be_destroyed)
+static void destroy_pgm(pgm_structure * to_be_destroyed)
 {
   if (to_be_destroyed == NULL)
     return; /* Don't do anything if a NULL pointer was passed it. */
@@ -503,7 +502,7 @@
 }
 
 /** \brief Helper function for load_pgm(...) to skip whitespace. */
-void load_pgm_skip(FILE *f) {
+static void load_pgm_skip(FILE *f) {
   int c, comment = 0;
   do {
     c = fgetc(f);
@@ -533,7 +532,7 @@
  * guaranteed with ppm is that all zero (R = 0, G = 0, B = 0) pixels will remain
  * zero, and non-zero pixels will remain non-zero.
  */
-pgm_structure * load_pgm(const char * file_name)
+static pgm_structure * load_pgm(const char * file_name)
 {
   int maximum_greyscale_value;
   FILE * input;
@@ -594,7 +593,7 @@
  * rounding error will only cause a minor amount of excess blur in the chroma
  * planes.
  */
-pgm_structure * generate_half_size_image(vf_instance_t * vf, pgm_structure * input_image)
+static pgm_structure * generate_half_size_image(vf_instance_t * vf, pgm_structure * input_image)
 {
   int x, y;
   pgm_structure * new_pgm = (pgm_structure *) safe_malloc (sizeof(pgm_structure));
--- vidix/drivers/savage_vid.c	(revision 19014)
+++ vidix/drivers/savage_vid.c	(working copy)
@@ -323,7 +323,7 @@
 	{ PCI_CHIP_PROSAVAGE_DDRK	, 			S3_PROSAVAGE },
 };
 
-void SavageSetColorOld(void)
+static void SavageSetColorOld(void)
 {
 
 
@@ -360,7 +360,7 @@
   }
 }
 
-void SavageSetColorKeyOld(void)
+static void SavageSetColorKeyOld(void)
 {
     int red, green, blue;
 
@@ -528,7 +528,7 @@
 
 }
 
-void SavageInitStreamsOld(void)
+static void SavageInitStreamsOld(void)
 {
     /*unsigned long jDelta;*/
     unsigned long format = 0;
@@ -726,7 +726,7 @@
 }
 
 
-void SavageStreamsOff(void)
+static void SavageStreamsOff(void)
 {
     unsigned char jStreamsControl;
     unsigned short vgaCRIndex = 0x3d0 + 4;
--- vidix/drivers/radeon_vid.c	(revision 19014)
+++ vidix/drivers/radeon_vid.c	(working copy)
@@ -950,7 +950,7 @@
 };
 
 #ifdef HAVE_X11
-void probe_fireGL_driver(void) {
+static void probe_fireGL_driver(void) {
   Display *dp = XOpenDisplay ((void*)0);
   int n = 0;
   char **extlist;
--- vidix/drivers/nvidia_vid.c	(revision 19014)
+++ vidix/drivers/nvidia_vid.c	(working copy)
@@ -387,7 +387,7 @@
 }
 
 /* Stop overlay video. */
-void rivatv_overlay_stop (struct rivatv_info *info) {
+static void rivatv_overlay_stop (struct rivatv_info *info) {
 	switch (info->chip.arch ) {
 	case NV_ARCH_10:
 	case NV_ARCH_20:
@@ -517,7 +517,7 @@
 
 
 /* Start overlay video. */
-void rivatv_overlay_start (struct rivatv_info *info,int bufno){
+static void rivatv_overlay_start (struct rivatv_info *info,int bufno){
     uint32_t base, size, offset, xscale, yscale, pan;
     uint32_t value;
 	int x=info->wx, y=info->wy;
--- vidix/drivers/unichrome_vid.c	(revision 19014)
+++ vidix/drivers/unichrome_vid.c	(working copy)
@@ -159,7 +159,7 @@
  * @note Derived from VIA's V4L driver.
  *       See ddover.c, DDOVER_HQVCalcZoomHeight()
  */
-int
+static int
 uc_ovl_map_vzoom (int sh, int dh, uint32_t * zoom, uint32_t * mini)
 {
   uint32_t sh1, tmp, d;
@@ -223,7 +223,7 @@
  * @note Derived from VIA's V4L driver.
  *       See ddover.c, DDOVER_HQVCalcZoomWidth() and DDOver_GetDisplayCount()
  */
-int
+static int
 uc_ovl_map_hzoom (int sw, int dw, uint32_t * zoom, uint32_t * mini,
 		  int *falign, int *dcount)
 {
@@ -292,7 +292,7 @@
  * @note Derived from VIA's V4L driver. See ddover.c, DDOver_GetFetch()
  * @note Only call after uc_ovl_map_hzoom()
  */
-uint32_t
+static uint32_t
 uc_ovl_map_qwfetch (uint32_t format, int sw)
 {
   uint32_t fetch = 0;
@@ -335,7 +335,7 @@
  *
  * @note Derived from VIA's V4L driver. See ddover.c, DDOver_GetV1Format()
  */
-uint32_t
+static uint32_t
 uc_ovl_map_format (uint32_t format)
 {
   switch (format)
@@ -371,7 +371,7 @@
  * @param control will hold value for V1_CONTROL.
  * @param fifo will hold value for V1_FIFO_CONTROL.
  */
-void
+static void
 uc_ovl_map_v1_control (uint32_t format, int sw,
 		       int hwrev, int extfifo_on,
 		       uint32_t * control, uint32_t * fifo)
@@ -431,7 +431,7 @@
  * @param extfifo_on pointer determining if extended fifo is enable or not.
  * @param dst_w destination width.
  */
-void
+static void
 uc_ovl_setup_fifo (int *extfifo_on, int dst_w)
 {
   if (dst_w <= 1024) /* Disable extended FIFO */
@@ -456,7 +456,7 @@
     }
 }
 
-void
+static void
 uc_ovl_vcmd_wait (volatile uint8_t * vio)
 {
   while ((VIDEO_IN (vio, V_COMPOSE_MODE)


More information about the MPlayer-dev-eng mailing list