[Issue 7953] DMD Error: variable r used before set when compiling with -O

2016-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7953 --- Comment #7 from Walter Bright --- (In reply to SomeDude from comment #3) > but I can't reproduce the error message, so maybe I've overlooked something. > However, interestingly, this compiles with -O flag and crashes the

[Issue 7953] DMD Error: variable r used before set when compiling with -O

2016-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7953 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread Andrei Alexandrescu via Digitalmars-d
On 4/24/16 7:00 PM, Temtaime wrote: On Sunday, 24 April 2016 at 21:45:32 UTC, Walter Bright wrote: On 4/24/2016 8:33 AM, Andrei Alexandrescu wrote: On 04/24/2016 02:57 AM, deadalnix wrote: On Saturday, 23 April 2016 at 15:29:08 UTC, Andrei Alexandrescu wrote: Yah, that's the canonical. I

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread Andrei Alexandrescu via Digitalmars-d
On 4/24/16 9:17 PM, Xinok wrote: I modified David's solution a bit to (hopefully) eliminate the branch: bool powerOf2(uint x){ return !x ^ !(x & (x - 1)); } <_D4test8powerOf2FkZb>: 0: 50 push %rax 1: 53 push

Re: Why are tests restarting in Github?

2016-04-24 Thread Daniel Murphy via Digitalmars-d
On 25/04/2016 5:44 AM, ag0aep6g wrote: On 24.04.2016 21:26, tcak wrote: There are 10 test. Some of them gets completed. And then, I look at it again, tests have restarted, and less number of tests are passed at that point. 1. What is the reason of restarts? Something else has been pulled.

[Issue 15945] sizeof on an invalid type seems to compile.

2016-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15945 Marco Leise changed: What|Removed |Added CC||marco.le...@gmx.de ---

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread Xinok via Digitalmars-d
On Sunday, 24 April 2016 at 23:17:53 UTC, David Nadlinger wrote: On Sunday, 24 April 2016 at 23:00:56 UTC, Temtaime wrote: Please no cmp. Just bool isPowerOf2(uint x) { return x && !(x & (x - 1)); } You do realise that this will (typically) emit a branch? — David I compiled using dmd -O

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread Xinok via Digitalmars-d
On Monday, 25 April 2016 at 01:17:48 UTC, Xinok wrote: ... Sorry, didn't mean to say David's solution. Too many edits. >_<

Re: Why are tests restarting in Github?

2016-04-24 Thread Basile B. via Digitalmars-d
On Sunday, 24 April 2016 at 19:26:43 UTC, tcak wrote: 2. What is reason of long waiting time? Sometimes number of passed tests stay there 2-3 days. There's a windows tester (win-farm-1) that takes 1 hour to complete each single test while most of the other testers usually take 10 to 20

Re: DlangUI translations

2016-04-24 Thread stunaep via Digitalmars-d-learn
On Sunday, 24 April 2016 at 04:49:36 UTC, thedeemon wrote: On Saturday, 23 April 2016 at 15:44:22 UTC, stunaep wrote: I am wondering how to use other languages and how to NOT use other languages. Did you see example1 from examples folder in dlangui? It has two languages and allows switching

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread David Nadlinger via Digitalmars-d
On Sunday, 24 April 2016 at 23:00:56 UTC, Temtaime wrote: Please no cmp. Just bool isPowerOf2(uint x) { return x && !(x & (x - 1)); } You do realise that this will (typically) emit a branch? — David

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread Temtaime via Digitalmars-d
On Sunday, 24 April 2016 at 21:45:32 UTC, Walter Bright wrote: On 4/24/2016 8:33 AM, Andrei Alexandrescu wrote: On 04/24/2016 02:57 AM, deadalnix wrote: On Saturday, 23 April 2016 at 15:29:08 UTC, Andrei Alexandrescu wrote: Yah, that's the canonical. I forgot why I chose (x & -x) > (x - 1)

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread Walter Bright via Digitalmars-d
On 4/24/2016 8:33 AM, Andrei Alexandrescu wrote: On 04/24/2016 02:57 AM, deadalnix wrote: On Saturday, 23 April 2016 at 15:29:08 UTC, Andrei Alexandrescu wrote: Yah, that's the canonical. I forgot why I chose (x & -x) > (x - 1) over it. I'm not sure why do you test against x - 1 when you

