Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mcutools/lua-struct
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: iryont/lua-struct
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on Sep 21, 2026

  1. Rewrite pack and unpack, add size (Fix iryont#4, Fix iryont#5)

    Negative numbers unpacked from "l" are no longer wrong, they are read as their complement so nothing has to pass through 2^64 in a double.
    Lua 5.3+ packs and unpacks its 64 bit integers without any loss.
    Floats are rounded to the nearest value like a cast in C does, and infinity, NaN, negative zero and subnormal numbers are handled.
    "c" without a number is a single char and only a number right behind it is taken as its size.
    unpack returns the position where it stopped reading and accepts a negative start position.
    New options follow the struct library of Roberto Ierusalimschy: "x", spaces, "in" and "In" with 1 to 8 bytes, "T" and "!" for alignment.
    Invalid options, wrong arguments and data which is too short raise an error which names the problem.
    The library loads with Lua 5.5 and works without math.frexp and math.ldexp.
    It is also faster, a long "s" string is no longer read char by char.
    The spec covers all of the above and runs the float tests a second time with the replacements of math.frexp and math.ldexp.
    iryont committed Sep 21, 2026
    Configuration menu
    Copy the full SHA
    b6ffc2c View commit details
    Browse the repository at this point in the history
  2. Replace Travis CI with GitHub Actions

    travis-ci.org was shut down in 2021, so the old configuration did nothing anymore.
    The workflow runs busted with Lua 5.1, 5.2, 5.3, 5.4, 5.5 and LuaJIT 2.1.
    iryont committed Sep 21, 2026
    Configuration menu
    Copy the full SHA
    1813c56 View commit details
    Browse the repository at this point in the history
  3. Update README and rockspec for 1.0.0

    The README documents unpack returning the position, size, the new options, how numbers are handled and what differs from the C library.
    It lists the changes which can affect code written for 0.9.
    The rockspec uses git+https because GitHub turned the git:// protocol off in 2022.
    iryont committed Sep 21, 2026
    Configuration menu
    Copy the full SHA
    66a36a4 View commit details
    Browse the repository at this point in the history
Loading