Browse Source

* PChar -> PAnsichar

Michaël Van Canneyt 2 years ago
parent
commit
145388cbc0

+ 2 - 2
packages/pasjpeg/examples/cderror.pas

@@ -52,7 +52,7 @@ type
      JTRC_GIF_EXTENSION,  { Ignoring GIF extension block of type 0x%02x }
      JTRC_GIF_NONSQUARE,  { Caution: nonsquare pixels in input }
      JWRN_GIF_BADDATA,  { Corrupt data in GIF file }
-     JWRN_GIF_CHAR,  { Bogus char 0x%02x in GIF file, ignoring }
+     JWRN_GIF_CHAR,  { Bogus AnsiChar 0x%02x in GIF file, ignoring }
      JWRN_GIF_ENDCODE,  { Premature end of GIF image }
      JWRN_GIF_NOMOREDATA,  { Ran out of GIF bits }
    {$endif} { GIF_SUPPORTED }
@@ -144,7 +144,7 @@ const
   { JTRC_GIF_EXTENSION } 'Ignoring GIF extension block of type 0x%02x',
   { JTRC_GIF_NONSQUARE } 'Caution: nonsquare pixels in input',
   { JWRN_GIF_BADDATA } 'Corrupt data in GIF file',
-  { JWRN_GIF_CHAR } 'Bogus char 0x%02x in GIF file, ignoring',
+  { JWRN_GIF_CHAR } 'Bogus AnsiChar 0x%02x in GIF file, ignoring',
   { JWRN_GIF_ENDCODE } 'Premature end of GIF image',
   { JWRN_GIF_NOMOREDATA } 'Ran out of GIF bits',
 {$endif} { GIF_SUPPORTED }

+ 3 - 3
packages/pasjpeg/examples/cdjpeg.pas

@@ -110,8 +110,8 @@ procedure enable_signal_catcher (cinfo : j_common_ptr);
   minchars is length of minimum legal abbreviation. }
 
 {GLOBAL}
-function keymatch (arg : string;
-                   const keyword : string;
+function keymatch (arg : ansistring;
+                   const keyword : ansistring;
                    minchars : int) : boolean;
 
 {$ifdef PROGRESS_REPORT}
@@ -203,7 +203,7 @@ function keymatch (arg : string;
                    minchars : int) : boolean;
 var
   {register} i : int;
-  ca, ck : char;
+  ca, ck : AnsiChar;
   {register} nmatched : int;
 begin
   nmatched := 0;

+ 7 - 7
packages/pasjpeg/examples/cjpeg.pas

@@ -66,9 +66,9 @@ var
  is_targa : boolean;    { records user -targa switch }
 
 function GetFirstChar(cinfo : j_compress_ptr;
-                      fptr : fileptr) : char;
+                      fptr : fileptr) : AnsiChar;
 var
-  c : char;
+  c : AnsiChar;
 begin
   if JFREAD(fptr, @c, 1) <> 1 then
     ERREXIT(j_common_ptr(cinfo), JERR_INPUT_EMPTY);
@@ -88,7 +88,7 @@ end;
 function select_file_type (cinfo : j_compress_ptr;
                            var infile : FILE) : cjpeg_source_ptr;
 var
-  c : char;
+  c : AnsiChar;
 begin
   if (is_targa) then
   begin
@@ -117,7 +117,7 @@ begin
   'R': select_file_type := jinit_read_rle(cinfo);
 {$endif}
 {$ifdef TARGA_SUPPORTED}
-  char($00): select_file_type := jinit_read_targa(cinfo);
+  AnsiChar($00): select_file_type := jinit_read_targa(cinfo);
 {$endif}
   else
     ERREXIT(j_common_ptr(cinfo), JERR_UNKNOWN_FORMAT);
