Re: Access Violation Tracking

2014-11-08 Thread Nikolay via Digitalmars-d-learn
i also developed a habit of writing assert()s before dereferencing pointers first time (including class refs) in appropriate places, so i'll got that stack trace for free. ;-) and i never turning off that asserts in release builds. If we can't rely on system level may be we should have

Re: Access Violation Tracking

2014-11-08 Thread ketmar via Digitalmars-d-learn
On Sat, 08 Nov 2014 11:46:16 + Nikolay via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: i also developed a habit of writing assert()s before dereferencing pointers first time (including class refs) in appropriate places, so i'll got that stack trace for free. ;-)

Re: Delegates and C function pointers

2014-11-08 Thread Gary Willoughby via Digitalmars-d-learn
On Saturday, 8 November 2014 at 12:23:45 UTC, Nicolas Sicard wrote: I would like to register a D delegate to a C API that takes a function pointer as a callback and a void* pointer to pass data to this callback. My solution is in http://dpaste.dzfl.pl/7d9b504b4b965. Is this code correct? Is

Re: Access Violation Tracking

2014-11-08 Thread ketmar via Digitalmars-d-learn
On Sat, 08 Nov 2014 15:51:58 + Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 5 November 2014 at 11:39:21 UTC, Marc Schütz wrote: If you're on Linux, you can turn SEGVs into Errors: import etc.linux.memoryerror;

Re: Delegates and C function pointers

2014-11-08 Thread anonymous via Digitalmars-d-learn
On Saturday, 8 November 2014 at 12:23:45 UTC, Nicolas Sicard wrote: I would like to register a D delegate to a C API that takes a function pointer as a callback and a void* pointer to pass data to this callback. My solution is in http://dpaste.dzfl.pl/7d9b504b4b965. Is this code correct? Is

libphobos2.so insists on its name while using shared libraries

2014-11-08 Thread tcak via Digitalmars-d-learn
I am using DMD 2.066.1 on Ubuntu 14.04 64-bit. I used the latest main.d and dll.d codes from http://dlang.org/dll-linux.html Then I used the following make file: all: cp /usr/lib/x86_64-linux-gnu/libphobos2.so ./libmyphobos2.so dmd -c dll.d -fPIC dmd -oflibdll.so dll.o

Re: Delegates and C function pointers

2014-11-08 Thread Nicolas Sicard via Digitalmars-d-learn
On Saturday, 8 November 2014 at 16:01:09 UTC, anonymous wrote: On Saturday, 8 November 2014 at 12:23:45 UTC, Nicolas Sicard wrote: I would like to register a D delegate to a C API that takes a function pointer as a callback and a void* pointer to pass data to this callback. My solution is in

Re: Audio file read/write?

2014-11-08 Thread Jeremy DeHaan via Digitalmars-d-learn
On Friday, 7 November 2014 at 11:55:16 UTC, ponce wrote: Pretty sure libsndfile can read .wav, .au, .ogg but not mp3 No commercial usage unless you pay a licence. https://github.com/p0nce/DerelictSndFile.git Not sure about the others, but you can use sndfile in a commercial project for free

joiner random access range?

2014-11-08 Thread bearophile via Digitalmars-d-learn
Given a 2D array, I'd like to sort its items sequentially: import std.stdio, std.algorithm, std.range; void foo(int[][] m) { m.joiner.sort().writeln; // error } void main() { auto m = [[10, 2], [30, 4]]; m.joiner.writeln; foo(m); m.joiner.writeln; // OK, but the matrix