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_EXTENSION,  { Ignoring GIF extension block of type 0x%02x }
      JTRC_GIF_NONSQUARE,  { Caution: nonsquare pixels in input }
      JTRC_GIF_NONSQUARE,  { Caution: nonsquare pixels in input }
      JWRN_GIF_BADDATA,  { Corrupt data in GIF file }
      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_ENDCODE,  { Premature end of GIF image }
      JWRN_GIF_NOMOREDATA,  { Ran out of GIF bits }
      JWRN_GIF_NOMOREDATA,  { Ran out of GIF bits }
    {$endif} { GIF_SUPPORTED }
    {$endif} { GIF_SUPPORTED }
@@ -144,7 +144,7 @@ const
   { JTRC_GIF_EXTENSION } 'Ignoring GIF extension block of type 0x%02x',
   { JTRC_GIF_EXTENSION } 'Ignoring GIF extension block of type 0x%02x',
   { JTRC_GIF_NONSQUARE } 'Caution: nonsquare pixels in input',
   { JTRC_GIF_NONSQUARE } 'Caution: nonsquare pixels in input',
   { JWRN_GIF_BADDATA } 'Corrupt data in GIF file',
   { 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_ENDCODE } 'Premature end of GIF image',
   { JWRN_GIF_NOMOREDATA } 'Ran out of GIF bits',
   { JWRN_GIF_NOMOREDATA } 'Ran out of GIF bits',
 {$endif} { GIF_SUPPORTED }
 {$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. }
   minchars is length of minimum legal abbreviation. }
 
 
 {GLOBAL}
 {GLOBAL}
-function keymatch (arg : string;
-                   const keyword : string;
+function keymatch (arg : ansistring;
+                   const keyword : ansistring;
                    minchars : int) : boolean;
                    minchars : int) : boolean;
 
 
 {$ifdef PROGRESS_REPORT}
 {$ifdef PROGRESS_REPORT}
@@ -203,7 +203,7 @@ function keymatch (arg : string;
                    minchars : int) : boolean;
                    minchars : int) : boolean;
 var
 var
   {register} i : int;
   {register} i : int;
-  ca, ck : char;
+  ca, ck : AnsiChar;
   {register} nmatched : int;
   {register} nmatched : int;
 begin
 begin
   nmatched := 0;
   nmatched := 0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -42,14 +42,14 @@ implementation
   implementation will be to ask for that instead.) }
   implementation will be to ask for that instead.) }
 
 
 type
 type
-  CharPtr = ^char;
+  CharPtr = ^AnsiChar;
 
 
 
 
 {$ifdef BITS_IN_JSAMPLE_IS_8}
 {$ifdef BITS_IN_JSAMPLE_IS_8}
 
 
 procedure PUTPPMSAMPLE(var ptr : CharPtr; v : byte);
 procedure PUTPPMSAMPLE(var ptr : CharPtr; v : byte);
 begin
 begin
-  ptr^ := char(v);
+  ptr^ := AnsiChar(v);
   Inc(ptr);
   Inc(ptr);
 end;
 end;
 
 
@@ -61,7 +61,7 @@ const
 
 
 procedure PUTPPMSAMPLE(var ptr : CharPtr; v : byte);
 procedure PUTPPMSAMPLE(var ptr : CharPtr; v : byte);
 begin
 begin
-  ptr^ := char (v shr (BITS_IN_JSAMPLE-8));
+  ptr^ := AnsiChar (v shr (BITS_IN_JSAMPLE-8));
   Inc(ptr);
   Inc(ptr);
 end;
 end;
 
 
@@ -77,9 +77,9 @@ var
   {register} val_ : int;
   {register} val_ : int;
 begin
 begin
   val_ := v;
   val_ := v;
-  ptr^ := char (val_ and $FF);
+  ptr^ := AnsiChar (val_ and $FF);
   Inc(ptr);
   Inc(ptr);
-  ptr^ := char ((val_ shr 8) and $FF);
+  ptr^ := AnsiChar ((val_ shr 8) and $FF);
   Inc(ptr);
   Inc(ptr);
 end;
 end;
 const
 const
