summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-10-23 19:28:37 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-10-23 19:28:37 +0800
commit50bab622bc5c6a3407ac03b6ec1fc5daa54d5b48 (patch)
tree410e15c5d21094fffc85bc7b72962e94504fa8f4
parentfb253aa9e4464832b21ffb0b6402bc163fcc36df (diff)
downloadpttbbs-50bab622bc5c6a3407ac03b6ec1fc5daa54d5b48.tar
pttbbs-50bab622bc5c6a3407ac03b6ec1fc5daa54d5b48.tar.gz
pttbbs-50bab622bc5c6a3407ac03b6ec1fc5daa54d5b48.tar.bz2
pttbbs-50bab622bc5c6a3407ac03b6ec1fc5daa54d5b48.tar.lz
pttbbs-50bab622bc5c6a3407ac03b6ec1fc5daa54d5b48.tar.xz
pttbbs-50bab622bc5c6a3407ac03b6ec1fc5daa54d5b48.tar.zst
pttbbs-50bab622bc5c6a3407ac03b6ec1fc5daa54d5b48.zip
fixing warnings
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5148 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/common/bbs/cache.c6
-rw-r--r--pttbbs/mbbsd/chc.c7
-rw-r--r--pttbbs/util/account.c2
-rw-r--r--pttbbs/util/buildir.c8
4 files changed, 8 insertions, 15 deletions
diff --git a/pttbbs/common/bbs/cache.c b/pttbbs/common/bbs/cache.c
index 592c732c..5550b2c0 100644
--- a/pttbbs/common/bbs/cache.c
+++ b/pttbbs/common/bbs/cache.c
@@ -114,7 +114,7 @@ attach_check_SHM(int version, int SHM_t_size)
shm_check_error();
}
if (SHM_t_size != sizeof(SHM_t)) {
- fprintf(stderr, "Error: SHM_t_size(%d) != sizeof(SHM_t)(%lu)\n",
+ fprintf(stderr, "Error: SHM_t_size(%d) != sizeof(SHM_t)(%zd)\n",
SHM_t_size, sizeof(SHM_t));
shm_check_error();
}
@@ -125,7 +125,7 @@ attach_check_SHM(int version, int SHM_t_size)
shm_check_error();
}
if (SHM->size != sizeof(SHM_t)) {
- fprintf(stderr, "Error: SHM->size(%d) != sizeof(SHM_t)(%lu)\n",
+ fprintf(stderr, "Error: SHM->size(%d) != sizeof(SHM_t)(%zd)\n",
SHM->size, sizeof(SHM_t));
shm_check_error();
}
@@ -709,7 +709,7 @@ reload_pttcache(void)
safe_sleep(1);
else { /* jochang: temporary workaround */
fileheader_t item, subitem;
- char pbuf[256], buf[256], *chr;
+ char pbuf[256], buf[256];
FILE *fp, *fp1, *fp2;
int id, aggid, rawid;
diff --git a/pttbbs/mbbsd/chc.c b/pttbbs/mbbsd/chc.c
index 6d4a2f4e..924d60e7 100644
--- a/pttbbs/mbbsd/chc.c
+++ b/pttbbs/mbbsd/chc.c
@@ -281,11 +281,7 @@ chc_log_machine_step(FILE* fp, board_t board, const drc_t *step)
}
static int
-#if defined(__linux__)
chc_filter(const struct dirent *dir)
-#else
-chc_filter(struct dirent *dir)
-#endif
{
if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0 )
return 0;
@@ -299,7 +295,8 @@ chc_log_poem(FILE* outfp)
int n;
// TODO use readdir(), don't use lots of memory
- n = scandir(BBSHOME"/etc/chess", &namelist, chc_filter, alphasort);
+ n = scandir(BBSHOME"/etc/chess", &namelist, chc_filter,
+ (int (*)(const struct dirent **, const struct dirent **))alphasort);
if (n < 0)
perror("scandir");
else {
diff --git a/pttbbs/util/account.c b/pttbbs/util/account.c
index a2e8b9f8..0a3327a1 100644
--- a/pttbbs/util/account.c
+++ b/pttbbs/util/account.c
@@ -201,7 +201,7 @@ static int
update_history(struct tm *ptime, int peak_hour, int peak_hour_login, int day_login)
{
int max_hour_login = 0, max_day_login = 0, max_reg = 0, max_online = 0;
- int peak_online;
+ int peak_online = 0;
FILE *fp, *fp1;
time_t t;
struct tm tm;
diff --git a/pttbbs/util/buildir.c b/pttbbs/util/buildir.c
index d8b7e339..cc30c437 100644
--- a/pttbbs/util/buildir.c
+++ b/pttbbs/util/buildir.c
@@ -1,18 +1,14 @@
/* $Id$ */
#include "bbs.h"
-#ifdef __linux__
int dirselect(const struct dirent *dir)
-#else
-int dirselect(struct dirent *dir)
-#endif
{
return strchr("MDSGH", dir->d_name[0]) && dir->d_name[1] == '.';
}
-int mysort(const void *a, const void *b)
+int mysort(const struct dirent **a, const struct dirent **b)
{
- return atoi(((*((struct dirent **)a))->d_name+2))-atoi(((*((struct dirent **)b))->d_name+2));
+ return atoi(((*a)->d_name+2))-atoi(((*b)->d_name+2));
}
int main(int argc, char **argv)