bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55882: [PATCH] bindat: Minor cleanups


From: Richard Hansen
Subject: bug#55882: [PATCH] bindat: Minor cleanups
Date: Fri, 10 Jun 2022 01:27:09 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

X-Debbugs-CC: monnier@iro.umontreal.ca

Attached are a few patches to fix some minor issues with bindat and its 
documentation and tests.

Patch 1:

    bindat (strz): Fix documentation for strz with pre-allocated string
* doc/lispref/processes.texi (Bindat Types): Document that a null
    terminator is not written if `bindat-pack' is given a pre-allocated
    string.

Patch 2:

    ; bindat-tests (str, strz): Refine tests
str and strz:
      * Add tests for packing into a pre-allocated string.
strz:
      * Add test cases to probe more boundary conditions.
      * Delete comments that no longer apply.
      * Add tests to ensure that truncated packed strings are rejected.
      * Keep the legacy spec tests in sync with the modern spec tests.

Patch 3:

    ; bindat (strz): Consistent length type check, take two
Commit 30ec4a7347b2944818c6fc469ae871374ce7caa4 is incorrect -- the
    length computation logic uses a simple nilness test, not `numberp'.
    The `numberp' case is just an optimization if `len' is a literal
    number; it does not affect the behavior.
Revert that commit, add some comments to help future readers avoid the
    same mistake, and update the pack logic to use the same optimization
    as the length computation for consistency.

Patch 4:

    ; bindat (bindat--length-group): Fix indentation

Attachment: 0001-bindat-strz-Fix-documentation-for-strz-with-pre-allo.patch
Description: Text Data

Attachment: 0002-bindat-tests-str-strz-Refine-tests.patch
Description: Text Data

Attachment: 0003-bindat-strz-Consistent-length-type-check-take-two.patch
Description: Text Data

Attachment: 0004-bindat-bindat-length-group-Fix-indentation.patch
Description: Text Data

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]