VirtualBox

Changeset 22553 in vbox


Ignore:
Timestamp:
Aug 28, 2009 2:10:04 PM (15 years ago)
Author:
vboxsync
Message:

sched-darwin.cpp: Fixed reference of uninitialized variable in rtSchedNativeCalcDefaultPriority.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/darwin/sched-darwin.cpp

    r22532 r22553  
    238238     * If it doesn't match the default, select the closest one from the table.
    239239     */
    240     int iCurDiff = RT_ABS(g_pProcessPriority->aTypes[enmType].iBasePriority - iBasePriority);
    241     if (iCurDiff)
     240    int offBest = RT_ABS(g_pProcessPriority->aTypes[enmType].iBasePriority - iBasePriority);
     241    if (offBest)
    242242    {
    243243        const PROCPRIORITY *pProcessPriority = &g_aDefaultPriority;
    244244        for (unsigned i = 0; i < RT_ELEMENTS(g_aPriorities); i++)
    245245        {
    246             /* @todo r=poetzsch: gcc warns here. iBasePriority in RT_ABS is the
    247              * one which should be initialized not the one from line 234. So I
    248              * guess gcc is right. */
    249             int iBasePriority = RT_ABS(g_aPriorities[i].aTypes[enmType].iBasePriority - iBasePriority);
    250             if (iBasePriority < iCurDiff)
     246            int off = RT_ABS(g_aPriorities[i].aTypes[enmType].iBasePriority - iBasePriority);
     247            if (off < offBest)
    251248            {
    252249                g_pProcessPriority = &g_aPriorities[i];
    253                 if (!iCurDiff)
     250                if (!off)
    254251                    break;
    255                 iCurDiff = iBasePriority;
     252                offBest = off;
    256253            }
    257254        }
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