> You can fix most of these by simply running 'indent' on your *.h and *.c

Thanks, this is super helpful. I'm happy to follow the coding style but a
linter would make it easier for me to track down these whitespace issues.

> Regarding the Automake stuff, please try the attached patch, on top of
your
> patch. Untested, but should be quite close to working.

The @CROSS_COMPILING@ flag doesn't seem to be getting set and I'm only
seeing it used in one other place, removing this makes it work and matches
the pattern in modules/uninorm/composition that you recommended earlier.

> Regarding GNU coding style, there are still tweaks needed in
>   crc-generate-table.c lines 54, 56, 83, 87, 100..114, 120..123,
>   crc.c line 92.

I used Simon's indent trick on both files, if there's anything that I
missed here then posting a diff would make life substantially easier.

> Other nitpicking:

> The generated file does not end in a newline. Could you add a newline at
the
> end? Just because it's the common convention.

Final line of print_header() does `fprintf (stream, "};\n\n");` and have
confirmed that when running a full build this gives us an empty newline at
the end of the file.

> In the 'main' function, please add a 'return 0;' statement at the end.
It's
> needed for Oracle cc 12.6.

Nice catch, technically not valid C if I'm not returning from an int main().

> The new code in crc.c makes use of uint64_t. Therefore, for my feeling,
> the '#include <stdint.h>', should go into crc.c. And then you don't
> need it in the generated file.

Removed from generated file, this is already getting included in crc.h and
it builds fine.

> The function crc32_update_no_xor_slice_by_8 is not an exported API.
> Therefore it should better be 'static'.

Done.

On Sun, 27 Oct 2024 at 11:41, Simon Josefsson <si...@josefsson.org> wrote:

> Thanks Sam, I think we are closing in on a good patch, and Bruno's
> feedback seems good.  Just one small piece of hint:
>
> Bruno Haible via Gnulib discussion list <bug-gnulib@gnu.org> writes:
>
> > 3) Use GNU coding style:
>
> You can fix most of these by simply running 'indent' on your *.h and *.c
> files, and then manually review it for any unintentional changes.  This
> catches many of the minor style issues brought up automatically.
>
> /Simon
>

Attachment: 0001-crc-New-optimised-slice-by-8-implementation.patch
Description: Binary data

Reply via email to