473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Data Alignment Macros?

Can any of you gentlemen tell me what exactly are data alignment macros?

I remember checking out the UPX source a while ago, reading about it in
books, and have wondered every since.
Nov 14 '05 #1
2 3014
RagnarDanneskjöld wrote:

Can any of you gentlemen tell me what
exactly are data alignment macros?


The only code I've seen for alignment, is the use of a union
to align an array of char, with a more restrictive data type,
as in K&R2, 8.7

--
pete
Nov 14 '05 #2
"pete" <pf*****@mindspring.com> wrote in message
news:40***********@mindspring.com...
RagnarDanneskjöld wrote:

Can any of you gentlemen tell me what
exactly are data alignment macros?


The only code I've seen for alignment, is the use of a union
to align an array of char, with a more restrictive data type,
as in K&R2, 8.7


You can also use bitfields in structures. Probably even less suitable for
the OP.

Peter
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Shailesh Humbad | last post by:
I wrote a short page as a quick reference to c++ integer data types. Any feedback welcome: http://www.somacon.com/blog/page11.php
67
by: S.Tobias | last post by:
I would like to check if I understand the following excerpt correctly: 6.2.5#26 (Types): All pointers to structure types shall have the same representation and alignment requirements as each...
4
by: Romeo Colacitti | last post by:
I have a need to make a custom quasi-memory allocator, and I remembered a simple ons in K&R2. Looking at the code for it now, I think I notice a "fault" in the design, and I was wondering if...
35
by: Sunil | last post by:
Hi all, I am using gcc compiler in linux.I compiled a small program int main() { printf("char : %d\n",sizeof(char)); printf("unsigned char : ...
5
by: pt | last post by:
Hi, i am wonderng what is faster according to accessing speed to read these data structure from the disk in c/c++ including alignment handling if we access it on little endian system 32 bits...
31
by: aarklon | last post by:
Hi all, this is a question which i saw in a book typedef struct mall_li_header_ { int refcnt; uchar pool; uchar flag; ushort magic_no; char data;
1
by: Stephen Plotnick | last post by:
I have a checkbox in a data grid that does not change it's state until I actually leave the field. I've done this routine several times in other data grids without an issue. I'm using VB.2003. ...
11
by: Brian Gladman | last post by:
A lot of low level cryptographic code and some hardware cryptographic accelerators either fail completely or perform very poorly if their input, output and/or key storage areas in memory are not...
18
by: H.K. Kingston-Smith | last post by:
I understand that a line like char *a = malloc(64) ; when succeeding will initialize a to a pointer that is aligned at worst on the natural boundary of the underlying architecture, possibly on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.