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

Use network byte order for wzip and wunzip test files #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xxyzz
Copy link

@xxyzz xxyzz commented Sep 2, 2019

Now no matter which byte order the system uses, if we use htonl and ntohl correctly, we will pass all the tests.

// before
$ xxd -b -c 5 tests/4.in
00000000: 00111010 00000000 00000000 00000000 01100001  :...a
00000005: 00000001 00000000 00000000 00000000 00001010  .....
0000000a: 00011111 00000000 00000000 00000000 01100010  ....b
0000000f: 00000001 00000000 00000000 00000000 00001010  .....
00000014: 00010100 00000000 00000000 00000000 01100011  ....c
00000019: 00000001 00000000 00000000 00000000 00001010  .....
0000001e: 00011111 00000000 00000000 00000000 01100100  ....d
00000023: 00000001 00000000 00000000 00000000 00001010  .....
00000028: 01111001 00000001 00000000 00000000 01100101  y...e
0000002d: 00000001 00000000 00000000 00000000 00001010  .....

// after
$ xxd -b -c 5 tests/4.in
00000000: 00000000 00000000 00000000 00111010 01100001  ...:a
00000005: 00000000 00000000 00000000 00000001 00001010  .....
0000000a: 00000000 00000000 00000000 00011111 01100010  ....b
0000000f: 00000000 00000000 00000000 00000001 00001010  .....
00000014: 00000000 00000000 00000000 00010100 01100011  ....c
00000019: 00000000 00000000 00000000 00000001 00001010  .....
0000001e: 00000000 00000000 00000000 00011111 01100100  ....d
00000023: 00000000 00000000 00000000 00000001 00001010  .....
00000028: 00000000 00000000 00000001 01111001 01100101  ...ye
0000002d: 00000000 00000000 00000000 00000001 00001010  .....

@xxyzz xxyzz changed the title reduce to 121 'e' characters Use network byte order for wzip and wunzip test files Nov 24, 2019
@xxyzz
Copy link
Author

xxyzz commented Dec 8, 2019

Hi @remzi-arpacidusseau, would you please review this pull request if you have time?

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.

None yet

2 participants