jonny91 / protoc-gen-as3

Automatically exported from code.google.com/p/protoc-gen-as3
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Use haxe.Int64 when used for haXe #28

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Add a flag indicate generated code should use haxe.Int64 instead of 
com.netease.protobuf.Int64 and com.netease.protobuf.Int64 .

Original issue reported on code.google.com by pop.atry@gmail.com on 7 Feb 2012 at 4:06

GoogleCodeExporter commented 8 years ago
May I ask why you consider using haxe.Int64 please ? Is this because 
com.netease.protobuf.Int64 has a bug issue ?
I'm asking for this because com.netease.protobuf.Int64.parseInt64(mynumber) 
where mynumber >= -1024 && mynumber <= -1 doesn't seem to work.

What about as3crypto com.hurlant.math.BigInteger class ?
http://code.google.com/p/as3crypto/source/browse/trunk/as3crypto/src/com/hurlant
/math/BigInteger.as
Does haxe.Int64 has better performances compared to com.hurlant.math.BigInteger 
?

Original comment by seb.tr...@gmail.com on 7 Mar 2012 at 3:18

GoogleCodeExporter commented 8 years ago
haxe.Int64 is native type in haXe, that's all why I want it.

as3crypto is not acceptable, because using as3crypto will introduce addition 
external dependency.

BTW: Could you provide a patch to fix the parseInt64 bug?

Original comment by pop.atry@gmail.com on 8 Mar 2012 at 1:34

GoogleCodeExporter commented 8 years ago
Thanks
About as3crypto. In my opinion including BigInteger only requires 3 additional 
classes of as3crypto: Random.as, Memory.as, Hex.as.

Sorry but I haven't a bug fix com.netease.protobuf.Int64.parseInt64. I'm not 
very good to investigate binary operations & encoding subjects especially if I 
have to talk about it in English. I'll let you know if I find the solution. 
However I think the problem is located inside com.netease.protobuf.Binary64 and 
its div/mul/add methods and the fact that the Number type is encoded on 53 bits.

Original comment by seb.tr...@gmail.com on 8 Mar 2012 at 9:41

GoogleCodeExporter commented 8 years ago
The Int64.parseInt64 is fixed in Revision 91fa42e337a1.

Original comment by pop.atry@gmail.com on 8 Mar 2012 at 1:02

GoogleCodeExporter commented 8 years ago
thanks!

Original comment by seb.tr...@gmail.com on 8 Mar 2012 at 1:16