]> Creatis software - gdcm.git/commitdiff
COMP: Fix compilation with -pedantic and -Wwrite-strings
authormalaterre <malaterre>
Thu, 27 Oct 2005 15:54:39 +0000 (15:54 +0000)
committermalaterre <malaterre>
Thu, 27 Oct 2005 15:54:39 +0000 (15:54 +0000)
src/gdcmmpeg2/src/mpeg2dec/getbits.c
src/gdcmmpeg2/src/mpeg2dec/gethdr.c
src/gdcmmpeg2/src/mpeg2dec/global.h
src/gdcmmpeg2/src/mpeg2dec/mpeg2dec.c
src/gdcmmpeg2/src/mpeg2dec/subspic.c

index 3a779b860d7d12fc314d09ec974ccd08435fdbe4..92e07b821427de68545cc19db04418ea7eafc214 100644 (file)
@@ -60,7 +60,6 @@ void Fill_Buffer()
 {
   int Buffer_Level;
 
-  /*Buffer_Level = read(ld->Infile,ld->Rdbfr,2048);*/
   Buffer_Level = ld->read_stream(ld->Infile,ld->Rdbfr,2048);
   ld->Rdptr = ld->Rdbfr;
 
@@ -97,7 +96,6 @@ int Get_Byte()
 {
   while(ld->Rdptr >= ld->Rdbfr+2048)
   {
-    /*read(ld->Infile,ld->Rdbfr,2048);*/
     ld->read_stream(ld->Infile,ld->Rdbfr,2048);
     ld->Rdptr -= 2048;
     ld->Rdmax -= 2048;
index 30ffa5a2fcd1cb5fbd0a87994987c780d2e685bb..c128f010d79f756c05183595f380ef4c24f417d2 100644 (file)
@@ -984,7 +984,7 @@ static int extra_bit_information()
 /* Purpose: this function is mainly designed to aid in bitstream conformance
    testing.  A simple Flush_Buffer(1) would do */
 void marker_bit(text)
-char *text;
+const char *text;
 {
   int marker;
   (void)text;
index 363e0db1f198be6b4363d0401a8e382d3c7fffae..807a182db6269a0b7d5977671021b241791ef90f 100644 (file)
@@ -72,7 +72,7 @@ void Decode_MPEG2_Non_Intra_Block _ANSI_ARGS_((int comp));
 int Get_Hdr _ANSI_ARGS_((void));
 void next_start_code _ANSI_ARGS_((void));
 int slice_header _ANSI_ARGS_((void));
-void marker_bit _ANSI_ARGS_((char *text));
+void marker_bit _ANSI_ARGS_((const char *text));
 
 /* getpic.c */
 void Decode_Picture _ANSI_ARGS_((int bitstream_framenum, 
@@ -105,7 +105,7 @@ void motion_vector _ANSI_ARGS_((int *PMV, int *dmvector,
 void Dual_Prime_Arithmetic _ANSI_ARGS_((int DMV[][2], int *dmvector, int mvx, int mvy));
 
 /* mpeg2dec.c */
-void Error _ANSI_ARGS_((char *text));
+void Error _ANSI_ARGS_((const char *text));
 void Warning _ANSI_ARGS_((char *text));
 void Print_Bits _ANSI_ARGS_((int code, int bits, int len));
 
@@ -263,10 +263,10 @@ EXTERN int Main_Bitstream_Flag;
 
 
 /* filenames */
-EXTERN char *Output_Picture_Filename;
-EXTERN char *Substitute_Picture_Filename;
-EXTERN char *Main_Bitstream_Filename; 
-EXTERN char *Enhancement_Layer_Bitstream_Filename; 
+EXTERN const char *Output_Picture_Filename;
+EXTERN const char *Substitute_Picture_Filename;
+EXTERN const char *Main_Bitstream_Filename; 
+EXTERN const char *Enhancement_Layer_Bitstream_Filename; 
 
 
 /* buffers for multiuse purposes */
@@ -287,7 +287,7 @@ EXTERN unsigned char *llframe0[3];
 EXTERN unsigned char *llframe1[3];
 
 EXTERN short *lltmp;
-EXTERN char *Lower_Layer_Picture_Filename;
+EXTERN const char *Lower_Layer_Picture_Filename;
 
 
 
index 4f156aa07452080b466ffff22147a20f70d93f28..6ab74fc171a542c7f3ba5e9c2ebcebf886fb2fda 100644 (file)
@@ -83,6 +83,7 @@ ssize_t my_read(istream *infile, void *buf, size_t count)
   printf( "%d , %d\n", count , r);
   return r;
 }
+
 int my_close(istream *infile)
 {
 #ifdef FILESTAR
@@ -94,7 +95,6 @@ int my_close(istream *infile)
 
 int my_fopenr(const char *path, const char *mode, istream *os)
 {
-#if 0
   FILE *fd = fopen(path, mode);
   if(fd)
     {
@@ -103,7 +103,6 @@ int my_fopenr(const char *path, const char *mode, istream *os)
     }
   else
     os->InFd = NULL;
-#endif
   return 0;
 }
 
@@ -198,6 +197,7 @@ int argc;
 char *argv[];
 {
   int ret, code;
+  istream bos,eos;
   /*base.open_stream = my_open;*/
   base.seek_stream = my_seek;
   base.read_stream = my_read;
@@ -218,7 +218,6 @@ char *argv[];
   /* NOTE: this is either a base layer stream or a spatial enhancement stream */
 /*  if ((base.Infile=open(Main_Bitstream_Filename,O_RDONLY|O_BINARY))<0) */
   /*base.Infile = ld->open_stream(Main_Bitstream_Filename);*/
-  istream bos;
   base.Infile = &bos;
 #ifdef FILESTAR
   base.Infile->InFd = fopen(Main_Bitstream_Filename, "rb");
@@ -279,7 +278,6 @@ char *argv[];
 
     /*if ((enhan.Infile = open(Enhancement_Layer_Bitstream_Filename,O_RDONLY|O_BINARY))<0)*/
     /*enhan.Infile = ld->open_stream(Enhancement_Layer_Bitstream_Filename);*/
-    istream eos;
     enhan.Infile = &eos;
 #ifdef FILESTAR
     enhan.Infile->InFd = fopen(Main_Bitstream_Filename, "rb");
@@ -431,7 +429,7 @@ static void Initialize_Sequence()
 }
 
 void Error(text)
-char *text;
+const char *text;
 {
   fprintf(stderr,text);
   exit(1);
index a9b8d515867add5361d913e714a23bf32db0a8e9..a8dde34771e700e07054df4ce55118a01bc5220c 100644 (file)
 #include "global.h"
 
 /* private prototypes*/
-static void Read_Frame _ANSI_ARGS_((char *filename, 
+static void Read_Frame _ANSI_ARGS_((const char *filename, 
   unsigned char *frame_buffer[], int framenum));
 static void Copy_Frame _ANSI_ARGS_((unsigned char *src, unsigned char *dst, 
   int width, int height, int parity, int incr));
-static int Read_Components _ANSI_ARGS_ ((char *filename, 
+static int Read_Components _ANSI_ARGS_ ((const char *filename, 
   unsigned char *frame[3], int framenum));
 static int Read_Component _ANSI_ARGS_ ((char *fname, unsigned char *frame, 
   int width, int height));
-static int Extract_Components _ANSI_ARGS_ ((char *filename,
+static int Extract_Components _ANSI_ARGS_ ((const char *filename,
   unsigned char *frame[3], int framenum));
 
 
@@ -148,7 +148,7 @@ int sequence_framenum;
 /* Note: fields are only read to serve as the same-frame reference for 
    a second field */
 static void Read_Frame(fname,frame,framenum)
-char *fname;
+const char *fname;
 unsigned char *frame[];
 int framenum;
 {
@@ -208,7 +208,7 @@ int framenum;
 
 
 static int Read_Components(filename, frame, framenum) 
-char *filename;
+const char *filename;
 unsigned char *frame[3];
 int framenum;
 {
@@ -276,7 +276,7 @@ int Height;
    MPEG Committee's syntax validation and conformance ad-hoc groups from 
    the year 1993 until 1995 */
 static int Extract_Components(filename, frame, framenum) 
-char *filename;
+const char *filename;
 unsigned char *frame[3];
 int framenum;
 {