diff options
author | rsc <devnull@localhost> | 2006-04-01 19:24:03 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-04-01 19:24:03 +0000 |
commit | cbeb0b26e4c7caa8d1b47de791a7418dc20a4567 (patch) | |
tree | e0f7e445de1aa22a42ef873dc4b1118a8105ae93 /src/cmd/tapefs | |
parent | 226d80b8213821af0cbf092d1507c52b504fd368 (diff) | |
download | plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.gz plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.bz2 plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.zip |
Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
Diffstat (limited to 'src/cmd/tapefs')
-rw-r--r-- | src/cmd/tapefs/fs.c | 34 | ||||
-rw-r--r-- | src/cmd/tapefs/tapefs.h | 4 | ||||
-rw-r--r-- | src/cmd/tapefs/zip.h | 5 | ||||
-rw-r--r-- | src/cmd/tapefs/zipfs.c | 2 |
4 files changed, 25 insertions, 20 deletions
diff --git a/src/cmd/tapefs/fs.c b/src/cmd/tapefs/fs.c index 2d596a3c..bc83648e 100644 --- a/src/cmd/tapefs/fs.c +++ b/src/cmd/tapefs/fs.c @@ -31,21 +31,24 @@ char *rflush(Fid*), *rversion(Fid*), *rauth(Fid*), *rread(Fid*), *rwrite(Fid*), *rclunk(Fid*), *rremove(Fid*), *rstat(Fid*), *rwstat(Fid*); -char *(*fcalls[])(Fid*) = { - [Tflush] rflush, - [Tversion] rversion, - [Tauth] rauth, - [Tattach] rattach, - [Twalk] rwalk, - [Topen] ropen, - [Tcreate] rcreate, - [Tread] rread, - [Twrite] rwrite, - [Tclunk] rclunk, - [Tremove] rremove, - [Tstat] rstat, - [Twstat] rwstat, -}; +char *(*fcalls[Tmax])(Fid*); +void +initfcalls(void) +{ + fcalls[Tflush]= rflush; + fcalls[Tversion]= rversion; + fcalls[Tauth]= rauth; + fcalls[Tattach]= rattach; + fcalls[Twalk]= rwalk; + fcalls[Topen]= ropen; + fcalls[Tcreate]= rcreate; + fcalls[Tread]= rread; + fcalls[Twrite]= rwrite; + fcalls[Tclunk]= rclunk; + fcalls[Tremove]= rremove; + fcalls[Tstat]= rstat; + fcalls[Twstat]= rwstat; +} char Eperm[] = "permission denied"; char Enotdir[] = "not a directory"; @@ -76,6 +79,7 @@ main(int argc, char *argv[]) char buf[TICKREQLEN]; fmtinstall('F', fcallfmt); + initfcalls(); defmnt = "tapefs"; ARGBEGIN{ diff --git a/src/cmd/tapefs/tapefs.h b/src/cmd/tapefs/tapefs.h index bfe75937..a76cf383 100644 --- a/src/cmd/tapefs/tapefs.h +++ b/src/cmd/tapefs/tapefs.h @@ -9,7 +9,7 @@ enum { OPERM = 0x3, /* mask of all permission types in open mode */ Nram = 512, - Maxbuf = 8192, /* max buffer size */ + Maxbuf = 8192 /* max buffer size */ }; typedef struct Fid Fid; @@ -53,7 +53,7 @@ enum Pread = 4, Pother = 1, Pgroup = 8, - Powner = 64, + Powner = 64 }; typedef struct idmap { diff --git a/src/cmd/tapefs/zip.h b/src/cmd/tapefs/zip.h index 9b703de2..34449803 100644 --- a/src/cmd/tapefs/zip.h +++ b/src/cmd/tapefs/zip.h @@ -16,7 +16,8 @@ enum ZTrailInfo = 1 << 3, /* uncsize, csize, and crc are in trailer */ ZCompPatch = 1 << 5, /* compression patched data */ - ZCrcPoly = 0xedb88320, +/* ZCrcPoly = 0xedb88320, */ +#define ZCrcPoly 0xedb88320 /* * compression method @@ -57,7 +58,7 @@ enum ZHeadCrc = 4 + 2 + 2 + 2 + 2 + 2, ZTrailSize = 4 + 4 + 4, ZCHeadSize = 4 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + 4 + 4 + 2 + 2 + 2 + 2 + 2 + 4 + 4, - ZECHeadSize = 4 + 2 + 2 + 2 + 2 + 4 + 4 + 2, + ZECHeadSize = 4 + 2 + 2 + 2 + 2 + 4 + 4 + 2 }; /* diff --git a/src/cmd/tapefs/zipfs.c b/src/cmd/tapefs/zipfs.c index 26bd4dc9..5d3c4338 100644 --- a/src/cmd/tapefs/zipfs.c +++ b/src/cmd/tapefs/zipfs.c @@ -19,7 +19,7 @@ enum { IS_MSDOS = 0, /* creator OS (interpretation of external flags) */ IS_RDONLY = 1, /* file was readonly (external flags) */ - IS_TEXT = 1, /* file was text (internal flags) */ + IS_TEXT = 1 /* file was text (internal flags) */ }; typedef struct Block Block; |