summaryrefslogtreecommitdiff
path: root/gcc/ada/sinput.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sinput.ads')
-rw-r--r--gcc/ada/sinput.ads30
1 files changed, 7 insertions, 23 deletions
diff --git a/gcc/ada/sinput.ads b/gcc/ada/sinput.ads
index 585a8b95ea0..b842790bc10 100644
--- a/gcc/ada/sinput.ads
+++ b/gcc/ada/sinput.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- $Revision: 1.69 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
@@ -274,34 +274,18 @@ package Sinput is
-- minus-minus sequence starting a comment, and all control characters
-- except ESC.
- -- These characters are used to compute a 31-bit checksum which is stored
- -- in the variable Scans.Checksum, as follows:
-
- -- If a character, C, is not part of a wide character sequence, then
- -- either the character itself, or its lower case equivalent if it
- -- is a letter outside a string literal is used in the computation:
-
- -- Checksum := Checksum + Checksum + Character'Pos (C);
- -- if Checksum > 16#8000_0000# then
- -- Checksum := (Checksum + 1) and 16#7FFF_FFFF#;
- -- end if;
-
- -- For a wide character sequence, the checksum is computed using the
- -- corresponding character code value C, as follows:
-
- -- Checksum := Checksum + Checksum + Char_Code'Pos (C);
- -- if Checksum > 16#8000_0000# then
- -- Checksum := (Checksum + 1) and 16#7FFF_FFFF#;
- -- end if;
+ -- The checksum algorithm used is the standard CRC-32 algorithm, as
+ -- implemented by System.CRC32, except that we do not bother with the
+ -- final XOR with all 1 bits.
-- This algorithm ensures that the checksum includes all semantically
-- significant aspects of the program represented by the source file,
-- but is insensitive to layout, presence or contents of comments, wide
-- character representation method, or casing conventions outside strings.
- -- Scans.Checksum is initialized to zero at the start of scanning a file,
- -- and copied into the Source_Checksum field of the file table entry when
- -- the end of file is encountered.
+ -- Scans.Checksum is initialized appropriately at the start of scanning
+ -- a file, and copied into the Source_Checksum field of the file table
+ -- entry when the end of file is encountered.
-------------------------------------
-- Handling Generic Instantiations --