@@ -218,7 +218,7 @@ function parse_switches (cinfo : j_compress_ptr;
 var
   argn,
   argc : int;
-  arg : string;
+  arg : ansistring;
 var
   value : int;
   code : integer;
@@ -230,10 +230,10 @@ var
   qtablefile,                  { saves -qtables filename if any }
   qslotsarg,                   { saves -qslots parm if any }
   samplearg,                   { saves -sample parm if any }
-  scansarg : string;           { saves -scans parm if any }
+  scansarg : ansistring;           { saves -scans parm if any }
 var
   lval : long;
-  ch : char;
+  ch : AnsiChar;
 
 const
   printed_version : boolean = FALSE;

+ 6 - 6
packages/pasjpeg/examples/djpeg.pas

@@ -161,7 +161,7 @@ function parse_switches (cinfo : j_decompress_ptr;
 var
   argn,
   argc : int;
-  arg : string;
+  arg : ansistring;
 var
   value : int;
   code : integer;
@@ -173,7 +173,7 @@ const
   printed_version : boolean = FALSE;
 var
   lval : long;
-  ch : char;
+  ch : AnsiChar;
 begin
   { Set up default JPEG parameters. }
   requested_fmt := DEFAULT_FMT; { set default output file format }
@@ -422,7 +422,7 @@ end;
   Note this code relies on a non-suspending data source. }
 
 {LOCAL}
-function jpeg_getc (cinfo : j_decompress_ptr) : char;
+function jpeg_getc (cinfo : j_decompress_ptr) : AnsiChar;
 { Read next byte }
 var
   datasrc : jpeg_source_mgr_ptr;
@@ -435,7 +435,7 @@ begin
       ERREXIT(j_common_ptr(cinfo), JERR_CANT_SUSPEND);
   end;
   Dec(datasrc^.bytes_in_buffer);
-  jpeg_getc := char(GETJOCTET(datasrc^.next_input_byte^));
+  jpeg_getc := AnsiChar(GETJOCTET(datasrc^.next_input_byte^));
   Inc(datasrc^.next_input_byte);
 end;
 
@@ -448,8 +448,8 @@ const
 var
   traceit : boolean;
   length : INT32;
-  ch : char;
-  lastch : char;
+  ch : AnsiChar;
+  lastch : AnsiChar;
 begin
   traceit := (cinfo^.err^.trace_level >= 1);
   lastch := #0;

+ 2 - 2
packages/pasjpeg/examples/fcache.pas

@@ -37,7 +37,7 @@ Function fc_getc(var fc : Cache) : Byte;
 { Read a byte at the current buffer read-index, increment the buffer
   read-index }
 
-function fc_ungetc (var fc  : Cache; ch : char) : Byte;
+function fc_ungetc (var fc  : Cache; ch : AnsiChar) : Byte;
 { Read a byte at the current buffer read-index, increment the buffer
   read-index }
 
@@ -133,7 +133,7 @@ begin
     fc_getc := Byte(EOF);
 end;
 
-function fc_ungetc (var fc  : Cache; ch : char) : Byte;
+function fc_ungetc (var fc  : Cache; ch : AnsiChar) : Byte;
 { Read a byte at the current buffer read-index, increment the buffer
   read-index }
 begin

+ 7 - 7
packages/pasjpeg/examples/jpegtran.pas

@@ -30,7 +30,7 @@ uses
 
 var
   progname,             { program name for error messages }
-  outfilename : string; { for -outfile switch }
+  outfilename : ansistring; { for -outfile switch }
   copyoption : JCOPY_OPTION;                  { -copy switch }
   transformoption : jpeg_transform_info; { image transformation options }
 
@@ -125,14 +125,14 @@ const
 var
   argn,
   argc : int;
-  arg : string;
+  arg : ansistring;
 
   simple_progressive : boolean;
-const
-  scansarg : string = '';       { saves -scans parm if any }
+var
+  scansarg : ansistring = '';       { saves -scans parm if any }
 var
   lval : long;
-  ch : char;
+  ch : AnsiChar;
   code : integer;
 begin
   { Set up default JPEG parameters. }
@@ -212,7 +212,7 @@ begin
         if keymatch(arg, '-cut', 2) then
         begin
         { Cut out a region of the image specified by an X geometry-like string }
-        p : PChar;
+        p : PAnsiChar;
 
           Inc(argn);
           if (argn >= argc) then
@@ -450,7 +450,7 @@ end;
 
 { The main program. }
 
-{main (int argc, char **argv)}
+{main (int argc, AnsiChar **argv)}
 var
   srcinfo : jpeg_decompress_struct;
   dstinfo : jpeg_compress_struct;

+ 2 - 2
packages/pasjpeg/examples/rdbmp.pas

@@ -50,11 +50,11 @@ type
 {$else} { !HAVE_UNSIGNED_CHAR }
   {$ifdef CHAR_IS_UNSIGNED}
   type
-    U_CHAR = char;
+    U_CHAR = AnsiChar;
     UCH = int;
   {$else}
   type
-    U_CHAR = char;
+    U_CHAR = AnsiChar;
     UCH = int(x) and $FF
   {$endif}
 {$endif} { HAVE_UNSIGNED_CHAR }

+ 2 - 2
packages/pasjpeg/examples/rdcolmap.pas

@@ -141,7 +141,7 @@ end;
 
 {LOCAL}
 function pbm_getc (var infile : FILE) : int;
-{ Read next char, skipping over any comments }
+{ Read next AnsiChar, skipping over any comments }
 { A comment/newline sequence is returned as a newline }
 var
   {register} ch : int;
@@ -255,7 +255,7 @@ end;
 procedure read_color_map (cinfo : j_decompress_ptr;
                           var infile : FILE);
 var
-  ch : char;
+  ch : AnsiChar;
 begin
   { Allocate space for a color map of maximum supported size. }
   cinfo^.colormap := cinfo^.mem^.alloc_sarray

+ 5 - 5
packages/pasjpeg/examples/rdjpgcom.pas

@@ -33,7 +33,7 @@ begin
 end;
 
 { Error exit handler }
-procedure ERREXIT(msg : string);
+procedure ERREXIT(msg : shortstring);
 begin
   WriteLn(output, msg);
   Halt(EXIT_FAILURE);
@@ -182,7 +182,7 @@ const
   LF = 10;
 var
   length : uInt;
-  comment : string;
+  comment : shortstring;
   lastch : byte;
 begin
   comment := '';
@@ -196,7 +196,7 @@ begin
   comment := '';
   while (length > 0) do
   begin
-    comment := comment + char(read_1_byte);
+    comment := comment + AnsiChar(read_1_byte);
     Dec(length);
   end;
   WriteLn(comment);
@@ -211,7 +211,7 @@ var
   length : uInt;
   image_height, image_width : uInt;
   data_precision, num_components : int;
-  process : string;
+  process : shortstring;
   ci: int;
 begin
   length := read_2_bytes;       { usual parameter length count }
@@ -341,7 +341,7 @@ end;
 var
   verbose : boolean;
   argn : int;
-  arg : string;
+  arg : shortstring;
 begin
   verbose := FALSE;
 

+ 7 - 7
packages/pasjpeg/examples/rdppm.pas

@@ -56,7 +56,7 @@ implementation
 
 {$ifdef HAVE_UNSIGNED_CHAR}
 type
-  U_CHAR = unsigned char;
+  U_CHAR = unsigned AnsiChar;
   UCH = int;
 {$else} { !HAVE_UNSIGNED_CHAR }
   {$ifdef CHAR_IS_UNSIGNED}
@@ -66,7 +66,7 @@ type
     UCH = int;
   {$else}
   type
-    U_CHAR = char;
+    U_CHAR = AnsiChar;
     UCH(x) = int (x and $FF)
   {$endif}
 {$endif} { HAVE_UNSIGNED_CHAR }
@@ -105,11 +105,11 @@ const
   CR = #13;
 
 {LOCAL}
-function pbm_getc (var infile : file) : char;
-{ Read next char, skipping over any comments }
+function pbm_getc (var infile : file) : AnsiChar;
+{ Read next AnsiChar, skipping over any comments }
 { A comment/newline sequence is returned as a newline }
 var
-  {register} ch : char;
+  {register} ch : AnsiChar;
 begin
   {getch} BlockRead(infile, ch, 1);
   if (ch = '#') then
@@ -132,7 +132,7 @@ function read_pbm_integer (cinfo : j_compress_ptr; var infile : file) : uint;
 const
   TAB = ^I;
 var
-  {register} ch : char;
+  {register} ch : AnsiChar;
   {register} val : uint;
 begin
   { Skip any leading whitespace }
@@ -386,7 +386,7 @@ procedure start_input_ppm (cinfo : j_compress_ptr;
                            sinfo : cjpeg_source_ptr); far;
 var
   source : ppm_source_ptr;
-  c : char;
+  c : AnsiChar;
   w, h, maxval : uint;
   need_iobuffer, use_raw_buffer, need_rescale : boolean;
 var

+ 26 - 26
packages/pasjpeg/examples/rdswitch.pas

@@ -23,7 +23,7 @@ uses
   jpeglib;
 
 {GLOBAL}
-function set_quant_slots (cinfo : j_compress_ptr; argtxt : string) : boolean;
+function set_quant_slots (cinfo : j_compress_ptr; argtxt : ansistring) : boolean;
 { Process a quantization-table-selectors parameter string, of the form
       N[,N,...]
   If there are more components than parameters, the last value is re0licated.
@@ -32,7 +32,7 @@ function set_quant_slots (cinfo : j_compress_ptr; argtxt : string) : boolean;
 
 {GLOBAL}
 function set_sample_factors (cinfo : j_compress_ptr;
-                             argtxt : string) : boolean;
+                             argtxt ansi: string) : boolean;
 { Process a sample-factors parameter string, of the form
       HxV[,HxV,...]
   If there are more components than parameters, "1x1" is assumed for the rest.
@@ -40,7 +40,7 @@ function set_sample_factors (cinfo : j_compress_ptr;
 
 {GLOBAL}
 function read_quant_tables (cinfo : j_compress_ptr;
-                            const filename : string;
+                            const filename : ansistring;
                             scale_factor : int;
                             force_baseline : boolean) : boolean;
 
@@ -55,7 +55,7 @@ function read_quant_tables (cinfo : j_compress_ptr;
 
 {GLOBAL}
 function read_scan_script (cinfo : j_compress_ptr;
-                           const filename : string) : boolean;
+                           const filename : ansistring) : boolean;
 { Read a scan script from the specified text file.
   Each entry in the file defines one scan to be emitted.
   Entries are separated by semicolons ';'.
@@ -83,16 +83,16 @@ const
   LF = #10; { }
 
 {LOCAL}
-function text_getc (var fc : Cache) : char;
-{ Read next char, skipping over any comments (# to end of line) }
+function text_getc (var fc : Cache) : AnsiChar;
+{ Read next AnsiChar, skipping over any comments (# to end of line) }
 { A comment/newline sequence is returned as a newline }
 var
-  ch : char; {register }
+  ch : AnsiChar; {register }
 begin
-  ch := char(fc_GetC(fc));
+  ch := AnsiChar(fc_GetC(fc));
   if (ch = '#') then
   repeat
-    ch := char(fc_GetC(fc));
+    ch := AnsiChar(fc_GetC(fc));
   Until (ch = #13) or (ch = EOF);
   text_getc := ch;
 end;
@@ -100,11 +100,11 @@ end;
 {LOCAL}
 function read_text_integer (var f : Cache;
                             var outval : long;
-                            var termchar : char) : boolean;
+                            var termchar : AnsiChar) : boolean;
 { Read an unsigned decimal integer from a file, store it in outval }
 { Reads one trailing character after the integer; returns it in termchar }
 var
-  {register} ch : char;
+  {register} ch : AnsiChar;
   {register} val : long;
 begin
   { Skip any leading whitespace, detect EOF }
@@ -143,7 +143,7 @@ end;
 
 {GLOBAL}
 function read_quant_tables (cinfo : j_compress_ptr;
-                            const filename : string;
+                            const filename : ansistring;
                             scale_factor : int;
                             force_baseline : boolean) : boolean;
 { Read a set of quantization tables from the specified file.
@@ -158,7 +158,7 @@ var
   f : file;
   fp : Cache;
   tblno, i : int;
-  termchar : char;
+  termchar : AnsiChar;
   val : long;
   table : array[0..DCTSIZE2-1] of uInt;
 begin
@@ -219,11 +219,11 @@ end;
 {LOCAL}
 function read_scan_integer (var f : cache;
                             var outval : long;
-                            var termchar : char) : boolean;
+                            var termchar : AnsiChar) : boolean;
 { Variant of read_text_integer that always looks for a non-space termchar;
   this simplifies parsing of punctuation in scan scripts. }
 var
-  ch : char; { register }
+  ch : AnsiChar; { register }
 begin
   if not read_text_integer(f, outval, termchar) then
   begin
@@ -257,7 +257,7 @@ end;
 
 {GLOBAL}
 function read_scan_script (cinfo : j_compress_ptr;
-                           const filename : string) : boolean;
+                           const filename : ansistring) : boolean;
 { Read a scan script from the specified text file.
   Each entry in the file defines one scan to be emitted.
   Entries are separated by semicolons ';'.
@@ -278,7 +278,7 @@ var
   f : file;
   fp : Cache;
   scanno, ncomps : int;
-  termchar : char;
+  termchar : AnsiChar;
   val : long;
   scanptr : jpeg_scan_info_ptr;
 const
@@ -389,9 +389,9 @@ end;
 
 {$endif} { C_MULTISCAN_FILES_SUPPORTED }
 
-function sscanf(var lineptr : PChar;
+function sscanf(var lineptr : PAnsiChar;
                 var val : int;
-                var ch : char) : boolean;
+                var ch : AnsiChar) : boolean;
 var
   digits : int;
 begin
@@ -423,10 +423,10 @@ function set_quant_slots (cinfo : j_compress_ptr;
 var
   val : int;    { default table # }
   ci : int;
-  ch : char;
+  ch : AnsiChar;
 var
-  arg_copy : string;
-  arg : PChar;
+  arg_copy : ansistring;
+  arg : PAnsiChar;
 begin
   arg_copy := argtxt + #0;
   if arg_copy[Length(arg_copy)] <> #0 then
@@ -469,17 +469,17 @@ end;
 
 {GLOBAL}
 function set_sample_factors (cinfo : j_compress_ptr;
-                             argtxt : string) : boolean;
+                             argtxt : ansistring) : boolean;
 { Process a sample-factors parameter string, of the form
       HxV[,HxV,...]
   If there are more components than parameters, "1x1" is assumed for the rest.
  }
 var
   ci, val1, val2 : int;
-  ch1, ch2 : char;
+  ch1, ch2 : AnsiChar;
 var
-  arg_copy : string;
-  arg : PChar;
+  arg_copy : ansistring;
+  arg : PAnsiChar;
 begin
   arg_copy := argtxt + #0;
   if arg_copy[Length(arg_copy)] <> #0 then

+ 8 - 8
packages/pasjpeg/examples/wrjpgcom.pas

@@ -60,7 +60,7 @@ begin
 end;
 
 { Error exit handler }
-procedure ERREXIT(msg : string);
+procedure ERREXIT(msg : ansistring);
 begin
   WriteLn(msg);
   Halt(EXIT_FAILURE);
@@ -353,14 +353,14 @@ begin
 end;
 
 
-function keymatch (const arg : string;
-                   const keyword : string;
+function keymatch (const arg : ansistring;
+                   const keyword : ansistring;
                    minchars : int) : boolean;
 { Case-insensitive matching of (possibly abbreviated) keyword switches. }
 { keyword is the constant keyword (must be lower case already), }
 { minchars is length of minimum legal abbreviation. }
 var
-  {register} ca, ck : char;
+  {register} ca, ck : AnsiChar;
   {register} nmatched : int;
   i, len : int;
 begin
@@ -386,10 +386,10 @@ end;
 var
   argc,
   argn : int;
-  arg : string;
+  arg : ansistring;
   keep_COM : boolean;
-  comment_arg : string;
-  comment_arg_0 : PChar;
+  comment_arg : ansistring;
+  comment_arg_0 : PAnsiChar;
   comment_file : TBufStream;
   comment_length : uint;
   marker : int;
@@ -560,7 +560,7 @@ begin
                    uint(MAX_COM_LENGTH)),' bytes);
           Halt(EXIT_FAILURE);
         end;
-        comment_arg[comment_length] := char(c);
+        comment_arg[comment_length] := AnsiChar(c);
         Inc(comment_length);
       end;
     until (c = EOF);

+ 9 - 9
packages/pasjpeg/examples/wrppm.pas

@@ -42,14 +42,14 @@ implementation
   implementation will be to ask for that instead.) }
 
 type
-  CharPtr = ^char;
+  CharPtr = ^AnsiChar;
 
 
 {$ifdef BITS_IN_JSAMPLE_IS_8}
 
 procedure PUTPPMSAMPLE(var ptr : CharPtr; v : byte);
 begin
-  ptr^ := char(v);
+  ptr^ := AnsiChar(v);
   Inc(ptr);
 end;
 
@@ -61,7 +61,7 @@ const
 
 procedure PUTPPMSAMPLE(var ptr : CharPtr; v : byte);
 begin
-  ptr^ := char (v shr (BITS_IN_JSAMPLE-8));
+  ptr^ := AnsiChar (v shr (BITS_IN_JSAMPLE-8));
   Inc(ptr);
 end;
 
@@ -77,9 +77,9 @@ var
   {register} val_ : int;
 begin
   val_ := v;
-  ptr^ := char (val_ and $FF);
+  ptr^ := AnsiChar (val_ and $FF);
   Inc(ptr);
-  ptr^ := char ((val_ shr 8) and $FF);
+  ptr^ := AnsiChar ((val_ shr 8) and $FF);
   Inc(ptr);
 end;
 const
@@ -89,7 +89,7 @@ const
 {$endif}
 
 
-{ When JSAMPLE is the same size as char, we can just fwrite() the
+{ When JSAMPLE is the same size as AnsiChar, we can just fwrite() the
   decompressed data to the PPM or PGM file.  On PCs, in order to make this
   work the output buffer must be allocated in near data space, because we are
   assuming small-data memory model wherein fwrite() can't reach far memory.
@@ -229,7 +229,7 @@ var
 var
   header : string[200];
 
-  function LongToStr(l : long) : string;
+  function LongToStr(l : long) : ansistring;
   var
     helpstr : string[20];
   begin
@@ -294,12 +294,12 @@ begin
 
   { Create physical I/O buffer.  Note we make this near on a PC. }
   dest^.samples_per_row := cinfo^.output_width * cinfo^.out_color_components;
-  dest^.buffer_width := dest^.samples_per_row * (BYTESPERSAMPLE * SIZEOF(char));
+  dest^.buffer_width := dest^.samples_per_row * (BYTESPERSAMPLE * SIZEOF(AnsiChar));
   dest^.iobuffer := CharPtr( cinfo^.mem^.alloc_small
     (j_common_ptr(cinfo), JPOOL_IMAGE, dest^.buffer_width) );
 
   if (cinfo^.quantize_colors) or (BITS_IN_JSAMPLE <> 8) or
-      (SIZEOF(JSAMPLE) <> SIZEOF(char)) then
+      (SIZEOF(JSAMPLE) <> SIZEOF(AnsiChar)) then
   begin
     { When quantizing, we need an output buffer for colormap indexes
       that's separate from the physical I/O buffer.  We also need a

+ 1 - 0
packages/pasjpeg/src/jconfig.inc

@@ -116,4 +116,5 @@
 {$MODE DELPHI}
 {$GOTO ON}
 {$DEFINE DELPHI_STREAM}
+{$H-}
 {$ENDIF}

+ 1 - 1
packages/pasjpeg/src/jcphuff.pas

@@ -55,7 +55,7 @@ type
     ac_tbl_no : int;            { the table number of the single component }
     EOBRUN : uInt;              { run length of EOBs }
     BE : uInt;                  { # of buffered correction bits before MCU }
-    bit_buffer : JBytePtr;      { buffer for correction bits (1 per char) }
+    bit_buffer : JBytePtr;      { buffer for correction bits (1 per AnsiChar) }
     { packing correction bits tightly would save some space but cost time... }
 
     restarts_to_go : uInt;      { MCUs left in this restart interval }

+ 1 - 1
packages/pasjpeg/src/jdatadst.pas

@@ -5,7 +5,7 @@ Unit JDataDst;
   are sufficient for most applications, some will want to use a different
   destination manager.
   IMPORTANT: we assume that fwrite() will correctly transcribe an array of
-  JOCTETs into 8-bit-wide elements on external storage.  If char is wider
+  JOCTETs into 8-bit-wide elements on external storage.  If AnsiChar is wider
   than 8 bits on your machine, you may need to do some tweaking. }
 
 { Original : jdatadst.c ; Copyright (C) 1994-1996, Thomas G. Lane. }

+ 1 - 1
packages/pasjpeg/src/jdatasrc.pas

@@ -5,7 +5,7 @@ Unit JDataSrc;
   are sufficient for most applications, some will want to use a different
   source manager.
   IMPORTANT: we assume that fread() will correctly transcribe an array of
-  JOCTETs from 8-bit-wide elements on external storage.  If char is wider
+  JOCTETs from 8-bit-wide elements on external storage.  If AnsiChar is wider
   than 8 bits on your machine, you may need to do some tweaking. }
 
 { jdatasrc.c ; Copyright (C) 1994-1996, Thomas G. Lane. }

+ 2 - 2
packages/pasjpeg/src/jdeferr.pas

@@ -190,7 +190,7 @@ type
      JTRC_GIF_EXTENSION,  { Ignoring GIF extension block of type 0x%02x }
      JTRC_GIF_NONSQUARE,  { Caution: nonsquare pixels in input }
      JWRN_GIF_BADDATA,  { Corrupt data in GIF file }
-     JWRN_GIF_CHAR,  { Bogus char 0x%02x in GIF file, ignoring }
+     JWRN_GIF_CHAR,  { Bogus AnsiChar 0x%02x in GIF file, ignoring }
      JWRN_GIF_ENDCODE,  { Premature end of GIF image }
      JWRN_GIF_NOMOREDATA,  { Ran out of GIF bits }
    {$endif} { GIF_SUPPORTED }
@@ -433,7 +433,7 @@ const
   { JTRC_GIF_EXTENSION } 'Ignoring GIF extension block of type 0x%02x',
   { JTRC_GIF_NONSQUARE } 'Caution: nonsquare pixels in input',
   { JWRN_GIF_BADDATA } 'Corrupt data in GIF file',
-  { JWRN_GIF_CHAR } 'Bogus char 0x%02x in GIF file, ignoring',
+  { JWRN_GIF_CHAR } 'Bogus AnsiChar 0x%02x in GIF file, ignoring',
   { JWRN_GIF_ENDCODE } 'Premature end of GIF image',
   { JWRN_GIF_NOMOREDATA } 'Ran out of GIF bits',
 {$endif} { GIF_SUPPORTED }

+ 3 - 3
packages/pasjpeg/src/jmemdosa.pas

@@ -28,7 +28,7 @@ type
   end;
 { offset is a reserved word in BASM }
 
-function jdos_open (var handle : short {far}; const filename {: PChar}) : short;
+function jdos_open (var handle : short {far}; const filename {: PAnsiChar}) : short;
 
 function jdos_close (handle : short) : short;
 
@@ -52,7 +52,7 @@ implementation
 
 
 function jdos_open (var handle : short {far};
-                    const filename {: PChar}) : short; assembler;
+                    const filename {: PAnsiChar}) : short; assembler;
 { Create and open a temporary file }
 label
   open_err;
@@ -294,7 +294,7 @@ function jems_available : short; assembler;
 label
   no_ems, avail_done;
 const
-  ASCII_device_name : packed array[0..7] of char  = 'EMMXXXX0';
+  ASCII_device_name : packed array[0..7] of AnsiChar  = 'EMMXXXX0';
 asm
         push    si                      { save all registers for safety }
         push    di

+ 4 - 4
packages/pasjpeg/src/jmorecfg.pas

@@ -83,24 +83,24 @@ const
 
 { Basic data types.
   You may need to change these if you have a machine with unusual data
-  type sizes; for example, "char" not 8 bits, "short" not 16 bits,
+  type sizes; for example, "AnsiChar" not 8 bits, "short" not 16 bits,
   or "long" not 32 bits.  We don't care whether "int" is 16 or 32 bits,
   but it had better be at least 16. }
 
 
 { Representation of a single sample (pixel element value).
   We frequently allocate large arrays of these, so it's important to keep
-  them small.  But if you have memory to burn and access to char or short
+  them small.  But if you have memory to burn and access to AnsiChar or short
   arrays is very slow on your hardware, you might want to change these. }
 
 
 {$ifdef BITS_IN_JSAMPLE_IS_8}
 { JSAMPLE should be the smallest type that will hold the values 0..255.
-  You can use a signed char by having GETJSAMPLE mask it with $FF. }
+  You can use a signed AnsiChar by having GETJSAMPLE mask it with $FF. }
 
 { CHAR_IS_UNSIGNED }
 type
-  JSAMPLE = byte; { Pascal unsigned char }
+  JSAMPLE = byte; { Pascal unsigned AnsiChar }
   GETJSAMPLE = int;
 
 const

+ 4 - 3
packages/pasjpeg/src/jpeglib.pas

@@ -713,6 +713,7 @@ type
 
   {int8array = Array[0..8-1] of int;}
   int8array = Array[0..8-1] of longint; { for TP FormatStr }
+  TFormatCallback = procedure  (cinfo : j_common_ptr; var buffer : shortstring);
 
   jpeg_error_mgr = record
     { Error exit handler: does not return to caller }
@@ -722,7 +723,7 @@ type
     { Routine that actually outputs a trace or error message }
     output_message : procedure (cinfo : j_common_ptr);
     { Format a message string for the most recent JPEG error or message }
-    format_message : procedure  (cinfo : j_common_ptr; var buffer : string);
+    format_message : TFormatCallback;
 
     { Reset error state variables at start of a new image }
     reset_error_mgr : procedure (cinfo : j_common_ptr);
@@ -760,7 +761,7 @@ type
       First table includes all errors generated by JPEG library itself.
       Error code 0 is reserved for a "no such error string" message. }
 
-    {const char * const * jpeg_message_table; }
+    {const AnsiChar * const * jpeg_message_table; }
     jpeg_message_table : ^msg_table; { Library errors }
 
     last_jpeg_message : J_MESSAGE_CODE;
@@ -768,7 +769,7 @@ type
     { Second table can be added by application (see cjpeg/djpeg for example).
       It contains strings numbered first_addon_message..last_addon_message. }
 
-    {const char * const * addon_message_table; }
+    {const AnsiChar * const * addon_message_table; }
     addon_message_table : ^msg_table; { Non-library errors }
 
     first_addon_message : J_MESSAGE_CODE;  { code for first string in addon table }