summaryrefslogtreecommitdiffstats
path: root/lib/crc32.c
Commit message (Collapse)AuthorAgeFilesLines
* lib/crc32: prefix public functionsGustavo Zacarias2016-10-191-2/+2
| | | | | | | | | | | Make the publicly-visible crc32 library functions prefixed by ul_, such as crc32() -> ul_crc32(). This is because it clashes with the crc32() function from zlib. For newer versions of glib (2.50+) zlib and libblkid are required dependencies and otherwise results in build failure when building statically. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
* misc: Fix various typosSebastian Rasmussen2016-05-311-1/+1
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* lib/crc32: don't require to modify GPT headerKarel Zak2015-09-241-1/+25
| | | | | | | | | | This patch introduces smart crc32 function that is able to exclude specified. The advantage is that we does not have to modify GPT header (set the current in-header crc field to zero) when we count crc32. This allows to keep GPT header in read-only buffers and simplify code. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: fix crc32 and crc64 interger overflows [AddressSanitizer]Sami Kerola2014-12-191-1/+3
| | | | | | | | | | lib/crc32.c:111:11: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long') lib/crc64.c:101:12: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long') Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib: add a generic crc32()Karel Zak2009-09-161-0/+116
This is public domain implementation, based on static crc32_table[]. This implementation is used on may places (libparted, FreeBSD kernel, PostgreSQL, ...). The Linux kernel uses on-the-fly generated and allocated tables. That's useless in shared libraries. Signed-off-by: Karel Zak <kzak@redhat.com>