Thread: What's wrong with my alignment?

  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, 10: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, 12:01 PM
  4. Print Alignment
    By Maxxus in forum C Programming
    Replies: 1
    Last Post: 10-28-2002, 12:29 PM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM