D source:
extern(C++) void thisWorks(const char* test);
extern(C++) void doesNotLink(const char** test);
void main() {
char* baz1;
char** baz2;
thisWorks(baz1);
doesNotLink(baz2);
}
CPP source:
#include
void thisWorks(const char* test) {
printf("hi\n");
}
void DoesNotLin
On Wednesday, 1 June 2016 at 07:09:16 UTC, abad wrote:
D source:
extern(C++) void thisWorks(const char* test);
extern(C++) void doesNotLink(const char** test);
void main() {
char* baz1;
char** baz2;
thisWorks(baz1);
doesNotLink(baz2);
}
CPP source:
#include
void thisWorks(co
On Wednesday, 1 June 2016 at 07:17:04 UTC, Mike Parker wrote:
On Wednesday, 1 June 2016 at 07:09:16 UTC, abad wrote:
What's happening? I know there are differences in const
behavior between D and C++, but can't figure a way around it.
Any sort of casting trick I tried doesn't seem to help.
On Wednesday, 1 June 2016 at 07:17:04 UTC, Mike Parker wrote:
On Wednesday, 1 June 2016 at 07:09:16 UTC, abad wrote:
Try this:
extern(C++) void DoesNotLink(const(char)**);
That does work, though I have to explicitly cast it in my caller
as well.
Like this:
doesNotLink(cast(const(char)**)ba
I've recently been trying to convince a friend of mine that D has
at least the functionality of C++, and have been learning the
language over C++ for a few months. Memory management is pretty
important to him, and a subject I'm honestly curious about as
well. I was wondering: what's the preferr
On 01/06/2016 7:59 PM, Anthony Monterrosa wrote:
I've recently been trying to convince a friend of mine that D has at
least the functionality of C++, and have been learning the language over
C++ for a few months. Memory management is pretty important to him, and
a subject I'm honestly curious abo
On Wednesday, 1 June 2016 at 07:59:50 UTC, Anthony Monterrosa
wrote:
I've recently been trying to convince a friend of mine that D
has at least the functionality of C++, and have been learning
the language over C++ for a few months. Memory management is
pretty important to him, and a subject I'
I was wondering: what's the preferred method for deterministic
memory management?
You may be interested in RefCounted. It only works for structs,
not classes, but it's still useful.
- Classes/Structs have constructors and destructors. I am
unconfident with my knowledge as to how this works
I understand that Base64 uses Ranges, and since String is seen
and used as unicode by Ranges (please tell me if I am wrong).
I am guessing, for this reason, auto btoa =
std.base64.Base64.encode("Blah"); doesn't work. You need to be
casting the string to ubyte[] to make it work which doesn't lo
On Wednesday, 1 June 2016 at 09:31:51 UTC, tcak wrote:
I understand that Base64 uses Ranges, and since String is seen
and used as unicode by Ranges (please tell me if I am wrong).
I am guessing, for this reason, auto btoa =
std.base64.Base64.encode("Blah"); doesn't work. You need to be
castin
How can we build QtE5 and/or the examples?
Download qte5.zip from github. Unzip it to qte5-master.
If you have Windows 32 then copy
qte5-master/windows32/QtE5Widgets32.dll to folder qte5-master.
Copy RunTime Qt-5 (all files and folders from
qte5-master/windows32/rt_Qt5_windows32.zip) to qte5-m
On Wednesday, 1 June 2016 at 08:53:01 UTC, Rene Zwanenburg wrote:
I was wondering: what's the preferred method for deterministic
memory management?
You can annotate your functions as @nogc. The compiler will
disallow any potential GC use, including calling other
functions that are not @nogc.
So I have ran into an issue where I want to replace a string with
regex.
but i cant figure out how to replace items followed by a number.
i use "$1001" to do paste first match but this thinks I'm trying
using match 1001
but if i try ${1}001 it gives me an error saying that it cant
match the o
On Wednesday, 1 June 2016 at 07:29:56 UTC, abad wrote:
That does work, though I have to explicitly cast it in my
caller as well.
Like this:
doesNotLink(cast(const(char)**)baz2);
It's a bit troublesome as my code will include quite a lot of
calls like this.
Casting is not necessary with the
I started using reference counters for my assets in my
application :
- Images
- Models
-
Such as :
alias ModelType = RefCounted!Model;
struct Model
{
static ModelType create(Mesh mesh, Shader shader) {
ModelType model = ModelType();
model.mesh =
I can see two option but neither of them is really portable :
I can set _store public in std.typecons or i could create a
setter method.
Neither of these options is portable because i need to directly
edit the librarie's source code so i can't jump from one computer
to the next without having
On Wednesday, 1 June 2016 at 16:16:26 UTC, Kagamin wrote:
Can you declare it as const char*const* one the C++ side?
Just to state the problem clearly, D's const is transitive, C++
it is not. C linkage doesn't care about const, so you can specify
it however you want. In C++ the const is includ
On Tuesday, 31 May 2016 at 20:52:20 UTC, Johan Engelen wrote:
On Tuesday, 31 May 2016 at 18:55:18 UTC, Gary Willoughby wrote:
If I have a pointer and iterate over it using a slice, like
this:
T* foo = &data;
foreach (element; foo[0 .. length])
{
...
I'm trying to create a type that for all intents and purposes
behaves exactly like an int except that it limits its values to
be within a certain range [a,b]. Theoretically, I would think
this looks something like:
struct FixedRangeInt {
this(int min, int max, int value=0) {
this.min = m
On Wednesday, 1 June 2016 at 18:14:33 UTC, Begah wrote:
I started using reference counters for my assets in my
application :
- Images
- Models
-
For my resource manager I started out with something similar to
what you're describing, but I eventually changed the design which
turned ou
On Wednesday, 1 June 2016 at 19:59:51 UTC, Mark Isaacson wrote:
FWIW, the fixed range int part of this question is just an
example, I'm mostly just interested in whether this idea is
possible without a lot of bloat/duplication.
I suspect not.. Here's how std.typecons.Proxy is doing it:
https:
Hahahaa. Who could possibly think that `build.sh` builds dub in
debug mode? With -release -O -inline -m64 it runs 5 times faster
: P. It made my day...
Here's the assembly code for my alpha-blending routine:
ubyte[4] src = *cast(ubyte[4]*)(palette.ptr + 4 * *c);
ubyte[4] *p = cast(ubyte[4]*)(workpad + (offsetX + x)*4 +
offsetY);
asm{//moving the values to their destinations
movdMM0, p;
movdMM1, src;
movqMM5, alpha;
movqMM7,
On Wednesday, 1 June 2016 at 23:23:49 UTC, ZILtoid1991 wrote:
After some debugging, I found out that the p pointer becomes
null at the end instead of pointing to a value. I have no
experience with using in-line assemblers (although I made a few
Hello World programs for MS-Dos with a stand-alone
How this could possibly be happening is confounding me and I have
no idea if it's something I missed or some contrived compiler bug.
This is the package.d that previously I've compiled with unittest
every so often as a way of doing regression testing -
https://github.com/pineapplemachine/mach.
On Wednesday, June 01, 2016 23:58:52 pineapple via Digitalmars-d-learn wrote:
> How this could possibly be happening is confounding me and I have
> no idea if it's something I missed or some contrived compiler bug.
>
> This is the package.d that previously I've compiled with unittest
> every so oft
I've got a fairly complex D project (25+ modules) that has grown
haphazardly over time. So it is not well designed. But I want to
get the thing fully ported before refining the code. (that's
called refactoring, I believe?)
Anyway, there is a new module called audio.d which which has all
the s
On Wednesday, 1 June 2016 at 23:35:40 UTC, Era Scarecrow wrote:
On Wednesday, 1 June 2016 at 23:23:49 UTC, ZILtoid1991 wrote:
After some debugging, I found out that the p pointer becomes
null at the end instead of pointing to a value. I have no
experience with using in-line assemblers (although
On Thursday, 2 June 2016 at 00:37:58 UTC, WhatMeWorry wrote:
I've got a fairly complex D project (25+ modules) that has
grown haphazardly over time. So it is not well designed. But I
want to get the thing fully ported before refining the code.
(that's called refactoring, I believe?)
Anyway, t
On Thursday, 2 June 2016 at 00:51:15 UTC, ZILtoid1991 wrote:
On Wednesday, 1 June 2016 at 23:35:40 UTC, Era Scarecrow wrote:
On Wednesday, 1 June 2016 at 23:23:49 UTC, ZILtoid1991 wrote:
I could get the code working with a bug after replacing pmulhuw
with pmullw, but due to integer overflow I
On Thursday, 2 June 2016 at 00:52:48 UTC, ZILtoid1991 wrote:
On Thursday, 2 June 2016 at 00:51:15 UTC, ZILtoid1991 wrote:
I could get the code working with a bug after replacing
pmulhuw with pmullw, but due to integer overflow I get a
glitched image. I try to get around the fact that pmulhuw
s
I found your git hub and tried simpledisplay and png. I had
virtually no problems getting them working from the get go!
Thanks for your hard work!!! You deserve a cookie, or a million
bucks!
I'm curious about how to draw a scaled image. I would like to
have a "global" scale for my image drawi
On Thursday, 2 June 2016 at 03:19:20 UTC, Pie? wrote:
I'm curious about how to draw a scaled image.
There's a few general options:
1) Scale it yourself in-memory then draw. This is a pain, I don't
think my public libraries have a scale method
2) If on MS Windows, you can resize the wind
On Thursday, 2 June 2016 at 03:37:01 UTC, Adam D. Ruppe wrote:
On Thursday, 2 June 2016 at 03:19:20 UTC, Pie? wrote:
I'm curious about how to draw a scaled image.
There's a few general options:
1) Scale it yourself in-memory then draw. This is a pain, I
don't think my public libraries have a
Does anyone know if there is any Asio bindings or direct D
available that allows for IO?
On Thursday, 2 June 2016 at 04:02:36 UTC, Pie? wrote:
Does anyone know if there is any Asio bindings or direct D
available that allows for IO?
Check out vibe.d: https://vibed.org/ - it includes a fairly
complete implementation of asynchronous I/O, among other things.
On Thursday, 2 June 2016 at 04:52:50 UTC, Mithun Hunsur wrote:
On Thursday, 2 June 2016 at 04:02:36 UTC, Pie? wrote:
Does anyone know if there is any Asio bindings or direct D
available that allows for IO?
Check out vibe.d: https://vibed.org/ - it includes a fairly
complete implementation of
37 matches
Mail list logo