summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-27 06:38:17 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-27 06:38:17 +0000
commit3c8999edce9e1f0d5c0dee3ff8311e781d64c684 (patch)
treed066567a720e5fad02e6f857d55bc165d9a3809a /src/map/status.c
parentea320701794515d4ffa6a8e8ff8f3b8fdfe09860 (diff)
downloadhercules-3c8999edce9e1f0d5c0dee3ff8311e781d64c684.tar.gz
hercules-3c8999edce9e1f0d5c0dee3ff8311e781d64c684.tar.bz2
hercules-3c8999edce9e1f0d5c0dee3ff8311e781d64c684.tar.xz
hercules-3c8999edce9e1f0d5c0dee3ff8311e781d64c684.zip
* Optional macro MEMSET_TURBO for faster low-level memory initializations.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8499 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 8f8da8098..12a20a335 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -95,8 +95,8 @@ void initChangeTables(void) {
StatusIconChangeTable[i] = SI_BLANK;
for (i = 0; i < MAX_SKILL; i++)
SkillStatusChangeTableArray[i] = -1;
- memset(StatusSkillChangeTable, 0, sizeof(StatusSkillChangeTable));
- memset(StatusChangeFlagTable, 0, sizeof(StatusChangeFlagTable));
+ malloc_set(StatusSkillChangeTable, 0, sizeof(StatusSkillChangeTable));
+ malloc_set(StatusChangeFlagTable, 0, sizeof(StatusChangeFlagTable));
//First we define the skill for common ailments. These are used in
//skill_additional_effect through sc cards. [Skotlex]
@@ -471,7 +471,7 @@ int SkillStatusChangeTable(int skill)
}
int StatusIconChangeTable[SC_MAX]; //Stores the icon that should be associated to this status change.
static void initDummyData(void) {
- memset(&dummy_status, 0, sizeof(dummy_status));
+ malloc_set(&dummy_status, 0, sizeof(dummy_status));
dummy_status.hp =
dummy_status.max_hp =
dummy_status.max_sp =
@@ -709,11 +709,11 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
{ //Reset regen ticks.
struct regen_data *regen = status_get_regen_data(target);
if (regen) {
- memset(&regen->tick, 0, sizeof(regen->tick));
+ malloc_set(&regen->tick, 0, sizeof(regen->tick));
if (regen->sregen)
- memset(&regen->sregen->tick, 0, sizeof(regen->sregen->tick));
+ malloc_set(&regen->sregen->tick, 0, sizeof(regen->sregen->tick));
if (regen->ssregen)
- memset(&regen->ssregen->tick, 0, sizeof(regen->ssregen->tick));
+ malloc_set(&regen->ssregen->tick, 0, sizeof(regen->ssregen->tick));
}
}
if(flag&4) //Delete from memory. (also invokes map removal code)
@@ -1559,7 +1559,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
// zeroed arays, order follows the order in map.h.
// add new arrays to the end of zeroed area in map.h (see comments) and size here. [zzo]
- memset (sd->param_bonus, 0, sizeof(sd->param_bonus)
+ malloc_set (sd->param_bonus, 0, sizeof(sd->param_bonus)
+ sizeof(sd->param_equip)
+ sizeof(sd->subele)
+ sizeof(sd->subrace)
@@ -1582,12 +1582,12 @@ int status_calc_pc(struct map_session_data* sd,int first)
+ sizeof(sd->sp_gain_race)
);
- memset (&sd->right_weapon.overrefine, 0, sizeof(sd->right_weapon) - sizeof(sd->right_weapon.atkmods));
- memset (&sd->left_weapon.overrefine, 0, sizeof(sd->left_weapon) - sizeof(sd->left_weapon.atkmods));
+ malloc_set (&sd->right_weapon.overrefine, 0, sizeof(sd->right_weapon) - sizeof(sd->right_weapon.atkmods));
+ malloc_set (&sd->left_weapon.overrefine, 0, sizeof(sd->left_weapon) - sizeof(sd->left_weapon.atkmods));
- memset(&sd->special_state,0,sizeof(sd->special_state));
- memset(&status->max_hp, 0, sizeof(struct status_data)-(sizeof(status->hp)+sizeof(status->sp)+sizeof(status->lhw)));
- memset(status->lhw, 0, sizeof(struct weapon_atk));
+ malloc_set(&sd->special_state,0,sizeof(sd->special_state));
+ malloc_set(&status->max_hp, 0, sizeof(struct status_data)-(sizeof(status->hp)+sizeof(status->sp)+sizeof(status->lhw)));
+ malloc_set(status->lhw, 0, sizeof(struct weapon_atk));
//FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex]
status->speed = DEFAULT_WALK_SPEED;
@@ -1606,7 +1606,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
status->race = RC_DEMIHUMAN;
//zero up structures...
- memset(&sd->autospell,0,sizeof(sd->autospell)
+ malloc_set(&sd->autospell,0,sizeof(sd->autospell)
+ sizeof(sd->autospell2)
+ sizeof(sd->addeff)
+ sizeof(sd->addeff2)
@@ -1621,7 +1621,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
);
// vars zeroing. ints, shorts, chars. in that order.
- memset (&sd->arrow_atk, 0,sizeof(sd->arrow_atk)
+ malloc_set (&sd->arrow_atk, 0,sizeof(sd->arrow_atk)
+ sizeof(sd->arrow_ele)
+ sizeof(sd->arrow_cri)
+ sizeof(sd->arrow_hit)
@@ -1764,7 +1764,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
//Store equipment script bonuses
memcpy(sd->param_equip,sd->param_bonus,sizeof(sd->param_equip));
- memset(sd->param_bonus, 0, sizeof(sd->param_bonus));
+ malloc_set(sd->param_bonus, 0, sizeof(sd->param_bonus));
status->def += (refinedef+50)/100;
@@ -4226,7 +4226,7 @@ void status_change_init(struct block_list *bl)
struct status_change *sc = status_get_sc(bl);
int i;
nullpo_retv(sc);
- memset(sc, 0, sizeof (struct status_change));
+ malloc_set(sc, 0, sizeof (struct status_change));
for (i=0; i< SC_MAX; i++)
sc->data[i].timer = -1;
}
@@ -7018,7 +7018,7 @@ static int status_calc_sigma(void)
unsigned int k;
for(i=0;i<MAX_PC_CLASS;i++) {
- memset(hp_sigma_val[i],0,sizeof(hp_sigma_val[i]));
+ malloc_tsetdword(hp_sigma_val[i],0,sizeof(hp_sigma_val[i]));
for(k=0,j=2;j<=MAX_LEVEL;j++) {
k += hp_coefficient[i]*j + 50;
k -= k%100;
@@ -7072,7 +7072,7 @@ int status_readdb(void) {
fclose(fp);
ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n",path);
- memset(job_bonus,0,sizeof(job_bonus)); // Job-specific stats bonus
+ malloc_tsetdword(job_bonus,0,sizeof(job_bonus)); // Job-specific stats bonus
sprintf(path, "%s/job_db2.txt", db_path);
fp=fopen(path,"r");
if(fp==NULL){
@@ -7113,7 +7113,7 @@ int status_readdb(void) {
continue;
if(atoi(line)<=0)
continue;
- memset(split,0,sizeof(split));
+ malloc_tsetdword(split,0,sizeof(split));
for(j=0,p=line;j<MAX_WEAPON_TYPE && p;j++){
split[j]=p;
p=strchr(p,',');
@@ -7148,7 +7148,7 @@ int status_readdb(void) {
continue;
if(atoi(line)<=0)
continue;
- memset(split,0,sizeof(split));
+ malloc_tsetdword(split,0,sizeof(split));
for(j=0,p=line;j<MAX_REFINE+4 && p;j++){
split[j]=p;
p=strchr(p,',');