Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.

This commit is contained in:
rsc 2006-04-01 19:24:03 +00:00
parent 226d80b821
commit cbeb0b26e4
492 changed files with 3218 additions and 3167 deletions

View file

@ -7,7 +7,7 @@ enum {
BytesPerEntry = 100, /* estimate of bytes per dir entries - determines number of index entries in the block */
FullPercentage = 80, /* don't allocate in block if more than this percentage full */
FlushSize = 200, /* number of blocks to flush */
DirtyPercentage = 50, /* maximum percentage of dirty blocks */
DirtyPercentage = 50 /* maximum percentage of dirty blocks */
};

View file

@ -917,12 +917,12 @@ vacfilesetdir(VacFile *f, VacDir *dir, char *uid)
f->dir.mtime = dir->mtime;
f->dir.atime = dir->atime;
//fprint(2, "mode %x %x ", f->dir.mode, dir->mode);
/*fprint(2, "mode %x %x ", f->dir.mode, dir->mode); */
mask = ~(ModeDir|ModeSnapshot);
f->dir.mode &= ~mask;
f->dir.mode |= mask & dir->mode;
f->dirty = 1;
//fprint(2, "->%x\n", f->dir.mode);
/*fprint(2, "->%x\n", f->dir.mode); */
filemetaflush2(f, oelem);
vtfree(oelem);
@ -1138,7 +1138,7 @@ fprint(2, "fileMetaFlush moving entry from %ud -> %ud\n", f->boff, boff);
bb = vtfileblock(fp->msource, f->boff, VtORDWR);
mbdelete(&mb, i, &me);
mbpack(&mb);
// blockDependency(b, bb, -1, nil, nil);
/* blockDependency(b, bb, -1, nil, nil); */
vtblockput(bb);
/* vtblockdirty(b); */
vtblockput(b);
@ -1641,7 +1641,7 @@ chksource(VacFile *f)
static int
filerlock(VacFile *f)
{
// assert(!canwlock(&f->fs->elk));
/* assert(!canwlock(&f->fs->elk)); */
rlock(&f->lk);
if(chksource(f) < 0){
runlock(&f->lk);
@ -1659,7 +1659,7 @@ filerunlock(VacFile *f)
static int
filelock(VacFile *f)
{
// assert(!canwlock(&f->fs->elk));
/* assert(!canwlock(&f->fs->elk)); */
wlock(&f->lk);
if(chksource(f) < 0){
wunlock(&f->lk);
@ -1683,7 +1683,7 @@ static void
filemetalock(VacFile *f)
{
assert(f->up != nil);
// assert(!canwlock(&f->fs->elk));
/* assert(!canwlock(&f->fs->elk)); */
wlock(&f->up->lk);
}

View file

@ -2,7 +2,7 @@
enum {
Nblock = 300000,
BlockSize = 8*1024,
BlockSize = 8*1024
};
uchar data[Nblock*VtScoreSize];

View file

@ -89,12 +89,12 @@ stats(r);
}
fprint(2, "count = %d top = %lud\n", count(r, 0), sourceGetDirSize(r));
// cacheCheck(c);
/* cacheCheck(c); */
fprint(2, "deleting\n");
for(i=0; i<num; i++)
delete(r);
// dump(r, 0, 0);
/* dump(r, 0, 0); */
lumpDecRef(r->lump, 0);
sourceRemove(r);

View file

@ -73,7 +73,7 @@ void plan9ToVacDir(VacDir*, Dir*, ulong entry, uvlong qid);
enum {
Version = 8,
BlockSize = 8*1024,
MaxExclude = 1000,
MaxExclude = 1000
};
struct {
@ -190,7 +190,7 @@ main(int argc, char *argv[])
if(statsFlag)
fprint(2, "files %ld:%ld data %ld:%ld:%ld meta %ld\n", stats.file, stats.sfile,
stats.data, stats.skip, stats.sdata, stats.meta);
//packetStats();
/*packetStats(); */
vtClose(z);
vtDetach();

View file

@ -77,7 +77,7 @@ void plan9tovacdir(VacDir*, Dir*, ulong entry, uvlong qid);
enum {
Version = 8,
BlockSize = 8*1024,
MaxExclude = 1000,
MaxExclude = 1000
};
struct {
@ -202,7 +202,7 @@ threadmain(int argc, char *argv[])
if(statsflag)
fprint(2, "files %ld:%ld data %ld:%ld:%ld meta %ld\n", stats.file, stats.sfile,
stats.data, stats.skip, stats.sdata, stats.meta);
//packetStats();
/*packetStats(); */
vthangup(z);
threadexitsall(0);

View file

@ -30,7 +30,7 @@ enum
ModeTemporary = (1<<19), /* MS-DOS */
ModeSnapshot = (1<<20), /* read only snapshot */
ModeDevice = (1<<21), /* Unix device */
ModeNamedPipe = (1<<22), /* Unix named pipe */
ModeNamedPipe = (1<<22) /* Unix named pipe */
};
enum
@ -39,7 +39,7 @@ enum
MetaHeaderSize = 12,
MetaIndexSize = 4,
IndexEntrySize = 8,
DirMagic = 0x1c4d9072,
DirMagic = 0x1c4d9072
};
enum
@ -47,7 +47,7 @@ enum
DirPlan9Entry = 1, /* not valid in version >= 9 */
DirNTEntry, /* not valid in version >= 9 */
DirQidSpaceEntry,
DirGenEntry, /* not valid in version >= 9 */
DirGenEntry /* not valid in version >= 9 */
};
struct VacDir

View file

@ -9,12 +9,12 @@ typedef struct DirBuf DirBuf;
enum
{
OPERM = 0x3, /* mask of all permission types in open mode */
OPERM = 0x3 /* mask of all permission types in open mode */
};
enum
{
DirBufSize = 20,
DirBufSize = 20
};
struct Fid
@ -46,7 +46,7 @@ enum
Pread = 4,
Pother = 1,
Pgroup = 8,
Powner = 64,
Powner = 64
};
Fid *fids;
@ -59,7 +59,7 @@ Fcall rhdr;
Fcall thdr;
VacFs *fs;
VtConn *conn;
// VtSession *session;
/* VtSession *session; */
int noperm;
int dotu;

View file

@ -2,7 +2,7 @@
enum {
Nblock = 10000,
BlockSize = 8*1024,
BlockSize = 8*1024
};
uchar data[Nblock*BlockSize];