diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-19 20:59:50 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-19 20:59:50 +0800 |
commit | 15135e4525a4294ce016f87e85841e7d3ec2164b (patch) | |
tree | c88bdd5afd05c2b5c5d08984b87fe103ec96cd9c /mbbsd/read.c | |
parent | 7c0c9404b7353ca9c4bf08b0b9a3226554ea8031 (diff) | |
download | pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.gz pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.bz2 pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.lz pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.xz pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.zst pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.zip |
add 'const' qualifiers on function parameters.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2632 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/read.c')
-rw-r--r-- | mbbsd/read.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c index 233e70d1..29b1c79f 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -96,7 +96,7 @@ EnumTagFhdr(fileheader_t * fhdr, char *direct, int locus) /* ow: whole tag list */ int -AskTag(char *msg) +AskTag(const char *msg) { int num; @@ -116,11 +116,12 @@ AskTag(char *msg) #define BATCH_SIZE 65536 -char * -f_map(char *fpath, int *fsize) +static char * +f_map(const char *fpath, int *fsize) { int fd, size; struct stat st; + char *map; if ((fd = open(fpath, O_RDONLY)) < 0) return (char *)-1; @@ -129,15 +130,15 @@ f_map(char *fpath, int *fsize) close(fd); return (char *)-1; } - fpath = (char *)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); + map = (char *)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); close(fd); *fsize = size; - return fpath; + return map; } static int -TagThread(char *direct) +TagThread(const char *direct) { int fsize, count; char *title, *fimage; @@ -199,7 +200,7 @@ TagPruner(int bid) /* cursor & reading record position control */ /* ----------------------------------------------------- */ keeploc_t * -getkeep(char *s, int def_topline, int def_cursline) +getkeep(const char *s, int def_topline, int def_cursline) { /* 為省記憶體, 且避免 malloc/free 不成對, getkeep 最好不要 malloc, * 只記 s 的 hash 值, @@ -252,7 +253,7 @@ getkeep(char *s, int def_topline, int def_cursline) } void -fixkeep(char *s, int first) +fixkeep(const char *s, int first) { keeploc_t *k; @@ -308,7 +309,7 @@ cursor_pos(keeploc_t * locmem, int val, int from_top, int isshow) * @return 新的游標位置 */ static int -thread(keeploc_t * locmem, int stypen) +thread(const keeploc_t * locmem, int stypen) { fileheader_t fh; int pos = locmem->crs_ln, jump = 200, new_ln; @@ -357,7 +358,7 @@ thread(keeploc_t * locmem, int stypen) #ifdef INTERNET_EMAIL static void -mail_forward(fileheader_t * fhdr, char *direct, int mode) +mail_forward(const fileheader_t * fhdr, const char *direct, int mode) { int i; char buf[STRLEN]; @@ -383,7 +384,7 @@ mail_forward(fileheader_t * fhdr, char *direct, int mode) #endif static int -select_read(keeploc_t * locmem, int sr_mode) +select_read(const keeploc_t * locmem, int sr_mode) { #define READSIZE 64 // 8192 / sizeof(fileheader_t) fileheader_t fhs[READSIZE]; |