VirtualBox

Changeset 11385 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 13, 2008 12:26:24 PM (16 years ago)
Author:
vboxsync
Message:

PerfAPI: Fixed warnings in fscanf calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/linux/PerformanceLinux.cpp

    r11180 r11385  
    6262    if (f)
    6363    {
    64         if (fscanf(f, "cpu %lu %lu %lu %lu", &u32user, &u32nice, &u32kernel, &u32idle) == 4)
     64        if (fscanf(f, "cpu %u %u %u %u", &u32user, &u32nice, &u32kernel, &u32idle) == 4)
    6565        {
    6666            *user   = (uint64_t)u32user + u32nice;
     
    107107    if (f)
    108108    {
    109         int processed = fscanf(f, "MemTotal: %lu kB\n", total);
    110         processed    += fscanf(f, "MemFree: %lu kB\n", available);
    111         processed    += fscanf(f, "Buffers: %lu kB\n", &buffers);
    112         processed    += fscanf(f, "Cached: %lu kB\n", &cached);
     109        int processed = fscanf(f, "MemTotal: %u kB\n", total);
     110        processed    += fscanf(f, "MemFree: %u kB\n", available);
     111        processed    += fscanf(f, "Buffers: %u kB\n", &buffers);
     112        processed    += fscanf(f, "Cached: %u kB\n", &cached);
    113113        if (processed == 4)
    114114        {
     
    148148    uint64_t u64Tmp;
    149149    unsigned uTmp;
    150     ULONG ulTmp, u32user, u32kernel;
     150    unsigned long ulTmp;
     151    ULONG u32user, u32kernel;
    151152    char buf[80]; /* @todo: this should be tied to max allowed proc name. */
    152153
     
    158159    if (f)
    159160    {
    160         if (fscanf(f, "%d %s %c %d %d %d %d %d %u %lu %lu %lu %lu %lu %lu "
    161                       "%ld %ld %ld %ld %ld %ld %llu %lu %ld",
     161        if (fscanf(f, "%d %s %c %d %d %d %d %d %u %lu %lu %lu %lu %u %u "
     162                      "%ld %ld %ld %ld %ld %ld %llu %lu %u",
    162163                   &pid2, buf, &c, &iTmp, &iTmp, &iTmp, &iTmp, &iTmp, &uTmp,
    163164                   &ulTmp, &ulTmp, &ulTmp, &ulTmp, &u32user, &u32kernel,
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