It would be good if there was a way to force alignment in specific structures, eg to align to a 4 byte boundary, also to align the overall size to a specific size or boundary too, etc
It would have to be recursive - so if you had something like a points structure (2 words, x,y) within your structure, then that too would be aligned for the x and the y.
[Implemented] Alignment in structures...
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
[Implemented] Alignment in structures...
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: Alignment in structures...
Would indeed be very useful.
16 bytes aligned would also be nice.
16 bytes aligned would also be nice.
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: Alignment in structures...
Looking at the gesture problem, it seems the recursive idea isn't a good one as MS don't seem to do this in theirs - which I think is pretty odd btw. ;p
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: Alignment in structures...
sorry for my bad english
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: Alignment in structures...
Thanks Josh, I did a search before I posted ('structure align') but didn't find anything. 

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
- Addict
- Posts: 1520
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Alignment in structures...
Good idea.
It would be great if you added the ability to align the structures.
http://www.purebasic.fr/english/viewtop ... 2&p=383107
It would be great if you added the ability to align the structures.
http://www.purebasic.fr/english/viewtop ... 2&p=383107
Re: Alignment in structures...
totally agree,
its everytime a mess when porting header files from C based libraries to PB beeing forced to add padding manually.
its everytime a mess when porting header files from C based libraries to PB beeing forced to add padding manually.
Check out OOP support for PB here!