Bladeren bron

- Fixed some compiling warnings.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10196 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 jaren geleden
bovenliggende
commit
8e93386102
4 gewijzigde bestanden met toevoegingen van 11 en 11 verwijderingen
  1. 4 4
      src/common/malloc.c
  2. 2 2
      src/ladmin/ladmin.c
  3. 3 3
      src/login/login.c
  4. 2 2
      src/map/npc.c

+ 4 - 4
src/common/malloc.c

@@ -575,8 +575,8 @@ static void memmgr_final (void)
 				{
 				#ifdef LOG_MEMMGR
 					sprintf (buf,
-						"%04d : %s line %d size %d\n", ++count,
-						head->file, head->line, head->size);
+						"%04d : %s line %d size %lu\n", ++count,
+						head->file, head->line, (unsigned long)head->size);
 					memmgr_log (buf);
 				#endif
 					// get block pointer and free it [celest]
@@ -623,8 +623,8 @@ static void memmgr_final (void)
 		large2 = large->next;
 	#ifdef LOG_MEMMGR
 		sprintf (buf,
-			"%04d : %s line %d size %d\n", ++count,
-			large->unit_head.file, large->unit_head.line, large->unit_head.size);
+			"%04d : %s line %d size %lu\n", ++count,
+			large->unit_head.file, large->unit_head.line, (unsigned long)large->unit_head.size);
 		memmgr_log (buf);
 	#endif
 		FREE(large,file,line,func);

+ 2 - 2
src/ladmin/ladmin.c

@@ -2198,11 +2198,11 @@ int changememo(char* param) {
 
 	if (strlen(memo) > 254) {
 		if (defaultlanguage == 'F') {
-			printf("Mémo trop long (%d caractères).\n", strlen(memo));
+			printf("Mémo trop long (%lu caractères).\n", (unsigned long)strlen(memo));
 			printf("Entrez un mémo de 254 caractères maximum svp.\n");
 			ladmin_log("Mémo trop long (%d caractères). Entrez un mémo de 254 caractères maximum svp." RETCODE, strlen(memo));
 		} else {
-			printf("Memo is too long (%d characters).\n", strlen(memo));
+			printf("Memo is too long (%lu characters).\n", (unsigned long)strlen(memo));
 			printf("Please input a memo of 254 bytes at the maximum.\n");
 			ladmin_log("Email is too long (%d characters). Please input a memo of 254 bytes at the maximum." RETCODE, strlen(memo));
 		}

+ 3 - 3
src/login/login.c

@@ -1940,7 +1940,7 @@ int parse_fromchar(int fd)
 					time(&raw_time);
 					strftime(tmpstr, 23, date_format, localtime(&raw_time));
 					fprintf(logfp, "%s: receiving of an unknown packet -> disconnection" RETCODE, tmpstr);
-					fprintf(logfp, "parse_fromchar: connection #%d (ip: %s), packet: 0x%x (with being read: %d)." RETCODE, fd, ip, RFIFOW(fd,0), RFIFOREST(fd));
+					fprintf(logfp, "parse_fromchar: connection #%d (ip: %s), packet: 0x%x (with being read: %lu)." RETCODE, fd, ip, RFIFOW(fd,0), (unsigned long)RFIFOREST(fd));
 					fprintf(logfp, "Detail (in hex):" RETCODE);
 					fprintf(logfp, "---- 00-01-02-03-04-05-06-07  08-09-0A-0B-0C-0D-0E-0F" RETCODE);
 					memset(tmpstr, '\0', sizeof(tmpstr));
@@ -2906,7 +2906,7 @@ int parse_admin(int fd)
 					time(&raw_time);
 					strftime(tmpstr, 23, date_format, localtime(&raw_time));
 					fprintf(logfp, "%s: receiving of an unknown packet -> disconnection" RETCODE, tmpstr);
-					fprintf(logfp, "parse_admin: connection #%d (ip: %s), packet: 0x%x (with being read: %d)." RETCODE, fd, ip, RFIFOW(fd,0), RFIFOREST(fd));
+					fprintf(logfp, "parse_admin: connection #%d (ip: %s), packet: 0x%x (with being read: %lu)." RETCODE, fd, ip, RFIFOW(fd,0), (unsigned long)RFIFOREST(fd));
 					fprintf(logfp, "Detail (in hex):" RETCODE);
 					fprintf(logfp, "---- 00-01-02-03-04-05-06-07  08-09-0A-0B-0C-0D-0E-0F" RETCODE);
 					memset(tmpstr, '\0', sizeof(tmpstr));
@@ -3333,7 +3333,7 @@ int parse_login(int fd)
 					time(&raw_time);
 					strftime(tmpstr, 23, date_format, localtime(&raw_time));
 					fprintf(logfp, "%s: receiving of an unknown packet -> disconnection" RETCODE, tmpstr);
-					fprintf(logfp, "parse_login: connection #%d (ip: %s), packet: 0x%x (with being read: %d)." RETCODE, fd, ip, RFIFOW(fd,0), RFIFOREST(fd));
+					fprintf(logfp, "parse_login: connection #%d (ip: %s), packet: 0x%x (with being read: %lu)." RETCODE, fd, ip, RFIFOW(fd,0), (unsigned long)RFIFOREST(fd));
 					fprintf(logfp, "Detail (in hex):" RETCODE);
 					fprintf(logfp, "---- 00-01-02-03-04-05-06-07  08-09-0A-0B-0C-0D-0E-0F" RETCODE);
 					memset(tmpstr, '\0', sizeof(tmpstr));

+ 2 - 2
src/map/npc.c

@@ -1206,8 +1206,8 @@ int npc_scriptcont(struct map_session_data *sd,int id)
 		TBL_NPC* nd_sd=(TBL_NPC*)map_id2bl(sd->npc_id);
 		TBL_NPC* nd=(TBL_NPC*)map_id2bl(id);
 		ShowDebug("npc_scriptcont: %s (sd->npc_id=%d) is not %s (id=%d).\n",
-			nd_sd?nd_sd->name:"'Unknown NPC'", sd->npc_id,
-		  	nd?nd->name:"'Unknown NPC'", id);
+			nd_sd?(char*)nd_sd->name:"'Unknown NPC'", (int)sd->npc_id,
+		  	nd?(char*)nd->name:"'Unknown NPC'", (int)id);
 		return 1;
 	}