Re: Directions to Ibis Hotel in Berlin from Tegel Airport

2016-04-24 Thread Walter Bright via Digitalmars-d
On 4/24/2016 10:56 AM, Iain Buclaw via Digitalmars-d wrote: On 24 April 2016 at 10:44, Walter Bright via Digitalmars-d wrote: The hotel emailed them to me, I presume they know what they're doing :-) so I thought I'd share: Bus 109 to Jakob-Kaiser-Platz Subway U 7

Re: Official dub packages for Debian and Ubuntu

2016-04-24 Thread Matthias Klumpp via Digitalmars-d-announce
On Thursday, 21 April 2016 at 22:00:11 UTC, Joseph Rushton Wakeling wrote: On Thursday, 21 April 2016 at 20:13:07 UTC, Joseph Rushton Wakeling wrote: On Monday, 18 April 2016 at 21:54:43 UTC, Matthias Klumpp wrote: Unfortunately it FTBFSes... Hopefully we can get the patch for that in as well:

Re: Why are tests restarting in Github?

2016-04-24 Thread ag0aep6g via Digitalmars-d
On 24.04.2016 21:26, tcak wrote: There are 10 test. Some of them gets completed. And then, I look at it again, tests have restarted, and less number of tests are passed at that point. 1. What is the reason of restarts? Something else has been pulled. That changes the code that's being

Why are tests restarting in Github?

2016-04-24 Thread tcak via Digitalmars-d
There are 10 test. Some of them gets completed. And then, I look at it again, tests have restarted, and less number of tests are passed at that point. 1. What is the reason of restarts? 2. What is reason of long waiting time? Sometimes number of passed tests stay there 2-3 days.

Re: Directions to Ibis Hotel in Berlin from Tegel Airport

2016-04-24 Thread Iain Buclaw via Digitalmars-d
On 24 April 2016 at 10:44, Walter Bright via Digitalmars-d wrote: > The hotel emailed them to me, I presume they know what they're doing :-) so > I thought I'd share: > > Bus 109 to Jakob-Kaiser-Platz > Subway U 7 in the direction of Rudow to Grenzallee > Cross the

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread Andrei Alexandrescu via Digitalmars-d
On 04/24/2016 02:57 AM, deadalnix wrote: On Saturday, 23 April 2016 at 15:29:08 UTC, Andrei Alexandrescu wrote: Yah, that's the canonical. I forgot why I chose (x & -x) > (x - 1) over it. I'm not sure why do you test against x - 1 when you could test for equality. Not only it looks like it is

Re: Why I can't pass to datetime.benchmark function with parameters?

2016-04-24 Thread David Nadlinger via Digitalmars-d-learn
On Saturday, 23 April 2016 at 18:52:30 UTC, Suliman wrote: My error. I mean it should be: auto r = benchmark!(foo(4))(1); But thanks for answer! This would use the result of foo(4) as the template parameter. Use e.g. { foo(4); } instead (a function that calls foo with the desired argument).

Re: Line spacing for '///ditto' on the website

2016-04-24 Thread Andrei Alexandrescu via Digitalmars-d
On 04/24/2016 08:28 AM, Joseph Rushton Wakeling wrote: The use of hardcoded tags in ddoc output is a bit odd -- surely it would be better to encode the list of symbols as entries in an unnumbered list, and use CSS to style its layout as wished? Great idea - could you please work on a PR to

[Issue 15907] Unjustified "is not visible from module" deprecation warning when using getMember trait

2016-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15907 Philpax changed: What|Removed |Added CC||m...@philpax.me --- Comment #2

