Results 1 to 6 of 6

Thread: Data Alignment in QT ?

  1. #1
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Data Alignment in QT ?

    i want build VMAC ,but it use Data Alignment in Code
    Ex:
    Qt Code:
    1. int main(void)
    2. {
    3. ALIGN(16) vmac_ctx_t ctx, ctx_aio, ctx_inc1, ctx_inc2;
    4. uint64_t res, tagl;
    5. void *p;
    6. unsigned char *m;
    7. ALIGN(4) unsigned char key[] = "abcdefghijklmnop";
    8. ALIGN(4) unsigned char nonce[] = "\0\0\0\0\0\0\0\0bcdefghi";
    9. unsigned int vector_lengths[] = {0,3,48,300,3000000};
    10. #if (VMAC_TAG_LEN == 64)
    11. ALIGN(4) char *should_be[] = {"2576BE1C56D8B81B","2D376CF5B1813CE5",
    12. "E8421F61D573D298","4492DF6C5CAC1BBE",
    13. "09BA597DD7601113"};
    To copy to clipboard, switch view to plain text mode 


    can you help find Define ALIGN(16) in QT ?

    this is define Data Alignment : _http://www.songho.ca/misc/alignment/dataalign.html

    and SOurce code on QT Error:

    _http://mfi.re/?mcwmgd0kjzeugrg

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Data Alignment in QT ?

    Qt is C++, it doesn't enforce any data alignment. Everything that applies to C++ applies to Qt as well.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Data Alignment in QT ?

    Quote Originally Posted by wysota View Post
    Qt is C++, it doesn't enforce any data alignment. Everything that applies to C++ applies to Qt as well.
    but when i run program error if use ALIGN(16)

  4. #4
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Data Alignment in QT ?

    With g++ you need to use it like this:
    Qt Code:
    1. __attribute__((aligned(16)))
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Data Alignment in QT ?

    Quote Originally Posted by Zlatomir View Post
    With g++ you need to use it like this:
    Qt Code:
    1. __attribute__((aligned(16)))
    To copy to clipboard, switch view to plain text mode 
    thank #define ALIGN(n) __attribute__ ((aligned(n)))

  6. #6
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    27
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Data Alignment in QT ?

    Is it possible to do an alignment on the entire project?
    I'm using Qt with the VS2008 DevEnv, and there is the possibility to choose a general struct alignment of the project.
    But I want to do this with my Makefile and qmake.

Similar Threads

  1. Alignment in QComboBox
    By Naami in forum Qt Programming
    Replies: 2
    Last Post: 26th May 2010, 14:53
  2. Set an Alignment in QGraphicsTextItem
    By avis_phoenix in forum Qt Programming
    Replies: 0
    Last Post: 26th October 2009, 17:39
  3. Help with alignment
    By IsleWitch in forum Newbie
    Replies: 1
    Last Post: 20th October 2007, 18:20
  4. QTextEdit Alignment
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 2nd May 2006, 07:44
  5. problem with alignment
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2006, 12:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.