]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Tweak the documentation of libiberty's xcrc32 function
authorPatrick Palka <ppalka@gcc.gnu.org>
Mon, 28 Dec 2015 22:00:14 +0000 (22:00 +0000)
committerPatrick Palka <ppalka@gcc.gnu.org>
Mon, 28 Dec 2015 22:00:14 +0000 (22:00 +0000)
libiberty/ChangeLog;

* crc32.c: In the documentation, don't refer to GDB's
now-nonexistent crc32 implementation.  In the table-generation
program embedded within the documentation, change the type of
the induction variables i and j from int to unsigned int, to
avoid undefined behavior.

From-SVN: r231983

libiberty/ChangeLog
libiberty/crc32.c

index 0bda40e0682e3601d5dab3c98c73f33120c212ca..6073c5bfed268b5d543b7f7bb20d5fce1f3a1200 100644 (file)
@@ -1,3 +1,11 @@
+2015-12-28  Patrick Palka  <ppalka@gcc.gnu.org>
+
+       * crc32.c: In the documentation, don't refer to GDB's
+       now-nonexistent crc32 implementation.  In the table-generation
+       program embedded within the documentation, change the type of
+       the induction variables i and j from int to unsigned int, to
+       avoid undefined behavior.
+
 2015-12-21  Nick Clifton  <nickc@redhat.com>
 
        PR 66827
index 12d9be07cfd65d479aa01e92e2fc6dd8c29509b4..52c982fb58327c0a7b2970d1126684da04dd71ba 100644 (file)
 
 #include "libiberty.h"
 
-/* This table was generated by the following program.  This matches
-   what gdb does.
+/* This table was generated by the following program.
 
    #include <stdio.h>
 
    int
    main ()
    {
-     int i, j;
+     unsigned int i, j;
      unsigned int c;
      int table[256];
 
@@ -146,10 +145,9 @@ starting value is @var{init}; this may be used to compute the CRC of
 data split across multiple buffers by passing the return value of each
 call as the @var{init} parameter of the next.
 
-This is intended to match the CRC used by the @command{gdb} remote
-protocol for the @samp{qCRC} command.  In order to get the same
-results as gdb for a block of data, you must pass the first CRC
-parameter as @code{0xffffffff}.
+This is used by the @command{gdb} remote protocol for the @samp{qCRC}
+command.  In order to get the same results as gdb for a block of data,
+you must pass the first CRC parameter as @code{0xffffffff}.
 
 This CRC can be specified as: