Constructor - the both look the same

2016-03-11 Thread Joel via Digitalmars-d-learn
Why does it come up with this? source/setup.d(40,16): Error: constructor inputjex.InputJex.this (Vector2!float pos, int fontSize, InputType type = cast(InputType)0) is not callable using argument types (Vector2!float, int, InputType) dmd failed with exit code 1.

Re: BZ2 library

2016-03-11 Thread stunaep via Digitalmars-d-learn
On Saturday, 12 March 2016 at 06:07:25 UTC, Mike Parker wrote: [...] I used visual studio 2013 to build the libraries With dflag -m64 and dub flag --arch=x86_64, this happens Running: dub build --arch=x86_64 ## Warning for package rsdlib ## The following compiler flags have

Re: BZ2 library

2016-03-11 Thread Basile B. via Digitalmars-d-learn
On Saturday, 12 March 2016 at 05:16:37 UTC, stunaep wrote: I'm really having a hard time using bzp (and later I need gzip and lzma). So I added this bzip2 D interface to my DUB dependencies "dependencies" : { "bzip2": "~>0.1.0" } I downloaded the bzip2 source code and compiled

Re: BZ2 library

2016-03-11 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 12 March 2016 at 05:16:37 UTC, stunaep wrote: I'm really having a hard time using bzp (and later I need gzip and lzma). So I added this bzip2 D interface to my DUB dependencies "dependencies" : { "bzip2": "~>0.1.0" } I downloaded the bzip2 source code and compiled

BZ2 library

2016-03-11 Thread stunaep via Digitalmars-d-learn
I'm really having a hard time using bzp (and later I need gzip and lzma). So I added this bzip2 D interface to my DUB dependencies "dependencies" : { "bzip2": "~>0.1.0" } I downloaded the bzip2 source code and compiled it for windows 32bit (will 64 bit work with dmd2?). Then I

Re: Simple call to static member function

2016-03-11 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 11 March 2016 at 23:14:48 UTC, ag0aep6g wrote: On 11.03.2016 23:47, WhatMeWorry wrote: [...] This suggests that you simply `import ResourceManager;` in main.d. [...] Very good. Thanks for the fix and the pointers. I'm porting C++ code over, and it has corrupted me. I'll

Re: Simple call to static member function

2016-03-11 Thread ag0aep6g via Digitalmars-d-learn
On 11.03.2016 23:47, WhatMeWorry wrote: --- main.d void main(string[] argv) { ResourceManager.LoadShader("VertexShader.glsl", "FragmentShader.glsl", "filler", "sprite"); --- File ResourceManager.d

Re: Simple call to static member function

2016-03-11 Thread tsbockman via Digitalmars-d-learn
On Friday, 11 March 2016 at 22:47:00 UTC, WhatMeWorry wrote: main.d(173): Error: undefined identifier 'LoadShader' in module 'ResourceManager' Please show enough of the code that I can actually try to compile it myself. In particular, I need to see how you handled the imports since that is

Simple call to static member function

2016-03-11 Thread WhatMeWorry via Digitalmars-d-learn
--- main.d void main(string[] argv) { ResourceManager.LoadShader("VertexShader.glsl", "FragmentShader.glsl", "filler", "sprite"); --- File ResourceManager.d class ResourceManager {

Re: asserting dmd has a problem?

2016-03-11 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2016-03-11 at 18:47 +, Adam D. Ruppe via Digitalmars-d- learn wrote: > On Friday, 11 March 2016 at 18:45:12 UTC, Russel Winder wrote: > > > > The following code compiles fine using DMD 2.70.2: > Using -release? Hummm… surreptitious -release I had missed. That deals with that. Many

Re: Iterating over thread local storage variables

2016-03-11 Thread sigod via Digitalmars-d-learn
On Friday, 11 March 2016 at 18:45:13 UTC, Anonymouse wrote: On Friday, 11 March 2016 at 17:33:43 UTC, sigod wrote: On Friday, 11 March 2016 at 17:03:38 UTC, Anonymouse wrote: On Friday, 11 March 2016 at 15:21:38 UTC, maik klein wrote: [...] As a drive-by comment, mind that

Re: asserting dmd has a problem?

2016-03-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 11 March 2016 at 18:45:12 UTC, Russel Winder wrote: The following code compiles fine using DMD 2.70.2: Using -release? Or catching the AssertError?

Re: Iterating over thread local storage variables

2016-03-11 Thread Anonymouse via Digitalmars-d-learn
On Friday, 11 March 2016 at 17:33:43 UTC, sigod wrote: On Friday, 11 March 2016 at 17:03:38 UTC, Anonymouse wrote: On Friday, 11 March 2016 at 15:21:38 UTC, maik klein wrote: static Singleton!T get() { if (!instantiated_) {

asserting dmd has a problem?

2016-03-11 Thread Russel Winder via Digitalmars-d-learn
Clearly I am missing something very, very simple, but… The following code compiles fine using DMD 2.70.2: writeln(play_bin); assert(play_bin is null); assert(play_bin !is null); with the output: null on executing the code. I have two comments:

Re: Use of GUID constants

2016-03-11 Thread Kagamin via Digitalmars-d-learn
Oh, it was https://github.com/D-Programming-Language/druntime/pull/1472

Re: GC scan for pointers

2016-03-11 Thread Gerald Jansen via Digitalmars-d-learn
On Thursday, 10 March 2016 at 10:58:41 UTC, thedeemon wrote: On Wednesday, 9 March 2016 at 15:14:02 UTC, Gerald Jansen wrote: enum n = 100_000_000; // some big number auto a = new ulong[](n); auto b = new char[8][](n); struct S { ulong x; char[8] y; } auto c = new S[](n); will the

Re: Use of GUID constants

2016-03-11 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 9 March 2016 at 18:35:31 UTC, KlausO wrote: So maybe they should be declared as "extern GUID ..." because they also seem to be defined in windows\lib\uuid.lib which comes with DMD. Declarations come from mingw and mingw doesn't have uuid.lib:

Re: static if else behavior and is type comparison

2016-03-11 Thread Chris Wright via Digitalmars-d-learn
On Fri, 11 Mar 2016 00:21:33 -0800, Ali Çehreli wrote: > You've been bitten by a common usability issue. :) > > On 03/11/2016 12:02 AM, Fynn Schröder wrote: > > static if (is(U == ubyte)) { > > pragma(msg, "is ubyte"); > > return fnUbyte(); > > } else if (is(U ==

Re: Iterating over thread local storage variables

2016-03-11 Thread sigod via Digitalmars-d-learn
On Friday, 11 March 2016 at 17:03:38 UTC, Anonymouse wrote: On Friday, 11 March 2016 at 15:21:38 UTC, maik klein wrote: static Singleton!T get() { if (!instantiated_) { synchronized(Singleton!T.classinfo){ if (!instance_){

Re: Iterating over thread local storage variables

2016-03-11 Thread Anonymouse via Digitalmars-d-learn
On Friday, 11 March 2016 at 15:21:38 UTC, maik klein wrote: static Singleton!T get() { if (!instantiated_) { synchronized(Singleton!T.classinfo){ if (!instance_){ instance_ = new Singleton!T(); }

Iterating over thread local storage variables

2016-03-11 Thread maik klein via Digitalmars-d-learn
I want to create a logger in a multithreaded system. I wanted to expose a global variable like logger.log("something"); I also wanted to reuse D's thread local global variables because that would make it easy to log in a multithreaded system. This is really easy to do, but the problem is

Re: static if else behavior and is type comparison

2016-03-11 Thread Marc Schütz via Digitalmars-d-learn
On Friday, 11 March 2016 at 12:10:53 UTC, Artur Skawina wrote: On 03/11/16 09:21, Ali Çehreli via Digitalmars-d-learn wrote: You've been bitten by a common usability issue. :) On 03/11/2016 12:02 AM, Fynn Schröder wrote: static if (is(U == ubyte)) { } else if (is(U == ushort)) {

Re: static if else behavior and is type comparison

2016-03-11 Thread Artur Skawina via Digitalmars-d-learn
On 03/11/16 09:21, Ali Çehreli via Digitalmars-d-learn wrote: > You've been bitten by a common usability issue. :) > > On 03/11/2016 12:02 AM, Fynn Schröder wrote: >> static if (is(U == ubyte)) { >> } else if (is(U == ushort)) { > > You mean 'else static if'. (Not your fault: I (and

Re: static if else behavior and is type comparison

2016-03-11 Thread Fynn Schröder via Digitalmars-d-learn
On Friday, 11 March 2016 at 08:21:33 UTC, Ali Çehreli wrote: You mean 'else static if'. (Not your fault: I (and others) wish the compiler warned about this problem.) Thanks! Such an easy mistake.. You're right Ali, it would be nice if the compiler gave a warning :)

Re: static if else behavior and is type comparison

2016-03-11 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 11 March 2016 at 08:02:41 UTC, Fynn Schröder wrote: Am I doing anything wrong here or is this a bug? You should write: static if { ... } else static if { ... } else static if { ... }

Re: static if else behavior and is type comparison

2016-03-11 Thread Ali Çehreli via Digitalmars-d-learn
You've been bitten by a common usability issue. :) On 03/11/2016 12:02 AM, Fynn Schröder wrote: > static if (is(U == ubyte)) { > pragma(msg, "is ubyte"); > return fnUbyte(); > } else if (is(U == ushort)) { You mean 'else static if'. (Not your fault: I (and others)

static if else behavior and is type comparison

2016-03-11 Thread Fynn Schröder via Digitalmars-d-learn
Hi all, I'm currently working on a small utility to control the EC (embedded controller) of my notebook. I need to call an external C library and choose different methods based on the desired return type. I came up with a solution based on type checking and static if - however I ran into a