summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-07-30 00:25:40 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-07-30 00:25:40 +0800
commit8059d1525a1b5bfa7192a68d2fe12242e47f0145 (patch)
tree077e1384fc174710ac1b596cd3500e40bed09478
parenta035b16261c3df5adbf6520ac8c848064243dbc7 (diff)
downloadpttbbs-8059d1525a1b5bfa7192a68d2fe12242e47f0145.tar
pttbbs-8059d1525a1b5bfa7192a68d2fe12242e47f0145.tar.gz
pttbbs-8059d1525a1b5bfa7192a68d2fe12242e47f0145.tar.bz2
pttbbs-8059d1525a1b5bfa7192a68d2fe12242e47f0145.tar.lz
pttbbs-8059d1525a1b5bfa7192a68d2fe12242e47f0145.tar.xz
pttbbs-8059d1525a1b5bfa7192a68d2fe12242e47f0145.tar.zst
pttbbs-8059d1525a1b5bfa7192a68d2fe12242e47f0145.zip
use int instead of long
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2151 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/proto.h4
-rw-r--r--mbbsd/bbs.c8
-rw-r--r--mbbsd/cache.c2
-rw-r--r--mbbsd/guess.c6
-rw-r--r--mbbsd/osdep.c4
-rw-r--r--mbbsd/record.c2
-rw-r--r--mbbsd/stuff.c2
-rw-r--r--mbbsd/talk.c2
-rw-r--r--mbbsd/topsong.c6
-rw-r--r--util/yearsold.c3
10 files changed, 19 insertions, 20 deletions
diff --git a/include/proto.h b/include/proto.h
index 53d606b0..c2d91f83 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -376,7 +376,7 @@ char *completeutmp_getname(int where);
/* osdep */
int cpuload(char *str);
-double swapused(long *total, long *used);
+double swapused(int *total, long *used);
#ifdef __linux__
char *strcasestr(const char *big, const char *little);
#endif
@@ -484,7 +484,7 @@ int cursor_key(int row, int column);
int search_num(int ch, int max);
void setuserfile(char *buf, char *fname);
int is_BM(char *list);
-long dasht(char *fname);
+time_t dasht(char *fname);
int dashd(char *fname);
int invalid_pname(char *str);
void setbdir(char *buf, char *boardname);
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 291a0964..df6d86ab 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -611,10 +611,10 @@ do_general(int isbid)
setbpath(fpath, currboard);
stampfile(fpath, &postfile);
if(isbid) {
- aborted = (int)fopen(fpath, "w");
- if(aborted) {
- print_bidinfo((FILE*)aborted, bidinfo);
- fclose((FILE*)aborted);
+ FILE *fp;
+ if( (fp = fopen(fpath, "w")) != NULL ){
+ print_bidinfo(fp, bidinfo);
+ fclose(fp);
}
}
else if(posttype!=-1 && ((1<<posttype) & bp->posttype_f)) {
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index d7bba339..4c14dda5 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -19,7 +19,7 @@ safe_sleep(unsigned int seconds)
sigemptyset(&set);
sigprocmask(SIG_BLOCK, &set, &oldset);
if (sigismember(&oldset, SIGALRM)) {
- unsigned long retv;
+ unsigned int retv;
log_usies("SAFE_SLEEP ", "avoid hang");
sigemptyset(&set);
sigaddset(&set, SIGALRM);
diff --git a/mbbsd/guess.c b/mbbsd/guess.c
index ca80aa15..98425b66 100644
--- a/mbbsd/guess.c
+++ b/mbbsd/guess.c
@@ -22,7 +22,7 @@ show_table(char TABLE[], char ifcomputer)
outs("\033[33m=================\033[m");
}
-static long int
+static int
get_money(void)
{
int money, i;
@@ -212,10 +212,10 @@ Diff_Random(char *answer)
#define lockreturn0(unmode, state) if(lockutmpmode(unmode, state)) return 0
int
-guess_main()
+guess_main(void)
{
char data[5];
- long int money;
+ int money;
char computerwin = 0, youwin = 0;
int count = 0, c_count = 0;
char ifcomputer[2];
diff --git a/mbbsd/osdep.c b/mbbsd/osdep.c
index 73af3f85..4647d198 100644
--- a/mbbsd/osdep.c
+++ b/mbbsd/osdep.c
@@ -177,7 +177,7 @@ cpuload(char *str)
}
double
-swapused(long *total, long *used)
+swapused(int *total, long *used)
{
double percent = -1;
kvm_t *kd;
@@ -220,7 +220,7 @@ cpuload(char *str)
}
double
-swapused(long *total, long *used)
+swapused(int *total, long *used)
{
double percent = -1;
char buf[101];
diff --git a/mbbsd/record.c b/mbbsd/record.c
index 6d4b55e1..f5d5929c 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -35,7 +35,7 @@ int
get_sum_records(char *fpath, int size)
{
struct stat st;
- long ans = 0;
+ int ans = 0;
int fp;
fileheader_t fhdr;
char buf[200], *p;
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index 3a8a8dd5..a893db25 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -262,7 +262,7 @@ dashs(char *fname)
return -1;
}
-long
+time_t
dasht(char *fname)
{
struct stat st;
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 0be62198..8edf5980 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -357,7 +357,7 @@ my_query(char *uident)
{
userec_t muser;
int tuid, i, fri_stat = 0;
- unsigned long int j;
+ unsigned int j;
userinfo_t *uentp;
const char *money[10] =
{"債台高築", "赤貧", "清寒", "普通", "小康",
diff --git a/mbbsd/topsong.c b/mbbsd/topsong.c
index 015f7de5..cb71ac5b 100644
--- a/mbbsd/topsong.c
+++ b/mbbsd/topsong.c
@@ -1,4 +1,4 @@
-/* $Id: topsong.c,v 1.6 2002/07/27 10:04:34 kcwu Exp $ */
+/* $Id$ */
#include "bbs.h"
#define MAX_SONGS 300
@@ -7,10 +7,10 @@
typedef struct songcmp_t {
char name[100];
char cname[100];
- long int count;
+ int count;
} songcmp_t;
-static long int totalcount = 0;
+static int totalcount = 0;
static int
count_cmp(songcmp_t * b, songcmp_t * a)
diff --git a/util/yearsold.c b/util/yearsold.c
index 83b43fa9..a3a78d27 100644
--- a/util/yearsold.c
+++ b/util/yearsold.c
@@ -28,8 +28,7 @@ int main(int argc, char **argv)
int i, j, k;
char buf[256];
FILE *fp;
- int year, max, item, maxyear;
- long totalyear;
+ int year, max, item, maxyear, totalyear;
int act[25];
time_t now;
struct tm *ptime;