gettimeofday: port recent C++ fix to Emacs
[gnulib.git] / lib / crc.c
index e3132fb..a67d642 100644 (file)
--- a/lib/crc.c
+++ b/lib/crc.c
@@ -1,26 +1,22 @@
 /* crc.c -- cyclic redundancy checks
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2013 Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
 
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Simon Josefsson.  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
 
 #include "crc.h"
 
@@ -97,7 +93,7 @@ crc32_no_xor (const char *buf, size_t len)
 uint32_t
 crc32_update (uint32_t crc, const char *buf, size_t len)
 {
-  return crc32_update_no_xor (0L ^ 0xffffffffL, buf, len) ^ 0xffffffffL;
+  return crc32_update_no_xor (crc ^ 0xffffffff, buf, len) ^ 0xffffffff;
 }
 
 uint32_t