From 4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 20 Jan 2015 04:36:08 +0100 Subject: Minor fixes and tweaks suggested by cppcheck - Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru --- src/map/buyingstore.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/map/buyingstore.c') diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 8efffa342..a53acdbb0 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -65,10 +65,9 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots) void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const uint8* itemlist, unsigned int count) { unsigned int i, weight, listidx; - struct item_data* id; - if( !result || count == 0 ) - {// canceled, or no items + if (!result || count == 0) { + // canceled, or no items return; } @@ -107,10 +106,11 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha weight = sd->weight; // check item list - for( i = 0; i < count; i++ ) - {// itemlist: .W .W .L + for (i = 0; i < count; i++) { + // itemlist: .W .W .L unsigned short nameid, amount; int price, idx; + struct item_data* id; nameid = RBUFW(itemlist,i*8+0); amount = RBUFW(itemlist,i*8+2); -- cgit v1.2.3-60-g2f50