Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on modern Unix and many cleanups #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

watchforsnakes
Copy link

@watchforsnakes watchforsnakes commented Feb 12, 2018

The class2.dat file included in this repo uses the SIZE_OFFSET 11 setting.

Add a validity check for things like 0-length input files.

Add -v (verbose debugging) flag that prints each object as it parses it. This helps when an invalid file causes it to crash before dumping the final .rdl output.

Add -S (shorten objects) flag to override the class sizes with shorter ones. For example, table is 6 bytes, not 9, for some files.

Stop parsing more input contents vectors if we hit 0xAA bytes. Some files seem to have these as padding after valid data.

Don't dump the 'teleport_address' attribute. It can't be parsed by our downstream tools and it seems like none of them have any useful data here anyway -- all .reg files I saw had 20 values, all 32. We can add valid addresses in during later processing. Original behavior can be restored with the -DDUMP_TELEPORT_ADDRESSES #ifdef.

Compile fix and cleanups:

  • Get rid of custom malloc() def
  • Initialize stdio vars in main(), not statically
  • Add braces to disambiguate nested ifs

Watch For Snakes added 3 commits February 11, 2018 21:23
The class2.dat file included in this repo uses the SIZE_OFFSET 11 setting.

Add a validity check for things like 0-length input files.

Add -v (verbose debugging) flag that prints each object as it parses it.
This helps when an invalid file causes it to crash before dumping the final
.rdl output.

Add -S (shorten objects) flag to override the class sizes with shorter ones.
For example, table is 6 bytes, not 9, for some files.

Stop parsing more input contents vectors if we hit 0xAA bytes. Some files
seem to have these as padding after valid data.

Don't dump the 'teleport_address' attribute. It can't be parsed by our
downstream tools and it seems like none of them have any useful data here
anyway -- all .reg files I saw had 20 values, all 32. We can add valid
addresses in during later processing. Original behavior can be restored with
the -DDUMP_TELEPORT_ADDRESSES #ifdef.

Compile fix and cleanusp:
* Get rid of custom malloc() def
* Initialize stdio vars in main(), not statically
* Add braces to disambiguate nested ifs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant