summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-10-01 22:42:57 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-10-01 22:42:57 +0800
commit233e3205df3f43bf54ed366333fc71340ca71bef (patch)
treee49249aa461450e97c8d469d640f6da164c8bb2e
parentefd842401473002b70d43e50aa3ecffe1423a899 (diff)
downloadpttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar
pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.gz
pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.bz2
pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.lz
pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.xz
pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.zst
pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.zip
* eliminate warnings according to lxb's commit on pttbbslite
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3581 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/common.h4
-rw-r--r--include/proto.h5
-rw-r--r--mbbsd/bbs.c2
-rw-r--r--mbbsd/chat.c43
-rw-r--r--mbbsd/read.c5
-rw-r--r--mbbsd/user.c2
-rw-r--r--mbbsd/var.c1
-rw-r--r--mbbsd/vote.c2
8 files changed, 9 insertions, 55 deletions
diff --git a/include/common.h b/include/common.h
index 9e7d7b23..59fd0fb7 100644
--- a/include/common.h
+++ b/include/common.h
@@ -118,10 +118,6 @@
ANSI_COLOR(31) "←[q]" ANSI_COLOR(30) "離開 " \
""
-#define MSG_SHORTULIST ANSI_COLOR(7) \
- "使用者代號 目前狀態 │使用者代號 目前狀態 │"\
- "使用者代號 目前狀態 " ANSI_RESET ANSI_CLRTOEND
-
#define MSG_SEPERATOR "\
───────────────────────────────────────"
diff --git a/include/proto.h b/include/proto.h
index bfab2e4b..0c990e82 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -60,7 +60,7 @@ int inc_badsale(const char *, int num);
//void set_assess(int uid, unsigned char num, int type);
/* bbs */
-void delete_allpost(char *userid);
+void delete_allpost(const char *userid);
int invalid_brdname(const char *brd);
void chomp(char *src);
int del_range(int ent, const fileheader_t *fhdr, const char *direct);
@@ -732,9 +732,10 @@ void sortsong(void);
int topsong(void);
/* user */
-int kill_user(int num, char *userid);
+int kill_user(int num, const char *userid);
int u_editcalendar(void);
void user_display(const userec_t *u, int real);
+int isvalidemail(const char *email);
void uinfo_query(userec_t *u, int real, int unum);
int showsignature(char *fname, int *j, SigInfo *psi);
int u_cancelbadpost();
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 967657b0..38cabddd 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -581,7 +581,7 @@ deleteCrossPost(const fileheader_t *fh, char *bname)
}
void
-delete_allpost(char *userid)
+delete_allpost(const char *userid)
{
fileheader_t fhdr;
int fd, i;
diff --git a/mbbsd/chat.c b/mbbsd/chat.c
index cb252e15..9d729969 100644
--- a/mbbsd/chat.c
+++ b/mbbsd/chat.c
@@ -116,37 +116,6 @@ chat_recv(struct ChatBuf *cb, int fd, char *chatroom, char *chatid, size_t chati
return 0;
}
-static int
-printuserent(const userinfo_t * uentp)
-{
- static char uline[80];
- static int cnt;
- char pline[30];
-
- if (!uentp) {
- if (cnt)
- printchatline(uline);
- bzero(uline, sizeof(uline));
- cnt = 0;
- return 0;
- }
- if (!HasUserPerm(PERM_SYSOP) && !HasUserPerm(PERM_SEECLOAK) && uentp->invisible)
- return 0;
-
- snprintf(pline, sizeof(pline), "%-13s%c%-10s ", uentp->userid,
- uentp->invisible ? '#' : ' ',
- modestring(uentp, 1));
- if (cnt < 2)
- strlcat(pline, "│", sizeof(pline));
- strlcat(uline, pline, sizeof(uline));
- if (++cnt == 3) {
- printchatline(uline);
- memset(uline, 0, 80);
- cnt = 0;
- }
- return 0;
-}
-
static void
chathelp(const char *cmd, const char *desc)
{
@@ -249,18 +218,6 @@ chat_query(char *arg)
printchatline(err_uid);
}
-static void
-chat_users(char* unused)
-{
- printchatline("");
- printchatline("【 " BBSNAME "的遊客列表 】");
- printchatline(msg_shortulist);
-
- if (apply_ulist(printuserent) == -1)
- printchatline("空無一人");
- printuserent(NULL);
-}
-
typedef struct chat_command_t {
char *cmdname; /* Chatroom command length */
void (*cmdfunc) (char *); /* Pointer to function */
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 7a3d0d4b..784db7c2 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -537,6 +537,7 @@ select_read(const keeploc_t * locmem, int sr_mode)
} else {
/* use cached data */
reload = 0;
+ inc = 0;
}
/* mark and recommend shouldn't incremental select */
@@ -616,9 +617,9 @@ select_read(const keeploc_t * locmem, int sr_mode)
}
} // end while
close(fr);
+ ftruncate(fd, count*sizeof(fileheader_t));
+ close(fd);
}
- ftruncate(fd, count*sizeof(fileheader_t));
- close(fd);
}
if(count) {
diff --git a/mbbsd/user.c b/mbbsd/user.c
index 4abc44ca..ed15a4e5 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -16,7 +16,7 @@ static const char * const chess_type[3] = {
#endif
int
-kill_user(int num, char *userid)
+kill_user(int num, const char *userid)
{
userec_t u;
char src[256], dst[256];
diff --git a/mbbsd/var.c b/mbbsd/var.c
index 39c87442..ecf91169 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -147,7 +147,6 @@ char * const loginview_file[NUMVIEWFILE][2] = {
/* message */
char * const msg_seperator = MSG_SEPERATOR;
-char * const msg_shortulist = MSG_SHORTULIST;
char * const msg_cancel = MSG_CANCEL;
char * const msg_usr_left = MSG_USR_LEFT;
diff --git a/mbbsd/vote.c b/mbbsd/vote.c
index d15ee08f..47d41bf7 100644
--- a/mbbsd/vote.c
+++ b/mbbsd/vote.c
@@ -1066,7 +1066,7 @@ user_vote_one(vote_buffer_t *vbuf, const char *bname, int ind)
if (buf[0] == 'Q' || buf[0] == 'q')
break;
setbfile(b_comments, bname, vbuf->comments);
- if (mycomments[0])
+ if (mycomments[0][0])
if ((fcm = fopen(b_comments, "a"))) {
fprintf(fcm,
ANSI_COLOR(36) "○使用者" ANSI_COLOR(1;36) " %s "