Changeset 5b3cf90 in mainline for uspace/srv/pci/libpci/names.c


Ignore:
Timestamp:
2009-08-02T19:38:02Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fa5526d
Parents:
f019cc07
Message:

Fix warnings in Bdsh and PCI lib.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/pci/libpci/names.c

    rf019cc07 r5b3cf90  
    151151        int nest;
    152152        static const char parse_error[] = "Parse error";
    153         int i;
     153        size_t i;
    154154
    155155        *lino = 0;
     
    331331                if (num)
    332332                        res = snprintf(buf, size, "%04x", iv);
    333                 else if (v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0))
     333                else if ((v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0)) != 0)
    334334                        return (char *) v->name;
    335335                else
     
    341341                if (num)
    342342                        res = snprintf(buf, size, "%04x", id);
    343                 else if (d = id_lookup(a, ID_DEVICE, iv, id, 0, 0))
     343                else if ((d = id_lookup(a, ID_DEVICE, iv, id, 0, 0)) != 0)
    344344                        return (char *) d->name;
    345345                else if (synth)
     
    371371                if (num)
    372372                        res = snprintf(buf, size, "%04x", isv);
    373                 else if (v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0))
     373                else if ((v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0)) != 0)
    374374                        return (char *) v->name;
    375375                else if (synth)
     
    385385                if (num)
    386386                        res = snprintf(buf, size, "%04x", isd);
    387                 else if (d = id_lookup_subsys(a, iv, id, isv, isd))
     387                else if ((d = id_lookup_subsys(a, iv, id, isv, isd)) != 0)
    388388                        return (char *) d->name;
    389389                else if (synth)
     
    416416                if (num)
    417417                        res = snprintf(buf, size, "%04x", icls);
    418                 else if (cls = id_lookup(a, ID_SUBCLASS, icls >> 8, icls & 0xff, 0, 0))
     418                else if ((cls = id_lookup(a, ID_SUBCLASS, icls >> 8, icls & 0xff, 0, 0)) != 0)
    419419                        return (char *) cls->name;
    420                 else if (cls = id_lookup(a, ID_CLASS, icls, 0, 0, 0))
     420                else if ((cls = id_lookup(a, ID_CLASS, icls, 0, 0, 0)) != 0)
    421421                        res = snprintf(buf, size, "%s [%04x]", cls->name, icls);
    422422                else if (synth)
     
    430430                if (num)
    431431                        res = snprintf(buf, size, "%02x", ipif);
    432                 else if (pif = id_lookup(a, ID_PROGIF, icls >> 8, icls & 0xff, ipif, 0))
     432                else if ((pif = id_lookup(a, ID_PROGIF, icls >> 8, icls & 0xff, ipif, 0)) != 0)
    433433                        return (char *) pif->name;
    434434                else if (icls == 0x0101 && !(ipif & 0x70)) {
Note: See TracChangeset for help on using the changeset viewer.