VirtualBox

Changeset 58791 in vbox


Ignore:
Timestamp:
Nov 20, 2015 3:39:54 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104241
Message:

iprt/asm.h: 16-bit fixes to ASMBitSetRange and ASMBitClearRange.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r58773 r58791  
    44114411    {
    44124412        volatile uint32_t *pu32 = (volatile uint32_t *)pvBitmap + (iBitStart >> 5);
    4413         int iStart = iBitStart & ~31;
    4414         int iEnd   = iBitEnd & ~31;
     4413        int32_t iStart = iBitStart & ~31;
     4414        int32_t iEnd   = iBitEnd & ~31;
    44154415        if (iStart == iEnd)
    4416             *pu32 &= ((1U << (iBitStart & 31)) - 1) | ~((1U << (iBitEnd & 31)) - 1);
     4416            *pu32 &= ((UINT32_C(1) << (iBitStart & 31)) - 1) | ~((UINT32_C(1) << (iBitEnd & 31)) - 1);
    44174417        else
    44184418        {
     
    44204420            if (iBitStart & 31)
    44214421            {
    4422                 *pu32 &= (1U << (iBitStart & 31)) - 1;
     4422                *pu32 &= (UINT32_C(1) << (iBitStart & 31)) - 1;
    44234423                pu32++;
    44244424                iBitStart = iStart + 32;
     
    44334433            {
    44344434                pu32 = (volatile uint32_t *)pvBitmap + (iBitEnd >> 5);
    4435                 *pu32 &= ~((1U << (iBitEnd & 31)) - 1);
     4435                *pu32 &= ~((UINT32_C(1) << (iBitEnd & 31)) - 1);
    44364436            }
    44374437        }
     
    44524452    {
    44534453        volatile uint32_t *pu32 = (volatile uint32_t *)pvBitmap + (iBitStart >> 5);
    4454         int iStart = iBitStart & ~31;
    4455         int iEnd   = iBitEnd & ~31;
     4454        int32_t iStart = iBitStart & ~31;
     4455        int32_t iEnd   = iBitEnd & ~31;
    44564456        if (iStart == iEnd)
    4457             *pu32 |= ((1U << (iBitEnd - iBitStart)) - 1) << (iBitStart & 31);
     4457            *pu32 |= ((UINT32_C(1) << (iBitEnd - iBitStart)) - 1) << (iBitStart & 31);
    44584458        else
    44594459        {
     
    44614461            if (iBitStart & 31)
    44624462            {
    4463                 *pu32 |= ~((1U << (iBitStart & 31)) - 1);
     4463                *pu32 |= ~((UINT32_C(1) << (iBitStart & 31)) - 1);
    44644464                pu32++;
    44654465                iBitStart = iStart + 32;
     
    44744474            {
    44754475                pu32 = (volatile uint32_t *)pvBitmap + (iBitEnd >> 5);
    4476                 *pu32 |= (1U << (iBitEnd & 31)) - 1;
     4476                *pu32 |= (UINT32_C(1) << (iBitEnd & 31)) - 1;
    44774477            }
    44784478        }
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