[Mplayer-cvslog] CVS: 0_90 unrarlib.c,1.2,1.3

Arpi of Ize arpi at mplayerhq.hu
Wed Apr 2 12:24:03 CEST 2003


Update of /cvsroot/mplayer/0_90
In directory mail:/var/tmp.root/cvs-serv7826

Modified Files:
	unrarlib.c 
Log Message:
Namespace cleanup (made lots of nonsense globals to static) to fix clashes
with libsmbclient etc.
noticed by Anthony Baxter <anthony at interlink.com.au>


Index: unrarlib.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/unrarlib.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- unrarlib.c	14 Dec 2002 17:54:59 -0000	1.2
+++ unrarlib.c	2 Apr 2003 10:24:01 -0000	1.3
@@ -137,7 +137,7 @@
 #include <unistd.h>
 #include <sys/time.h>
 
-DWORD GetTickCount()
+static DWORD GetTickCount()
 {
     struct timeval tv;
     gettimeofday( &tv, 0 );
@@ -153,13 +153,13 @@
 
 #ifdef _DEBUG_LOG                           /* define macros for debugging  */
 
-BOOL debug_log_first_start = TRUE;
+static BOOL debug_log_first_start = TRUE;
 
 #define debug_log(a); debug_log_proc(a, __FILE__, __LINE__);
 #define debug_init(a); debug_init_proc(a);
 
-void debug_log_proc(char *text, char *sourcefile, int sourceline);
-void debug_init_proc(char *file_name);
+static void debug_log_proc(char *text, char *sourcefile, int sourceline);
+static void debug_init_proc(char *file_name);
 
 #else
 #define debug_log(a);   /* no debug this time */
@@ -293,44 +293,44 @@
 struct NewFileHeader NewLhd;
 struct BlockHeader BlockHead;
 
-UBYTE *TempMemory;                          /* temporary unpack-buffer      */
-char *CommMemory;
+static UBYTE *TempMemory;                          /* temporary unpack-buffer      */
+static char *CommMemory;
 
 
-UBYTE *UnpMemory;
-char ArgName[NM];                           /* current file in rar archive  */
-char ArcFileName[NM];                       /* file to decompress           */
+static UBYTE *UnpMemory;
+static char ArgName[NM];                           /* current file in rar archive  */
+static char ArcFileName[NM];                       /* file to decompress           */
 
 #ifdef _USE_MEMORY_TO_MEMORY_DECOMPRESSION  /* mem-to-mem decompression     */
-  MemoryFile *MemRARFile;                   /* pointer to RAR file in memory*/
+static   MemoryFile *MemRARFile;                   /* pointer to RAR file in memory*/
 #else
-  char ArcName[255];                        /* RAR archive name             */
-  FILE *ArcPtr;                             /* input RAR file handler       */
+static   char ArcName[255];                        /* RAR archive name             */
+static   FILE *ArcPtr;                             /* input RAR file handler       */
 #endif
-char Password[255];                         /* password to decrypt files    */
+static char Password[255];                         /* password to decrypt files    */
 
-unsigned char *temp_output_buffer;          /* extract files to this pointer*/
-unsigned long *temp_output_buffer_offset;   /* size of temp. extract buffer */
+static unsigned char *temp_output_buffer;          /* extract files to this pointer*/
+static unsigned long *temp_output_buffer_offset;   /* size of temp. extract buffer */
 
-BOOL FileFound;                             /* TRUE=use current extracted   */
+static BOOL FileFound;                             /* TRUE=use current extracted   */
                                             /* data FALSE=throw data away,  */
                                             /* wrong file                   */
-int MainHeadSize;
-long CurBlockPos,NextBlockPos;
+static int MainHeadSize;
+static long CurBlockPos,NextBlockPos;
 
-unsigned long CurUnpRead, CurUnpWrite;
-long UnpPackedSize;
-long DestUnpSize;
-
-UDWORD HeaderCRC;
-int Encryption;
-
-unsigned int UnpWrSize;
-unsigned char *UnpWrAddr;
-unsigned int UnpPtr,WrPtr;
+static unsigned long CurUnpRead, CurUnpWrite;
+static long UnpPackedSize;
+static long DestUnpSize;
+
+static UDWORD HeaderCRC;
+static int Encryption;
+
+static unsigned int UnpWrSize;
+static unsigned char *UnpWrAddr;
+static unsigned int UnpPtr,WrPtr;
 
-unsigned char PN1,PN2,PN3;
-unsigned short OldKey[4];
+static unsigned char PN1,PN2,PN3;
+static unsigned short OldKey[4];
 
 
 
@@ -338,8 +338,8 @@
 int ReadHeader(int BlockType);
 BOOL ExtrFile(void);
 BOOL ListFile(void);
-int tread(void *stream,void *buf,unsigned len);
-int tseek(void *stream,long offset,int fromwhere);
+static int tread(void *stream,void *buf,unsigned len);
+static int tseek(void *stream,long offset,int fromwhere);
 BOOL UnstoreFile(void);
 int IsArchive(void);
 int ReadBlock(int BlockType);
@@ -360,7 +360,7 @@
 static void MakeDecodeTables(unsigned char *LenTab,
                              struct Decode *Dec,
                              int Size);
-int stricomp(char *Str1,char *Str2);
+static int stricomp(char *Str1,char *Str2);
 /* ------------------------------------------------------------------------ */
 
 
@@ -1091,7 +1091,7 @@
  ************************************************************************** */
 
 
-int tread(void *stream,void *buf,unsigned len)
+static int tread(void *stream,void *buf,unsigned len)
 {
 #ifdef _USE_MEMORY_TO_MEMORY_DECOMPRESSION
 
@@ -1111,14 +1111,14 @@
 
 
 #ifndef _USE_MEMORY_TO_MEMORY_DECOMPRESSION
-int tseek(void *stream,long offset,int fromwhere)
+static int tseek(void *stream,long offset,int fromwhere)
 {
   return(fseek((FILE*)stream,offset,fromwhere));
 }
 #endif
 
 
-char* strupper(char *Str)
+static char* strupper(char *Str)
 {
   char *ChPtr;
   for (ChPtr=Str;*ChPtr;ChPtr++)
@@ -1127,7 +1127,7 @@
 }
 
 
-int stricomp(char *Str1,char *Str2)
+static int stricomp(char *Str1,char *Str2)
 /* compare strings without regard of '\' and '/'                            */
 {
   char S1[512],S2[512];
@@ -1249,7 +1249,7 @@
 #define MC 257
 
 
-struct AudioVariables AudV[4];
+static struct AudioVariables AudV[4];
 
 #define GetBits()                                                 \
         BitField = ( ( ( (UDWORD)InBuf[InAddr]   << 16 ) |        \
@@ -1266,16 +1266,16 @@
 static unsigned int BitField;
 static unsigned int Number;
 
-unsigned char InBuf[8192];                  /* input read buffer            */
+static unsigned char InBuf[8192];                  /* input read buffer            */
 
-unsigned char UnpOldTable[MC*4];
+static unsigned char UnpOldTable[MC*4];
 
-unsigned int InAddr,InBit,ReadTop;
+static unsigned int InAddr,InBit,ReadTop;
 
-unsigned int LastDist,LastLength;
+static unsigned int LastDist,LastLength;
 static unsigned int Length,Distance;
 
-unsigned int OldDist[4],OldDistPtr;
+static unsigned int OldDist[4],OldDistPtr;
 
 
 struct LitDecode
@@ -1320,7 +1320,7 @@
 
 static struct MultDecode *MDPtr[4]={&MD[0],&MD[1],&MD[2],&MD[3]};
 
-int UnpAudioBlock,UnpChannels,CurChannel,ChannelDelta;
+static int UnpAudioBlock,UnpChannels,CurChannel,ChannelDelta;
 
 
 void Unpack(unsigned char *UnpAddr)
@@ -2662,15 +2662,15 @@
 
 
 /* -- global stuff -------------------------------------------------------- */
-char  log_file_name[256];                   /* file name for the log file   */
-DWORD debug_start_time;                     /* starttime of debug           */
-BOOL  debug_started = FALSE;                /* debug_log writes only if     */
+static char  log_file_name[256];                   /* file name for the log file   */
+static DWORD debug_start_time;                     /* starttime of debug           */
+static BOOL  debug_started = FALSE;                /* debug_log writes only if     */
                                             /* this is TRUE                 */
 /* ------------------------------------------------------------------------ */
 
 
 /* -- global functions ---------------------------------------------------- */
-void debug_init_proc(char *file_name)
+static void debug_init_proc(char *file_name)
 /* Create/Rewrite a log file                                                */
 {
   FILE *fp;
@@ -2691,7 +2691,7 @@
 }
 
 
-void debug_log_proc(char *text, char *sourcefile, int sourceline)
+static void debug_log_proc(char *text, char *sourcefile, int sourceline)
 /* add a line to the log file                                               */
 {
   FILE *fp;



More information about the MPlayer-cvslog mailing list