What's wrong with my alignment?

This is a discussion on What's wrong with my alignment? within the C Programming forums, part of the General Programming Boards category; Hi. I am trying to align an array to a 32 bit boundry. I wrote the following code to achieve ...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    30

    What's wrong with my alignment?

    Hi.

    I am trying to align an array to a 32 bit boundry. I wrote the following code to achieve that:

    Code:
    static jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE];
    &splitbuf = (jpc_fix_t*) ( (int)(&splitbuf + 31) & ~5);//32 byte alignment.
    I get the following error message in TI.s Code Composer Studio 3.1:

    "error: expression must be a modifiable lvalue"

    Thanks,
    Esben.

  2. #2
    Run! Forrest Gump! TalosChen's Avatar
    Join Date
    May 2006
    Location
    Shanghai
    Posts
    27
    array name is unmodifiable, so you should use another pointer that points to "splitbuf".

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    30
    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 09:50 PM
  2. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 12:40 PM
  3. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 11:01 AM
  4. Print Alignment
    By Maxxus in forum C Programming
    Replies: 1
    Last Post: 10-28-2002, 11:29 AM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21