summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-08-12 15:24:51 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-08-12 15:24:51 +0800
commit59412f931afadb4a89e711761580749fc3d761a9 (patch)
tree86a8f974d402c10201f1e63e9fd9b8da2a3549c9 /util
parentda6382afa9cc31ed70b028839f8188953a061a9c (diff)
downloadpttbbs-59412f931afadb4a89e711761580749fc3d761a9.tar
pttbbs-59412f931afadb4a89e711761580749fc3d761a9.tar.gz
pttbbs-59412f931afadb4a89e711761580749fc3d761a9.tar.bz2
pttbbs-59412f931afadb4a89e711761580749fc3d761a9.tar.lz
pttbbs-59412f931afadb4a89e711761580749fc3d761a9.tar.xz
pttbbs-59412f931afadb4a89e711761580749fc3d761a9.tar.zst
pttbbs-59412f931afadb4a89e711761580749fc3d761a9.zip
use NULL instead of (~ 0) in class linked-list
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1092 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/boardlist.c12
-rw-r--r--util/shmctl.c5
-rw-r--r--util/toplazyBM.c2
3 files changed, 8 insertions, 11 deletions
diff --git a/util/boardlist.c b/util/boardlist.c
index 42fd707a..4c338328 100644
--- a/util/boardlist.c
+++ b/util/boardlist.c
@@ -1,4 +1,4 @@
-/* $Id: boardlist.c,v 1.4 2003/07/21 09:27:16 in2 Exp $ */
+/* $Id$ */
/* 這是用來將樹狀分類輸出成 perl module (可以給像是 man/ 使用) */
#include "bbs.h"
@@ -25,9 +25,9 @@ load_uidofgid(const int gid, const int type)
}
bcache[gid - 1].childcount = childcount;
if (currbptr == &bcache[gid - 1])
- currbptr->firstchild[type] = (boardheader_t *) ~ 0;
+ currbptr->firstchild[type] = NULL;
else
- currbptr->next[type] = (boardheader_t *) ~ 0;
+ currbptr->next[type] = NULL;
}
char *skipEscape(char *s)
@@ -52,8 +52,7 @@ void dumpclass(int bid)
if (bptr->firstchild[0] == NULL || bptr->childcount <= 0)
load_uidofgid(bid + 1, 0); /* 因為這邊 bid從 0開始, 所以再 +1 回來 */
printf(" %5d => [\n", bid);
- for (bptr = bptr->firstchild[0]; bptr != (boardheader_t *) ~ 0;
- bptr = bptr->next[0]) {
+ for (bptr = bptr->firstchild[0]; bptr != NULL ; bptr = bptr->next[0]) {
if( (bptr->brdattr & (BRD_HIDE | BRD_TOP)) ||
(bptr->level && !(bptr->brdattr & BRD_POSTMASK) &&
(bptr->level &
@@ -75,8 +74,7 @@ void dumpclass(int bid)
printf(" ],\n");
bptr = &bcache[bid];
- for (bptr = bptr->firstchild[0]; bptr != (boardheader_t *) ~ 0;
- bptr = bptr->next[0]) {
+ for (bptr = bptr->firstchild[0]; bptr != NULL ; bptr = bptr->next[0]) {
if( (bptr->brdattr & (BRD_HIDE | BRD_TOP)) ||
(bptr->level && !(bptr->brdattr & BRD_POSTMASK) &&
(bptr->level &
diff --git a/util/shmctl.c b/util/shmctl.c
index 382a823b..1eb33bd1 100644
--- a/util/shmctl.c
+++ b/util/shmctl.c
@@ -1,4 +1,4 @@
-/* $Id: shmctl.c,v 1.45 2003/07/20 00:55:34 in2 Exp $ */
+/* $Id$ */
#include "bbs.h"
#include <sys/wait.h>
@@ -462,8 +462,7 @@ void buildclass(int bid, int level)
if (bptr->firstchild[1] == NULL || bptr->childcount <= 0)
load_uidofgid(bid + 1, 1); /* 因為這邊 bid從 0開始, 所以再 +1 回來 */
- for (bptr = bptr->firstchild[0]; bptr != (boardheader_t *) ~ 0;
- bptr = bptr->next[0]) {
+ for (bptr = bptr->firstchild[0]; bptr != NULL ; bptr = bptr->next[0]) {
if( bptr->brdattr & BRD_GROUPBOARD )
buildclass(bptr - bcache, level + 1);
}
diff --git a/util/toplazyBM.c b/util/toplazyBM.c
index 5dc9a3df..55267927 100644
--- a/util/toplazyBM.c
+++ b/util/toplazyBM.c
@@ -1,4 +1,4 @@
-/* $Id: toplazyBM.c,v 1.18 2003/07/20 00:55:34 in2 Exp $ */
+/* $Id$ */
#define _UTIL_C_
#include "bbs.h"
#define OUTFILE BBSHOME "/etc/toplazyBM"