diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-11-17 11:35:31 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-11-17 11:35:31 +0800 |
commit | 000083cc87916be528e889208126e700918c313e (patch) | |
tree | 2c0dacc861e0700fb3cc1705080f282117ab21eb /mbbsd/board.c | |
parent | 86dbcf633bd13c10081ee3414c136c299a4c7e13 (diff) | |
download | pttbbs-000083cc87916be528e889208126e700918c313e.tar pttbbs-000083cc87916be528e889208126e700918c313e.tar.gz pttbbs-000083cc87916be528e889208126e700918c313e.tar.bz2 pttbbs-000083cc87916be528e889208126e700918c313e.tar.lz pttbbs-000083cc87916be528e889208126e700918c313e.tar.xz pttbbs-000083cc87916be528e889208126e700918c313e.tar.zst pttbbs-000083cc87916be528e889208126e700918c313e.zip |
rewrite SHM->HBcache sorted bsorted as offset value.
git-svn-id: http://opensvn.csie.org/pttbbs/branches/ptt.linux@2334 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r-- | mbbsd/board.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index 61d369c8..954c7d8f 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -131,7 +131,8 @@ load_uidofgid(const int gid, const int type) int n, childcount = 0; currbptr = &bcache[gid - 1]; for (n = 0; n < numboards; ++n) { - if( !(bptr = SHM->bsorted[type][n]) || bptr->brdname[0] == '\0' ) + if( !(bptr = &bcache[SHM->bsorted[type][n]]) + || bptr->brdname[0] == '\0' ) continue; if (bptr->gid == gid) { if (currbptr == &bcache[gid - 1]) @@ -259,14 +260,15 @@ load_boards(char *key) else if( class_bid == -1 ){ nbrd = (boardstat_t *)malloc(sizeof(boardstat_t) * SHM->nHOTs); for( i = 0 ; i < SHM->nHOTs ; ++i ) - addnewbrdstat(SHM->HBcache[i] - SHM->bcache, - HasPerm(SHM->HBcache[i])); + if(SHM->HBcache[i]==-1) continue; + addnewbrdstat(SHM->HBcache[i], + HasPerm(bcache[SHM->HBcache[i]])); } #endif else { // general case nbrd = (boardstat_t *) MALLOC(sizeof(boardstat_t) * numboards); for (i = 0; i < numboards; i++) { - if ((bptr = SHM->bsorted[type][i]) == NULL) + if ((bptr = &bcache[SHM->bsorted[type][i]]) == NULL) continue; n = getbid(bptr); if (!bptr->brdname[0] || |