Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
This commit is contained in:
parent
226d80b821
commit
cbeb0b26e4
492 changed files with 3218 additions and 3167 deletions
|
|
@ -145,7 +145,7 @@ diskcachereadbig(DiskCache *d, u64int offset)
|
|||
lock(&d->lk);
|
||||
dcb = findblock(d, offset);
|
||||
if(dcb){
|
||||
//fprint(2, "found %llud in cache %p\n", (uvlong)offset, dcb);
|
||||
/*fprint(2, "found %llud in cache %p\n", (uvlong)offset, dcb);*/
|
||||
if(dcb->ref++ == 0)
|
||||
delfromlru(d, dcb);
|
||||
unlock(&d->lk);
|
||||
|
|
@ -165,7 +165,7 @@ diskcachereadbig(DiskCache *d, u64int offset)
|
|||
putlru(d, dcb);
|
||||
dcb = nil;
|
||||
}else{
|
||||
//fprint(2, "read %llud from disk %p\n", (uvlong)offset, dcb);
|
||||
/*fprint(2, "read %llud from disk %p\n", (uvlong)offset, dcb); */
|
||||
dcb->subblock = b;
|
||||
dcb->ref++;
|
||||
addtohash(d, dcb, offset);
|
||||
|
|
@ -223,7 +223,7 @@ diskcacheread(Disk *dd, u32int len, u64int offset)
|
|||
len = dlen-frag;
|
||||
}
|
||||
b->len = len;
|
||||
//fprint(2, "offset %llud at pointer %p %lux\n", (uvlong)offset, b->data, *(ulong*)(b->data+4));
|
||||
/*fprint(2, "offset %llud at pointer %p %lux\n", (uvlong)offset, b->data, *(ulong*)(b->data+4)); */
|
||||
return b;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,8 +111,8 @@ ext2blockread(Fsys *fsys, u64int vbno)
|
|||
fprint(2, "loading group: %r...");
|
||||
return nil;
|
||||
}
|
||||
// if(debug)
|
||||
// fprint(2, "group %d bitblock=%d...", bno/fs->blockspergroup, g->bitblock);
|
||||
/* if(debug) */
|
||||
/* fprint(2, "group %d bitblock=%d...", bno/fs->blockspergroup, g->bitblock); */
|
||||
|
||||
if((bitb = diskread(fs->disk, fs->blocksize, (u64int)g->bitblock*fs->blocksize)) == nil){
|
||||
if(debug)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ enum
|
|||
IFREG = 0100000,
|
||||
IFLNK = 0120000,
|
||||
IFSOCK = 0140000,
|
||||
IFWHT = 0160000,
|
||||
IFWHT = 0160000
|
||||
};
|
||||
|
||||
#define DIRLEN(namlen) (((namlen)+8+3)&~3)
|
||||
|
|
@ -144,7 +144,7 @@ struct Dirent
|
|||
};
|
||||
enum
|
||||
{
|
||||
MinDirentSize = 4+2+1+1,
|
||||
MinDirentSize = 4+2+1+1
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -164,9 +164,9 @@ okay:
|
|||
blockput(cgb);
|
||||
goto error;
|
||||
}
|
||||
// cg->nfrag = cgblk->nfrag;
|
||||
// cg->nblock = (cgblk->nfrag+fs->fragsperblock-1) / fs->fragsperblock;
|
||||
// fprint(2, "cg #%d: cgblk %lud, %d blocks, %d inodes\n", cgblk->num, (ulong)cg->cgblkno, cg->nblock, cg->nino);
|
||||
/* cg->nfrag = cgblk->nfrag; */
|
||||
/* cg->nblock = (cgblk->nfrag+fs->fragsperblock-1) / fs->fragsperblock; */
|
||||
/* fprint(2, "cg #%d: cgblk %lud, %d blocks, %d inodes\n", cgblk->num, (ulong)cg->cgblkno, cg->nblock, cg->nino); */
|
||||
}
|
||||
}
|
||||
blockput(b);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ enum
|
|||
DTREG = 8,
|
||||
DTLNK = 10,
|
||||
DTSOCK = 12,
|
||||
DTWHT = 14,
|
||||
DTWHT = 14
|
||||
};
|
||||
|
||||
struct Cylsum
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ preadn(int fd, void *vdata, u32int ulen, u64int offset)
|
|||
nfilereads++;
|
||||
len = ulen;
|
||||
data = vdata;
|
||||
// fprint(2, "readn 0x%llux 0x%ux\n", offset, ulen);
|
||||
/* fprint(2, "readn 0x%llux 0x%ux\n", offset, ulen); */
|
||||
while(len > 0){
|
||||
n = pread(fd, data, len, offset);
|
||||
if(n <= 0)
|
||||
|
|
|
|||
|
|
@ -56,14 +56,14 @@ _vtfileblock(VtCache *c, VtEntry *e, u32int bn)
|
|||
return nil;
|
||||
}
|
||||
|
||||
//fprint(2, "vtread %V\n", e->score);
|
||||
/*fprint(2, "vtread %V\n", e->score); */
|
||||
b = vtcacheglobal(c, e->score, e->type);
|
||||
if(b == nil)
|
||||
return nil;
|
||||
|
||||
for(i=d-1; i>=0; i--){
|
||||
t = VtDataType+i;
|
||||
//fprint(2, "vtread %V\n", b->data+index[i]*VtScoreSize);
|
||||
/*fprint(2, "vtread %V\n", b->data+index[i]*VtScoreSize); */
|
||||
bb = vtcacheglobal(c, b->data+index[i]*VtScoreSize, t);
|
||||
vtblockput(b);
|
||||
if(bb == nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue