]> Savannah Git Hosting - gnulib.git/commitdiff
crc.h: declare each function with _GL_ATTRIBUTE_PURE
authorJim Meyering <meyering@meta.com>
Mon, 9 Sep 2024 06:54:30 +0000 (23:54 -0700)
committerJim Meyering <meyering@meta.com>
Mon, 9 Sep 2024 06:57:29 +0000 (23:57 -0700)
* lib/crc.h (crc32, crc32_update, crc32_no_xor)
(crc32_update_no_xor): Declare with _GL_ATTRIBUTE_PURE.

ChangeLog
lib/crc.h

index f87bc0f741acc4c8f0028e62fc4dfc6ff451f3b1..a0d0a4084b41b0f816710e2e2c5bad697f90d220 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-09-08  Jim Meyering  <meyering@meta.com>
+
+       crc.h: declare each function with _GL_ATTRIBUTE_PURE
+       * lib/crc.h (crc32, crc32_update, crc32_no_xor)
+       (crc32_update_no_xor): Declare with _GL_ATTRIBUTE_PURE.
+
 2024-09-05  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix COPYING.EXCEPTION license notices
index 4014216cc33489acedefc61ee73def07fa1ce0f9..2754126dbe3cc6c6ee56e028ca582c021a34967a 100644 (file)
--- a/lib/crc.h
+++ b/lib/crc.h
@@ -28,18 +28,20 @@ extern "C" {
 
 
 /* Compute CRC-32 value of LEN bytes long BUF, and return it. */
-extern uint32_t crc32 (const char *buf, size_t len);
+extern uint32_t crc32 (const char *buf, size_t len) _GL_ATTRIBUTE_PURE;
 
 /* Incrementally update CRC-32 value CRC using LEN bytes long BUF.  In
    the first call, use 0 as the value for CRC.  Return the updated
    CRC-32 value.  */
-extern uint32_t crc32_update (uint32_t crc, const char *buf, size_t len);
+extern uint32_t crc32_update (uint32_t crc, const char *buf, size_t len)
+  _GL_ATTRIBUTE_PURE;
 
 /* Compute modified-CRC-32 value of LEN bytes long BUF, and return it.
    The "modification" is to avoid the initial and final XOR operation.
    Due to historic implementation errors, this variant is sometimes
    used (i.e., in RFC 3961). */
-extern uint32_t crc32_no_xor (const char *buf, size_t len);
+extern uint32_t crc32_no_xor (const char *buf, size_t len)
+  _GL_ATTRIBUTE_PURE;
 
 /* Incrementally update modified-CRC-32 value CRC using LEN bytes long
    BUF.  In the first call, use 0 as the value for CRC.  Return the
@@ -47,7 +49,8 @@ extern uint32_t crc32_no_xor (const char *buf, size_t len);
    initial and final XOR operation.  Due to historic implementation
    errors, this variant is sometimes used (i.e., in RFC 3961).  */
 extern uint32_t
-crc32_update_no_xor (uint32_t crc, const char *buf, size_t len);
+crc32_update_no_xor (uint32_t crc, const char *buf, size_t len)
+  _GL_ATTRIBUTE_PURE;
 
 
 #ifdef __cplusplus