Thread overview | |||||
---|---|---|---|---|---|
|
November 25, 2007 memmove C++ -> D | ||||
---|---|---|---|---|
| ||||
C++ memmove: memmove(bounds + upperIndex + 2, bounds + upperIndex, (edgeCount - upperIndex) * sizeof(b2Bound)); D memmove: memmove(bounds.ptr + upperIndex + 2, bounds.ptr + upperIndex, (edgeCount - upperIndex) * b2Bound.sizeof); Is this a correct translation to D? Thanks. ~ Clay |
November 25, 2007 Re: memmove C++ -> D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Clay Smith | Clay Smith wrote:
> C++ memmove:
>
> memmove(bounds + upperIndex + 2, bounds + upperIndex, (edgeCount - upperIndex) * sizeof(b2Bound));
>
> D memmove:
>
> memmove(bounds.ptr + upperIndex + 2, bounds.ptr + upperIndex, (edgeCount - upperIndex) * b2Bound.sizeof);
>
> Is this a correct translation to D? Thanks.
>
> ~ Clay
Oh, and bounds in the C++ version is a pointer, while in the D version is an array.
|
November 25, 2007 Re: memmove C++ -> D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Clay Smith | Clay Smith wrote:
> Clay Smith wrote:
>> C++ memmove:
>>
>> memmove(bounds + upperIndex + 2, bounds + upperIndex, (edgeCount - upperIndex) * sizeof(b2Bound));
>>
>> D memmove:
>>
>> memmove(bounds.ptr + upperIndex + 2, bounds.ptr + upperIndex, (edgeCount - upperIndex) * b2Bound.sizeof);
>>
>> Is this a correct translation to D? Thanks.
>>
>> ~ Clay
>
> Oh, and bounds in the C++ version is a pointer, while in the D version is an array.
Looks ok, unless b2Bound is a class. Then the sizeof would be giving you the size of just the reference to the class.
--bb
|
Copyright © 1999-2021 by the D Language Foundation