Re: Distributor's whishlist and questions for D

2016-04-24 Thread Iain Buclaw via Digitalmars-d
On 23 April 2016 at 21:35, Jacob Carlborg via Digitalmars-d wrote: > On 2016-04-21 03:01, Matthias Klumpp wrote: > >> ## How complete are the free compilers? >> This is an important question, because we would need to know whether we >> can expect D code to be compiled

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread Iain Buclaw via Digitalmars-d
On 23 April 2016 at 15:56, Andrei Alexandrescu via Digitalmars-d wrote: > On 4/23/16 9:54 AM, Andrei Alexandrescu wrote: >> >> On 4/23/16 9:06 AM, Vladimir Panteleev wrote: >>> >>> On Saturday, 23 April 2016 at 13:04:00 UTC, Nordlöw wrote: Wanted: CT-trait

Re: Will the GC scan this pointer?

2016-04-24 Thread safety0ff via Digitalmars-d-learn
On Sunday, 24 April 2016 at 11:03:11 UTC, Lass Safin wrote: So the question is: Will the GC scan ptr? As you can see, it is a write-only pointer, so reading from it will cause undefined behavior (such as return data which looks like a pointer to data..), and can potentially be reallly slow.

Re: Line spacing for '///ditto' on the website

2016-04-24 Thread Joseph Rushton Wakeling via Digitalmars-d
On Saturday, 23 April 2016 at 19:53:38 UTC, Andrei Alexandrescu wrote: On 04/23/2016 03:50 PM, ag0aep6g wrote: On 23.04.2016 21:43, Andrei Alexandrescu wrote: http://dlang.org/phobos/std_experimental_allocator_building_blocks_affix_allocator.html#.AffixAllocator.goodAllocSize Looks like

Re: Will the GC scan this pointer?

2016-04-24 Thread ag0aep6g via Digitalmars-d-learn
On 24.04.2016 13:03, Lass Safin wrote: // Omitting the required imports. void[] ptr; void main() { uint buffer; glCreateBuffers(1, ); // Filling the buffer with data and such... ptr = glMapNamedBufferRange(buffer, 0, 512, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT |

Re: GSoC 2016 - A replacement of std.xml for the Phobos standard library

2016-04-24 Thread Chris via Digitalmars-d
On Saturday, 23 April 2016 at 08:30:32 UTC, Lodovico Giaretta wrote: Hi, I'm Lodovico Giaretta and I've been selected by the D Foundation for GSoC 2016. First of all, I'd like to thank the D Foundation for this fantastic opportunity. In particular, I'd like to thank Craig Dillabaugh and

Re: DlangUI on Android

2016-04-24 Thread Chris via Digitalmars-d-announce
On Sunday, 24 April 2016 at 06:19:14 UTC, thedeemon wrote: On Saturday, 23 April 2016 at 18:16:38 UTC, Chris wrote: Anyone interested in taking DlangUI and turning it into something like Swing/JavaFX for D? What exactly do you mean by that? Embrace DlangUI or something based on it in the

Re: Line spacing for '///ditto' on the website

2016-04-24 Thread Nick Treleaven via Digitalmars-d
On Saturday, 23 April 2016 at 20:50:31 UTC, Adam D. Ruppe wrote: I still can't get over the ridiculous grey constraints. WTF. It's much better reading signatures than before. But what we could do is add a margin-bottom to them if needed, while keeping the others hugged up. Good idea,

Re: An important pull request: accessing shared affix for immutable data

2016-04-24 Thread Marco Leise via Digitalmars-d
Am Sat, 13 Feb 2016 19:16:43 +0100 schrieb Timon Gehr : > Not necessarily. shared is transitive and prefix/suffix are arbitrary > types which might contain mutable indirections. I don't want to disturb your conversation, but how about designing a working "shared" first? My

Will the GC scan this pointer?

