Changeset 5b3cf90 in mainline


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.

Location:
uspace
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    rf019cc07 r5b3cf90  
    173173int cmd_cp(char **argv)
    174174{
    175         unsigned int argc, buffer = 0, verbose = 0;
     175        unsigned int argc, verbose = 0;
     176        int buffer = 0;
    176177        int c, opt_ind;
    177178        int64_t ret;
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    rf019cc07 r5b3cf90  
    9090        int rc;
    9191
    92         if (rc = stat(pathname, &s)) {
     92        rc = stat(pathname, &s);
     93        if (rc != 0) {
    9394                /* Odd chance it was deleted from the time readdir() found it */
    9495                printf("ls: skipping bogus node %s\n", pathname);
  • uspace/app/bdsh/cmds/modules/ls/ls.h

    rf019cc07 r5b3cf90  
    77#define LS_DIR   2
    88
    9 
    10 static unsigned int ls_scope(const char *);
    119static void ls_scan_dir(const char *, DIR *);
    1210static void ls_print(const char *, const char *);
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    rf019cc07 r5b3cf90  
    210210        }
    211211
    212         if (optind == argc) {
     212        if ((unsigned) optind == argc) {
    213213                cli_error(CL_EFAIL,
    214214                        "%s: insufficient arguments. Try %s --help", cmdname, cmdname);
  • uspace/srv/pci/libpci/generic.c

    rf019cc07 r5b3cf90  
    3030                t->dev = dev;
    3131                multi = 0;
    32                 for (t->func = 0; !t->func || multi && t->func < 8;
     32                for (t->func = 0; !t->func || (multi && t->func < 8);
    3333                     t->func++) {
    3434                        u32 vd = pci_read_long(t, PCI_VENDOR_ID);
  • uspace/srv/pci/libpci/i386-ports.c

    rf019cc07 r5b3cf90  
    8080        for (d.dev = 0; d.dev < 32; d.dev++) {
    8181                u16 class, vendor;
    82                 if (m->read(&d, PCI_CLASS_DEVICE, (byte *) & class,
     82                if ((m->read(&d, PCI_CLASS_DEVICE, (byte *) & class,
    8383                         sizeof(class))
    8484                    && (class == cpu_to_le16(PCI_CLASS_BRIDGE_HOST)
    85                         || class == cpu_to_le16(PCI_CLASS_DISPLAY_VGA))
    86                     || m->read(&d, PCI_VENDOR_ID, (byte *) & vendor,
     85                        || class == cpu_to_le16(PCI_CLASS_DISPLAY_VGA)))
     86                    || (m->read(&d, PCI_VENDOR_ID, (byte *) & vendor,
    8787                               sizeof(vendor))
    8888                    && (vendor == cpu_to_le16(PCI_VENDOR_ID_INTEL)
    89                         || vendor == cpu_to_le16(PCI_VENDOR_ID_COMPAQ))) {
     89                        || vendor == cpu_to_le16(PCI_VENDOR_ID_COMPAQ)))) {
    9090                        a->debug("...outside the Asylum at 0/%02x/0",
    9191                                 d.dev);
  • 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.