viewing paste Unknown #1704 | Diff

Posted on the
  1. # This patch file was generated by NetBeans IDE
  2. # Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/ra2
  3. # This patch can be applied using context Tools: Patch action on respective folder.
  4. # It uses platform neutral UTF-8 encoding and \n newlines.
  5. # Above lines and this line are ignored by the patching process.
  6. Index: 3rdparty/libconfig/libconfig.c
  7. --- 3rdparty/libconfig/libconfig.c Base (BASE)
  8. +++ 3rdparty/libconfig/libconfig.c Locally Modified (Based On LOCAL)
  9. @@ -300,7 +300,7 @@
  10.  
  11.        if(list)
  12.        {
  13. -        int len = list->length;
  14. +        unsigned int len = list->length;
  15.          config_setting_t **s;
  16.  
  17.          for(s = list->elements; len--; s++)
  18. @@ -764,7 +764,7 @@
  19.    setting = _new(config_setting_t);
  20.    setting->parent = parent;
  21.    setting->name = (name == NULL) ? NULL : strdup(name);
  22. -  setting->type = type;
  23. +  setting->type =(short) type;
  24.    setting->config = parent->config;
  25.    setting->hook = NULL;
  26.    setting->line = 0;
  27. @@ -1131,8 +1131,7 @@
  28.  
  29.  short config_setting_get_format(const config_setting_t *setting)
  30.  {
  31. -  return(setting->format != 0 ? setting->format
  32. -         : setting->config->default_format);
  33. +  return((short) (setting->format != 0 ? setting->format: setting->config->default_format) );
  34.  }
  35.  
  36.  /* ------------------------------------------------------------------------- */
  37. Index: CMakeLists.txt
  38. --- CMakeLists.txt Base (BASE)
  39. +++ CMakeLists.txt Locally Modified (Based On LOCAL)
  40. @@ -14,7 +14,7 @@
  41.  #   ENABLE_* : option to use an internal feature/code or not
  42.  #   HAVE_*   : internal variable indicating if we have and are using something
  43.  #
  44. -# Maintainer: Fl�vio J. Saraiva (feel free to send complaints or suggestions)
  45. +# Maintainer: Flávio J. Saraiva (feel free to send complaints or suggestions)
  46.  #   flaviojs @ rAthena forum/irc
  47.  #   flaviojs2005 \A-T/ gmail <D.o,T> com
  48.  #
  49. Index: conf/help.txt
  50. --- conf/help.txt Base (BASE)
  51. +++ conf/help.txt Locally Modified (Based On LOCAL)
  52. @@ -96,10 +96,10 @@
  53.  	"4068 Minstrel            4069 Wanderer              4070 Sura                 4071 Genetic\n"
  54.  	"4072 Shadow Chaser\n"
  55.  	"----- 3rd Class (Transcendent) -----\n"
  56. -	"4060 Rune Knight    4061 Warlock                 4062 Ranger             4063 Arch Bishop\n"
  57. -	"4064 Mechanic         4065 Guillotine Cross  4073 Royal Guard    4074 Sorcerer\n"
  58. -	"4075 Minstrel            4076 Wanderer              4077 Sura                  4078 Genetic\n"
  59. -	"4079 Shadow Chaser\n"
  60. +	"4060 Rune Knight T   4061 Warlock T                 4062 Ranger T             4063 Arch Bishop T\n"
  61. +	"4064 Mechanic T        4065 Guillotine Cross T  4073 Royal Guard T   4074 Sorcerer T\n"
  62. +	"4075 Minstrel T           4076 Wanderer T             4077 Sura T                 4078 Genetic T\n"
  63. +	"4079 Shadow Chaser T\n"
  64.  	"----- Expanded Class -----\n"
  65.  	"     23 Super Novice      24 Gunslinger              25 Ninja                 4045 Super Baby\n"
  66.  	"4046 Taekwon           4047 Star Gladiator     4049 Soul Linker            4050 Gangsi\n"
  67. Index: configure
  68. --- configure Base (BASE)
  69. +++ configure Locally Modified (Based On LOCAL)
  70. @@ -4423,7 +4423,7 @@
  71.  
  72.  
  73.  
  74. -CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wno-sign-compare"
  75. +CFLAGS="$CFLAGS -pipe -ffast-math -Wall"
  76.  CPPFLAGS="$CPPFLAGS -I../common"
  77.  
  78.  
  79. @@ -4784,7 +4784,7 @@
  80.  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-unused-parameter" >&5
  81.  $as_echo_n "checking whether $CC supports -Wno-unused-parameter... " >&6; }
  82.  OLD_CFLAGS="$CFLAGS"
  83. -CFLAGS="$CFLAGS -Wno-unused-parameter"
  84. +#CFLAGS="$CFLAGS -Wno-unused-parameter"
  85.  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  86.  /* end confdefs.h.  */
  87.  int foo;
  88. @@ -4854,8 +4854,8 @@
  89.  
  90.  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-pointer-sign" >&5
  91.  $as_echo_n "checking whether $CC supports -Wno-pointer-sign... " >&6; }
  92. -OLD_CFLAGS="$CFLAGS"
  93. -CFLAGS="$CFLAGS -Wno-pointer-sign"
  94. +#OLD_CFLAGS="$CFLAGS"
  95. +#CFLAGS="$CFLAGS -Wno-pointer-sign"
  96.  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  97.  /* end confdefs.h.  */
  98.  int foo;
  99. @@ -4868,7 +4868,7 @@
  100.  $as_echo_n "checking whether $CC can actually use -Wno-pointer-sign... " >&6; }
  101.  		# This option causes warnings in C++ mode
  102.  		# Note: -Werror must be before -Wno-pointer-sign, otherwise it does not do anything
  103. -		CFLAGS="$OLD_CFLAGS -Werror -Wno-pointer-sign"
  104. +#		CFLAGS="$OLD_CFLAGS -Werror -Wno-pointer-sign"
  105.  		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  106.  /* end confdefs.h.  */
  107.  int foo;
  108. @@ -4877,13 +4877,13 @@
  109.  
  110.  				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  111.  $as_echo "yes" >&6; }
  112. -				CFLAGS="$OLD_CFLAGS -Wno-pointer-sign"
  113. +#				CFLAGS="$OLD_CFLAGS -Wno-pointer-sign"
  114.  
  115.  else
  116.  
  117.  				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  118.  $as_echo "no" >&6; }
  119. -				CFLAGS="$OLD_CFLAGS"
  120. +#				CFLAGS="$OLD_CFLAGS"
  121.  
  122.  
  123.  fi
  124. @@ -4893,7 +4893,7 @@
  125.  
  126.  		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  127.  $as_echo "no" >&6; }
  128. -		CFLAGS="$OLD_CFLAGS"
  129. +#		CFLAGS="$OLD_CFLAGS"
  130.  
  131.  
  132.  fi
  133. @@ -5112,7 +5112,7 @@
  134.  		CFLAGS="$CFLAGS -Wno-unused -Wno-parentheses"
  135.  		;;
  136.  	"yes")
  137. -		CFLAGS="$CFLAGS -g -DDEBUG"
  138. +		CFLAGS="$CFLAGS -g -DDEBUG -Wconversion"
  139.  		;;
  140.  	"gdb")
  141.  		CFLAGS="$CFLAGS -ggdb -DDEBUG"
  142. @@ -7202,3 +7202,4 @@
  143.  $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
  144.  fi
  145.  
  146. +echo "Configure finish, CFLAG= $CFLAGS "
  147. \ No newline at end of file
  148. Index: src/char/char.c
  149. --- src/char/char.c Base (BASE)
  150. +++ src/char/char.c Locally Modified (Based On LOCAL)
  151. @@ -232,13 +232,13 @@
  152.      if (login_fd > 0 && !session[login_fd]->flag.eof) {
  153.          WFIFOHEAD(login_fd,6);
  154.          WFIFOW(login_fd,0) = 0x272b;
  155. -        WFIFOL(login_fd,2) = account_id;
  156. +        WFIFOL(login_fd,2) = (uint32) account_id;
  157.          WFIFOSET(login_fd,6);
  158.      }
  159.  
  160.  }
  161.  
  162. -void set_char_online(int map_id, int char_id, int account_id)
  163. +void set_char_online(short map_id, uint32 char_id, uint32 account_id)
  164.  {
  165.      struct online_char_data *character;
  166.      struct mmo_charstatus *cp;
  167. @@ -281,7 +281,7 @@
  168.      }
  169.  }
  170.  
  171. -void set_char_offline(int char_id, int account_id)
  172. +void set_char_offline(uint32 char_id, uint32 account_id)
  173.  {
  174.      struct online_char_data *character;
  175.  
  176. Index: src/char/inter.c
  177. --- src/char/inter.c Base (BASE)
  178. +++ src/char/inter.c Locally Modified (Based On LOCAL)
  179. @@ -1148,8 +1148,8 @@
  180.      WFIFOW(fd, 0) = 0x3806;
  181.      WFIFOL(fd, 2) = account_id;
  182.      WFIFOL(fd, 6) = char_id;
  183. -    WFIFOB(fd,10) = type;
  184. -    WFIFOB(fd,11) = flag;
  185. +    WFIFOB(fd,10) =(uint8) type;
  186. +    WFIFOB(fd,11) =(uint8) flag;
  187.      memcpy(WFIFOP(fd, 12), name, NAME_LENGTH);
  188.      WFIFOSET(fd, NAME_LENGTH+13);
  189.  }
  190. Index: src/common/core.c
  191. --- src/common/core.c Base (BASE)
  192. +++ src/common/core.c Locally Modified (Based On LOCAL)
  193. @@ -181,20 +181,22 @@
  194.          const char *postfix = "/"EXPAND_AND_QUOTE(SVNNODEPATH)")"; // there should exist only 1 entry like this
  195.          size_t prefix_len = strlen(prefix);
  196.          size_t postfix_len = strlen(postfix);
  197. -        size_t i,j,len;
  198. +        size_t i,j, slen;
  199. +        long int len;
  200.          char *buffer;
  201.  
  202.          // read file to buffer
  203.          fseek(fp, 0, SEEK_END);
  204.          len = ftell(fp);
  205. -        buffer = (char *)aMalloc(len + 1);
  206. +        slen = sizeof(len);
  207. +        buffer = (char *)aMalloc(slen + 1);
  208.          fseek(fp, 0, SEEK_SET);
  209. -        len = fread(buffer, 1, len, fp);
  210. -        buffer[len] = '\0';
  211. +        slen = fread(buffer, 1, slen, fp);
  212. +        buffer[slen] = '\0';
  213.          fclose(fp);
  214.  
  215.          // parse buffer
  216. -        for (i = prefix_len + 1; i + postfix_len <= len; ++i) {
  217. +        for (i = prefix_len + 1; i + postfix_len <= slen; ++i) {
  218.              if (buffer[i] != postfix[0] || memcmp(buffer + i, postfix, postfix_len) != 0)
  219.                  continue; // postfix missmatch
  220.              for (j = i; j > 0; --j) {
  221. Index: src/common/grfio.c
  222. --- src/common/grfio.c Base (BASE)
  223. +++ src/common/grfio.c Locally Modified (Based On LOCAL)
  224. @@ -198,7 +198,7 @@
  225.      scycle = 7;
  226.  
  227.      // so decrypt/de-shuffle periodically
  228. -    j = -1; // 0, adjusted to fit the ++j step
  229. +    j =(size_t) -1; // 0, adjusted to fit the ++j step
  230.      for (i = 20; i < nblocks; ++i) {
  231.          if (i % dcycle == 0) {
  232.              // decrypt block
  233. @@ -414,7 +414,7 @@
  234.      FILELIST *entry = filelist_find(fname);
  235.      if (entry == NULL || entry->gentry <= 0) { // LocalFileCheck
  236.          char lfname[256];
  237. -        int declen;
  238. +        unsigned int declen;
  239.          FILE *in;
  240.          grfio_localpath_create(lfname, sizeof(lfname), (entry && entry->fnd) ? entry->fnd : fname);
  241.  
  242. @@ -443,7 +443,7 @@
  243.          char *grfname = gentry_table[entry->gentry - 1];
  244.          FILE *in = fopen(grfname, "rb");
  245.          if (in != NULL) {
  246. -            int fsize = entry->srclen_aligned;
  247. +            unsigned int fsize = entry->srclen_aligned;
  248.              unsigned char *buf = (unsigned char *)aMalloc(fsize);
  249.              fseek(in, entry->srcpos, 0);
  250.              if (fread(buf, 1, fsize, in) != fsize) ShowError("An error occured in fread in grfio_reads, grfname=%s\n",grfname);
  251. @@ -513,7 +513,8 @@
  252.  /// @param gentry index of the grf file name in the gentry_table
  253.  static int grfio_entryread(const char *grfname, int gentry)
  254.  {
  255. -    long grf_size,list_size;
  256. +    long grf_size;
  257. +	unsigned int list_size;
  258.      unsigned char grf_header[0x2e];
  259.      int entry,entrys,ofs,grf_version;
  260.      unsigned char *grf_filelist;
  261. @@ -578,7 +579,7 @@
  262.  #ifdef  GRFIO_LOCAL
  263.                  aentry.gentry         = -(gentry+1);    // As Flag for making it a negative number carrying out the first time LocalFileCheck
  264.  #else
  265. -                aentry.gentry         = gentry+1;       // With no first time LocalFileCheck
  266. +                aentry.gentry         =(char) gentry+1;       // With no first time LocalFileCheck
  267.  #endif
  268.                  filelist_modify(&aentry);
  269.              }
  270. @@ -630,13 +631,13 @@
  271.                  aentry.srclen_aligned = getlong(grf_filelist+ofs2+4);
  272.                  aentry.declen         = getlong(grf_filelist+ofs2+8);
  273.                  aentry.srcpos         = getlong(grf_filelist+ofs2+13)+0x2e;
  274. -                aentry.type           = type;
  275. +                aentry.type           =(char) type;
  276.                  safestrncpy(aentry.fn, fname, sizeof(aentry.fn));
  277.                  aentry.fnd            = NULL;
  278.  #ifdef  GRFIO_LOCAL
  279.                  aentry.gentry         = -(gentry+1);    // As Flag for making it a negative number carrying out the first time LocalFileCheck
  280.  #else
  281. -                aentry.gentry         = gentry+1;       // With no first time LocalFileCheck
  282. +                aentry.gentry         =(char) gentry+1;       // With no first time LocalFileCheck
  283.  #endif
  284.                  filelist_modify(&aentry);
  285.              }
  286. Index: src/common/malloc.c
  287. --- src/common/malloc.c Base (BASE)
  288. +++ src/common/malloc.c Locally Modified (Based On LOCAL)
  289. @@ -249,7 +249,7 @@
  290.              p->unit_head.block = NULL;
  291.              p->unit_head.size  = 0;
  292.              p->unit_head.file  = file;
  293. -            p->unit_head.line  = line;
  294. +            p->unit_head.line  =(unsigned short) line;
  295.              p->prev = NULL;
  296.              if (unit_head_large_first == NULL)
  297.                  p->next = NULL;
  298. @@ -318,7 +318,7 @@
  299.  
  300.      head->block = block;
  301.      head->file  = file;
  302. -    head->line  = line;
  303. +    head->line  = (short) line;
  304.      head->size  = (unsigned short)size;
  305.      *(long *)((char *)head + sizeof(struct unit_head) - sizeof(long) + size) = 0xdeadbeaf;
  306.      return (char *)head + sizeof(struct unit_head) - sizeof(long);
  307. @@ -415,7 +415,7 @@
  308.  #ifdef DEBUG_MEMMGR
  309.              memset(ptr, 0xfd, block->unit_size - sizeof(struct unit_head) + sizeof(long));
  310.              head->file = file;
  311. -            head->line = line;
  312. +            head->line = (short) line;
  313.  #endif
  314.              memmgr_assert(block->unit_used > 0);
  315.              if (--block->unit_used == 0) {
  316. Index: src/common/mapindex.c
  317. --- src/common/mapindex.c Base (BASE)
  318. +++ src/common/mapindex.c Locally Modified (Based On LOCAL)
  319. @@ -117,7 +117,7 @@
  320.  unsigned short mapindex_name2id(const char *name)
  321.  {
  322.      //TODO: Perhaps use a db to speed this up? [Skotlex]
  323. -    int i;
  324. +    unsigned short i;
  325.  
  326.      char map_name[MAP_NAME_LENGTH];
  327.      mapindex_getmapname(name, map_name);
  328. Index: src/common/mmo.h
  329. --- src/common/mmo.h Base (BASE)
  330. +++ src/common/mmo.h Locally Modified (Based On LOCAL)
  331. @@ -283,12 +283,7 @@
  332.      unsigned int exp;
  333.      short rename_flag;
  334.      short vaporize; //albator
  335. -    int str ;
  336. -    int agi ;
  337. -    int vit ;
  338. -    int int_ ;
  339. -    int dex ;
  340. -    int luk ;
  341. +    unsigned short str, agi, vit, int_, dex, luk;
  342.  };
  343.  
  344.  struct s_mercenary {
  345. @@ -305,8 +300,9 @@
  346.      int char_id;
  347.      short class_;
  348.      int mode;
  349. -    int hp, sp, max_hp, max_sp, str, agi, vit, int_, dex, luk;
  350. -    int life_time;
  351. +    unsigned int hp, sp, max_hp, max_sp;
  352. +    unsigned short str, agi, vit, int_, dex, luk;
  353. +    unsigned int life_time;
  354.  };
  355.  
  356.  struct s_friend {
  357. Index: src/common/socket.c
  358. --- src/common/socket.c Base (BASE)
  359. +++ src/common/socket.c Locally Modified (Based On LOCAL)
  360. @@ -18,6 +18,9 @@
  361.  #include "../common/winapi.h"
  362.  #else
  363.  #include <errno.h>
  364. +#ifdef __linux__
  365. +        #include <sys/select.h>
  366. +#endif
  367.  #include <sys/socket.h>
  368.  #include <netinet/in.h>
  369.  #include <netinet/tcp.h>
  370. Index: src/common/socket.h
  371. --- src/common/socket.h Base (BASE)
  372. +++ src/common/socket.h Locally Modified (Based On LOCAL)
  373. @@ -73,9 +73,9 @@
  374.  
  375.  struct socket_data {
  376.      struct {
  377. -        unsigned char eof : 1;
  378. -        unsigned char server : 1;
  379. -        unsigned char ping : 2;
  380. +        int eof : 1;
  381. +        int server : 1;
  382. +        int ping : 2;
  383.      } flag;
  384.  
  385.      uint32 client_addr; // remote client address
  386. Index: src/login/account_sql.c
  387. --- src/login/account_sql.c Base (BASE)
  388. +++ src/login/account_sql.c Locally Modified (Based On LOCAL)
  389. @@ -279,7 +279,7 @@
  390.          else if (strcmpi(key, "codepage") == 0)
  391.              safestrncpy(db->codepage, value, sizeof(db->codepage));
  392.          else if (strcmpi(key, "case_sensitive") == 0)
  393. -            db->case_sensitive = config_switch(value);
  394. +            db->case_sensitive =(bool) config_switch(value);
  395.          else if (strcmpi(key, "account_db") == 0)
  396.              safestrncpy(db->account_db, value, sizeof(db->account_db));
  397.          else if (strcmpi(key, "accreg_db") == 0)
  398. Index: src/map/atcommand.c
  399. --- src/map/atcommand.c Base (BASE)
  400. +++ src/map/atcommand.c Locally Modified (Based On LOCAL)
  401. @@ -271,7 +271,7 @@
  402.              len=SHRT_MAX-4; // maximum length
  403.              off=4;
  404.          }
  405. -        WFIFOHEAD(fd, len);
  406. +        WFIFOHEAD(fd, sizeof(len));
  407.          WFIFOW(fd,0)=TOW(type);
  408.  
  409.          // parse packet contents
  410. @@ -415,7 +415,7 @@
  411.                  // terminate the string
  412.                  if (off < end) {
  413.                      // fill the rest with 0's
  414. -                    memset(WFIFOP(fd,off),0,end-off);
  415. +                    memset(WFIFOP(fd,off),0,sizeof(end)-sizeof(off));
  416.                      off=end;
  417.                  }
  418.              } else {
  419. @@ -429,12 +429,12 @@
  420.          if (packet_db[sd->packet_ver][type].len == -1) {
  421.              // send dynamic packet
  422.              WFIFOW(fd,2)=TOW(off);
  423. -            WFIFOSET(fd,off);
  424. +            WFIFOSET(fd,sizeof(off));
  425.          } else {
  426.              // send static packet
  427.              if (off < len)
  428. -                memset(WFIFOP(fd,off),0,len-off);
  429. -            WFIFOSET(fd,len);
  430. +                memset(WFIFOP(fd,off),0,sizeof(len)-sizeof(off));
  431. +            WFIFOSET(fd,sizeof(len));
  432.          }
  433.      } else {
  434.          clif_displaymessage(fd, msg_txt(259)); // Invalid packet
  435. @@ -736,7 +736,7 @@
  436.      if (sscanf(message, "%199[^\n]", match_text) < 1)
  437.          strcpy(match_text, "");
  438.      for (j = 0; match_text[j]; j++)
  439. -        match_text[j] = TOLOWER(match_text[j]);
  440. +        match_text[j] =(char) TOLOWER(match_text[j]);
  441.  
  442.      count = 0;
  443.      level = pc_get_group_level(sd);
  444. @@ -750,7 +750,7 @@
  445.          if (match_text[0]) {
  446.              memcpy(player_name, pl_sd->status.name, NAME_LENGTH);
  447.              for (j = 0; player_name[j]; j++)
  448. -                player_name[j] = TOLOWER(player_name[j]);
  449. +                player_name[j] =(char) TOLOWER(player_name[j]);
  450.              // search with no case sensitive
  451.              if (strstr(player_name, match_text) == NULL)
  452.                  continue;
  453. @@ -845,19 +845,19 @@
  454.   *------------------------------------------*/
  455.  ACMD_FUNC(speed)
  456.  {
  457. -    int speed;
  458. +    unsigned short speed;
  459.  
  460.      nullpo_retr(-1, sd);
  461.  
  462.      memset(atcmd_output, '\0', sizeof(atcmd_output));
  463.  
  464. -    if (!message || !*message || sscanf(message, "%d", &speed) < 1) {
  465. +    if (!message || !*message || sscanf(message, "%hui", &speed) < 1) {
  466.          sprintf(atcmd_output, msg_txt(918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>).
  467.          clif_displaymessage(fd, atcmd_output);
  468.          return -1;
  469.      }
  470.  
  471. -    sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);
  472. +    sd->base_status.speed =(unsigned short) cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);
  473.      status_calc_bl(&sd->bl, SCB_SPEED);
  474.      clif_displaymessage(fd, msg_txt(8)); // Speed changed.
  475.      return 0;
  476. @@ -920,10 +920,11 @@
  477.   *------------------------------------------*/
  478.  ACMD_FUNC(option)
  479.  {
  480. -    int param1 = 0, param2 = 0, param3 = 0;
  481. +    unsigned short param1 = 0, param2 = 0;
  482. +	unsigned int param3 = 0;
  483.      nullpo_retr(-1, sd);
  484.  
  485. -    if (!message || !*message || sscanf(message, "%d %d %d", &param1, &param2, &param3) < 1 || param1 < 0 || param2 < 0 || param3 < 0) {
  486. +    if (!message || !*message || sscanf(message, "%hu %hu %u", &param1, &param2, &param3) < 1 || param1 < 0 || param2 < 0 || param3 < 0) {
  487.          // failed to match the parameters so inform the user of the options
  488.          const char *text = NULL;
  489.  
  490. @@ -1092,9 +1093,9 @@
  491.  
  492.          sscanf(message, "%199[^\n]", atcmd_output);
  493.          if (strstr(command, "l") != NULL)
  494. -            clif_broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP);
  495. +            clif_broadcast(&sd->bl, atcmd_output,(int)strlen(atcmd_output) + 1, 0, ALL_SAMEMAP);
  496.          else
  497. -            intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? 0x10 : 0);
  498. +            intif_broadcast(atcmd_output,(int)strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? 0x10 : 0);
  499.      } else {
  500.          if (!message || !*message || (sscanf(message, "%lx %199[^\n]", &color, atcmd_output) < 2)) {
  501.              clif_displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic <color> <message>).
  502. @@ -1105,7 +1106,7 @@
  503.              clif_displaymessage(fd, msg_txt(982)); // Invalid color.
  504.              return -1;
  505.          }
  506. -        intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0);
  507. +        intif_broadcast2(atcmd_output, (int)strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0);
  508.      }
  509.      return 0;
  510.  }
  511. @@ -1174,7 +1175,8 @@
  512.  ACMD_FUNC(item)
  513.  {
  514.      char item_name[100];
  515. -    int number = 0, item_id, flag = 0;
  516. +    int number = 0, flag = 0;
  517. +	short item_id;
  518.      struct item item_tmp;
  519.      struct item_data *item_data;
  520.      int get_count, i;
  521. @@ -1210,7 +1212,7 @@
  522.          if (!pet_create_egg(sd, item_id)) {
  523.              memset(&item_tmp, 0, sizeof(item_tmp));
  524.              item_tmp.nameid = item_id;
  525. -            item_tmp.identify = 1;
  526. +            item_tmp.identify = (short) 1;
  527.  
  528.              if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
  529.                  clif_additem(sd, 0, 0, flag);
  530. @@ -1230,18 +1232,19 @@
  531.      struct item item_tmp;
  532.      struct item_data *item_data;
  533.      char item_name[100];
  534. -    int item_id, number = 0;
  535. -    int identify = 0, refine = 0, attr = 0;
  536. -    int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  537. +    int number = 0;
  538. +    short c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  539.      int flag = 0;
  540.      int loop, get_count, i;
  541. +    short item_id;
  542. +    char identify = 0, refine = 0, attr=0;
  543.      nullpo_retr(-1, sd);
  544.  
  545.      memset(item_name, '\0', sizeof(item_name));
  546.  
  547.      if (!message || !*message || (
  548. -            sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 &&
  549. -            sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
  550. +            sscanf(message, "\"%99[^\"]\" %d %c %c %c %hd %hd %hd %hd", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 &&
  551. +            sscanf(message, "%99s %d %c %c %c %hd %hd %hd %hd", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
  552.          )) {
  553.          clif_displaymessage(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity>
  554.          clif_displaymessage(fd, msg_txt(985)); //   <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>).
  555. @@ -1273,7 +1276,8 @@
  556.                  refine = MAX_REFINE;
  557.          } else {
  558.              identify = 1;
  559. -            refine = attr = 0;
  560. +            refine = 0;
  561. +			attr = 0;
  562.          }
  563.          for (i = 0; i < loop; i++) {
  564.              memset(&item_tmp, 0, sizeof(item_tmp));
  565. @@ -1322,10 +1326,12 @@
  566.   *------------------------------------------*/
  567.  ACMD_FUNC(baselevelup)
  568.  {
  569. -    int level=0, i=0, status_point=0;
  570. +    unsigned int level=0;
  571. +    int i=0, status_point=0;
  572.      nullpo_retr(-1, sd);
  573. -    level = atoi(message);
  574.  
  575. +    sscanf(message, "%ud", &level);
  576. +
  577.      if (!message || !*message || !level) {
  578.          clif_displaymessage(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>).
  579.          return -1;
  580. @@ -1336,7 +1342,7 @@
  581.              clif_displaymessage(fd, msg_txt(47)); // Base level can't go any higher.
  582.              return -1;
  583.          } // End Addition
  584. -        if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow
  585. +        if (level > pc_maxbaselv(sd) || level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow
  586.              level = pc_maxbaselv(sd) - sd->status.base_level;
  587.          for (i = 0; i < level; i++)
  588.              status_point += pc_gets_status_point(sd->status.base_level + i);
  589. @@ -1352,7 +1358,7 @@
  590.              return -1;
  591.          }
  592.          level*=-1;
  593. -        if ((unsigned int)level >= sd->status.base_level)
  594. +        if (level >= sd->status.base_level)
  595.              level = sd->status.base_level-1;
  596.          for (i = 0; i > -level; i--)
  597.              status_point += pc_gets_status_point(sd->status.base_level + i - 1);
  598. @@ -1362,7 +1368,7 @@
  599.              sd->status.status_point = 0;
  600.          else
  601.              sd->status.status_point -= status_point;
  602. -        sd->status.base_level -= (unsigned int)level;
  603. +        sd->status.base_level -= level;
  604.          clif_displaymessage(fd, msg_txt(22)); // Base level lowered.
  605.      }
  606.      sd->status.base_exp = 0;
  607. @@ -1826,7 +1832,7 @@
  608.      // get possible name of the city
  609.      map_name[MAP_NAME_LENGTH-1] = '\0';
  610.      for (i = 0; map_name[i]; i++)
  611. -        map_name[i] = TOLOWER(map_name[i]);
  612. +        map_name[i] = (char) TOLOWER(map_name[i]);
  613.      // try to identify the map name
  614.      if (strncmp(map_name, "prontera", 3) == 0) {
  615.          town = 0;
  616. @@ -2083,13 +2089,14 @@
  617.   *------------------------------------------*/
  618.  ACMD_FUNC(refine)
  619.  {
  620. -    int i,j, position = 0, refine = 0, current_position, final_refine;
  621. +    int i,j, position = 0, current_position;
  622. +	char final_refine, refine = 0;
  623.      int count;
  624.      nullpo_retr(-1, sd);
  625.  
  626.      memset(atcmd_output, '\0', sizeof(atcmd_output));
  627.  
  628. -    if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) {
  629. +    if (!message || !*message || sscanf(message, "%d %c", &position, &refine) < 2) {
  630.          clif_displaymessage(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>).
  631.          sprintf(atcmd_output, msg_txt(997), EQP_HEAD_LOW); // %d: Lower Headgear
  632.          clif_displaymessage(fd, atcmd_output);
  633. @@ -2162,7 +2169,8 @@
  634.  ACMD_FUNC(produce)
  635.  {
  636.      char item_name[100];
  637. -    int item_id, attribute = 0, star = 0;
  638. +	short attribute = 0, item_id=0;
  639. +    int star = 0;
  640.      int flag = 0;
  641.      struct item_data *item_data;
  642.      struct item tmp_item;
  643. @@ -2172,8 +2180,8 @@
  644.      memset(item_name, '\0', sizeof(item_name));
  645.  
  646.      if (!message || !*message || (
  647. -            sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 &&
  648. -            sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1
  649. +            sscanf(message, "\"%99[^\"]\" %hi %d", item_name, &attribute, &star) < 1 &&
  650. +            sscanf(message, "%99s %hi %d", item_name, &attribute, &star) < 1
  651.          )) {
  652.          clif_displaymessage(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>).
  653.          return -1;
  654. @@ -2197,8 +2205,7 @@
  655.          tmp_item.amount = 1;
  656.          tmp_item.identify = 1;
  657.          tmp_item.card[0] = CARD0_FORGE;
  658. -        tmp_item.card[1] = item_data->type==IT_WEAPON?
  659. -                           ((star*5) << 8) + attribute:0;
  660. +        tmp_item.card[1] = ((short) item_data->type==IT_WEAPON?((star*5) << 8) + attribute:0);
  661.          tmp_item.card[2] = GetWord(sd->status.char_id, 0);
  662.          tmp_item.card[3] = GetWord(sd->status.char_id, 1);
  663.          clif_produceeffect(sd, 0, item_id);
  664. @@ -2404,7 +2411,8 @@
  665.   *------------------------------------------*/
  666.  ACMD_FUNC(param)
  667.  {
  668. -    int i, value = 0, new_value, max;
  669. +    int i;
  670. +    short value = 0, new_value, max;
  671.      const char *param[] = { "str", "agi", "vit", "int", "dex", "luk" };
  672.      short *status[6];
  673.      //we don't use direct initialization because it isn't part of the c standard.
  674. @@ -2412,7 +2420,7 @@
  675.  
  676.      memset(atcmd_output, '\0', sizeof(atcmd_output));
  677.  
  678. -    if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
  679. +    if (!message || !*message || sscanf(message, "%hi", &value) < 1 || value == 0) {
  680.          clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
  681.          return -1;
  682.      }
  683. @@ -2466,8 +2474,8 @@
  684.   *------------------------------------------*/
  685.  ACMD_FUNC(stat_all)
  686.  {
  687. -    int index, count, value, max, new_value;
  688. -    short *status[6];
  689. +    int index, count;
  690. +    short *status[6], new_value, value, max;
  691.      //we don't use direct initialization because it isn't part of the c standard.
  692.      nullpo_retr(-1, sd);
  693.  
  694. @@ -2478,19 +2486,17 @@
  695.      status[4] = &sd->status.dex;
  696.      status[5] = &sd->status.luk;
  697.  
  698. -    if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
  699. +    if (!message || !*message || sscanf(message, "%hi", &value) < 1) {
  700.          value = pc_maxparameter(sd);
  701. -        max = pc_maxparameter(sd);
  702. -    } else {
  703. +    }
  704. +
  705.          if (battle_config.atcommand_max_stat_bypass)
  706.              max = SHRT_MAX;
  707.          else
  708.              max = pc_maxparameter(sd);
  709. -    }
  710.  
  711.      count = 0;
  712.      for (index = 0; index < ARRAYLENGTH(status); index++) {
  713. -
  714.          if (value > 0 && *status[index] > max - value)
  715.              new_value = max;
  716.          else if (value < 0 && *status[index] <= -value)
  717. @@ -2621,11 +2627,11 @@
  718.   *------------------------------------------*/
  719.  ACMD_FUNC(petfriendly)
  720.  {
  721. -    int friendly;
  722. +    short friendly;
  723.      struct pet_data *pd;
  724.      nullpo_retr(-1, sd);
  725.  
  726. -    if (!message || !*message || (friendly = atoi(message)) < 0) {
  727. +    if (!message || !*message || sscanf(message, "%hi", &friendly) < 1) {
  728.          clif_displaymessage(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>).
  729.          return -1;
  730.      }
  731. @@ -2657,11 +2663,11 @@
  732.   *------------------------------------------*/
  733.  ACMD_FUNC(pethungry)
  734.  {
  735. -    int hungry;
  736. +    short hungry;
  737.      struct pet_data *pd;
  738.      nullpo_retr(-1, sd);
  739.  
  740. -    if (!message || !*message || (hungry = atoi(message)) < 0) {
  741. +    if (!message || !*message || sscanf(message, "%hi", &hungry) < 1) {
  742.          clif_displaymessage(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>).
  743.          return -1;
  744.      }
  745. @@ -3214,11 +3220,11 @@
  746.   *------------------------------------------*/
  747.  ACMD_FUNC(spiritball)
  748.  {
  749. -    int max_spiritballs;
  750. -    int number;
  751. +    short max_spiritballs;
  752. +    short number;
  753.      nullpo_retr(-1, sd);
  754.  
  755. -    max_spiritballs = min(ARRAYLENGTH(sd->spirit_timer), 0x7FFF);
  756. +    max_spiritballs = min(ARRAYLENGTH(sd->spirit_timer), SHRT_MAX);
  757.  
  758.      if (!message || !*message || (number = atoi(message)) < 0 || number > max_spiritballs) {
  759.          char msg[CHAT_SIZE_MAX];
  760. @@ -5262,12 +5268,11 @@
  761.  {
  762.      struct map_session_data *pl_sd = NULL;
  763.      struct block_list *bl;
  764. -    int skillnum;
  765. -    int skilllv;
  766. +    short skillnum, skilllv;
  767.      char target[100];
  768.      nullpo_retr(-1, sd);
  769.  
  770. -    if (!message || !*message || sscanf(message, "%d %d %23[^\n]", &skillnum, &skilllv, target) != 3) {
  771. +    if (!message || !*message || sscanf(message, "%hi %hi %23[^\n]", &skillnum, &skilllv, target) != 3) {
  772.          clif_displaymessage(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target>
  773.          return -1;
  774.      }
  775. @@ -5376,7 +5381,8 @@
  776.  // Hand a ring with partners name on it to this char
  777.  void getring(struct map_session_data *sd)
  778.  {
  779. -    int flag, item_id;
  780. +    int flag;
  781. +	short item_id;
  782.      struct item item_tmp;
  783.      item_id = (sd->status.sex) ? WEDDING_RING_M : WEDDING_RING_F;
  784.  
  785. @@ -5384,7 +5390,7 @@
  786.      item_tmp.nameid = item_id;
  787.      item_tmp.identify = 1;
  788.      item_tmp.card[0] = 255;
  789. -    item_tmp.card[2] = sd->status.partner_id;
  790. +    item_tmp.card[2] = sd->status.partner_id & 0xF;
  791.      item_tmp.card[3] = sd->status.partner_id >> 16;
  792.  
  793.      if ((flag = pc_additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) {
  794. @@ -7589,7 +7595,7 @@
  795.   *------------------------------------------*/
  796.  ACMD_FUNC(invite)
  797.  {
  798. -    unsigned int did = sd->duel_group;
  799. +    int did = sd->duel_group;
  800.      struct map_session_data *target_sd = map_nick2sd((char *)message);
  801.  
  802.      if (did <= 0)    {
  803. @@ -8284,18 +8290,20 @@
  804.   *------------------------------------------*/
  805.  ACMD_FUNC(font)
  806.  {
  807. -    int font_id;
  808. +    unsigned short font_id;
  809.      nullpo_retr(-1,sd);
  810.  
  811. -    font_id = atoi(message);
  812. +	if (!message || !*message || (sscanf(message, "%hui", &font_id) < 1 )) {
  813. +            clif_displaymessage(fd, msg_txt(1357)); // Use @font <1-9> to change your message font.
  814. +            clif_displaymessage(fd, msg_txt(1358)); // Use 0 or no parameter to return to normal font.
  815. +			return -1;
  816. +    }
  817. +
  818.      if (font_id == 0) {
  819.          if (sd->user_font) {
  820.              sd->user_font = 0;
  821.              clif_displaymessage(fd, msg_txt(1356)); // Returning to normal font.
  822.              clif_font(sd);
  823. -        } else {
  824. -            clif_displaymessage(fd, msg_txt(1357)); // Use @font <1-9> to change your message font.
  825. -            clif_displaymessage(fd, msg_txt(1358)); // Use 0 or no parameter to return to normal font.
  826.          }
  827.      } else if (font_id < 0 || font_id > 9)
  828.          clif_displaymessage(fd, msg_txt(1359)); // Invalid font. Use a value from 0 to 9.
  829. Index: src/map/duel.c
  830. --- src/map/duel.c Base (BASE)
  831. +++ src/map/duel.c Locally Modified (Based On LOCAL)
  832. @@ -52,7 +52,7 @@
  833.      if (sd->duel_group != ssd->duel_group) return 0;
  834.  
  835.      sprintf(output, "      %d. %s", ++(*p), sd->status.name);
  836. -    clif_disp_onlyself(ssd, output, strlen(output));
  837. +    clif_disp_onlyself(ssd, output,(int) strlen(output));
  838.      return 1;
  839.  }
  840.  
  841. @@ -73,7 +73,7 @@
  842.                  duel_list[did].members_count,
  843.                  duel_list[did].members_count + duel_list[did].invites_count);
  844.  
  845. -    clif_disp_onlyself(sd, output, strlen(output));
  846. +    clif_disp_onlyself(sd, output,(int) strlen(output));
  847.      map_foreachpc(duel_showinfo_sub, sd, &p);
  848.  }
  849.  
  850. @@ -92,27 +92,27 @@
  851.      duel_list[i].max_players_limit = maxpl;
  852.  
  853.      strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --"
  854. -    clif_disp_onlyself(sd, output, strlen(output));
  855. +    clif_disp_onlyself(sd, output, (int) strlen(output));
  856.  
  857.      clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
  858.      //clif_misceffect2(&sd->bl, 159);
  859.      return i;
  860.  }
  861.  
  862. -void duel_invite(const unsigned int did, struct map_session_data *sd, struct map_session_data *target_sd)
  863. +void duel_invite(const int did, struct map_session_data *sd, struct map_session_data *target_sd)
  864.  {
  865.      char output[256];
  866.  
  867.      // " -- Player %s invites %s to duel --"
  868.      sprintf(output, msg_txt(373), sd->status.name, target_sd->status.name);
  869. -    clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
  870. +    clif_disp_message(&sd->bl, output,(int) strlen(output), DUEL_WOS);
  871.  
  872.      target_sd->duel_invite = did;
  873.      duel_list[did].invites_count++;
  874.  
  875.      // "Blue -- Player %s invites you to PVP duel (@accept/@reject) --"
  876.      sprintf(output, msg_txt(374), sd->status.name);
  877. -    clif_broadcast((struct block_list *)target_sd, output, strlen(output)+1, 0x10, SELF);
  878. +    clif_broadcast((struct block_list *)target_sd, output,(int) strlen(output)+1, 0x10, SELF);
  879.  }
  880.  
  881.  static int duel_leave_sub(struct map_session_data *sd, va_list va)
  882. @@ -129,7 +129,7 @@
  883.  
  884.      // " <- Player %s has left duel --"
  885.      sprintf(output, msg_txt(375), sd->status.name);
  886. -    clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
  887. +    clif_disp_message(&sd->bl, output,(int) strlen(output), DUEL_WOS);
  888.  
  889.      duel_list[did].members_count--;
  890.  
  891. @@ -154,7 +154,7 @@
  892.  
  893.      // " -> Player %s has accepted duel --"
  894.      sprintf(output, msg_txt(376), sd->status.name);
  895. -    clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
  896. +    clif_disp_message(&sd->bl, output,(int) strlen(output), DUEL_WOS);
  897.  
  898.      clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
  899.      //clif_misceffect2(&sd->bl, 159);
  900. @@ -166,7 +166,7 @@
  901.  
  902.      // " -- Player %s has rejected duel --"
  903.      sprintf(output, msg_txt(377), sd->status.name);
  904. -    clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
  905. +    clif_disp_message(&sd->bl, output,(int) strlen(output), DUEL_WOS);
  906.  
  907.      duel_list[did].invites_count--;
  908.      sd->duel_invite = 0;
  909. Index: src/map/duel.h
  910. --- src/map/duel.h Base (BASE)
  911. +++ src/map/duel.h Locally Modified (Based On LOCAL)
  912. @@ -7,7 +7,7 @@
  913.  struct duel {
  914.      int members_count;
  915.      int invites_count;
  916. -    int max_players_limit;
  917. +    unsigned int max_players_limit;
  918.  };
  919.  
  920.  #define MAX_DUEL 1024
  921. @@ -16,7 +16,7 @@
  922.  
  923.  //Duel functions // [LuzZza]
  924.  int duel_create(struct map_session_data *sd, const unsigned int maxpl);
  925. -void duel_invite(const unsigned int did, struct map_session_data *sd, struct map_session_data *target_sd);
  926. +void duel_invite(const int did, struct map_session_data *sd, struct map_session_data *target_sd);
  927.  void duel_accept(const unsigned int did, struct map_session_data *sd);
  928.  void duel_reject(const unsigned int did, struct map_session_data *sd);
  929.  void duel_leave(const unsigned int did, struct map_session_data *sd);
  930. Index: src/map/elemental.c
  931. --- src/map/elemental.c Base (BASE)
  932. +++ src/map/elemental.c Locally Modified (Based On LOCAL)
  933. @@ -59,7 +59,7 @@
  934.      return &elemental_db[i].vd;
  935.  }
  936.  
  937. -int elemental_create(struct map_session_data *sd, int class_, unsigned int lifetime)
  938. +int elemental_create(struct map_session_data *sd, short class_, unsigned int lifetime)
  939.  {
  940.      struct s_elemental ele;
  941.      struct s_elemental_db *db;
  942. @@ -86,7 +86,7 @@
  943.      return 1;
  944.  }
  945.  
  946. -int elemental_get_lifetime(struct elemental_data *ed)
  947. +unsigned int elemental_get_lifetime(struct elemental_data *ed)
  948.  {
  949.      const struct TimerData *td;
  950.      if (ed == NULL || ed->summon_timer == INVALID_TIMER)
  951. @@ -566,7 +566,8 @@
  952.  static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *sd, unsigned int tick)
  953.  {
  954.      struct block_list *target = NULL;
  955. -    int master_dist, view_range, mode;
  956. +    unsigned int master_dist;
  957. +    int view_range, mode;
  958.  
  959.      nullpo_ret(ed);
  960.      nullpo_ret(sd);
  961. @@ -667,7 +668,8 @@
  962.      FILE *fp;
  963.      char line[1024], *p;
  964.      char *str[26];
  965. -    int i, j = 0, k = 0, ele;
  966. +    int i, j = 0, k = 0;
  967. +    unsigned char ele;
  968.      struct s_elemental_db *db;
  969.      struct status_data *status;
  970.  
  971. @@ -760,7 +762,8 @@
  972.      char *str[4];
  973.      struct s_elemental_db *db;
  974.      int i, j = 0, k = 0, class_;
  975. -    int skillid, skilllv, skillmode;
  976. +    unsigned short skillid, skilllv;
  977. +    short skillmode;
  978.  
  979.      sprintf(line, "%s/%s", db_path, "elemental_skill_db.txt");
  980.      fp = fopen(line, "r");
  981. Index: src/map/elemental.h
  982. --- src/map/elemental.h Base (BASE)
  983. +++ src/map/elemental.h Locally Modified (Based On LOCAL)
  984. @@ -59,7 +59,7 @@
  985.  bool elemental_class(int class_);
  986.  struct view_data *elemental_get_viewdata(int class_);
  987.  
  988. -int elemental_create(struct map_session_data *sd, int class_, unsigned int lifetime);
  989. +int elemental_create(struct map_session_data *sd, short class_, unsigned int lifetime);
  990.  int elemental_data_received(struct s_elemental *ele, bool flag);
  991.  int elemental_save(struct elemental_data *ed);
  992.  
  993. @@ -72,7 +72,7 @@
  994.  int elemental_delete(struct elemental_data *ed, int reply);
  995.  void elemental_summon_stop(struct elemental_data *ed);
  996.  
  997. -int elemental_get_lifetime(struct elemental_data *ed);
  998. +unsigned int elemental_get_lifetime(struct elemental_data *ed);
  999.  
  1000.  int elemental_unlocktarget(struct elemental_data *ed);
  1001.  int elemental_skillnotok(int skillid, struct elemental_data *ed);
  1002. Index: src/map/itemdb.h
  1003. --- src/map/itemdb.h Base (BASE)
  1004. +++ src/map/itemdb.h Locally Modified (Based On LOCAL)
  1005. @@ -85,7 +85,7 @@
  1006.  #define UNKNOWN_ITEM_ID 512
  1007.  
  1008.  struct item_data {
  1009. -    int nameid;
  1010. +    short nameid;
  1011.      char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH];
  1012.  
  1013.      //Do not add stuff between value_buy and view_id (see how getiteminfo works)
  1014. Index: src/map/map.c
  1015. --- src/map/map.c Base (BASE)
  1016. +++ src/map/map.c Locally Modified (Based On LOCAL)
  1017. @@ -176,7 +176,7 @@
  1018.  /*==========================================
  1019.   * server player count (this mapserver only)
  1020.   *------------------------------------------*/
  1021. -int map_usercount(void)
  1022. +unsigned int map_usercount(void)
  1023.  {
  1024.      return pc_db->size(pc_db);
  1025.  }
  1026. @@ -363,9 +363,9 @@
  1027.   * Pass flag as 1 to prevent doing skill_unit_move checks
  1028.   * (which are executed by default on BL_CHAR types)
  1029.   *------------------------------------------*/
  1030. -int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
  1031. +int map_moveblock(struct block_list *bl, short x1, short y1, unsigned int tick)
  1032.  {
  1033. -    int x0 = bl->x, y0 = bl->y;
  1034. +    short x0 = bl->x, y0 = bl->y;
  1035.      struct status_change *sc = NULL;
  1036.      int moveblock = (x0/BLOCK_SIZE != x1/BLOCK_SIZE || y0/BLOCK_SIZE != y1/BLOCK_SIZE);
  1037.  
  1038. @@ -469,9 +469,9 @@
  1039.  /*==========================================
  1040.   * Counts specified number of objects on given cell.
  1041.   *------------------------------------------*/
  1042. -int map_count_oncell(int m, int x, int y, int type)
  1043. +int map_count_oncell(short m, short x, short y, int type)
  1044.  {
  1045. -    int bx,by;
  1046. +    short bx,by;
  1047.      struct block_list *bl;
  1048.      int count = 0;
  1049.  
  1050. @@ -497,7 +497,7 @@
  1051.   * Looks for a skill unit on a given cell
  1052.   * flag&1: runs battle_check_target check based on unit->group->target_flag
  1053.   */
  1054. -struct skill_unit *map_find_skill_unit_oncell(struct block_list *target,int x,int y,int skill_id,struct skill_unit *out_unit, int flag) {
  1055. +struct skill_unit *map_find_skill_unit_oncell(struct block_list *target,short x,short y,short skill_id,struct skill_unit *out_unit, int flag) {
  1056.      int m,bx,by;
  1057.      struct block_list *bl;
  1058.      struct skill_unit *unit;
  1059. @@ -525,7 +525,7 @@
  1060.  /*==========================================
  1061.   * Adapted from foreachinarea for an easier invocation. [Skotlex]
  1062.   *------------------------------------------*/
  1063. -int map_foreachinrange(int (*func)(struct block_list *,va_list), struct block_list *center, int range, int type, ...)
  1064. +int map_foreachinrange(int (*func)(struct block_list *,va_list), struct block_list *center, short range, int type, ...)
  1065.  {
  1066.      int bx, by, m;
  1067.      int returnCount = 0;    //total sum of returned values of func() [Skotlex]
  1068. @@ -590,7 +590,7 @@
  1069.  /*==========================================
  1070.   * Same as foreachinrange, but there must be a shoot-able range between center and target to be counted in. [Skotlex]
  1071.   *------------------------------------------*/
  1072. -int map_foreachinshootrange(int (*func)(struct block_list *,va_list),struct block_list *center, int range, int type,...)
  1073. +int map_foreachinshootrange(int (*func)(struct block_list *,va_list),struct block_list *center, short range, int type,...)
  1074.  {
  1075.      int bx, by, m;
  1076.      int returnCount = 0;    //total sum of returned values of func() [Skotlex]
  1077. @@ -661,7 +661,7 @@
  1078.   * Apply *func with ... arguments for the range.
  1079.   * @type = BL_PC/BL_MOB etc..
  1080.   *------------------------------------------*/
  1081. -int map_foreachinarea(int (*func)(struct block_list *,va_list), int m, int x0, int y0, int x1, int y1, int type, ...)
  1082. +int map_foreachinarea(int (*func)(struct block_list *,va_list), short m, short x0, short y0, short x1, short y1, int type, ...)
  1083.  {
  1084.      int bx, by;
  1085.      int returnCount = 0;    //total sum of returned values of func() [Skotlex]
  1086. @@ -679,8 +679,8 @@
  1087.  
  1088.      x0 = max(x0, 0);
  1089.      y0 = max(y0, 0);
  1090. -    x1 = min(x1, map[ m ].xs - 1);
  1091. -    y1 = min(y1, map[ m ].ys - 1);
  1092. +    x1 =(short) min(x1, map[ m ].xs - 1);
  1093. +    y1 =(short) min(y1, map[ m ].ys - 1);
  1094.      if (type&~BL_MOB)
  1095.          for (by = y0 / BLOCK_SIZE; by <= y1 / BLOCK_SIZE; by++)
  1096.              for (bx = x0 / BLOCK_SIZE; bx <= x1 / BLOCK_SIZE; bx++)
  1097. @@ -715,7 +715,7 @@
  1098.  /*==========================================
  1099.   * Adapted from forcountinarea for an easier invocation. [pakpil]
  1100.   *------------------------------------------*/
  1101. -int map_forcountinrange(int (*func)(struct block_list *,va_list), struct block_list *center, int range, int count, int type, ...)
  1102. +int map_forcountinrange(int (*func)(struct block_list *,va_list), struct block_list *center, short range, int count, int type, ...)
  1103.  {
  1104.      int bx, by, m;
  1105.      int returnCount = 0;    //total sum of returned values of func() [Skotlex]
  1106. @@ -777,7 +777,7 @@
  1107.      bl_list_count = blockcount;
  1108.      return returnCount; //[Skotlex]
  1109.  }
  1110. -int map_forcountinarea(int (*func)(struct block_list *,va_list), int m, int x0, int y0, int x1, int y1, int count, int type, ...)
  1111. +int map_forcountinarea(int (*func)(struct block_list *,va_list), short m, short x0, short y0, short x1, short y1, int count, int type, ...)
  1112.  {
  1113.      int bx, by;
  1114.      int returnCount = 0;    //total sum of returned values of func() [Skotlex]
  1115. @@ -795,8 +795,8 @@
  1116.  
  1117.      x0 = max(x0, 0);
  1118.      y0 = max(y0, 0);
  1119. -    x1 = min(x1, map[ m ].xs - 1);
  1120. -    y1 = min(y1, map[ m ].ys - 1);
  1121. +    x1 =(short) min(x1, map[ m ].xs - 1);
  1122. +    y1 =(short) min(y1, map[ m ].ys - 1);
  1123.  
  1124.      if (type&~BL_MOB)
  1125.          for (by = y0 / BLOCK_SIZE; by <= y1 / BLOCK_SIZE; by++)
  1126. @@ -837,13 +837,13 @@
  1127.   * Move bl and do func* with va_list while moving.
  1128.   * Mouvement is set by dx dy wich are distance in x and y
  1129.   *------------------------------------------*/
  1130. -int map_foreachinmovearea(int (*func)(struct block_list *,va_list), struct block_list *center, int range, int dx, int dy, int type, ...)
  1131. +int map_foreachinmovearea(int (*func)(struct block_list *,va_list), struct block_list *center, short range, short dx, short dy, int type, ...)
  1132.  {
  1133. -    int bx, by, m;
  1134. +    short bx, by, m;
  1135.      int returnCount = 0;  //total sum of returned values of func() [Skotlex]
  1136.      struct block_list *bl;
  1137.      int blockcount = bl_list_count, i;
  1138. -    int x0, x1, y0, y1;
  1139. +    short x0, x1, y0, y1;
  1140.      va_list ap;
  1141.  
  1142.      if (!range) return 0;
  1143. @@ -877,8 +877,8 @@
  1144.  
  1145.          x0 = max(x0, 0);
  1146.          y0 = max(y0, 0);
  1147. -        x1 = min(x1, map[ m ].xs - 1);
  1148. -        y1 = min(y1, map[ m ].ys - 1);
  1149. +        x1 =(short) min(x1, map[ m ].xs - 1);
  1150. +        y1 =(short) min(y1, map[ m ].ys - 1);
  1151.  
  1152.          for (by = y0 / BLOCK_SIZE; by <= y1 / BLOCK_SIZE; by++) {
  1153.              for (bx = x0 / BLOCK_SIZE; bx <= x1 / BLOCK_SIZE; bx++) {
  1154. @@ -905,8 +905,8 @@
  1155.  
  1156.          x0 = max(x0, 0);
  1157.          y0 = max(y0, 0);
  1158. -        x1 = min(x1, map[ m ].xs - 1);
  1159. -        y1 = min(y1, map[ m ].ys - 1);
  1160. +        x1 =(short) min(x1, map[ m ].xs - 1);
  1161. +        y1 =(short) min(y1, map[ m ].ys - 1);
  1162.  
  1163.          for (by = y0 / BLOCK_SIZE; by <= y1 / BLOCK_SIZE; by++) {
  1164.              for (bx = x0 / BLOCK_SIZE; bx <= x1 / BLOCK_SIZE; bx++) {
  1165. @@ -962,7 +962,7 @@
  1166.  //           which only checks the exact single x/y passed to it rather than an
  1167.  //           area radius - may be more useful in some instances)
  1168.  //
  1169. -int map_foreachincell(int (*func)(struct block_list *,va_list), int m, int x, int y, int type, ...)
  1170. +int map_foreachincell(int (*func)(struct block_list *,va_list), short m, short x, short y, int type, ...)
  1171.  {
  1172.      int bx, by;
  1173.      int returnCount = 0;  //total sum of returned values of func() [Skotlex]
  1174. @@ -1005,7 +1005,7 @@
  1175.  /*============================================================
  1176.  * For checking a path between two points (x0, y0) and (x1, y1)
  1177.  *------------------------------------------------------------*/
  1178. -int map_foreachinpath(int (*func)(struct block_list *,va_list),int m,int x0,int y0,int x1,int y1,int range,int length, int type,...)
  1179. +int map_foreachinpath(int (*func)(struct block_list *,va_list),short m,short x0,short y0,short x1,short y1,short range,int length, int type,...)
  1180.  {
  1181.      int returnCount = 0;  //total sum of returned values of func() [Skotlex]
  1182.      //////////////////////////////////////////////////////////////
  1183. @@ -1092,8 +1092,8 @@
  1184.  
  1185.      mx0 = max(mx0, 0);
  1186.      my0 = max(my0, 0);
  1187. -    mx1 = min(mx1, map[ m ].xs - 1);
  1188. -    my1 = min(my1, map[ m ].ys - 1);
  1189. +    mx1 =(short) min(mx1, map[ m ].xs - 1);
  1190. +    my1 =(short) min(my1, map[ m ].ys - 1);
  1191.  
  1192.      range *= range << 8; //Values are shifted later on for higher precision using int math.
  1193.  
  1194. @@ -1183,7 +1183,7 @@
  1195.  }
  1196.  
  1197.  // Copy of map_foreachincell, but applied to the whole map. [Skotlex]
  1198. -int map_foreachinmap(int (*func)(struct block_list *,va_list), int m, int type,...)
  1199. +int map_foreachinmap(int (*func)(struct block_list *,va_list), short m, int type,...)
  1200.  {
  1201.      int b, bsize;
  1202.      int returnCount = 0;  //total sum of returned values of func() [Skotlex]
  1203. @@ -1300,7 +1300,7 @@
  1204.   * to place an BL_ITEM object. Scan area is 9x9, returns 1 on success.
  1205.   * x and y are modified with the target cell when successful.
  1206.   *------------------------------------------*/
  1207. -int map_searchrandfreecell(int m,int *x,int *y,int stack)
  1208. +int map_searchrandfreecell(short m,short *x,short *y,int stack)
  1209.  {
  1210.      int free_cell,i,j;
  1211.      int free_cells[9][2];
  1212. @@ -1346,10 +1346,10 @@
  1213.   * &2 = the target should be able to walk to the target tile.
  1214.   * &4 = there shouldn't be any players around the target tile (use the no_spawn_on_player setting)
  1215.   *------------------------------------------*/
  1216. -int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx, int ry, int flag)
  1217. +int map_search_freecell(struct block_list *src, short m, short *x,short *y, short rx, short ry, int flag)
  1218.  {
  1219.      int tries, spawn=0;
  1220. -    int bx, by;
  1221. +    short bx, by;
  1222.      int rx2 = 2*rx+1;
  1223.      int ry2 = 2*ry+1;
  1224.  
  1225. @@ -1417,7 +1417,7 @@
  1226.   * @first_charid, @second_charid, @third_charid, looting priority
  1227.   * @flag: &1 MVP item. &2 do stacking check.
  1228.   *------------------------------------------*/
  1229. -int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int first_charid,int second_charid,int third_charid,int flags)
  1230. +int map_addflooritem(struct item *item_data,int amount,short m,short x,short y,int first_charid,int second_charid,int third_charid,int flags)
  1231.  {
  1232.      int r;
  1233.      struct flooritem_data *fitem=NULL;
  1234. @@ -1690,7 +1690,7 @@
  1235.  
  1236.      if (map[sd->bl.m].instance_id) {
  1237.          // Avoid map conflicts and warnings on next login
  1238. -        int m;
  1239. +        short m;
  1240.          struct point *pt;
  1241.          if (map[sd->bl.m].save.map)
  1242.              pt = &map[sd->bl.m].save;
  1243. @@ -1839,7 +1839,7 @@
  1244.  /*==========================================
  1245.   * Convext Mirror
  1246.   *------------------------------------------*/
  1247. -struct mob_data *map_getmob_boss(int m) {
  1248. +struct mob_data *map_getmob_boss(short m) {
  1249.      DBIterator *iter;
  1250.      struct mob_data *md = NULL;
  1251.      bool found = false;
  1252. @@ -2131,9 +2131,9 @@
  1253.   *-----------------------------------------*/
  1254.  // Stores the spawn data entry in the mob list.
  1255.  // Returns the index of successful, or -1 if the list was full.
  1256. -int map_addmobtolist(unsigned short m, struct spawn_data *spawn)
  1257. +int map_addmobtolist(short m, struct spawn_data *spawn)
  1258.  {
  1259. -    size_t i;
  1260. +    int i;
  1261.      ARR_FIND(0, MAX_MOB_LIST_PER_MAP, i, map[m].moblist[i] == NULL);
  1262.      if (i < MAX_MOB_LIST_PER_MAP) {
  1263.          map[m].moblist[i] = spawn;
  1264. @@ -2142,7 +2142,7 @@
  1265.      return -1;
  1266.  }
  1267.  
  1268. -void map_spawnmobs(int m)
  1269. +void map_spawnmobs(short m)
  1270.  {
  1271.      int i, k=0;
  1272.      if (map[m].mob_delete_timer != INVALID_TIMER) {
  1273. @@ -2216,7 +2216,7 @@
  1274.      return 1;
  1275.  }
  1276.  
  1277. -void map_removemobs(int m)
  1278. +void map_removemobs(short m)
  1279.  {
  1280.      if (map[m].mob_delete_timer != INVALID_TIMER) // should never happen
  1281.          return; //Mobs are already scheduled for removal
  1282. @@ -2306,7 +2306,7 @@
  1283.  /*==========================================
  1284.   * Returns the direction of the given cell, relative to 'src'
  1285.   *------------------------------------------*/
  1286. -uint8 map_calc_dir(struct block_list *src, int x, int y)
  1287. +uint8 map_calc_dir(struct block_list *src, short x, short y)
  1288.  {
  1289.      unsigned char dir = 0;
  1290.      int dx, dy;
  1291. @@ -2441,12 +2441,12 @@
  1292.  /*==========================================
  1293.   * Confirm if celltype in (m,x,y) match the one given in cellchk
  1294.   *------------------------------------------*/
  1295. -int map_getcell(int m,int x,int y,cell_chk cellchk)
  1296. +int map_getcell(short m,short x,short y,cell_chk cellchk)
  1297.  {
  1298.      return (m < 0 || m >= MAX_MAP_PER_SERVER) ? 0 : map_getcellp(&map[m],x,y,cellchk);
  1299.  }
  1300.  
  1301. -int map_getcellp(struct map_data *m,int x,int y,cell_chk cellchk)
  1302. +int map_getcellp(struct map_data *m,short x,short y,cell_chk cellchk)
  1303.  {
  1304.      struct mapcell cell;
  1305.  
  1306. @@ -2522,7 +2522,7 @@
  1307.   * 'cell' - which flag to modify
  1308.   * 'flag' - true = on, false = off
  1309.   *------------------------------------------*/
  1310. -void map_setcell(int m, int x, int y, cell_t cell, bool flag)
  1311. +void map_setcell(short m, short x, short y, cell_t cell, bool flag)
  1312.  {
  1313.      int j;
  1314.  
  1315. @@ -2569,7 +2569,7 @@
  1316.      }
  1317.  }
  1318.  
  1319. -void map_setgatcell(int m, int x, int y, int gat)
  1320. +void map_setgatcell(short m, short x, short y, int gat)
  1321.  {
  1322.      int j;
  1323.      struct mapcell cell;
  1324. @@ -2590,7 +2590,7 @@
  1325.   *------------------------------------------*/
  1326.  static DBMap *iwall_db;
  1327.  
  1328. -void map_iwall_nextxy(int x, int y, int dir, int pos, int *x1, int *y1)
  1329. +void map_iwall_nextxy(short x, short y, int dir, int pos, short *x1, short *y1)
  1330.  {
  1331.      if (dir == 0 || dir == 4)
  1332.          *x1 = x; // Keep X
  1333. @@ -2607,7 +2607,7 @@
  1334.          *y1 = y + pos;
  1335.  }
  1336.  
  1337. -bool map_iwall_set(int m, int x, int y, int size, int dir, bool shootable, const char *wall_name)
  1338. +bool map_iwall_set(short m, short x, short y, int size, int dir, bool shootable, const char *wall_name)
  1339.  {
  1340.      struct iwall_data *iwall;
  1341.      int i, x1 = 0, y1 = 0;
  1342. @@ -3512,7 +3512,8 @@
  1343.   *------------------------------------------*/
  1344.  void do_final(void)
  1345.  {
  1346. -    int i, j;
  1347. +    short i;
  1348. +    int j;
  1349.      struct map_session_data *sd;
  1350.      struct s_mapiterator *iter;
  1351.  
  1352. Index: src/map/map.h
  1353. --- src/map/map.h Base (BASE)
  1354. +++ src/map/map.h Locally Modified (Based On LOCAL)
  1355. @@ -466,20 +466,18 @@
  1356.  
  1357.  struct mapcell {
  1358.      // terrain flags
  1359. -    unsigned char
  1360. -    walkable : 1,
  1361. -             shootable : 1,
  1362. -             water : 1;
  1363. +    int walkable : 1;
  1364. +    int shootable : 1;
  1365. +    int water : 1;
  1366.  
  1367.      // dynamic flags
  1368. -    unsigned char
  1369. -    npc : 1,
  1370. -        basilica : 1,
  1371. -        landprotector : 1,
  1372. -        novending : 1,
  1373. -        nochat : 1,
  1374. -        maelstrom : 1,
  1375. -        icewall : 1;
  1376. +    int npc : 1;
  1377. +    int basilica : 1;
  1378. +    int landprotector : 1;
  1379. +    int novending : 1;
  1380. +    int nochat : 1;
  1381. +    int maelstrom : 1;
  1382. +    int icewall : 1;
  1383.  
  1384.  #ifdef CELL_NOSTACK
  1385.      unsigned char cell_bl; //Holds amount of bls in this cell.
  1386. @@ -498,7 +496,7 @@
  1387.      struct mapcell *cell; // Holds the information of each map cell (NULL if the map is not on this map-server).
  1388.      struct block_list **block;
  1389.      struct block_list **block_mob;
  1390. -    int m;
  1391. +    short m; //mapid
  1392.      short xs,ys; // map dimensions (in cells)
  1393.      short bxs,bys; // map dimensions (in blocks)
  1394.      short bgscore_lion, bgscore_eagle; // Battleground ScoreBoard
  1395. @@ -596,10 +594,10 @@
  1396.      uint16 port;
  1397.  };
  1398.  
  1399. -int map_getcell(int,int,int,cell_chk);
  1400. +int map_getcell(short,short,short,cell_chk);
  1401.  int map_getcellp(struct map_data *,int,int,cell_chk);
  1402. -void map_setcell(int m, int x, int y, cell_t cell, bool flag);
  1403. -void map_setgatcell(int m, int x, int y, int gat);
  1404. +void map_setcell(short m, short x, short y, cell_t cell, bool flag);
  1405. +void map_setgatcell(short m, short x, short y, int gat);
  1406.  
  1407.  extern struct map_data map[];
  1408.  extern int map_num;
  1409. @@ -623,7 +621,7 @@
  1410.  // users
  1411.  void map_setusers(int);
  1412.  int map_getusers(void);
  1413. -int map_usercount(void);
  1414. +unsigned int map_usercount(void);
  1415.  
  1416.  // blocklist lock
  1417.  int map_freeblock(struct block_list *bl);
  1418. @@ -632,22 +630,22 @@
  1419.  // blocklist manipulation
  1420.  int map_addblock(struct block_list *bl);
  1421.  int map_delblock(struct block_list *bl);
  1422. -int map_moveblock(struct block_list *, int, int, unsigned int);
  1423. -int map_foreachinrange(int (*func)(struct block_list *,va_list), struct block_list *center, int range, int type, ...);
  1424. -int map_foreachinshootrange(int (*func)(struct block_list *,va_list), struct block_list *center, int range, int type, ...);
  1425. -int map_foreachinarea(int (*func)(struct block_list *,va_list), int m, int x0, int y0, int x1, int y1, int type, ...);
  1426. -int map_forcountinrange(int (*func)(struct block_list *,va_list), struct block_list *center, int range, int count, int type, ...);
  1427. -int map_forcountinarea(int (*func)(struct block_list *,va_list), int m, int x0, int y0, int x1, int y1, int count, int type, ...);
  1428. -int map_foreachinmovearea(int (*func)(struct block_list *,va_list), struct block_list *center, int range, int dx, int dy, int type, ...);
  1429. -int map_foreachincell(int (*func)(struct block_list *,va_list), int m, int x, int y, int type, ...);
  1430. -int map_foreachinpath(int (*func)(struct block_list *,va_list), int m, int x0, int y0, int x1, int y1, int range, int length, int type, ...);
  1431. -int map_foreachinmap(int (*func)(struct block_list *,va_list), int m, int type, ...);
  1432. +int map_moveblock(struct block_list *, short, short, unsigned int);
  1433. +int map_foreachinrange(int (*func)(struct block_list *,va_list), struct block_list *center, short range, int type, ...);
  1434. +int map_foreachinshootrange(int (*func)(struct block_list *,va_list), struct block_list *center, short range, int type, ...);
  1435. +int map_foreachinarea(int (*func)(struct block_list *,va_list), short m, short x0, short y0, short x1, short y1, int type, ...);
  1436. +int map_forcountinrange(int (*func)(struct block_list *,va_list), struct block_list *center, short range, int count, int type, ...);
  1437. +int map_forcountinarea(int (*func)(struct block_list *,va_list), short m, short x0, short y0, short x1, short y1, int count, int type, ...);
  1438. +int map_foreachinmovearea(int (*func)(struct block_list *,va_list), struct block_list *center, short range, short dx, short dy, int type, ...);
  1439. +int map_foreachincell(int (*func)(struct block_list *,va_list), short m, short x, short y, int type, ...);
  1440. +int map_foreachinpath(int (*func)(struct block_list *,va_list), short m, short x0, short y0, short x1, short y1, short range, int length, int type, ...);
  1441. +int map_foreachinmap(int (*func)(struct block_list *,va_list), short m, int type, ...);
  1442.  //blocklist nb in one cell
  1443. -int map_count_oncell(int m,int x,int y,int type);
  1444. -struct skill_unit *map_find_skill_unit_oncell(struct block_list *,int x,int y,int skill_id,struct skill_unit *, int flag);
  1445. +int map_count_oncell(short m,short x,short y,int type);
  1446. +struct skill_unit *map_find_skill_unit_oncell(struct block_list *,short x,short y,short skill_id,struct skill_unit *, int flag);
  1447.  // search and creation
  1448.  int map_get_new_object_id(void);
  1449. -int map_search_freecell(struct block_list *src, int m, short *x, short *y, int rx, int ry, int flag);
  1450. +int map_search_freecell(struct block_list *src, short m, short *x, short *y, short rx, short ry, int flag);
  1451.  //
  1452.  int map_quit(struct map_session_data *);
  1453.  // npc
  1454. @@ -657,7 +655,7 @@
  1455.  int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr_t data);
  1456.  int map_removemobs_timer(int tid, unsigned int tick, int id, intptr_t data);
  1457.  void map_clearflooritem(struct block_list *bl);
  1458. -int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int first_charid,int second_charid,int third_charid,int flags);
  1459. +int map_addflooritem(struct item *item_data,int amount,short m,short x,short y,int first_charid,int second_charid,int third_charid,int flags);
  1460.  
  1461.  // player to map session
  1462.  void map_addnickdb(int charid, const char *nick);
  1463. @@ -690,7 +688,7 @@
  1464.  void map_foreachregen(int (*func)(struct block_list *bl, va_list args), ...);
  1465.  void map_foreachiddb(int (*func)(struct block_list *bl, va_list args), ...);
  1466.  struct map_session_data *map_nick2sd(const char *);
  1467. -struct mob_data *map_getmob_boss(int m);
  1468. +struct mob_data *map_getmob_boss(short m);
  1469.  struct mob_data *map_id2boss(int id);
  1470.  
  1471.  // reload config file looking only for npcs
  1472. @@ -716,7 +714,7 @@
  1473.  #define mapit_geteachiddb() mapit_alloc(MAPIT_NORMAL,BL_ALL)
  1474.  
  1475.  int map_check_dir(int s_dir,int t_dir);
  1476. -unsigned char map_calc_dir(struct block_list *src,int x,int y);
  1477. +uint8 map_calc_dir(struct block_list *src,short x,short y);
  1478.  int map_random_dir(struct block_list *bl, short *x, short *y); // [Skotlex]
  1479.  
  1480.  int cleanup_sub(struct block_list *bl, va_list ap);
  1481. @@ -728,9 +726,9 @@
  1482.  void map_iwall_get(struct map_session_data *sd);
  1483.  void map_iwall_remove(const char *wall_name);
  1484.  
  1485. -int map_addmobtolist(unsigned short m, struct spawn_data *spawn);   // [Wizputer]
  1486. -void map_spawnmobs(int); // [Wizputer]
  1487. -void map_removemobs(int); // [Wizputer]
  1488. +int map_addmobtolist(short m, struct spawn_data *spawn);   // [Wizputer]
  1489. +void map_spawnmobs(short); // [Wizputer]
  1490. +void map_removemobs(short); // [Wizputer]
  1491.  void do_reconnect_map(void); //Invoked on map-char reconnection [Skotlex]
  1492.  void map_addmap2db(struct map_data *m);
  1493.  void map_removemapdb(struct map_data *m);
  1494. Index: src/map/pc.c
  1495. --- src/map/pc.c Base (BASE)
  1496. +++ src/map/pc.c Locally Modified (Based On LOCAL)
  1497. @@ -5924,7 +5924,7 @@
  1498.  }
  1499.  
  1500.  // Calculates the number of status points PC gets when leveling up (from level to level+1)
  1501. -int pc_gets_status_point(int level)
  1502. +unsigned int pc_gets_status_point(int level)
  1503.  {
  1504.      if (battle_config.use_statpoint_table) //Use values from "db/statpoint.txt"
  1505.          return (statp[level+1] - statp[level]);
  1506. @@ -9003,7 +9003,7 @@
  1507.  /*==========================================
  1508.   * Memo player sd savepoint. (map,x,y)
  1509.   *------------------------------------------*/
  1510. -int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
  1511. +int pc_setsavepoint(struct map_session_data *sd, unsigned short mapindex,int x,int y)
  1512.  {
  1513.      nullpo_ret(sd);
  1514.  
  1515. Index: src/map/pc.h
  1516. --- src/map/pc.h Base (BASE)
  1517. +++ src/map/pc.h Locally Modified (Based On LOCAL)
  1518. @@ -475,7 +475,6 @@
  1519.      // temporary debugging of bug #3504
  1520.      const char *delunit_prevfile;
  1521.      int delunit_prevline;
  1522. -
  1523.  };
  1524.  
  1525.  //Update this max as necessary. 55 is the value needed for Super Baby currently
  1526. @@ -702,7 +701,7 @@
  1527.  #define pc_checkoversp(sd) ((sd)->battle_status.sp == (sd)->battle_status.max_sp)
  1528.  
  1529.  int pc_setpos(struct map_session_data *sd, unsigned short mapindex, int x, int y, clr_type clrtype);
  1530. -int pc_setsavepoint(struct map_session_data *,short,int,int);
  1531. +int pc_setsavepoint(struct map_session_data *,unsigned short,int,int);
  1532.  int pc_randomwarp(struct map_session_data *sd,clr_type type);
  1533.  int pc_memo(struct map_session_data *sd, int pos);
  1534.  
  1535. @@ -765,7 +764,7 @@
  1536.  unsigned int pc_thisbaseexp(struct map_session_data *);
  1537.  unsigned int pc_nextjobexp(struct map_session_data *);
  1538.  unsigned int pc_thisjobexp(struct map_session_data *);
  1539. -int pc_gets_status_point(int);
  1540. +unsigned int pc_gets_status_point(int);
  1541.  int pc_need_status_point(struct map_session_data *,int,int);
  1542.  int pc_statusup(struct map_session_data *,int);
  1543.  int pc_statusup2(struct map_session_data *,int,int);
  1544. Index: src/map/skill.c
  1545. --- src/map/skill.c Base (BASE)
  1546. +++ src/map/skill.c Locally Modified (Based On LOCAL)
  1547. @@ -12270,7 +12270,6 @@
  1548.              p_sd[(*c)++] = tsd->bl.id;
  1549.          return 1;
  1550.      } else {
  1551. -
  1552.          switch (skillid) {
  1553.              case PR_BENEDICTIO: {
  1554.                      int dir = map_calc_dir(&sd->bl,tsd->bl.x,tsd->bl.y);
  1555. @@ -12308,8 +12307,6 @@
  1556.                          !tsd->sc.data[SC_DANCING]) {
  1557.                          p_sd[(*c)++]=tsd->bl.id;
  1558.                          return skilllv;
  1559. -                    } else {
  1560. -                        return 0;
  1561.                      }
  1562.                  }
  1563.                  break;
  1564. Index: src/map/unit.c
  1565. --- src/map/unit.c Base (BASE)
  1566. +++ src/map/unit.c Locally Modified (Based On LOCAL)
  1567. @@ -666,7 +666,8 @@
  1568.      if (count) {
  1569.          struct map_session_data *sd;
  1570.          struct skill_unit *su = NULL;
  1571. -        int nx, ny, result;
  1572. +        short nx, ny;
  1573. +		int result;
  1574.  
  1575.          sd = BL_CAST(BL_PC, bl);
  1576.          su = BL_CAST(BL_SKILL, bl);
  1577. @@ -1607,7 +1608,7 @@
  1578.  /*==========================================
  1579.   * Calculates position of Pet/Mercenary/Homunculus/Elemental
  1580.   *------------------------------------------*/
  1581. -int unit_calc_pos(struct block_list *bl, int tx, int ty, int dir)
  1582. +int unit_calc_pos(struct block_list *bl, short tx, short ty, int dir)
  1583.  {
  1584.      int dx, dy, x, y, i, k;
  1585.      struct unit_data *ud = unit_bl2ud(bl);
  1586. Index: src/map/unit.h
  1587. --- src/map/unit.h Base (BASE)
  1588. +++ src/map/unit.h Locally Modified (Based On LOCAL)
  1589. @@ -75,7 +75,7 @@
  1590.  int unit_walktoxy(struct block_list *bl, short x, short y, int easy);
  1591.  int unit_walktobl(struct block_list *bl, struct block_list *target, int range, int easy);
  1592.  int unit_run(struct block_list *bl);
  1593. -int unit_calc_pos(struct block_list *bl, int tx, int ty, int dir);
  1594. +int unit_calc_pos(struct block_list *bl, short tx, short ty, int dir);
  1595.  
  1596.  // ���s��~
  1597.  // type�͈ȉ��̑g�ݍ��킹 :
  1598. Index: vcproj-10/char-server_sql.vcxproj
  1599. --- vcproj-10/char-server_sql.vcxproj Base (BASE)
  1600. +++ vcproj-10/char-server_sql.vcxproj Locally Modified (Based On LOCAL)
  1601. @@ -66,7 +66,7 @@
  1602.        </AdditionalOptions>
  1603.        <PrecompiledHeader>
  1604.        </PrecompiledHeader>
  1605. -      <WarningLevel>Level3</WarningLevel>
  1606. \ No newline at end of file
  1607. +      <WarningLevel>Level4</WarningLevel>
  1608. \ No newline at end of file
  1609.        <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
  1610.        <CompileAs>CompileAsC</CompileAs>
  1611.        <DisableSpecificWarnings>4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
  1612. Index: vcproj-10/login-server_sql.vcxproj
  1613. --- vcproj-10/login-server_sql.vcxproj Base (BASE)
  1614. +++ vcproj-10/login-server_sql.vcxproj Locally Modified (Based On LOCAL)
  1615. @@ -64,7 +64,7 @@
  1616.        </AdditionalOptions>
  1617.        <PrecompiledHeader>
  1618.        </PrecompiledHeader>
  1619. -      <WarningLevel>Level3</WarningLevel>
  1620. \ No newline at end of file
  1621. +      <WarningLevel>Level4</WarningLevel>
  1622. \ No newline at end of file
  1623.        <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
  1624.        <CompileAs>CompileAsC</CompileAs>
  1625.        <DisableSpecificWarnings>4100;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
  1626. Index: vcproj-10/map-server_sql.vcxproj
  1627. --- vcproj-10/map-server_sql.vcxproj Base (BASE)
  1628. +++ vcproj-10/map-server_sql.vcxproj Locally Modified (Based On LOCAL)
  1629. @@ -63,7 +63,7 @@
  1630.        </AdditionalOptions>
  1631.        <PrecompiledHeader>
  1632.        </PrecompiledHeader>
  1633. -      <WarningLevel>Level3</WarningLevel>
  1634. +      <WarningLevel>Level4</WarningLevel>
  1635. \ No newline at end of file
  1636.        <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
  1637.        <CompileAs>CompileAsC</CompileAs>
  1638.        <DisableSpecificWarnings>4018;4100;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
  1639. Index: vcproj-10/mapcache.vcxproj
  1640. --- vcproj-10/mapcache.vcxproj Base (BASE)
  1641. +++ vcproj-10/mapcache.vcxproj Locally Modified (Based On LOCAL)
  1642. @@ -62,7 +62,7 @@
  1643.        </AdditionalOptions>
  1644.        <PrecompiledHeader>
  1645.        </PrecompiledHeader>
  1646. -      <WarningLevel>Level3</WarningLevel>
  1647. \ No newline at end of file
  1648. +      <WarningLevel>Level4</WarningLevel>
  1649. \ No newline at end of file
  1650.        <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
  1651.        <CompileAs>CompileAsC</CompileAs>
  1652.        <MultiProcessorCompilation>true</MultiProcessorCompilation>
  1653. Index: vcproj-10/mapcache.vcxproj.filters
  1654. --- vcproj-10/mapcache.vcxproj.filters Base (BASE)
  1655. +++ vcproj-10/mapcache.vcxproj.filters Locally Modified (Based On LOCAL)
  1656. @@ -57,6 +57,7 @@
  1657.      <ClInclude Include="..\src\common\winapi.h">
  1658.        <Filter>common</Filter>
  1659.      </ClInclude>
  1660. +    <ClInclude Include="..\src\config\renewal.h" />
  1661. \ No newline at end of file
  1662.    </ItemGroup>
  1663.    <ItemGroup>
  1664.      <Filter Include="common">
Viewed 534 times, submitted by lighta.