diff options
author | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-09 14:31:15 +0000 |
---|---|---|
committer | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-03-09 14:31:15 +0000 |
commit | 33369a948f2d6ba2059f81816ea7b16e486090ba (patch) | |
tree | b08a112ecbacf193f3a98c2bcc05a01fddef5feb /src/char/int_auction.c | |
parent | 440542802577e5f3f67081803873bc87642a3f48 (diff) | |
download | hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.gz hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.bz2 hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.xz hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.zip |
Code cleanup: replaced `DBIterator` function calls with macros where possible.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15668 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/int_auction.c')
-rw-r--r-- | src/char/int_auction.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/char/int_auction.c b/src/char/int_auction.c index 04e321062..4fc9215a0 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -27,16 +27,14 @@ static int auction_count(int char_id, bool buy) { int i = 0; struct auction_data *auction; - DBIterator* iter; - DBKey key; + DBIterator *iter = db_iterator(auction_db_); - iter = auction_db_->iterator(auction_db_); - for( auction = (struct auction_data*)iter->first(iter,&key); iter->exists(iter); auction = (struct auction_data*)iter->next(iter,&key) ) + for( auction = dbi_first(iter); dbi_exists(iter); auction = dbi_next(iter) ) { if( (buy && auction->buyer_id == char_id) || (!buy && auction->seller_id == char_id) ) i++; } - iter->destroy(iter); + dbi_destroy(iter); return i; } @@ -258,15 +256,13 @@ static void mapif_parse_Auction_requestlist(int fd) int price = RFIFOL(fd,10); short type = RFIFOW(fd,8), page = max(1,RFIFOW(fd,14)); unsigned char buf[5 * sizeof(struct auction_data)]; - DBIterator* iter; - DBKey key; + DBIterator *iter = db_iterator(auction_db_); struct auction_data *auction; short i = 0, j = 0, pages = 1; memcpy(searchtext, RFIFOP(fd,16), NAME_LENGTH); - iter = auction_db_->iterator(auction_db_); - for( auction = (struct auction_data*)iter->first(iter,&key); iter->exists(iter); auction = (struct auction_data*)iter->next(iter,&key) ) + for( auction = dbi_first(iter); dbi_exists(iter); auction = dbi_next(iter) ) { if( (type == 0 && auction->type != IT_ARMOR && auction->type != IT_PETARMOR) || (type == 1 && auction->type != IT_WEAPON) || @@ -291,7 +287,7 @@ static void mapif_parse_Auction_requestlist(int fd) memcpy(WBUFP(buf, j * len), auction, len); j++; // Found Results } - iter->destroy(iter); + dbi_destroy(iter); mapif_Auction_sendlist(fd, char_id, j, pages, buf); } |