Comments (10)
Hi!
Thank you for your contribution.
Please checkout the updates and make a new test. Then tell me if it was solved.
from binn.
Sure! I'll give it a try tomorrow. Thanks for the quick response!.
from binn.
Hi Corey,
Is it OK now?
from binn.
Sorry for taking so long to reply. Changes in job.
I took your latest update and made the following changes:
#if defined(__APPLE__) || defined(_WIN32)
#define __BIG_ENDIAN 0x1000
#define __LITTLE_ENDIAN 0x0001
#define __BYTE_ORDER __LITTLE_ENDIAN
#elif defined (_AIX)
#include <sys/machine.h>
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#define __BYTE_ORDER BYTE_ORDER
#else
#include <endian.h>
#endif
Here's the relevant part of <sys/machine.h> on AIX:
/*
* Definitions for byte order,
* according to byte significance from low address to high.
*/
#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */
#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */
#define BYTE_ORDER BIG_ENDIAN
I can compile without issue now. I'm testing the result now.
Thanks!
from binn.
Running the tests, it looks like at least some of it assumes you're on LE.
So on BE, the test_endianess() function asserts immediately.
void test_endianess() {
unsigned short vshort1, vshort2;
unsigned int vint1, vint2;
uint64 value1, value2;
printf("testing endianess... ");
/* tobe16 */
vshort1 = 0x1122;
vshort2 = tobe16(vshort1);
assert(vshort2 == 0x2211);
vshort2 = tobe16(vshort2);
assert(vshort2 == vshort1);
Should we make the tests endian agnostic?
from binn.
Hi Corey,
Thank you!
Indeed, the test should test the endianess conversion on both architectures. The expected values are different for each. The expected values should be unmodified on BE.
from binn.
I updated the endianess test case.
Do you want to send a pull request with your contribution for AIX?
If yes, it must contain only those modifications on binn.c to be accepted. It should not contain formatting differences on the file.
If you don't want then I can insert them.
from binn.
I'll give the test case a try.
My machine doesn't have access to the internet, so I can't do git work with it. Its probably just as easy for you to add the changes.
Thanks!
from binn.
OK, I updated it.
The leading underscores were used because the endianess checking was based on the Google Chrome source, and it is used on Linux. But it is really becoming weird now. At least they are not exported on binn.h
from binn.
The macros were renamed
from binn.
Related Issues (20)
- Using binn in C# possible? HOT 1
- aes.hpp superfluous - C++/C has standards support semantics not reflected here. HOT 1
- Specification and version HOT 3
- Missing magic number in specification HOT 4
- Nested objects HOT 1
- Qt Creator can't compile header file (just 1 function) HOT 2
- Setting length of buffer HOT 2
- build issue on mips32 (big endian) HOT 1
- binn_map_get_blob() fails if blob size is 1 byte HOT 1
- Blob size implementation always uses 4-byte block HOT 4
- Performance Benchmark HOT 2
- Iterate over binn obj example HOT 2
- All key names should be "const char*" instead of "char*" HOT 2
- Contador no working?? HOT 2
- Array serialization HOT 1
- unable to create dll in visual studio 2019
- How to properly load and read a binn object from a data buffer without too many allocations? HOT 3
- Donating my Rust implementation
- Clang 18 implicit conversion warnings HOT 1
- Exception Handling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binn.