@@ -89,7 +89,7 @@ const
 {$endif}
 {$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
   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
   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.
   assuming small-data memory model wherein fwrite() can't reach far memory.
@@ -229,7 +229,7 @@ var
 var
 var
   header : string[200];
   header : string[200];
 
 
-  function LongToStr(l : long) : string;
+  function LongToStr(l : long) : ansistring;
   var
   var
     helpstr : string[20];
     helpstr : string[20];
   begin
   begin
@@ -294,12 +294,12 @@ begin
 
 
   { Create physical I/O buffer.  Note we make this near on a PC. }
   { 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^.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
   dest^.iobuffer := CharPtr( cinfo^.mem^.alloc_small
     (j_common_ptr(cinfo), JPOOL_IMAGE, dest^.buffer_width) );
     (j_common_ptr(cinfo), JPOOL_IMAGE, dest^.buffer_width) );
 
 
   if (cinfo^.quantize_colors) or (BITS_IN_JSAMPLE <> 8) or
   if (cinfo^.quantize_colors) or (BITS_IN_JSAMPLE <> 8) or
-      (SIZEOF(JSAMPLE) <> SIZEOF(char)) then
+      (SIZEOF(JSAMPLE) <> SIZEOF(AnsiChar)) then
   begin
   begin
     { When quantizing, we need an output buffer for colormap indexes
     { When quantizing, we need an output buffer for colormap indexes
       that's separate from the physical I/O buffer.  We also need a
       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}
 {$MODE DELPHI}
 {$GOTO ON}
 {$GOTO ON}
 {$DEFINE DELPHI_STREAM}
 {$DEFINE DELPHI_STREAM}
+{$H-}
 {$ENDIF}
 {$ENDIF}

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

@@ -55,7 +55,7 @@ type
     ac_tbl_no : int;            { the table number of the single component }
     ac_tbl_no : int;            { the table number of the single component }
     EOBRUN : uInt;              { run length of EOBs }
     EOBRUN : uInt;              { run length of EOBs }
     BE : uInt;                  { # of buffered correction bits before MCU }
     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... }
     { packing correction bits tightly would save some space but cost time... }
 
 
     restarts_to_go : uInt;      { MCUs left in this restart interval }
     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
   are sufficient for most applications, some will want to use a different
   destination manager.
   destination manager.
   IMPORTANT: we assume that fwrite() will correctly transcribe an array of
   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. }
   than 8 bits on your machine, you may need to do some tweaking. }
 
 
 { Original : jdatadst.c ; Copyright (C) 1994-1996, Thomas G. Lane. }
 { 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
   are sufficient for most applications, some will want to use a different
   source manager.
   source manager.
   IMPORTANT: we assume that fread() will correctly transcribe an array of
   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. }
   than 8 bits on your machine, you may need to do some tweaking. }
 
 
 { jdatasrc.c ; Copyright (C) 1994-1996, Thomas G. Lane. }
 { 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_EXTENSION,  { Ignoring GIF extension block of type 0x%02x }
      JTRC_GIF_NONSQUARE,  { Caution: nonsquare pixels in input }
      JTRC_GIF_NONSQUARE,  { Caution: nonsquare pixels in input }
      JWRN_GIF_BADDATA,  { Corrupt data in GIF file }
      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_ENDCODE,  { Premature end of GIF image }
      JWRN_GIF_NOMOREDATA,  { Ran out of GIF bits }
      JWRN_GIF_NOMOREDATA,  { Ran out of GIF bits }
    {$endif} { GIF_SUPPORTED }
    {$endif} { GIF_SUPPORTED }
@@ -433,7 +433,7 @@ const
   { JTRC_GIF_EXTENSION } 'Ignoring GIF extension block of type 0x%02x',
   { JTRC_GIF_EXTENSION } 'Ignoring GIF extension block of type 0x%02x',
   { JTRC_GIF_NONSQUARE } 'Caution: nonsquare pixels in input',
   { JTRC_GIF_NONSQUARE } 'Caution: nonsquare pixels in input',
   { JWRN_GIF_BADDATA } 'Corrupt data in GIF file',
   { 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_ENDCODE } 'Premature end of GIF image',
   { JWRN_GIF_NOMOREDATA } 'Ran out of GIF bits',
   { JWRN_GIF_NOMOREDATA } 'Ran out of GIF bits',
 {$endif} { GIF_SUPPORTED }
 {$endif} { GIF_SUPPORTED }

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

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

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

@@ -83,24 +83,24 @@ const
 
 
 { Basic data types.
 { Basic data types.
   You may need to change these if you have a machine with unusual data
   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,
   or "long" not 32 bits.  We don't care whether "int" is 16 or 32 bits,
   but it had better be at least 16. }
   but it had better be at least 16. }
 
 
 
 
 { Representation of a single sample (pixel element value).
 { Representation of a single sample (pixel element value).
   We frequently allocate large arrays of these, so it's important to keep
   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. }
   arrays is very slow on your hardware, you might want to change these. }
 
 
 
 
 {$ifdef BITS_IN_JSAMPLE_IS_8}
 {$ifdef BITS_IN_JSAMPLE_IS_8}
 { JSAMPLE should be the smallest type that will hold the values 0..255.
 { 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 }
 { CHAR_IS_UNSIGNED }
 type
 type
-  JSAMPLE = byte; { Pascal unsigned char }
+  JSAMPLE = byte; { Pascal unsigned AnsiChar }
   GETJSAMPLE = int;
   GETJSAMPLE = int;
 
 
 const
 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 int;}
   int8array = Array[0..8-1] of longint; { for TP FormatStr }
   int8array = Array[0..8-1] of longint; { for TP FormatStr }
+  TFormatCallback = procedure  (cinfo : j_common_ptr; var buffer : shortstring);
 
 
   jpeg_error_mgr = record
   jpeg_error_mgr = record
     { Error exit handler: does not return to caller }
     { Error exit handler: does not return to caller }
@@ -722,7 +723,7 @@ type
     { Routine that actually outputs a trace or error message }
     { Routine that actually outputs a trace or error message }
     output_message : procedure (cinfo : j_common_ptr);
     output_message : procedure (cinfo : j_common_ptr);
     { Format a message string for the most recent JPEG error or message }
     { 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 state variables at start of a new image }
     reset_error_mgr : procedure (cinfo : j_common_ptr);
     reset_error_mgr : procedure (cinfo : j_common_ptr);
@@ -760,7 +761,7 @@ type
       First table includes all errors generated by JPEG library itself.
       First table includes all errors generated by JPEG library itself.
       Error code 0 is reserved for a "no such error string" message. }
       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 }
     jpeg_message_table : ^msg_table; { Library errors }
 
 
     last_jpeg_message : J_MESSAGE_CODE;
     last_jpeg_message : J_MESSAGE_CODE;
@@ -768,7 +769,7 @@ type
     { Second table can be added by application (see cjpeg/djpeg for example).
     { Second table can be added by application (see cjpeg/djpeg for example).
       It contains strings numbered first_addon_message..last_addon_message. }
       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 }
     addon_message_table : ^msg_table; { Non-library errors }
 
 
     first_addon_message : J_MESSAGE_CODE;  { code for first string in addon table }
     first_addon_message : J_MESSAGE_CODE;  { code for first string in addon table }