Re: Apache Thrift codegen doesn't compile with dmd v2.069.2. I'd like to help. Any tips on the syntax to fix this?

2016-01-11 Thread Lucas Burson via Digitalmars-d
I'm researching and found that facebook/fbthrift has the commit below which might work. I'll pull it in and see if it works. "Make all fbcode D code compatible with dmd 2.068.0" https://github.com/facebook/fbthrift/commit/aee392c7b8947712f4e3d0e3434dd3ee3d5f3540

Apache Thrift codegen doesn't compile with dmd v2.069.2. I'd like to help. Any tips on the syntax to fix this?

2016-01-11 Thread Lucas Burson via Digitalmars-d
Hi, I'm using Apache Thrift and using the tutorial to codegen D, but the generated code doesn't compile with dmd v2.096.2. I submitted Thrift defect [1] but I'd like to try to help fix the issue. The code is very generic and I'm looking for tips on which lines would need changed (or if you

dmd Regression(?): bigEndianToNative buffer slice allows only literals

2015-05-13 Thread Lucas Burson via Digitalmars-d-learn
The std.batmanip bigEndianToNative has a regression where the slice range doesn't work with variables (only literals). Is the syntax incorrect or is this a regression in dmd? Using this main.d: import std.bitmanip; int main(string args[]) { auto datain = new ubyte[16]; // this syntax

Re: dmd Regression(?): bigEndianToNative buffer slice allows only literals

2015-05-13 Thread Lucas Burson via Digitalmars-d-learn
I reported this as a regression https://issues.dlang.org/show_bug.cgi?id=14582

bitmanip bigEndianToNative using a buffer slice?

2014-10-21 Thread Lucas Burson via Digitalmars-d-learn
I'm trying to create a primitive type given a specific buffer slice. I can place the uint into a sliced buffer but I'm getting compiler errors when using a slice to create the uint. Still new to Dlang and unfamiliar with the template system. How do I get this working? import std.bitmanip;

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-18 Thread Lucas Burson via Digitalmars-d-learn
On Saturday, 18 October 2014 at 00:53:57 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 18 Oct 2014 00:32:09 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Wow, your changes made it much simpler. Thank you for the suggestions and expertise ketmar :)

String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread Lucas Burson via Digitalmars-d-learn
When creating a string from a ubyte[], I have an invalid length and string.strip() doesn't strip off all whitespace. I'm new to the language. Is this a compiler issue? import std.string : strip; import std.stdio : writefln; int main() { const string ATA_STR = ATA ; // this works

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread Lucas Burson via Digitalmars-d-learn
On Friday, 17 October 2014 at 08:31:04 UTC, spir via Digitalmars-d-learn wrote: On 17/10/14 09:29, thedeemon via Digitalmars-d-learn wrote: On Friday, 17 October 2014 at 06:29:24 UTC, Lucas Burson wrote: // This is where things breaks { ubyte[] buff = new ubyte[16];

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread Lucas Burson via Digitalmars-d-learn
On Friday, 17 October 2014 at 15:30:52 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 15:24:21 + Lucas Burson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: So given the below buffer would I use fromStringz (is this in the stdlib?) to cast it from a null

Re: String created from buffer has wrong length and strip() result is incorrect

2014-10-17 Thread Lucas Burson via Digitalmars-d-learn
On Friday, 17 October 2014 at 17:40:09 UTC, ketmar via Digitalmars-d-learn wrote: i developed a habit of making such buffers one byte bigger than necessary and just setting the last byte to 0 before converting. this way it's guaranteed to be 0-terminated. Perfect, great idea. Below is my