浏览代码

* Fixed gcc compile warnings in char-server and console plug-in (bugreport:4771, topic:208746, since r9631 and r14700).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14716 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 年之前
父节点
当前提交
48746d078e
共有 4 个文件被更改,包括 6 次插入7 次删除
  1. 1 0
      Changelog-Trunk.txt
  2. 1 1
      src/char/char.c
  3. 2 2
      src/char_sql/char.c
  4. 2 4
      src/plugins/console.c

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2011/02/19
+	* Fixed gcc compile warnings in char-server and console plug-in (bugreport:4771, topic:208746, since r9631 and r14700). [Ai4rei]
 	* Fixed buying stores could be opened and sold to regardless of distance between seller and buyer (since r14713). [Ai4rei]
 	* Fixed 'feature.conf' not getting loaded and a typo buying store feature setting name (follow up to r14713). [Ai4rei]
 	* Implemented buying store system (aka. reverse vending, purchase shop) together with related skill and items, without NPCs. [Ai4rei]

+ 1 - 1
src/char/char.c

@@ -541,7 +541,7 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg,
 		p->last_point.map, p->last_point.x, p->last_point.y, //
 		p->save_point.map, p->save_point.x, p->save_point.y,
 		p->partner_id,p->father,p->mother,p->child,p->fame, //
-		TOL(p->delete_date));  // FIXME: platform-dependent size
+		(unsigned long)p->delete_date);  // FIXME: platform-dependent size
 	for(i = 0; i < MAX_MEMOPOINTS; i++)
 		if (p->memo_point[i].map) {
 			str_p += sprintf(str_p, "%d,%d,%d ", p->memo_point[i].map, p->memo_point[i].x, p->memo_point[i].y);

+ 2 - 2
src/char_sql/char.c

@@ -493,7 +493,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
 			p->weapon, p->shield, p->head_top, p->head_mid, p->head_bottom,
 			mapindex_id2name(p->last_point.map), p->last_point.x, p->last_point.y,
 			mapindex_id2name(p->save_point.map), p->save_point.x, p->save_point.y, p->rename,
-			TOL(p->delete_date),  // FIXME: platform-dependent size
+			(unsigned long)p->delete_date,  // FIXME: platform-dependent size
 			p->account_id, p->char_id) )
 		{
 			Sql_ShowDebug(sql_handle);
@@ -3076,7 +3076,7 @@ static void char_delete2_req(int fd, struct char_session_data* sd)
 	// success
 	delete_date = time(NULL)+char_del_delay;
 
-	if( SQL_SUCCESS != Sql_Query(sql_handle, "UPDATE `%s` SET `delete_date`='%lu' WHERE `char_id`='%d'", char_db, TOL(delete_date), char_id) )
+	if( SQL_SUCCESS != Sql_Query(sql_handle, "UPDATE `%s` SET `delete_date`='%lu' WHERE `char_id`='%d'", char_db, (unsigned long)delete_date, char_id) )
 	{
 		Sql_ShowDebug(sql_handle);
 		char_delete2_ack(fd, char_id, 3, 0);

+ 2 - 4
src/plugins/console.c

@@ -34,8 +34,7 @@
 	do{ \
 		DWORD dwThreadId; \
 		buf.worker = CreateThread(NULL, 0, worker_ ## name, NULL, CREATE_SUSPENDED, &dwThreadId); \
-		if( errvar ) \
-			*errvar = ( buf.worker == NULL ); \
+		*(errvar) = ( buf.worker == NULL ); \
 	}while(0)
 
 /// Buffer for asynchronous input
@@ -61,8 +60,7 @@ typedef struct _buffer {
 		if( pid == 0 ){ \
 			worker_ ## name(); \
 		} \
-		if( errvar ) \
-			*errvar = (pid == -1); \
+		*(errvar) = (pid == -1); \
 	}while(0)
 
 #define PIPE_READ 0