Преглед изворни кода

Small finalisation for ARM va_list issue

lighta пре 8 година
родитељ
комит
c93b9cec6e
1 измењених фајлова са 5 додато и 18 уклоњено
  1. 5 18
      src/map/itemdb.c

+ 5 - 18
src/map/itemdb.c

@@ -1778,29 +1778,16 @@ static int itemdb_final_sub(DBKey key, DBData *data, va_list ap)
 /** NOTE:
 * In some OSs, like Raspbian, we aren't allowed to pass 0 in va_list.
 * So, itemdb_group_free2 is useful in some cases.
+* NB : We keeping that funciton cause that signature is needed for some iterator..
 */
 static int itemdb_group_free(DBKey key, DBData *data, va_list ap) {
-	struct s_item_group_db *group = (struct s_item_group_db *)db_data2ptr(data);
-	uint8 j;
-	if (!group)
-		return 0;
-	if (group->must_qty)
-		aFree(group->must);
-	group->must_qty = 0;
-	for (j = 0; j < MAX_ITEMGROUP_RANDGROUP; j++) {
-		if (!group->random[j].data_qty || !(&group->random[j]))
-			continue;
-		aFree(group->random[j].data);
-		group->random[j].data_qty = 0;
-	}
-	aFree(group);
-	return 0;
+	return itemdb_group_free2(key,data);
 }
 
-/** (Raspberry PI)
-* Adaptation of itemdb_group_free. This function enables to run rAthena on Raspbian OS.
+/** (ARM)
+* Adaptation of itemdb_group_free. This function enables to compile rAthena on Raspbian OS.
 */
-static int itemdb_group_free2(DBKey key, DBData *data) {
+static inline int itemdb_group_free2(DBKey key, DBData *data) {
 	struct s_item_group_db *group = (struct s_item_group_db *)db_data2ptr(data);
 	uint8 j;
 	if (!group)