VirtualBox

Changeset 26049 in vbox


Ignore:
Timestamp:
Jan 26, 2010 2:31:29 PM (15 years ago)
Author:
vboxsync
Message:

ATA: checksum typo, cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r26001 r26049  
    11481148}
    11491149
    1150 static uint32_t ataChecksum(void* p, size_t count)
    1151 {
    1152     uint8_t sum = 0xa5, *pp = (uint8_t*)p;
     1150static uint32_t ataChecksum(void* ptr, size_t count)
     1151{
     1152    uint8_t u8Sum = 0xa5, *p = (uint8_t*)ptr;
    11531153    size_t i;
    11541154
    11551155    for (i = 0; i < count; i++)
    11561156    {
    1157       sum += pp[i];
    1158       count--;
    1159     }
    1160 
    1161     return (uint8_t)-(int32_t)sum;
     1157      u8Sum += *p++;
     1158    }
     1159
     1160    return (uint8_t)-(int32_t)u8Sum;
    11621161}
    11631162
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