2016-04-24 Thread Lass Safin via Digitalmars-d-learn
// Omitting the required imports. void[] ptr; void main() { uint buffer; glCreateBuffers(1, ); // Filling the buffer with data and such... ptr = glMapNamedBufferRange(buffer, 0, 512, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT)[0 .. 512]; } So the question is:

Re: Who wore it better?

2016-04-24 Thread Nick Treleaven via Digitalmars-d
On Friday, 15 April 2016 at 18:46:01 UTC, Steven Schveighoffer wrote: inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) Might be nice if inout applied to template parameter types: T[] overlap(inout T)(T[] r1, T[] r2); If it wasn't for the virtual function issue, I wonder if inout would

Re: GSoC 2016 - A replacement of std.xml for the Phobos standard library

2016-04-24 Thread Lodovico Giaretta via Digitalmars-d
On Saturday, 23 April 2016 at 18:49:00 UTC, Jack Stouffer wrote: If you want, you can get more feedback by submitting a work in progress PR to Phobos so people can see the development of the library and comment on it as you go. This would also allow you to test your code with the Phobos CI

Re: GSoC 2016 - A replacement of std.xml for the Phobos standard library

2016-04-24 Thread Lodovico Giaretta via Digitalmars-d
On Saturday, 23 April 2016 at 14:38:36 UTC, Seb wrote: Do you know about these two projects? https://github.com/jacob-carlborg/orange https://github.com/s-ludwig/std_data_json It would be great if your xml library could work with the proposed std.data specification. Ideally switching from

Directions to Ibis Hotel in Berlin from Tegel Airport

2016-04-24 Thread Walter Bright via Digitalmars-d
The hotel emailed them to me, I presume they know what they're doing :-) so I thought I'd share: Bus 109 to Jakob-Kaiser-Platz Subway U 7 in the direction of Rudow to Grenzallee Cross the street at the traffic light and turn left. The next street on the right is Jahnstraße. On the left side

Re: How do you use D to launch/open a window?

2016-04-24 Thread Satoshi via Digitalmars-d-learn
On Friday, 22 April 2016 at 21:13:31 UTC, anonymousuer wrote: What code is needed to tell D to open a window? Thank you in advance. You can choose between existing libraries or wrappers for GUI implementation like: DlangUI, Qt, ..., (or my new GUI framework called Rikarin what will be

Re: Line spacing for '///ditto' on the website

2016-04-24 Thread default0 via Digitalmars-d
On Saturday, 23 April 2016 at 20:50:31 UTC, Adam D. Ruppe wrote: On Saturday, 23 April 2016 at 20:06:39 UTC, ag0aep6g wrote: On 23.04.2016 21:53, Andrei Alexandrescu wrote: Should we use a single ? -- Andrei That would look better in the case you linked, but it would be a step back with

[Issue 13698] ICE(e2ir.c) on on simd call

2016-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13698 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c8700645b3148c26ae3ffe9bf24d621ae26223b7 fix Issue 13698 - ICE(e2ir.c) on on simd call

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread deadalnix via Digitalmars-d
On Saturday, 23 April 2016 at 15:29:08 UTC, Andrei Alexandrescu wrote: Yah, that's the canonical. I forgot why I chose (x & -x) > (x - 1) over it. I'm not sure why do you test against x - 1 when you could test for equality. Not only it looks like it is going to require an extra computation

Re: Checking if an Integer is an Exact Binary Power

2016-04-24 Thread deadalnix via Digitalmars-d
On Saturday, 23 April 2016 at 13:04:00 UTC, Nordlöw wrote: Wanted: CT-trait and run-time predicate for checking whether its single integer parameter is an exact power of two. I guess https://dlang.org/phobos/std_math.html#.truncPow2 or https://dlang.org/phobos/std_math.html#.nextPow2 could

Re: DlangUI on Android

2016-04-24 Thread thedeemon via Digitalmars-d-announce
On Saturday, 23 April 2016 at 18:16:38 UTC, Chris wrote: Anyone interested in taking DlangUI and turning it into something like Swing/JavaFX for D? What exactly do you mean by that?