Ignore:
Timestamp:
Oct 18, 2011, 8:12:25 PM (14 years ago)
Author:
dmik
Message:

Declare index var used outside for().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/src/kernel32/oslibmem.cpp

    r21339 r21711  
    9191        tmp = allocrecords;
    9292        while(tmp->next) {
    93             if(tmp->next->baseaddr > baseaddr) {     
     93            if(tmp->next->baseaddr > baseaddr) {
    9494                break;
    9595            }
     
    121121        tmp = allocrecords;
    122122        while(tmp->next) {
    123             if(tmp->next->baseaddr == baseaddr) {     
     123            if(tmp->next->baseaddr == baseaddr) {
    124124                break;
    125125            }
     
    181181    DWORD pAlias = (DWORD)*ppbAlias;
    182182
    183     while(pAlias < (DWORD)*ppbAlias + cb) 
     183    while(pAlias < (DWORD)*ppbAlias + cb)
    184184    {
    185185        rc = DosQueryMem((PVOID)pAlias, &size, &attr);
     
    189189            return rc;
    190190        }
    191         //Don't bother if the pages are not committed. DosSetMem will return 
    192         //ERROR_ACCESS_DENIED. 
     191        //Don't bother if the pages are not committed. DosSetMem will return
     192        //ERROR_ACCESS_DENIED.
    193193        if(attr & PAG_COMMIT) {
    194194            rc = DosSetMem((PVOID)pAlias, size, fl);
     
    325325        fMemFlags = 0;
    326326    }
    327    
     327
    328328    /*
    329329     * Let's try use the extended DosAllocMem API of Win32k.sys.
     
    358358    }
    359359    // already 64k aligned ?
    360     if((ULONG) pvMemAddr & 0xFFFF) 
     360    if((ULONG) pvMemAddr & 0xFFFF)
    361361    {
    362362        ULONG addr64kb;
     
    371371            return rc;
    372372        }
    373        
     373
    374374        PVOID baseAddr = (PVOID)addr64kb; // sunlover20040613: save returned address for a possible Free on failure
    375        
     375
    376376        dprintf(("Allocate aligned memory %x -> %x", addr64kb, (addr64kb + 0xFFFF) & ~0xFFFF));
    377377
     
    409409
    410410    *lpAttr = 0;
    411    
     411
    412412    if(FindAllocRec((ULONG)lpMemAddr, &ulBase, &ulSize, lpAttr) == TRUE) {
    413413        return (PVOID)ulBase;
    414414    }
    415    
     415
    416416    ulSize = PAGE_SIZE;
    417417    rc = DosQueryMem(lpMemAddr, &ulSize, &ulAttr);
     
    463463
    464464    //Find base within previous 64kb (alignment can add filler pages)
    465     for(int i=0;i<16;i++) {
     465    int i;
     466    for(i=0;i<16;i++) {
    466467        rc = DosQueryMem((PVOID)ulAddr, &ulSize, &ulAttr);
    467468        if(rc != NO_ERROR) {
     
    482483    }
    483484    FreeAllocRec((ULONG)lpMemAddr);
    484    
     485
    485486    RasRemoveObject (rthVirtual, (ULONG)lpMemAddr);
    486487
Note: See TracChangeset for help on using the changeset viewer.