Am Tue, 07 Apr 2015 20:38:52 +
schrieb "Jens Bauer" :
> On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
> > Question number 1: How can a C subroutine be made optional, so
> > it's called only if it linked ?
>
> Question 1 might be answered by the following thread:
> http://forum.
tcak:
I am planning to implement "Iterator" class. But looking at
"foreach" statement, it takes a range only.
Unless you are just experimenting, it's better to not go against
a language and its std lib.
Bye,
bearophile
On Wednesday, 8 April 2015 at 08:02:35 UTC, Johannes Pfau wrote:
I actually saw these errors when I first tested your examples,
but I thought that was a mistake in the example code. I didn't
even know that extern weak symbols get default values in C ;-)
Don't feel bad about that. I think I fou
Hi folks,
While trying to generate all combinations of length X in an array,
I came across the question on stackoverflow. [1]
Theres a couple good answers there, but one that caught my eye
shows a C# code snippet that is quite nice and short:
public static IEnumerable> Combinations(this
IEnu
wobbles:
While trying to generate all combinations of length X in an
array,
I came across the question on stackoverflow. [1]
Theres a couple good answers there, but one that caught my eye
shows a C# code snippet that is quite nice and short:
Often short code is not the best code.
Take a lo
On Wednesday, 8 April 2015 at 10:54:45 UTC, bearophile wrote:
wobbles:
While trying to generate all combinations of length X in an
array,
I came across the question on stackoverflow. [1]
Theres a couple good answers there, but one that caught my eye
shows a C# code snippet that is quite nice
On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
Question number 2: Is it possible to change the VectorFunc to
be a real function pointer, rather than a void* ?
I did something along these lines (modified to match your
example) and it worked fine for me:
alias VectorFunc = vo
On Wednesday, 8 April 2015 at 11:08:00 UTC, wobbles wrote:
On Wednesday, 8 April 2015 at 10:54:45 UTC, bearophile wrote:
wobbles:
While trying to generate all combinations of length X in an
array,
I came across the question on stackoverflow. [1]
Theres a couple good answers there, but one th
i got two modules
opengvg.d and vg.d
vg.d contains calls to external c functions
openvg.d should wrap and simplify some of those calls
in openvg.d i make public import of submodule vg.d
such that if openvg.d is imported the functions in vg.d can be
called, this works as intended. but as soon as
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
Question number 2: Is it possible to change the VectorFunc to
be a real function pointer, rather than a void* ?
I did something along these lines (modified to match your
ex
A struct is copied when you pass it to foreach, so it iterates
over the copy leaving the original the same.
A class is referenced by foreach, so the original is affected by
it.
This is one reason why separating containers from the
ranges/iterators that go over them is helpful: the iterator
If Iterator is a struct then Iterator.input won't be adjusted
properly when the foreach loop ends.
Iterator.input still holds "abcde" value.
If i mark Iterator as class then Iterator.input will be an empty
string after the foreach loop.
Could anyone explain me the difference please?
Thank you.
Something tells me that now is when I have to start doing some
hard work. ;)
-Sorry, I need to split this up into short replies/questions.
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
Question number 2: Is it possible to cha
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
I did something along these lines (modified to match your
example) and it worked fine for me:
alias VectorFunc = void function();
@attribute("weak") @attribute("alias", "defaultHandler")
extern void Reset_Handler();
Strange; I can't get
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
Question number 3: How can I call an external function and
keep the binary file size down ?
Are you compiling with -ffunction-sections -fdata-sections and
linking with --gc-sec
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
enum weak = gcc.attribute.attribute("weak");
enum isrDefault = gcc.attribute.attribute("alias",
"defaultHandler");
extern @weak @isrDefault void NMI_Handler();
extern @weak @isr
While I technically finished the 0.2 version of my graphics
engine which has a reasonable speed at low internal resolutions
and with only a couple of sprites, but it still gets bottlenecked
a lot. First I'll throw out the "top-down determination
algorhythm" as it requires constant memory paging
On Wednesday, 8 April 2015 at 15:53:37 UTC, Jens Bauer wrote:
[snip] I find it strange that calling an empty function outside
the source file will cause that huge difference.
-But of course, there's a logic explanation somewhere. ;)
It might be caused by the linker script; I'll try and see if I
On Wednesday, 8 April 2015 at 12:05:00 UTC, ddos wrote:
vg.d:
module vg;
extern (C) void vgSetParameterfv(VGHandle object, VGint
paramType, VGint count, VGfloat *values);
openvg.d
module openvg;
public import vg;
void vgSetParameterfv(VGHandle object, VGint paramType,
const(VGfloat[]) value
On Wednesday, 8 April 2015 at 09:02:08 UTC, bearophile wrote:
tcak:
I am planning to implement "Iterator" class. But looking at
"foreach" statement, it takes a range only.
Unless you are just experimenting, it's better to not go
against a language and its std lib.
Bye,
bearophile
Also, w
On Wednesday, 8 April 2015 at 16:10:53 UTC, Jens Bauer wrote:
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
-I actually added @attribute("naked") to my defaultResetHandler
yesterday, as I wanted to get rid of the prologue
On Wednesday, 8 April 2015 at 23:23:53 UTC, Mike wrote:
I actually added that out of necessity, not optimization. Id I
use the STM32, and reset the MCU, the CCRAM is disabled by
default. Since my stack is in CCRAM, I need to first enable it
before any functions can be called.
According to S
On Wednesday, 8 April 2015 at 22:53:39 UTC, ddos wrote:
why not just make it callable without the alias?
It's to prevent "hijacking": http://dlang.org/hijack.html
On Wednesday, 8 April 2015 at 15:44:00 UTC, Jens Bauer wrote:
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
I did something along these lines (modified to match your
example) and it worked fine for me:
alias VectorFunc = void function();
@attribute("weak") @attribute("alias", "defau
On Wednesday, 8 April 2015 at 23:28:45 UTC, Mike wrote:
If I use the STM32 system bootloader, and reset the MCU,
the CCRAM is disabled by default.
I see. That is absolutely incorrect behaviour of the bootloader.
A bootloader should only change the things that are absolutely
necessary to change
On Wednesday, 8 April 2015 at 17:45:01 UTC, Jens Bauer wrote:
On Wednesday, 8 April 2015 at 15:53:37 UTC, Jens Bauer wrote:
[snip] I find it strange that calling an empty function outside
the source file will cause that huge difference.
-But of course, there's a logic explanation somewhere. ;)
On Thursday, 9 April 2015 at 00:37:32 UTC, Jens Bauer wrote:
On Wednesday, 8 April 2015 at 23:23:53 UTC, Mike wrote:
I actually added that out of necessity, not optimization. Id
I use the STM32, and reset the MCU, the CCRAM is disabled by
default. Since my stack is in CCRAM, I need to first e
On Wednesday, 8 April 2015 at 23:23:53 UTC, Mike wrote:
On Wednesday, 8 April 2015 at 16:10:53 UTC, Jens Bauer wrote:
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
-I actually added @attribute("naked") to my
defaultReset
ddos:
same behavior when overriding methods of base classes
This is by design.
Bye,
bearophile
On Wednesday, 8 April 2015 at 17:48:36 UTC, anonymous wrote:
On Wednesday, 8 April 2015 at 12:05:00 UTC, ddos wrote:
vg.d:
module vg;
extern (C) void vgSetParameterfv(VGHandle object, VGint
paramType, VGint count, VGfloat *values);
openvg.d
module openvg;
public import vg;
void vgSetParamet
30 matches
Mail list logo