From e55fdb123dd302ba87d35cef044e9aab3477aa2f Mon Sep 17 00:00:00 2001 From: malaterre Date: Sun, 4 Sep 2005 15:51:46 +0000 Subject: [PATCH] COMP: People really don't know what is the difference between cstring and char* --- src/gdcmjpegls/Decoder/global.c | 12 ++++++------ src/gdcmjpegls/Decoder/global.h | 8 +------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/gdcmjpegls/Decoder/global.c b/src/gdcmjpegls/Decoder/global.c index 768a3ead..89b69be3 100644 --- a/src/gdcmjpegls/Decoder/global.c +++ b/src/gdcmjpegls/Decoder/global.c @@ -60,7 +60,7 @@ -char *disclaimer = "\ +char disclaimer[] = "\ This program is Copyright (c) University of British Columbia.\n\ All rights reserved. It may be freely redistributed in its\n\ entirety provided that this copyright notice is not removed.\n\ @@ -104,13 +104,13 @@ int bpp, /* bits per sample */ /* define color mode strings */ -char *plane_int_string = "plane by plane", - *line_int_string = "line intlv", - *pixel_int_string = "sample intlv"; +char plane_int_string[] = "plane by plane", + line_int_string[] = "line intlv", + pixel_int_string[] = "sample intlv"; /* function to print out error messages */ -void error(char *msg) { +void error(const char *msg) { fprintf(stderr, msg); exit(-1); } @@ -326,7 +326,7 @@ void check_compatibility(jpeg_ls_header *head_frame, jpeg_ls_header *head_scan, /* for writing disclaimer to command line in DOS */ -char *ttyfilename = "CON"; +char ttyfilename[] = "CON"; #define PAUSE 20 diff --git a/src/gdcmjpegls/Decoder/global.h b/src/gdcmjpegls/Decoder/global.h index e7412bd0..6bf1206d 100644 --- a/src/gdcmjpegls/Decoder/global.h +++ b/src/gdcmjpegls/Decoder/global.h @@ -91,10 +91,6 @@ #define DEFAULT_COLOR_MODE LINE_INT -extern char *plane_int_string, - *line_int_string, - *pixel_int_string; - #ifndef BIG_ENDIAN #define BIG_ENDIAN 1 @@ -151,8 +147,6 @@ extern int sampling[MAX_COMPONENTS]; #define RIGHTMARGIN 1 -extern char *disclaimer; - /* alphabet size */ #define MAXA8 (256) @@ -334,7 +328,7 @@ extern int N[TOT_CONTEXTS], /****** Function prototypes */ /* global.c */ -void error(char *msg); +void error(const char *msg); void *safealloc(size_t size); void *safecalloc(size_t numels, size_t size); double get_utime(); -- 2.48.1