Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib



On Sun Oct 22 2006 at 23:57:19 +0000, Tom Spindler wrote:
> This code generates quite a few lint warnings - partially because of c9x
> constructs, partially because of questionable code. Here's some examples:
> 
> /home/dogcow/work/nbobj/dd/usr/include/fs/puffs/puffs_msgif.h(396): warning: 
> zero sized struct [47]
> (c9x)
> 
> /home/dogcow/work/nbsrc/lib/libpuffs/subr.c(109): warning: conversion to 
> 'unsigned int' due to prototype, arg #3 [259]
> (unknown)
> 
> /home/dogcow/work/nbsrc/lib/libpuffs/subr.c(130): warning: comparison of 
> unsigned int with negative constant, op != [162]
> (bad.)

Most of it (except the first one) is directly from either the kernel or
kernel types.  I know it's there.  Maybe I should just sprinkle LINTED.

> Also, subr.c bombs completely:
> /home/dogcow/work/nbsrc/lib/libpuffs/subr.c: In function 'puffs_vtype2dt':
> /home/dogcow/work/nbsrc/lib/libpuffs/subr.c:170: warning: comparison of 
> unsigned expression < 0 is always false

Hmm, actually, what defines if an enum is signed or unsigned?  Well,
I wrote the check a bit differently now.  The original had an off-by-one
in any case, so well spotted ;)

> I'm also a little unsure why vdmap/puffs_vtype2dt exists, since
> it's more-or-less duplicating everything in the original vtype enum
> to begin with.

Because it's the mapping from vnode type to directory type that readdir
wants.

-- 
Antti Kantee <pooka%iki.fi@localhost>                     Of course he runs 
NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"



Home | Main Index | Thread Index | Old Index