diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-01-15 11:02:12 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-01-15 11:02:12 +0800 |
commit | 97393424193c434e0bdcca7b00df2f8c6c7dd043 (patch) | |
tree | 1ddb286344341e087f981b17add566e122de6b39 | |
parent | a5af086e838643e98c61aea59f815c654ac6e9fc (diff) | |
download | pttbbs-97393424193c434e0bdcca7b00df2f8c6c7dd043.tar pttbbs-97393424193c434e0bdcca7b00df2f8c6c7dd043.tar.gz pttbbs-97393424193c434e0bdcca7b00df2f8c6c7dd043.tar.bz2 pttbbs-97393424193c434e0bdcca7b00df2f8c6c7dd043.tar.lz pttbbs-97393424193c434e0bdcca7b00df2f8c6c7dd043.tar.xz pttbbs-97393424193c434e0bdcca7b00df2f8c6c7dd043.tar.zst pttbbs-97393424193c434e0bdcca7b00df2f8c6c7dd043.zip |
prevent using inlines
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5297 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/assess.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/pttbbs/mbbsd/assess.c b/pttbbs/mbbsd/assess.c index 05a25ea3..ed53e60d 100644 --- a/pttbbs/mbbsd/assess.c +++ b/pttbbs/mbbsd/assess.c @@ -14,19 +14,18 @@ inline static void inc(unsigned char *num, int n) (*num) += n; } -#define modify_column(_attr) \ -int inc_##_attr(const char *userid, int num) \ -{ \ - userec_t xuser; \ - int uid = getuser(userid, &xuser);\ - if( uid > 0 ){ \ - inc(&xuser._attr, num); \ - passwd_sync_update(uid, &xuser); \ - return xuser._attr; }\ - return 0;\ -} +int +inc_badpost(const char *userid, int num) { + userec_t xuser; + int uid = getuser(userid, &xuser); -modify_column(badpost); /* inc_badpost */ + if (uid <= 0) + return 0; + + xuser.badpost += num; + passwd_sync_update(uid, &xuser); + return xuser.badpost; +} static char * const badpost_reason[] = { "廣告", "不當用辭", "人身攻擊" |