Comments (6)
Good point, I will.
from flatbuffers.
Or may be you could use higher precision for unsigned types, for example for ubyte in buffer use short in java and for ushort in buffer use int in java.
from flatbuffers.
It really depends what the unsigned item represents how you want to deal
with it.
You can convert a byte to a short using: (short)(mybyte & 0xff)
Question is, should the generated API always do that for you, or should you
do that only when necessary. I gravitate to the latter.
On Sat, Jun 21, 2014 at 5:17 AM, bml13 [email protected] wrote:
Or may be you could use higher precision for unsigned types, for example
for ubyte in buffer use short in java and for ushort in buffer use int in
java.—
Reply to this email directly or view it on GitHub
#9 (comment).
from flatbuffers.
I think it is the API who should do that always, since the user defined a field as unsigned (eg. ubyte) then he should get it as unsigned value, because if he wanted it signed then he should define as signed (eg. byte). I propose to to return both ushort and ubyte as int. Or it should be an option in the compiler.
from flatbuffers.
You're right, that makes more sense.
But uint as.. long? and ulong still as long?
from flatbuffers.
Yes you can return uint as long, and for ulong you can say in the documentation that it is not supported only long is supported.
from flatbuffers.
Related Issues (20)
- [swift] distinguish unknown from absent enum value for scheme evolution HOT 5
- undocumented breaking change GenerateText->GenText
- [Java, FlatBuffers 23.5.26, Mac OS 14.3] getByKey returns null while accessing using vector index works
- `get_root_as_*` functions not generated [Rust, 23.5.26, Linux] HOT 1
- Generating schemas with language adapters (as optional add-ons)?
- Streaming flatbuffers in java HOT 1
- [TS] optional escalar not set in the binary when it holds value 0 HOT 13
- Release a new version, please HOT 1
- Default value of 0 for field is not part of [optional] enum (java)
- Buffer generated in python gets rejected by flatcc [Python / C, Flatbuffer 23.5.26]
- Invalid Code generation if Property has same name as Struct [Windows/C#/24.3.7]
- v24.3.7 of Rust crate not released to crates.io HOT 4
- [v24.3.7] Rust: push_u8_u64_alignment test fails on i686 target (Ubuntu 22.04, CentOS 9)
- How to print nested table using FlatBufferToString?
- [Python] Flatc stub compatibility with gRPC asyncio Interface
- [Rust] Add better support for "crate-per-schema" HOT 2
- [Bazel CI] Swift toolchain analysis failed due to missing 'swift' configuration fragment HOT 1
- [C#][Feature Request] Unity Game Development needs mutate fixed size string value HOT 2
- Generated CreateXDirect with std::span<T> or "T* + size" payloads
- newbie's question.. use in c# / vector struct / adding int64...
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 flatbuffers.