VirtualBox

Changeset 27983 in vbox


Ignore:
Timestamp:
Apr 5, 2010 1:24:19 PM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: fix 32/64bit bug

Location:
trunk/src/VBox
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_pixelmap.c

    r27091 r27983  
    1414    int packet_length =
    1515        sizeof( map ) +
    16         sizeof( mapsize ) + sizeof(int) + sizeof(uintptr_t);
     16        sizeof( mapsize ) + sizeof(int) + sizeof(GLint);
    1717    unsigned char *data_ptr;
    1818
     
    2727    WRITE_DATA( 4, GLsizei, mapsize );
    2828    WRITE_DATA( 8, int, nodata);
    29     WRITE_DATA( 12, uintptr_t, (uintptr_t)values);
     29    WRITE_DATA( 12, GLint, (GLint)(uintptr_t)values);
    3030
    3131    if (!nodata)
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_pixels.c

    r27091 r27983  
    2525        sizeof( height ) +
    2626        sizeof( format ) +
    27         sizeof( type ) + sizeof(int) + sizeof(uintptr_t);
     27        sizeof( type ) + sizeof(int) + sizeof(GLint);
    2828
    2929    if (!noimagedata)
     
    4545    WRITE_DATA( 12, GLenum, type );
    4646    WRITE_DATA( 16, GLint, noimagedata );
    47     WRITE_DATA( 20, uintptr_t, (uintptr_t) pixels );
     47    WRITE_DATA( 20, GLint, (GLint) (uintptr_t) pixels );
    4848
    4949    if (!noimagedata)
     
    124124        sizeof( xmove ) +
    125125        sizeof( ymove ) +
    126         sizeof( GLuint ) + sizeof(uintptr_t);
     126        sizeof( GLuint ) + sizeof(GLint);
    127127
    128128    if (!noimagedata)
     
    141141    WRITE_DATA( 20, GLfloat, ymove );
    142142    WRITE_DATA( 24, GLuint, noimagedata );
    143     WRITE_DATA( 28, uintptr_t, (uintptr_t) bitmap);
     143    WRITE_DATA( 28, GLint, (GLint) (uintptr_t) bitmap);
    144144
    145145    crBitmapCopy(width, height, (GLubyte *)(data_ptr + 32), bitmap, unpack);
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_stipple.c

    r27091 r27983  
    1818
    1919    if (nodata)
    20         packet_length += sizeof(uintptr_t);
     20        packet_length += sizeof(GLint);
    2121    else
    2222        packet_length += 32*32/8;
     
    2626    if (nodata)
    2727    {
    28         WRITE_DATA_AI(uintptr_t, (uintptr_t)mask);
     28        WRITE_DATA_AI(GLint, (GLint)(uintptr_t)mask);
    2929    }
    3030    else
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_texture.c

    r27091 r27983  
    2727        sizeof(internalformat) +
    2828        sizeof(width) +
    29         sizeof(border) + sizeof(format) + sizeof(type) + sizeof(int) + sizeof(uintptr_t);
     29        sizeof(border) + sizeof(format) + sizeof(type) + sizeof(int) + sizeof(GLint);
    3030
    3131    if (!noimagedata)
     
    4343    WRITE_DATA(24, GLenum, type);
    4444    WRITE_DATA(28, int, noimagedata);
    45     WRITE_DATA(32, uintptr_t, (uintptr_t) pixels);
     45    WRITE_DATA(32, GLint, (GLint)(uintptr_t) pixels);
    4646
    4747    if (!noimagedata)
     
    7373        sizeof(width) +
    7474        sizeof(height) +
    75         sizeof(border) + sizeof(format) + sizeof(type) + sizeof(int) + sizeof(uintptr_t);
     75        sizeof(border) + sizeof(format) + sizeof(type) + sizeof(int) + sizeof(GLint);
    7676
    7777    if (!noimagedata)
     
    105105    WRITE_DATA(28, GLenum, type);
    106106    WRITE_DATA(32, int, noimagedata);
    107     WRITE_DATA(36, uintptr_t, (uintptr_t) pixels);
     107    WRITE_DATA(36, GLint, (GLint)(uintptr_t) pixels);
    108108
    109109    if (!noimagedata)
     
    154154        sizeof( format ) +
    155155        sizeof( type ) +
    156         sizeof( int ) + sizeof(uintptr_t);
     156        sizeof( int ) + sizeof(GLint);
    157157
    158158    if (!noimagedata)
     
    182182    WRITE_DATA( 32, GLenum, type );
    183183    WRITE_DATA( 36, int, noimagedata );
    184     WRITE_DATA( 40, uintptr_t, (uintptr_t) pixels);
     184    WRITE_DATA( 40, GLint, (GLint)(uintptr_t) pixels);
    185185
    186186    if (!noimagedata)
     
    230230        sizeof( format ) +
    231231        sizeof( type ) +
    232         sizeof( int ) + sizeof(uintptr_t);
     232        sizeof( int ) + sizeof(GLint);
    233233
    234234    if (!noimagedata)
     
    258258    WRITE_DATA( 32, GLenum, type );
    259259    WRITE_DATA( 36, int, noimagedata );
    260     WRITE_DATA( 40, uintptr_t, (uintptr_t) pixels);
     260    WRITE_DATA( 40, GLint, (GLint)(uintptr_t) pixels);
    261261
    262262    if (!noimagedata)
     
    562562        sizeof(depth) +
    563563        sizeof(format) +
    564         sizeof(type) + sizeof(int) + sizeof(uintptr_t);
     564        sizeof(type) + sizeof(int) + sizeof(GLint);
    565565
    566566    if (!noimagedata)
     
    581581    WRITE_DATA(36, GLenum, type);
    582582    WRITE_DATA(40, GLint, noimagedata);
    583     WRITE_DATA(44, uintptr_t, (uintptr_t) pixels);
     583    WRITE_DATA(44, GLint, (GLint)(uintptr_t) pixels);
    584584
    585585    if (!noimagedata)
     
    612612        sizeof(width) +
    613613        sizeof(height) +
    614         sizeof(format) + sizeof(type) + sizeof(int) + sizeof(uintptr_t);
     614        sizeof(format) + sizeof(type) + sizeof(int) + sizeof(GLint);
    615615
    616616    if (!noimagedata)
     
    629629    WRITE_DATA(28, GLenum, type);
    630630    WRITE_DATA(32, GLint, noimagedata);
    631     WRITE_DATA(36, uintptr_t, (uintptr_t) pixels);
     631    WRITE_DATA(36, GLint, (GLint)(uintptr_t) pixels);
    632632
    633633    if (!noimagedata)
     
    656656        sizeof(xoffset) +
    657657        sizeof(width) +
    658         sizeof(format) + sizeof(type) + sizeof(int) + sizeof(uintptr_t);
     658        sizeof(format) + sizeof(type) + sizeof(int) + sizeof(GLint);
    659659
    660660    if (!noimagedata)
     
    671671    WRITE_DATA(20, GLenum, type);
    672672    WRITE_DATA(24, GLint, noimagedata);
    673     WRITE_DATA(28, uintptr_t, (uintptr_t) pixels);
     673    WRITE_DATA(28, GLint, (GLint)(uintptr_t) pixels);
    674674
    675675    if (!noimagedata)
     
    733733        sizeof( border ) +
    734734        sizeof( imagesize ) +
    735         sizeof( int ) + sizeof(uintptr_t);
     735        sizeof( int ) + sizeof(GLint);
    736736
    737737    if (!noimagedata)
     
    750750    WRITE_DATA( 24, GLsizei, imagesize );
    751751    WRITE_DATA( 28, int, noimagedata );
    752     WRITE_DATA( 32, uintptr_t, (uintptr_t) data);
     752    WRITE_DATA( 32, GLint, (GLint)(uintptr_t) data);
    753753
    754754    if (!noimagedata) {
     
    779779        sizeof( border ) +
    780780        sizeof( imagesize ) +
    781         sizeof( int ) + sizeof(uintptr_t);
     781        sizeof( int ) + sizeof(GLint);
    782782
    783783    if (!noimagedata)
     
    798798    WRITE_DATA( 28, GLsizei, imagesize );
    799799    WRITE_DATA( 32, int, noimagedata );
    800     WRITE_DATA( 36, uintptr_t, (uintptr_t) data);
     800    WRITE_DATA( 36, GLint, (GLint)(uintptr_t) data);
    801801
    802802    if (!noimagedata) {
     
    828828        sizeof( border ) +
    829829        sizeof( imagesize ) +
    830         sizeof( int ) + sizeof(uintptr_t);
     830        sizeof( int ) + sizeof(GLint);
    831831
    832832    if (!noimagedata)
     
    846846    WRITE_DATA( 32, GLsizei, imagesize );
    847847    WRITE_DATA( 36, int, noimagedata );
    848     WRITE_DATA( 40, uintptr_t, (uintptr_t) data);
     848    WRITE_DATA( 40, GLint, (GLint)(uintptr_t) data);
    849849
    850850    if (!noimagedata) {
     
    874874        sizeof( format ) +
    875875        sizeof( imagesize ) +
    876         sizeof( int ) + sizeof(uintptr_t);
     876        sizeof( int ) + sizeof(GLint);
    877877
    878878    if (!noimagedata)
     
    890890    WRITE_DATA( 24, GLsizei, imagesize );
    891891    WRITE_DATA( 28, int, noimagedata );
    892     WRITE_DATA( 32, uintptr_t, (uintptr_t) data);
     892    WRITE_DATA( 32, GLint, (GLint)(uintptr_t) data);
    893893
    894894    if (!noimagedata) {
     
    920920        sizeof( format ) +
    921921        sizeof( imagesize ) +
    922         sizeof( int ) + sizeof(uintptr_t);
     922        sizeof( int ) + sizeof(GLint);
    923923
    924924    if (!noimagedata)
     
    938938    WRITE_DATA( 32, GLsizei, imagesize );
    939939    WRITE_DATA( 36, int, noimagedata );
    940     WRITE_DATA( 40, uintptr_t, (uintptr_t) data);
     940    WRITE_DATA( 40, GLint, (GLint)(uintptr_t) data);
    941941
    942942    if (!noimagedata) {
     
    970970        sizeof( format ) +
    971971        sizeof( imagesize ) +
    972         sizeof( int ) + sizeof(uintptr_t);
     972        sizeof( int ) + sizeof(GLint);
    973973
    974974    if (!noimagedata)
     
    990990    WRITE_DATA( 40, GLsizei, imagesize );
    991991    WRITE_DATA( 44, int, noimagedata );
    992     WRITE_DATA( 48, uintptr_t, (uintptr_t) data);
     992    WRITE_DATA( 48, GLint, (GLint)(uintptr_t) data);
    993993
    994994    if (!noimagedata) {
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getpixelmap.c

    r27091 r27983  
    6868        GLvoid *pbo_offset;
    6969
    70         pbo_offset = (GLfloat*) ((uintptr_t) *((GLvoid**)values));
     70        pbo_offset = (GLfloat*) ((uintptr_t) *((GLint*)values));
    7171
    7272        cr_server.head_spu->dispatch_table.GetPixelMapfv( map, pbo_offset );
     
    9595        GLvoid *pbo_offset;
    9696
    97         pbo_offset = (GLuint*) ((uintptr_t) *((GLvoid**)values));
     97        pbo_offset = (GLuint*) ((uintptr_t) *((GLint*)values));
    9898
    9999        cr_server.head_spu->dispatch_table.GetPixelMapuiv( map, pbo_offset );
     
    122122        GLvoid *pbo_offset;
    123123
    124         pbo_offset = (GLushort*) ((uintptr_t) *((GLvoid**)values));
     124        pbo_offset = (GLushort*) ((uintptr_t) *((GLint*)values));
    125125
    126126        cr_server.head_spu->dispatch_table.GetPixelMapusv( map, pbo_offset );
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getteximage.c

    r27091 r27983  
    2929          pbo>4gb (yet?)
    3030         */
    31         pbo_offset = (GLvoid*) ((uintptr_t) *((GLvoid**)pixels));
     31        pbo_offset = (GLvoid*) ((uintptr_t) *((GLint*)pixels));
    3232
    3333        cr_server.head_spu->dispatch_table.GetTexImage(target, level, format, type, pbo_offset);
     
    7474        GLvoid *pbo_offset;
    7575
    76         pbo_offset = (GLvoid*) ((uintptr_t) *((GLvoid**)img));
     76        pbo_offset = (GLvoid*) ((uintptr_t) *((GLint*)img));
    7777
    7878        cr_server.head_spu->dispatch_table.GetCompressedTexImageARB(target, level, pbo_offset);
     
    106106        GLvoid *pbo_offset;
    107107
    108         pbo_offset = (GLubyte*) ((uintptr_t) *((GLvoid**)mask));
     108        pbo_offset = (GLubyte*) ((uintptr_t) *((GLint*)mask));
    109109
    110110        cr_server.head_spu->dispatch_table.GetPolygonStipple(pbo_offset);
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_readpixels.c

    r27091 r27983  
    4040          pbo>4gb (yet?)
    4141         */
    42         pbo_offset = (GLvoid*) ((uintptr_t) *((GLvoid**)pixels));
     42        pbo_offset = (GLvoid*) ((uintptr_t) *((GLint*)pixels));
    4343
    4444        cr_server.head_spu->dispatch_table.ReadPixels(x, y, width, height,
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_drawpixels.c

    r27091 r27983  
    1818
    1919    if (noimagedata)
    20         pixels = (void*) READ_DATA( sizeof( int ) + 20, uintptr_t);
     20        pixels = (void*) (uintptr_t) READ_DATA( sizeof( int ) + 20, GLint);
    2121    else
    2222        pixels = DATA_POINTER( sizeof( int ) + 24, GLvoid );
     
    4444
    4545    if (noimagedata)
    46         bitmap = (void*) READ_DATA(sizeof(int) + 28, uintptr_t);
     46        bitmap = (void*) (uintptr_t) READ_DATA(sizeof(int) + 28, GLint);
    4747    else
    4848        bitmap = DATA_POINTER( sizeof(int) + 32, GLubyte );
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_pixelmap.c

    r27091 r27983  
    1515
    1616    if (nodata)
    17         values = (GLfloat*) READ_DATA(sizeof(int) + 12, uintptr_t);
     17        values = (GLfloat*) (uintptr_t) READ_DATA(sizeof(int) + 12, GLint);
    1818    else
    1919        values = DATA_POINTER( sizeof( int ) + 16, GLfloat );
     
    3131
    3232    if (nodata)
    33         values = (GLuint*) READ_DATA(sizeof(int) + 12, uintptr_t);
     33        values = (GLuint*) (uintptr_t) READ_DATA(sizeof(int) + 12, GLint);
    3434    else
    3535        values = DATA_POINTER( sizeof( int ) + 16, GLuint );
     
    4747
    4848    if (nodata)
    49         values = (GLushort*) READ_DATA(sizeof(int) + 12, uintptr_t);
     49        values = (GLushort*) (uintptr_t) READ_DATA(sizeof(int) + 12, GLint);
    5050    else
    5151        values = DATA_POINTER( sizeof( int ) + 16, GLushort );
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_stipple.c

    r27091 r27983  
    1313
    1414    if (nodata)
    15         mask = (void*) READ_DATA(4, uintptr_t);
     15        mask = (void*) (uintptr_t) READ_DATA(4, GLint);
    1616    else
    1717        mask = DATA_POINTER( 4, GLubyte );
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_texture.c

    r27091 r27983  
    3131     */
    3232    if ( noimagedata )
    33         pixels = (void*) READ_DATA(sizeof(int)+40, uintptr_t);
     33        pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+40, GLint);
    3434    else
    3535        pixels = DATA_POINTER( sizeof( int ) + 44, GLvoid );
     
    5858   
    5959    if ( noimagedata )
    60         pixels = (void*) READ_DATA(sizeof(int)+40, uintptr_t);
     60        pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+40, GLint);
    6161    else
    6262        pixels = DATA_POINTER( sizeof( int ) + 44, GLvoid );
     
    8282
    8383    if ( noimagedata )
    84         pixels = (void*) READ_DATA(sizeof(int)+36, uintptr_t);
     84        pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+36, GLint);
    8585    else
    8686        pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
     
    104104
    105105    if ( noimagedata )
    106         pixels = (void*) READ_DATA(sizeof(int)+32, uintptr_t);
     106        pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+32, GLint);
    107107    else
    108108        pixels = DATA_POINTER( sizeof( int ) + 36, GLvoid );
     
    191191
    192192    if ( noimagedata )
    193         pixels = (void*) READ_DATA(sizeof(int)+44, uintptr_t);
     193        pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+44, GLint);
    194194    else
    195195        pixels = DATA_POINTER( sizeof( int ) + 48, GLvoid );
     
    220220
    221221    if ( noimagedata )
    222         pixels = (void*) READ_DATA(sizeof(int)+36, uintptr_t);
     222        pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+36, GLint);
    223223    else
    224224        pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
     
    246246
    247247    if ( noimagedata )
    248         pixels = (void*) READ_DATA(sizeof(int)+28, uintptr_t);
     248        pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+28, GLint);
    249249    else
    250250        pixels = DATA_POINTER( sizeof( int ) + 32, GLvoid );
     
    343343
    344344    if( noimagedata )
    345         pixels = (void*) READ_DATA(4+sizeof(int)+36, uintptr_t);
     345        pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+36, GLint);
    346346    else
    347347        pixels = DATA_POINTER( 4 + sizeof(int) + 40, GLvoid );
     
    366366
    367367    if ( noimagedata )
    368         pixels = (void*) READ_DATA(4+sizeof(int)+32, uintptr_t);
     368        pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+32, GLint);
    369369    else
    370370        pixels = DATA_POINTER( 4 + sizeof( int ) + 36, GLvoid );
     
    388388
    389389    if( noimagedata )
    390         pixels = (void*) READ_DATA(4+sizeof(int)+28, uintptr_t);
     390        pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+28, GLint);
    391391    else
    392392        pixels = DATA_POINTER( 4 + sizeof(int) + 32, GLvoid );
     
    413413
    414414    if( noimagedata )
    415         pixels = (void*) READ_DATA(4+sizeof(int)+44, uintptr_t);
     415        pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+44, GLint);
    416416    else
    417417        pixels = DATA_POINTER( 4 + sizeof(int) + 48, GLvoid );
     
    438438
    439439    if( noimagedata )
    440         pixels = (void*) READ_DATA(4+sizeof(int)+36, uintptr_t);
     440        pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+36, GLint);
    441441    else
    442442        pixels = DATA_POINTER( 4 + sizeof(int) + 40, GLvoid );
     
    460460
    461461    if( noimagedata )
    462         pixels = (void*) READ_DATA(4+sizeof(int)+28, uintptr_t);
     462        pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+28, GLint);
    463463    else
    464464        pixels = DATA_POINTER( 4 + sizeof(int) + 32, GLvoid );
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette