Diverse kaputte Casts repariert.
Unwirksame und ueberfluessige Casts entfernt,
etwas Code-Cleanup.
Change-Id: I92f01e6391c432cd0881a5faac580f6d0b40c323
diff --git a/items/money.c b/items/money.c
index af88680..f6a5173 100644
--- a/items/money.c
+++ b/items/money.c
@@ -6,7 +6,7 @@
inherit "/std/unit";
-#pragma strong_types,rtt_checks
+#pragma strict_types,rtt_checks
#include <properties.h>
#include <language.h>
@@ -116,7 +116,7 @@
int _query_autoloadobj()
{
- return (int)Query(P_AMOUNT, F_VALUE);
+ return ({int})Query(P_AMOUNT, F_VALUE);
}
string current_long() {
diff --git a/obj/tools/lupe.c b/obj/tools/lupe.c
index 105b602..94da478 100644
--- a/obj/tools/lupe.c
+++ b/obj/tools/lupe.c
@@ -697,7 +697,7 @@
if (intp(ob))
return ""+ob;
if (stringp(ob))
- return string_desc((string)ob);
+ return string_desc(ob);
if (objectp(ob))
return "OBJ("+object_name(ob)+")";
if (!pointerp(ob))
diff --git a/p/daemon/channeld.c b/p/daemon/channeld.c
index d7d9029..cc9ced9 100644
--- a/p/daemon/channeld.c
+++ b/p/daemon/channeld.c
@@ -305,7 +305,7 @@
// Hab ich die noetigen Rechte im Memory?
if (call_other(MEMORY,"HaveRights")) {
// Objektpointer laden
- channelH = (mixed) call_other(MEMORY,"Load","History");
+ channelH = call_other(MEMORY,"Load","History");
// Wenns nich geklappt hat, hat der Memory noch keinen Zeiger, dann
if (!mappingp(channelH)){
diff --git a/p/daemon/debug.c b/p/daemon/debug.c
index e1b3f7f..2727d9c 100644
--- a/p/daemon/debug.c
+++ b/p/daemon/debug.c
@@ -30,7 +30,8 @@
// Wer (noch) nicht auf dem Kanal ist, bekommt auch keine
// Ausgabe - sonst gibt es selbige doppelt, da der CHMASTER
// einen automatisch den Kanal betreten laesst ...
- if ( !objectp(pl) || !pointerp(tmp=(mixed)pl->QueryProp(P_CHANNELS)) ||
+ if ( !objectp(pl) ||
+ !pointerp(tmp=({string*})pl->QueryProp(P_CHANNELS)) ||
member( tmp, lower_case(ch) ) == -1 )
return 1;
diff --git a/secure/awmaster.c b/secure/awmaster.c
index cccdb1d..f1ce7d4 100644
--- a/secure/awmaster.c
+++ b/secure/awmaster.c
@@ -98,17 +98,17 @@
if (!ob || !objectp(ob))
return 0;
re=0;
- if (((object)ob->QueryProp(P_WEAR_FUNC))==ob ||
- ((object)ob->QueryProp(P_WIELD_FUNC))==ob )
+ if ((({object})ob->QueryProp(P_WEAR_FUNC))==ob ||
+ (({object})ob->QueryProp(P_WIELD_FUNC))==ob )
re += AWF_PUTON;
- if (((object)ob->QueryProp(P_REMOVE_FUNC))==ob ||
- ((object)ob->QueryProp(P_UNWIELD_FUNC))==ob )
+ if ((({object})ob->QueryProp(P_REMOVE_FUNC))==ob ||
+ (({object})ob->QueryProp(P_UNWIELD_FUNC))==ob )
re += AWF_PUTOFF;
- if (((object)ob->QueryProp(P_DEFEND_FUNC))==ob ||
- ((object)ob->QueryProp(P_HIT_FUNC))==ob )
+ if ((({object})ob->QueryProp(P_DEFEND_FUNC))==ob ||
+ (({object})ob->QueryProp(P_HIT_FUNC))==ob )
re += AWF_BOOST;
// ists nen Mapping und nicht leer?
- if (mappingp(m=(mapping)ob->QueryProp(P_RESISTANCE_STRENGTHS))
+ if (mappingp(m=({mapping})ob->QueryProp(P_RESISTANCE_STRENGTHS))
&& sizeof(m))
re += AWF_RESIST;
return re;
@@ -127,17 +127,17 @@
{
armours[id][AWM_TIME]=time();
flag=0;
- if ((h=(int)ob->QueryProp(P_AC)) > armours[id][AWM_CLASS])
+ if ((h=({int})ob->QueryProp(P_AC)) > armours[id][AWM_CLASS])
{
armours[id][AWM_CLASS]=h;
flag=1;
}
- if ((h=(int)ob->QueryProp(P_EFFECTIVE_AC)) > armours[id][AWM_EFF_CLASS])
+ if ((h=({int})ob->QueryProp(P_EFFECTIVE_AC)) > armours[id][AWM_EFF_CLASS])
{
armours[id][AWM_EFF_CLASS]=h;
flag=1;
}
- if ((h=(int)ob->QueryProp(P_NR_HANDS)) < armours[id][AWM_HANDS])
+ if ((h=({int})ob->QueryProp(P_NR_HANDS)) < armours[id][AWM_HANDS])
{
armours[id][AWM_HANDS]=h;
flag=1;
@@ -181,17 +181,17 @@
{
weapons[id][AWM_TIME] = time();
flag=0;
- if ((h=(int)ob->QueryProp(P_WC)) > weapons[id][AWM_CLASS])
+ if ((h=({int})ob->QueryProp(P_WC)) > weapons[id][AWM_CLASS])
{
weapons[id][AWM_CLASS]=h;
flag=1;
}
- if ((h=(int)ob->QueryProp(P_EFFECTIVE_WC)) > weapons[id][AWM_EFF_CLASS])
+ if ((h=({int})ob->QueryProp(P_EFFECTIVE_WC)) > weapons[id][AWM_EFF_CLASS])
{
weapons[id][AWM_EFF_CLASS]=h;
flag=1;
}
- if ((h=(int)ob->QueryProp(P_NR_HANDS)) < weapons[id][AWM_HANDS])
+ if ((h=({int})ob->QueryProp(P_NR_HANDS)) < weapons[id][AWM_HANDS])
{
weapons[id][AWM_HANDS]=h;
flag=1;
diff --git a/secure/login.c b/secure/login.c
index 2da60cc..ab6ee16 100644
--- a/secure/login.c
+++ b/secure/login.c
@@ -260,7 +260,7 @@
{
string res;
- res = (string)master()->QuerySBanished(query_ip_number(this_object()));
+ res = ({string})master()->QuerySBanished(query_ip_number(this_object()));
if (!res)
{
// check connection from Tor exit node
@@ -411,7 +411,7 @@
for ( i = sizeof(user = users() - ({ 0, this_object() })); i--; )
if ( object_name(user[i])[0..12] == "/secure/login" &&
- ((string)user[i]->loginname()) == loginname ){
+ (({string})user[i]->loginname()) == loginname ){
write( "Eine Anmeldung fuer diesen Namen laeuft bereits.\n" );
destruct( this_object() );
return;
@@ -434,7 +434,7 @@
}
- if ( (txt = (string)master()->QueryBanished(loginname)) ){
+ if ( (txt = ({string})master()->QueryBanished(loginname)) ){
if ( txt != "Dieser Name ist gesperrt." )
txt = sprintf("Hoppla - dieser Name ist reserviert oder gesperrt "
"(\"gebanisht\")!\nGrund: %s\n",txt);
@@ -483,7 +483,7 @@
return;
}
- if ( (int)master()->check_late_player(loginname) )
+ if ( ({int})master()->check_late_player(loginname) )
{
write( "Dieser Spieler hat uns leider fuer immer verlassen.\n" );
loginname = "logon";
@@ -492,7 +492,7 @@
return;
}
- if ( txt = (string)master()->QueryTBanished(loginname) ){
+ if ( txt = ({string})master()->QueryTBanished(loginname) ){
write( txt );
loginname = "logon";
input_to( "logon2", INPUT_PROMPT,
@@ -826,7 +826,7 @@
}
if ( guestflag ){
- if ( catch(guestflag = (int)GUESTMASTER->new_guest();publish)
+ if ( catch(guestflag = ({int})GUESTMASTER->new_guest();publish)
|| !guestflag ){
write( "Derzeit ist kein Gastlogin moeglich!\n" );
destruct( this_object() );
@@ -891,7 +891,7 @@
/* Now reconnect to the old body */
exec( ob, this_object() );
ob->set_realip(realip);
- if ( ((int)ob->QueryProp(P_LEVEL)) == -1 )
+ if ( (({int})ob->QueryProp(P_LEVEL)) == -1 )
ob->start_player( cap_name );
else
ob->Reconnect( was_interactive );
diff --git a/secure/merlin.c b/secure/merlin.c
index 53b90c4..21a4333 100644
--- a/secure/merlin.c
+++ b/secure/merlin.c
@@ -919,7 +919,7 @@
((player->QueryProp(P_GENDER))==2?"in":""));
write("Merlin ruft: "+capitalize(playername)+text);
shout("Merlin ruft: "+capitalize(playername)+text);
- PostSeher(capitalize(playername),(int)player->QueryProp(P_GENDER));
+ PostSeher(capitalize(playername),({int})player->QueryProp(P_GENDER));
if(!catch(
faq=clone_object("/d/seher/haeuser/special/seherfaqmobil") ;publish))
{
diff --git a/secure/potionmaster.c b/secure/potionmaster.c
index cc80302..e2aa300 100644
--- a/secure/potionmaster.c
+++ b/secure/potionmaster.c
@@ -155,7 +155,7 @@
// Pfad normalisieren - Expansion von Platzhaltern ist hier ziemlich
// sinnloss und faellt daher weg (Neue ZTs in /players/ gibts eh nicht
// mehr.)
- room=(string)master()->make_path_absolute(room);
+ room=({string})master()->make_path_absolute(room);
// Datei mit dem ZT-Spruch muss existieren.
if ( file_size( TIPS(to_string(nextroom)+".zt") ) < 0 ) {
@@ -192,8 +192,8 @@
// Pfad normalisieren - Expansion von Platzhaltern ist hier ziemlich
// sinnloss und faellt daher weg (Neue ZTs in /players/ gibts eh nicht
// mehr.)
- old=(string)master()->make_path_absolute(old);
- new=(string)master()->make_path_absolute(new);
+ old=({string})master()->make_path_absolute(old);
+ new=({string})master()->make_path_absolute(new);
// Der neue Raum darf nicht bereits eingetragen sein, ...
if ( member(reverse_table,new) )
diff --git a/secure/questmaster.c b/secure/questmaster.c
index 6a7d952..d6f2fb4 100644
--- a/secure/questmaster.c
+++ b/secure/questmaster.c
@@ -207,7 +207,7 @@
for (i=sizeof(allowedobj)-1;i>=0;i--)
{
if (!stringp(allowedobj[i]) || allowedobj[i]=="") return -4;
- allowedobj[i]=(string)master()->make_path_absolute(allowedobj[i]);
+ allowedobj[i]=({string})master()->make_path_absolute(allowedobj[i]);
}
if (!stringp(hint) || hint=="") return -5;
if (difficulty<-1 || difficulty>100) return -6;
@@ -555,7 +555,7 @@
|| trigob->QueryProp(P_TESTPLAYER) || IS_LEARNER(trigob))
return;
- int lvl = (int)trigob->QueryProp(P_LEVEL);
+ int lvl = ({int})trigob->QueryProp(P_LEVEL);
if (lvl <= 0)
return;
@@ -690,7 +690,7 @@
if (allowedobj[<2..] == ".c")
allowedobj = allowedobj[0..<3];
allowedobj = explode(allowedobj, "#")[0];
- allowedobj = (string)master()->make_path_absolute(allowedobj);
+ allowedobj = ({string})master()->make_path_absolute(allowedobj);
if (file_size(allowedobj+".c") <=0)
return -3;
@@ -1043,7 +1043,7 @@
if (new_mqob[<2..] == ".c")
new_mqob = new_mqob[0..<3];
new_mqob = explode(new_mqob, "#")[0];
- new_mqob = (string)master()->make_path_absolute(new_mqob);
+ new_mqob = ({string})master()->make_path_absolute(new_mqob);
if (file_size(new_mqob+".c") <= 0)
return -3;
// Wenn das neue Objekt schon eine MQ vergibt, kann es keine weitere
diff --git a/secure/scoremaster.c b/secure/scoremaster.c
index af40a93..6a08eff 100644
--- a/secure/scoremaster.c
+++ b/secure/scoremaster.c
@@ -397,7 +397,7 @@
int score = by_num[bit,BYNUM_SCORE];
foreach(string pl: unconfirmed_scores[bit]) {
- string eks = (string)master()->query_ek(pl);
+ string eks = ({string})master()->query_ek(pl);
eks = set_bit(eks, bit);
master()->update_ek(pl, eks);
write_file(SCOREAUTOLOG, sprintf(
diff --git a/secure/telnetneg.c b/secure/telnetneg.c
index 6f4b3e0..707bc7b 100644
--- a/secure/telnetneg.c
+++ b/secure/telnetneg.c
@@ -981,13 +981,13 @@
Set( P_TTY_TYPE, 0 ); //avoid ANY mistakes... Wird unten neu gesetzt.
// Daten aus dem Loginobjekt uebertragen. Das ist wichtig! (Dabei wird dann
// auch der Status von der letzten Session ueberschrieben.)
- TN = (mapping) previous_object()->query_telnet_neg();
+ TN = ({mapping}) previous_object()->query_telnet_neg();
// bevor irgendwas anderes gemacht wird, werden erstmal die Standardhandler
// gesetzt. Die sind naemlich in diesem Objekt jetzt erstmal kaputt, weil
// sie im Loginobjekt gerufen werden.
_bind_telneg_std_handlers();
// dann restliche Daten aus dem Loginobjekt holen.
- Terminals = (string *) previous_object()->query_terminals();
+ Terminals = ({string *}) previous_object()->query_terminals();
Set( P_TTY_COLS, previous_object()->Query(P_TTY_COLS) );
Set( P_TTY_ROWS, previous_object()->Query(P_TTY_ROWS) );
@@ -1117,8 +1117,8 @@
l = 24;
}
- if ( ((int) Query(P_TTY_ROWS) != l) ||
- ((int) Query(P_TTY_COLS) != c) ){
+ if ( (({int}) Query(P_TTY_ROWS) != l) ||
+ (({int}) Query(P_TTY_COLS) != c) ){
Set( P_TTY_ROWS, l );
Set( P_TTY_COLS, c );
diff --git a/secure/udp_mail.c b/secure/udp_mail.c
index 3203fb9..4bd8d74 100644
--- a/secure/udp_mail.c
+++ b/secure/udp_mail.c
@@ -200,7 +200,7 @@
{
string *match;
- match=filter(m_indices((mapping)INETD->query("hosts")),
+ match=filter(m_indices(({mapping})INETD->query("hosts")),
#'match_mud_name,lower_case(hostname));
return (sizeof(match)==1);
diff --git a/std/container/items.c b/std/container/items.c
index d25aa0b..c27736f 100644
--- a/std/container/items.c
+++ b/std/container/items.c
@@ -100,14 +100,14 @@
{
for(i=sizeof(filename);i--;)
{
- filename[i] = (string)master()->make_path_absolute( filename[i] );
+ filename[i] = ({string})master()->make_path_absolute( filename[i] );
}
file=filename[random(sizeof(filename))];
}
else
{
- file=filename=(string)master()->make_path_absolute(filename);
+ file=filename=({string})master()->make_path_absolute(filename);
}
if(props==1)
diff --git a/std/container/light.c b/std/container/light.c
index d0e2e4c..24a2bf4 100644
--- a/std/container/light.c
+++ b/std/container/light.c
@@ -115,7 +115,7 @@
// etwas an einem container geaendert wird. Daher Auswertung jedes mal
// neu aktualisieren.
if (!environment()
- || !(envlight=(int)environment()->QueryProp(P_INT_LIGHT)))
+ || !(envlight=({int})environment()->QueryProp(P_INT_LIGHT)))
return Query(P_INT_LIGHT, F_VALUE);
else {
intlight = Query(P_INT_LIGHT, F_VALUE);
diff --git a/std/gilden_ob.c b/std/gilden_ob.c
index 51a4b88..7b0a565 100644
--- a/std/gilden_ob.c
+++ b/std/gilden_ob.c
@@ -42,7 +42,7 @@
if (!pl && !(pl=this_player()))
return 0;
- if (!(plg=(string)pl->QueryProp(P_GUILD)))
+ if (!(plg=({string})pl->QueryProp(P_GUILD)))
return 0;
if (GuildName()!=plg) {
_notify_fail("Du gehoerst dieser Gilde nicht an!\n");
@@ -72,7 +72,7 @@
int lv;
mapping lvs;
- if (!(lv=(int)this_player()->QueryProp(P_GUILD_LEVEL))) return 1;
+ if (!(lv=({int})this_player()->QueryProp(P_GUILD_LEVEL))) return 1;
if (!(lvs=QueryProp(P_GUILD_LEVELS))) return 0;
return check_cond(lvs[lv+1]); // Bedingung fuer naechsten Level testen.
}
@@ -83,9 +83,9 @@
if (!pl ||
- !(lv=(int)pl->QueryProp(P_GUILD_LEVEL)))
+ !(lv=({int})pl->QueryProp(P_GUILD_LEVEL)))
return;
- switch((int)pl->QueryProp(P_GENDER)) {
+ switch(({int})pl->QueryProp(P_GENDER)) {
case MALE:
ti=QueryProp(P_GUILD_MALE_TITLES);
break;
@@ -132,7 +132,7 @@
printf("Du kannst dieser Gilde nicht beitreten.\nGrund: %s",res);
return -3;
}
- if (erg=(int)GUILDMASTER->beitreten()) {
+ if (erg=({int})GUILDMASTER->beitreten()) {
if (erg<0)
return erg;
if (!(this_player()->QueryProp(P_GUILD_LEVEL)))
@@ -143,7 +143,7 @@
}
varargs int austreten(int loss) {
- return (int)GUILDMASTER->austreten(loss);
+ return ({int})GUILDMASTER->austreten(loss);
}
int bei_oder_aus_treten(string str) {
@@ -240,7 +240,7 @@
if (!(sfunc=ski[SI_SKILLFUNC]))
sfunc=spell;
spellbook=SPELLBOOK_DIR+spellbook;
- if (!(ski2=(mapping)(spellbook->QuerySpell(sfunc))))
+ if (!(ski2=({mapping})(spellbook->QuerySpell(sfunc))))
return 0;
return AddSkillMappings(ski2,ski); // Reihenfolge wichtig!
// Die Gilde kann Spelleigenschaften neu definieren!
@@ -260,14 +260,14 @@
ski+=sinfo;
spellbook=SPELLBOOK_DIR+spellbook;
// printf("%O %O %O %O\n",spellbook,caster,spell,ski);
- return (int)spellbook->UseSpell(caster,spell,ski);
+ return ({int})spellbook->UseSpell(caster,spell,ski);
}
static int
InitialSkillAbility(mapping ski, object pl) {
if (!ski || !pl) return 0;
return (300*GetOffset(SI_SKILLLEARN,ski,pl)+
- (200*(int)pl->QueryAttribute(A_INT)*
+ (200*({int})pl->QueryAttribute(A_INT)*
GetFactor(SI_SKILLLEARN,ski,pl))/100);
}
@@ -451,7 +451,7 @@
else if (sum > MAX_ABILITY)
sum = MAX_ABILITY;
- return (int)pl->SetProp(P_GUILD_RATING, sum);
+ return ({int})pl->SetProp(P_GUILD_RATING, sum);
}
// Wird von /std/player/quest.c aufgerufen, wenn Quest geloest.
diff --git a/std/living/life.c b/std/living/life.c
index d868cdd..7feb2c2 100644
--- a/std/living/life.c
+++ b/std/living/life.c
@@ -17,7 +17,7 @@
// P_POISON -- level of poison
// P_CORPSE -- corpse-object
// P_DEAF -- if living is deaf
-#pragma strong_types,save_types,rtt_checks
+#pragma strict_types,save_types,rtt_checks
#pragma range_check
#pragma no_clone
@@ -232,7 +232,7 @@
if ( QueryProp(P_XP) && objectp(enemy) )
{
if ( !QueryProp(P_NO_XP) )
- enemy->AddExp(dam*(int)QueryProp(P_TOTAL_WC)/10);
+ enemy->AddExp(dam*({int})QueryProp(P_TOTAL_WC)/10);
}
if (living(enemy)) {
@@ -516,7 +516,7 @@
// NPC_Killed_By() rufen.
if ( !query_once_interactive(ME) )
{
- object killer = ((object) QueryProp(P_KILLER)) || previous_object() ||
+ object killer = (({object}) QueryProp(P_KILLER)) || previous_object() ||
this_interactive() || this_player();
if ( killer && query_once_interactive(killer) )
diff --git a/std/living/moving.c b/std/living/moving.c
index b05262c..78a1cf5 100644
--- a/std/living/moving.c
+++ b/std/living/moving.c
@@ -3,7 +3,7 @@
// living/moving.c -- moving of living objects
//
// $Id: moving.c 9448 2016-01-22 17:52:28Z Zesstra $
-#pragma strong_types
+#pragma strict_types
#pragma save_types
#pragma range_check
#pragma no_clone
@@ -224,7 +224,7 @@
|| ((file_size(fn+".c")>0 ||
(file_size(vc=implode(explode(fn,"/")[0..<2],"/")+
"/virtual_compiler.c")>0 &&
- !catch(tmp=(int)call_other(vc,"QueryValidObject",fn);
+ !catch(tmp=({int})call_other(vc,"QueryValidObject",fn);
publish) && tmp>0)) &&
!catch(load_object(fn);publish) )) &&
(!interactive(ME) || !fn->QueryProp(P_NO_PLAYERS) ||
@@ -301,13 +301,13 @@
string *mout;
if ( !textout ){
if ( method & M_TPORT )
- textout = (string) QueryProp(P_MMSGOUT) ||
- (string) QueryProp(P_MSGOUT);
+ textout = ({string}) QueryProp(P_MMSGOUT) ||
+ ({string}) QueryProp(P_MSGOUT);
else
- textout = (mout = explode( (string)
+ textout = (mout = explode( ({string})
QueryProp(P_MSGOUT) || "",
"#" ))[0]
- || (string)QueryProp(P_MMSGOUT);
+ || ({string})QueryProp(P_MMSGOUT);
}
if ( !sizeof(direction) )
@@ -378,9 +378,9 @@
if ( !(method & M_SILENT) ) {
if ( !textin ) {
if ( method & M_TPORT )
- textin = (string) QueryProp(P_MMSGIN);
+ textin = ({string}) QueryProp(P_MMSGIN);
else
- textin = (string) QueryProp(P_MSGIN);
+ textin = ({string}) QueryProp(P_MSGIN);
}
inv = all_inventory(environment()) - ({ this_object() });
diff --git a/std/player/restrictions.c b/std/player/restrictions.c
index dc00415..4b79c2b 100644
--- a/std/player/restrictions.c
+++ b/std/player/restrictions.c
@@ -54,23 +54,18 @@
// **** local property methods
static int _query_max_weight() {
- int str,val;
- mixed ski;
-
if (QueryProp(P_GHOST) && !IS_WIZARD(ME))
return 0;
- str=QueryAttribute(A_STR);
- ski = UseSkill(SK_CARRY, ([SI_SKILLARG : str ]));
+ int str=QueryAttribute(A_STR);
+ int ski = UseSkill(SK_CARRY, ([SI_SKILLARG : str ]));
- if (!intp(ski))
- ski = 0;
-
+ int val;
if (str<0) {
- val=9200+str*160+(int)ski;
+ val=9200+str*160+ski;
if (val<3000) val=3000;
return val;
}
- val = 9200+str*800+(int)ski;
+ val = 9200+str*800+ski;
if (val<3000)
val = 3000;
return val;
diff --git a/std/player/skills.c b/std/player/skills.c
index fa60d1d..cdac73e 100644
--- a/std/player/skills.c
+++ b/std/player/skills.c
@@ -7,7 +7,7 @@
//
// 2003-01-20: Nun Zooks Baustelle
//
-#pragma strong_types
+#pragma strict_types
#pragma save_types
#pragma range_check
#pragma no_clone
@@ -45,7 +45,7 @@
// Wir holen die Gilden aus dem Gildenmaster
foreach(string guild:
- (string *)call_other(GUILDMASTER,"QueryProp",P_VALID_GUILDS))
+ ({string *})call_other(GUILDMASTER,"QueryProp",P_VALID_GUILDS))
{
if(catch(act=call_other("/gilden/"+guild,"QueryProp",
P_GUILD_DEACTIVATE_SKILLS); publish ))
@@ -299,8 +299,8 @@
//wt_aus=call_other(waf_aus,"QueryProp",P_WEAPON_TYPE);
//if (wt_azu==wt_aus)
if (objectp(waf_aus) && objectp(waf_azu) &&
- (string)waf_aus->QueryProp(P_WEAPON_TYPE)
- == (string)waf_azu->QueryProp(P_WEAPON_TYPE))
+ ({string})waf_aus->QueryProp(P_WEAPON_TYPE)
+ == ({string})waf_azu->QueryProp(P_WEAPON_TYPE))
{
// Bonus von bis zu 5 Punkten
//log_file("humni/log_azubi",
diff --git a/std/room/description.c b/std/room/description.c
index b09fdfa..9431d31 100644
--- a/std/room/description.c
+++ b/std/room/description.c
@@ -4,7 +4,7 @@
//
// $Id: description.c 9468 2016-02-19 21:07:04Z Gloinson $
-#pragma strong_types
+#pragma strict_types
#pragma save_types
#pragma range_check
#pragma no_clone
@@ -109,7 +109,7 @@
// ggf. Tueren hinzufuegen.
if (QueryProp(P_DOOR_INFOS)) {
- string tmp=((string)call_other(DOOR_MASTER,"look_doors"));
+ string tmp=(({string})call_other(DOOR_MASTER,"look_doors"));
if (stringp(tmp) && sizeof(tmp))
descr += tmp;
}
@@ -120,7 +120,7 @@
descr += GetExits(viewer) || "";
// Viewpoint (Objekt oder Objektarray) sind nicht sichtbar
- inv_descr = (string) make_invlist(viewer, all_inventory(ME)
+ inv_descr = ({string}) make_invlist(viewer, all_inventory(ME)
- (pointerp(viewpoint)?viewpoint:({viewpoint})) ,flags);
if ( inv_descr != "" )
@@ -164,7 +164,7 @@
descr += GetExits(viewer) || "";
// Viewpoint (Objekt oder Objektarray) sind nicht sichtbar
- inv_descr = (string) make_invlist( viewer, all_inventory(ME)
+ inv_descr = ({string}) make_invlist( viewer, all_inventory(ME)
- (pointerp(viewpoint)?viewpoint:({viewpoint})) );
if ( inv_descr != "" )
diff --git a/std/room/doors.c b/std/room/doors.c
index a9bab7d..10e1cca 100644
--- a/std/room/doors.c
+++ b/std/room/doors.c
@@ -86,12 +86,12 @@
string *cmds;
int i,j;
- if (!pointerp(info=(mixed *)QueryProp(P_DOOR_INFOS))) return;
+ if (!pointerp(info=({mixed *})QueryProp(P_DOOR_INFOS))) return;
add_action("oeffnen","oeffne");
add_action("schliessen","schliesse");
add_action("schliessen","schliess");
for (i=sizeof(info)-1;i>=0;i--) {
- cmds=(string *)(info[i][D_CMDS]);
+ cmds=({string *})(info[i][D_CMDS]);
for (j=sizeof(cmds)-1;j>=0;j--)
add_action("go_door",cmds[j]);
// Befehle IMMER anfuegen, gechecked wird sowieso erst beim Durchgehen.
@@ -108,14 +108,14 @@
{
if (!str || !QueryProp(P_DOOR_INFOS))
return 0;
- return (int) call_other(DOOR_MASTER,"oeffnen",str);
+ return ({int}) call_other(DOOR_MASTER,"oeffnen",str);
}
int schliessen (string str)
{
if (!str || !QueryProp(P_DOOR_INFOS))
return 0;
- return (int) call_other(DOOR_MASTER,"schliessen",str);
+ return ({int}) call_other(DOOR_MASTER,"schliessen",str);
}
varargs int
diff --git a/std/room/gilde.c b/std/room/gilde.c
index 3086fe1..737dfc2 100644
--- a/std/room/gilde.c
+++ b/std/room/gilde.c
@@ -3,7 +3,7 @@
// gilde.c -- Standardgilde
//
// $Id: gilde.c 8388 2013-02-16 17:28:31Z Zesstra $
-#pragma strong_types
+#pragma strict_types
#pragma save_types
#pragma range_check
#pragma no_clone
@@ -237,9 +237,9 @@
if (lev<0) lev=0;
if (pl->QueryProp(P_GENDER) == MALE)
- titles=(mapping)QueryProp(P_GUILD_MALE_TITLES);
+ titles=QueryProp(P_GUILD_MALE_TITLES);
else
- titles=(mapping)QueryProp(P_GUILD_FEMALE_TITLES);
+ titles=QueryProp(P_GUILD_FEMALE_TITLES);
if (!mappingp(titles) || !sizeof(titles)) return 0;
@@ -280,7 +280,7 @@
// Falls die konkrete Gilde des Spielern irgedwas mit dem Titel in
// ABhaengigkeit des Spielerlevels tun will. Ausnahmsweise per call_other,
// die Funktion kommt eigentlich aus /std/gilden_ob.c.
- string gname=(string)pl->QueryProp(P_GUILD);
+ string gname=({string})pl->QueryProp(P_GUILD);
(GUILD_DIR+"/"+gname)->adjust_title(pl);
return 1;
diff --git a/std/shells/magier/admin.c b/std/shells/magier/admin.c
index 7e86dc9..64f3168 100644
--- a/std/shells/magier/admin.c
+++ b/std/shells/magier/admin.c
@@ -45,7 +45,7 @@
if (member(({"commands","email","hosts","inetd","list","mud_port","time",
"version"}),type)==-1)
write("TYPEs: commands, email, hosts, inetd, list, mud_port, time, version\n");
- if (ret=(string)INETD->_send_udp(mud,([SENDER:getuid(), REQUEST:QUERY, DATA:type]),1))
+ if (ret=({string})INETD->_send_udp(mud,([SENDER:getuid(), REQUEST:QUERY, DATA:type]),1))
write(ret);
else
write("Anfrage abgeschickt.\n");
@@ -189,7 +189,7 @@
}
if ( arg=="*" )
{
- More((string)call_other("/secure/sinmaster","Dump",1));
+ More(({string})call_other("/secure/sinmaster","Dump",1));
return 1;
}
@@ -267,7 +267,7 @@
_notify_fail( "Syntax: mbanish <name> [<grund>]\n" );
if ( !str || !stringp(str) || !sizeof(str) ){
- if ( !mappingp(list = (mapping)"/secure/merlin"->MBanishList()) ||
+ if ( !mappingp(list = ({mapping})"/secure/merlin"->MBanishList()) ||
!(i = sizeof(list)) ){
write( "Momentan ist kein Spieler auf der mbanish-Liste.\n" );
return 1;
@@ -357,14 +357,21 @@
{
string ip;
int days;
- mapping sites;
// Mindestens L26 fuer diesen Befehl
if ( secure_level() <= DOMAINMEMBER_LVL )
return 0;
- if ( !str || !stringp(str) || !sizeof(str) ){
- if ( !sizeof(sites = (mapping)MASTER->SiteBanish( 0, 0 )) ){
+ if ( !str || !stringp(str) || !sizeof(str) )
+ {
+ mapping|int sites = ({mapping|int})MASTER->SiteBanish( 0, 0 );
+ if ( !mappingp(sites) )
+ {
+ write("Du darfst (noch) keine gesperrten Adressen abfragen!\n");
+ return 1;
+ }
+ if ( !sizeof(sites) )
+ {
write( "Es sind zur Zeit keine Adressen gesperrt!\n" );
return 1;
}
@@ -396,8 +403,11 @@
// _notify_fail( "Ungueltiges Adress-Format!\n" );
- if ( !days ){
- int res=(int)MASTER->SiteBanish(ip, 0);
+ if ( !days )
+ {
+ // Eigentlich ist SiteBanish() int|mapping. Bei diesem Aufruf kommt
+ // jedoch nur int zurueck. Fall sichs das mal aendert, soll es buggen.
+ int res=({int})MASTER->SiteBanish(ip, 0);
if ( res == 1 )
printf( "Die Adresse '%s' ist jetzt nicht mehr gesperrt.\n",
ip );
@@ -407,17 +417,23 @@
else
printf( "Du darfst nur eigene Sperrungen wieder aufheben!\n" );
}
- else {
- int res;
+ else
+ {
if ( days != 1 && !IS_DEPUTY(secure_euid()) )
+ {
write( "Du darfst Adressen nur fuer einen Tag sperren!\n" );
- else if ( (res = (int)MASTER->SiteBanish(ip, days)) == 1 )
+ return 1;
+ }
+ // Eigentlich ist SiteBanish() int|mapping. Bei diesem Aufruf kommt
+ // jedoch nur int zurueck. Fall sichs das mal aendert, soll es buggen.
+ int res = ({int})MASTER->SiteBanish(ip, days);
+ if ( res == 1 )
printf( "Die Adresse '%s' ist jetzt fuer %s gesperrt.\n",
ip, (days > 1 ? sprintf( "%d Tage", days ) :
(days > 0 ? "einen Tag" : "immer")) );
else if ( res == -1 )
write( "Du darfst " + (LORD_SECURITY ? "255 IP-Adressen"
- : "nur einzelne IP-Adressen") + " sperren!\n" );
+ : "nur einzelne IP-Adressen") + " sperren!\n" );
else if ( res == -2 )
write( "Du hast schon genug Adressen gesperrt!\n" );
}
diff --git a/std/shells/magier/fileedit.c b/std/shells/magier/fileedit.c
index b558585..b0bfeb0 100644
--- a/std/shells/magier/fileedit.c
+++ b/std/shells/magier/fileedit.c
@@ -95,8 +95,8 @@
static mixed cp_file(mixed filedata,int move,int flags, mixed *do_delete)
{
string source,dest;
- source=(string)filedata[FULLNAME];
- dest=(string)filedata[DESTNAME];
+ source=filedata[FULLNAME];
+ dest=filedata[DESTNAME];
if (source==dest) return ERROR(SAME_FILE,source,RET_FAIL);
if (!MAY_READ(source)) return ERROR(NO_READ,source,RET_JUMP);
if (!MAY_WRITE(dest)) return ERROR(NO_WRITE,dest,RET_JUMP);
diff --git a/std/shells/magier/fileview.c b/std/shells/magier/fileview.c
index f96d6e3..ca0aa20 100644
--- a/std/shells/magier/fileview.c
+++ b/std/shells/magier/fileview.c
@@ -161,7 +161,7 @@
string group="";
if (flags&LS_U)
{
- creator=(string)call_other(master(),"creator_file", full);
+ creator=({string})call_other(master(),"creator_file", full);
switch(creator)
{
case ROOTID: creator="root"; break;
@@ -445,10 +445,10 @@
!regexp(({""}),args[0]))
return printf("man: Ungueltiger Ausdruck in Maske.\n"),1;
}
- tmp=(string *)call_other(MAND,"locate",args[0],flags&(MAN_M|MAN_R));
+ tmp=({string *})call_other(MAND,"locate",args[0],flags&(MAN_M|MAN_R));
}
- oldman_result=(mapping)0;
+ oldman_result=0;
if(i && sizeof(tmp)>2 && sizeof(tmp)>=(i<<1))
tmp=tmp[((i<<1)-2)..((i<<1)-1)];
switch(sizeof(tmp))
@@ -500,7 +500,7 @@
if (flags==-1||sizeof(args)!=2)
return USAGE("rman <hilfeseite> <mudname>");
write("man: " +
- (string)call_other(UDP_CMD_DIR+"man","send_request",args[1],args[0]));
+ ({string})call_other(UDP_CMD_DIR+"man","send_request",args[1],args[0]));
return 1;
}
diff --git a/std/shells/magier/magier_ext.c b/std/shells/magier/magier_ext.c
index 9660015..365ac63 100644
--- a/std/shells/magier/magier_ext.c
+++ b/std/shells/magier/magier_ext.c
@@ -356,7 +356,7 @@
printf("Du hoerst auf zu snoopen.\n");
// evtl. irgendetwas loggen ... sollte eigentlich nicht passieren.
}
- snoopee=(object)0;
+ snoopee=0;
return 1;
}
SetProp(P_SNOOPFLAGS,flags); // FUNKTIONIERT NUR, WENN magier.h und
diff --git a/std/shells/magier/objects.c b/std/shells/magier/objects.c
index 1968de6..1a51ba5 100644
--- a/std/shells/magier/objects.c
+++ b/std/shells/magier/objects.c
@@ -119,7 +119,7 @@
else
ob=args[0];
cmdline=capitalize(to_string(ob->name(WER)));
- flags=(int)ob->QueryProp(P_PLURAL); // Missbrauch von flags :o)
+ flags=({int})ob->QueryProp(P_PLURAL); // Missbrauch von flags :o)
if (query_verb()=="destruct")
{
if (!ob->remove())
diff --git a/std/shells/magier/parsing.c b/std/shells/magier/parsing.c
index d719550..a38210a 100644
--- a/std/shells/magier/parsing.c
+++ b/std/shells/magier/parsing.c
@@ -33,7 +33,7 @@
// Rueckgabe: Dateiname
//
-static mixed to_filename(string str)
+static string to_filename(string str)
{
string *tmp,p,newfn;
int i;
@@ -88,7 +88,7 @@
}
if (build_fn)
{
- if (str=(string)to_filename(str)) line+=({ str });
+ if (str=to_filename(str)) line+=({ str });
}
else
line+= ({ str });
diff --git a/std/shells/magier/upd.c b/std/shells/magier/upd.c
index cd86d33..f48d73c 100644
--- a/std/shells/magier/upd.c
+++ b/std/shells/magier/upd.c
@@ -370,7 +370,7 @@
// mittels Configure()
if ( ! (flags & UPD_C ) )
{
- catch(restore_config=(mixed)call_resolved(&configdata,obj,
+ catch(restore_config=call_resolved(&configdata,obj,
"Configure",0);
publish);
// Wenn UPD_CONF gesetzt wird, _muss_ das Objekt ein oeffentliches
@@ -388,7 +388,7 @@
mixed items;
// Herausbekommen, ob hier Items existieren, die per AddItem
// erzeugt werden. Die duerfen nicht gesichert werden.
- items=(mixed)obj->QueryProp(P_ITEMS); // mixed, da array of arrays
+ items=({mixed})obj->QueryProp(P_ITEMS); // mixed, da array of arrays
if (pointerp(items)&&sizeof(items))
{
items=transpose_array(items)[0];
@@ -407,7 +407,7 @@
env = environment(obj);
if ( flags & UPD_C )
{
- pro = (mapping)(obj->QueryProperties());
+ pro = ({mapping})(obj->QueryProperties());
}
}
else inv = ({});
@@ -461,7 +461,7 @@
else if (restore_config)
{
int conf_res;
- if (!catch(conf_res=(int)obj->Configure(configdata); publish)
+ if (!catch(conf_res=({int})obj->Configure(configdata); publish)
&& conf_res == 1)
{
msg += ", (re-)konfiguriert";
diff --git a/std/thing/commands.c b/std/thing/commands.c
index 5bfa386..c3eddf6 100644
--- a/std/thing/commands.c
+++ b/std/thing/commands.c
@@ -277,7 +277,7 @@
// ggf. id in das ID-Mapping eintragen
if(cmdid) {
mixed *tmp;
- j=sizeof((string*)added_cmds[str, CMDIDX_FUN]);
+ j=sizeof(added_cmds[str, CMDIDX_FUN]);
tmp=added_cmds[str, CMDIDX_ID]||allocate(j);
if(sizeof(tmp)<j) tmp+=allocate(j-sizeof(tmp));
tmp[<1]=cmdid;
@@ -355,7 +355,8 @@
cachecl[j..j] = allocate(0);
if(ids) {
ids[j..j] = allocate(0);
- if(!sizeof(ids-allocate(1))) ids=(mixed*)0;
+ if(!sizeof(ids-allocate(1)))
+ ids=0;
}
ret++;
}
@@ -378,7 +379,7 @@
static int _execute(mixed fun, string str, mixed *parsed) {
switch(typeof(fun)) {
case T_CLOSURE:
- return ((int)funcall(fun,str,&parsed));
+ return (({int})funcall(fun,str,&parsed));
case T_STRING:
int ret;
if(!call_resolved(&ret, this_object(), fun, str, &parsed))
@@ -488,7 +489,7 @@
else if(check_present&CHECK_ID && id(tmpstr)) // ID ?
matchstr=this_object();
else if((check_present&CHECK_PUTGET) && // PUT_GET_??? ?
- (tmpobj=(object*)
+ (tmpobj=({object*})
this_player()->find_obs(tmpstr,
([CHECK_PUTGETNONE:PUT_GET_NONE,
CHECK_PUTGETDROP:PUT_GET_TAKE,
@@ -669,7 +670,7 @@
}
static mapping _set_commands(mapping commands) {
- if(!commands) added_cmds=(mapping)0;
+ if(!commands) added_cmds=0;
else if(mappingp(commands)) {
if(widthof(commands) != CMDS_WIDTH)
raise_error("SetProp(P_COMMANDS): corrupt commands-mapping.\n");
diff --git a/std/thing/description.c b/std/thing/description.c
index 15d6afc..b2326da 100644
--- a/std/thing/description.c
+++ b/std/thing/description.c
@@ -88,7 +88,7 @@
Set( P_CLONER, NOSETMETHOD|SECURED, F_MODE_AS );
// Gibt es FPs ?
- explore = (mixed *)EPMASTER->QueryExplore();
+ explore = ({<string*|int>*})EPMASTER->QueryExplore();
return;
}
@@ -121,7 +121,7 @@
// Danach sollte der EPMASTER neu nach den Details befragt werden.
visible void __reload_explore()
{
- explore = (mixed *)EPMASTER->QueryExplore();
+ explore = ({<string*|int>*})EPMASTER->QueryExplore();
return;
}
@@ -359,7 +359,7 @@
case WEM:
case WEN:
if ( art && last=='e'&&QueryProp(P_GENDER) == MALE)
- sh = (string)sh + "n";
+ sh = sh + "n";
break;
case WESSEN:
@@ -370,11 +370,11 @@
case 'x':
case 's':
case 'z':
- sh = (string)sh + "'";
+ sh = sh + "'";
break;
default:
- sh = (string)sh + "s";
+ sh = sh + "s";
}
}
else
@@ -383,11 +383,11 @@
{
default:
if (QueryProp(P_GENDER)!=FEMALE)
- sh=(string)sh+"s";
+ sh=sh+"s";
break;
case 'e':
if (QueryProp(P_GENDER)==MALE)
- sh=(string)sh+"n";
+ sh=sh+"n";
case 'x':
case 's':
case 'z':
@@ -398,7 +398,7 @@
} /* pointerp(sh) */
// RAW? Dann mal zurueck
- if (demon == RAW) return (string)sh;
+ if (demon == RAW) return sh;
// Selber Artikel suchen ...
if (demon==2)
@@ -653,11 +653,11 @@
if (!stringp(detail))
{
if (closurep(detail))
- detail = (string)funcall(detail,key);
+ detail = ({string})funcall(detail,key);
else if (mappingp(detail))
- detail = (string)(detail[race]||detail[0]);
+ detail = detail[race] || detail[0];
else if (pointerp(detail))
- detail = (string)(detail[random(sizeof(detail))]);
+ detail = detail[random(sizeof(detail))];
}
// FP vergeben (so vorhanden ;-) )
@@ -722,7 +722,7 @@
if (stringp(str))
str = ({ str });
// Aliase aufloesen und implizite Klassen addieren.
- str = (string*)CLASSDB->AddImplicitClasses(str);
+ str = ({string*})CLASSDB->AddImplicitClasses(str);
// Summe mit alten Klassen bilden und Doppelte eliminieren
str = str + Query(P_CLASS, F_VALUE);
Set( P_CLASS, m_indices(mkmapping(str)), F_VALUE);
@@ -737,7 +737,7 @@
str = ({ str });
// Aliase aufloesen und implizite Klassen addieren.
- str = (string*)CLASSDB->AddImplicitClasses(str);
+ str = ({string*})CLASSDB->AddImplicitClasses(str);
// Und alle - inklusive impliziter Klassen - entfernen
// TODO: Pruefen, ob dies die richtige Entscheidung ist.
@@ -833,14 +833,14 @@
// Anteil der Gruppe am Objekt
public int QueryMaterialGroup( string matgroup )
{
- return (int)call_other( MATERIALDB, "MaterialGroup",
+ return ({int})call_other( MATERIALDB, "MaterialGroup",
QueryProp(P_MATERIAL), matgroup );
}
public string MaterialList( int casus, mixed idinf )
{
- return (string)call_other( MATERIALDB, "ConvMaterialList",
+ return ({string})call_other( MATERIALDB, "ConvMaterialList",
QueryProp(P_MATERIAL), casus, idinf );
}
diff --git a/std/thing/moving.c b/std/thing/moving.c
index 978fe97..8845c10 100644
--- a/std/thing/moving.c
+++ b/std/thing/moving.c
@@ -41,11 +41,11 @@
return ME_CANT_BE_TAKEN;
// Gewicht ermitteln
- if ( !(tmp = (int)QueryProp(P_TOTAL_WEIGHT)) )
- tmp = (int)QueryProp(P_WEIGHT);
+ if ( !(tmp = ({int})QueryProp(P_TOTAL_WEIGHT)) )
+ tmp = ({int})QueryProp(P_WEIGHT);
// Ist das Objekt nicht zu schwer?
- if ( (tmp = (int)dest->MayAddWeight(tmp)) < 0) {
+ if ( (tmp = ({int})dest->MayAddWeight(tmp)) < 0) {
if ( tmp == -2 ) return ME_TOO_HEAVY_FOR_ENV;
return ME_TOO_HEAVY;
}
@@ -87,7 +87,7 @@
// Bewegung in Para-Welt-Raeume?
// tmp ist die Ziel-Parallelweltnummer
if (!environment()||!living(environment())||
- !intp(tmp =(int)environment()->Query(P_PARA)))
+ !intp(tmp =({int})environment()->Query(P_PARA)))
tmp=0;
// Wenn das Objekt von einem in der Parawelt befindlichen Spieler
@@ -110,7 +110,7 @@
if ( (find_object(fn) || ((file_size(fn+".c")>0||
(file_size(vc=implode(explode(fn,"/")[0..<2],"/")+
"/virtual_compiler.c")>0 &&
- !catch(tmp=(int)call_other(vc,"QueryValidObject",fn);
+ !catch(tmp=({int})call_other(vc,"QueryValidObject",fn);
publish) && tmp>0)) &&
!catch(load_object( fn );publish))) &&
(!fn->QueryProp(P_NO_PLAYERS) || QueryProp(P_TESTPLAYER)) )
diff --git a/std/unit.c b/std/unit.c
index 415c71e..3024714 100644
--- a/std/unit.c
+++ b/std/unit.c
@@ -109,12 +109,13 @@
static int _query_weight()
{
- mixed gpu, req;
- if ((req=QueryProp(U_REQ))<1) return 0;
- gpu=Query(U_GPU);
- if (intp(gpu)) return req * gpu;
- if (!pointerp(gpu)) return 0;
- return MAX(1,(req*gpu[0])/gpu[1]);
+ int req = QueryProp(U_REQ);
+ if (req<1)
+ return 0;
+ int|int* gpu=Query(U_GPU, F_VALUE);
+ if (pointerp(gpu))
+ return MAX(1,(req*gpu[0])/gpu[1]);
+ return req * gpu;
}
static int _set_weight(int num) {
@@ -125,19 +126,18 @@
static int _query_total_weight()
{
- mixed gpu, amount;
- if ((amount=Query(P_AMOUNT))<1) return 0;
- gpu=Query(U_GPU);
- if (intp(gpu))
- return amount*(int)gpu;
- if (!pointerp(gpu)) return 0;
- return MAX(1,(amount*gpu[0])/gpu[1]);
+ int amount = Query(P_AMOUNT);
+ if (amount<1)
+ return 0;
+ int|int* gpu=Query(U_GPU, F_VALUE);
+ if (pointerp(gpu))
+ return MAX(1,(amount*gpu[0])/gpu[1]);
+ return amount*gpu;
}
static int _query_plural()
{
- int i;
- i=QueryProp(U_REQ); // wichtig _nicht_ QueryProp
+ int i = QueryProp(U_REQ);
return (i<=1 ? 0 : i);
}
@@ -145,8 +145,8 @@
static string|string* _query_name()
{
if (QueryProp(U_REQ)==1)
- return "%s%s"+((string *)Query(P_NAME))[0];
- return "%d %s"+((string *)Query(P_NAME))[1];
+ return "%s%s"+Query(P_NAME)[0];
+ return "%d %s"+Query(P_NAME)[1];
}
// gibt string | string* zurueck.
diff --git a/std/user_filter.c b/std/user_filter.c
index 111dfcb..edc3deb 100644
--- a/std/user_filter.c
+++ b/std/user_filter.c
@@ -3,8 +3,7 @@
// user_filter.c -- Hilfsmodul fuer die wer-Liste
//
// $Id: user_filter.c 8755 2014-04-26 13:13:40Z Zesstra $
-#pragma strict_types
-#pragma save_types
+#pragma save_types,rtt_checks
#pragma no_clone
#pragma range_check
@@ -37,7 +36,7 @@
static int is_prop_set( object ob, mixed x )
{
- return (mixed)ob->QueryProp(x) != 0;
+ return ob->QueryProp(x) != 0;
}
static int is_second( object ob, mixed x )
@@ -56,13 +55,14 @@
// nur Magier koennen eine andere Gilde per P_VISIBLE_GUILD in werlisten
// etc. vortaeuschen.
- if (IS_LEARNER(ob)) {
+ if (IS_LEARNER(ob))
+ {
// Querymethode von P_VISIBLE_GUILD fragt ggf. auch P_GUILD ab.
- if ( !stringp(str = (string)ob->QueryProp(P_VISIBLE_GUILD)) )
- return 0;
+ str = ob->QueryProp(P_VISIBLE_GUILD);
}
- else {
- str = (string)ob->QueryProp(P_GUILD);
+ else
+ {
+ str = ob->QueryProp(P_GUILD);
}
if (!stringp(str)) return 0; // login hat z.B. keine Gilde.
return strstr(lower_case(str),x) == 0;
@@ -70,12 +70,12 @@
static int is_in_team( object ob, mixed x )
{
- object team;
-
- if ( !objectp(team = (object)ob->QueryProp(P_TEAM)) )
+ object team = ob->QueryProp(P_TEAM);
+
+ if ( !objectp(team) )
return x == "";
-
- return lower_case((string)team->Name()) == x;
+
+ return lower_case(team->Name()) == x;
}
static int is_name_in( object ob, mixed x )
@@ -91,17 +91,17 @@
static int is_region_member( object ob, mixed x )
{
- return (int)master()->domain_member( geteuid(ob), x );
+ return master()->domain_member( geteuid(ob), x );
}
static int is_region_master( object ob, mixed x )
{
- return (int)master()->domain_master( geteuid(ob), x );
+ return master()->domain_master( geteuid(ob), x );
}
static int is_guild_master(object ob, mixed x)
{
- return (int)master()->guild_master(geteuid(ob), x);
+ return master()->guild_master(geteuid(ob), x);
}
static int is_gender( object ob, mixed x )
@@ -131,7 +131,7 @@
static int is_ghost( object ob)
{
- return (int)ob->QueryProp(P_GHOST);
+ return ob->QueryProp(P_GHOST);
}
static int uses_ssl(object ob)
@@ -146,7 +146,7 @@
}
protected int is_active_guide(object ob) {
- int cic=(int)ob->QueryProp(P_NEWBIE_GUIDE);
+ int cic=({int})ob->QueryProp(P_NEWBIE_GUIDE);
if (!intp(cic) || cic <= 0)
return 0;
else if (cic < 60)
@@ -389,16 +389,15 @@
case "erwartete":
if ( i < (sz-1) && words[i+1] == "wegen" ) {
i++;
-
- if ( !mappingp(x = (mixed)this_player()->QueryProp(P_WAITFOR_REASON)) ||
- !pointerp(x = m_indices(x)) )
+ x = this_player()->QueryProp(P_WAITFOR_REASON);
+ if ( !mappingp(x) )
break;
-
+ x=m_indices(x);
zwi = filter( orig, "is_name_in", ME, x );
break;
}
-
- if ( !pointerp(x = (mixed)this_player()->QueryProp(P_WAITFOR)) )
+ x = this_player()->QueryProp(P_WAITFOR);
+ if ( !pointerp(x) )
break;
zwi = filter( orig, "is_name_in", ME, x );
break;
diff --git a/std/util/pager.c b/std/util/pager.c
index 54980c3..f3219fa 100644
--- a/std/util/pager.c
+++ b/std/util/pager.c
@@ -4,7 +4,7 @@
//
// $Id: pager.c 8755 2014-04-26 13:13:40Z Zesstra $
-#pragma strong_types
+#pragma strict_types
#pragma save_types
#pragma range_check
#pragma no_clone
@@ -124,9 +124,9 @@
pinfo[MAXL] += sizeof(explode(tmp, "\n"))+1;
pinfo[PAGE] = PAGELENGTH;
if(!pinfo[PAGE]) pinfo[FLAG] |= E_CAT;
- if ((this_interactive() && (j=(int)this_interactive()->QueryProp(P_MORE_FLAGS))) ||
+ if ((this_interactive() && (j=({int})this_interactive()->QueryProp(P_MORE_FLAGS))) ||
(this_player() && interactive(this_player()) &&
- (j=(int)this_player()->QueryProp(P_MORE_FLAGS))))
+ (j=({int})this_player()->QueryProp(P_MORE_FLAGS))))
pinfo[FLAG] |= j;
pinfo[CURL] = 1;
diff --git a/std/util/path.c b/std/util/path.c
index 193a865..00ceaa6 100644
--- a/std/util/path.c
+++ b/std/util/path.c
@@ -40,7 +40,7 @@
break;
default:
if(user && PL && getuid(PL) == user
- && (cwd=(string)PL->QueryProp(P_CURRENTDIR)))
+ && (cwd=({string})PL->QueryProp(P_CURRENTDIR)))
path=cwd + "/" + path;
}
return path;
diff --git a/sys/magier.h b/sys/magier.h
index f6eb3a8..544bcc7 100644
--- a/sys/magier.h
+++ b/sys/magier.h
@@ -214,7 +214,7 @@
static string *parseargs(string cmdline,int flags,string opts,int build_fn);
static varargs void asynchron(mixed* array, closure cmd, mixed data, mixed flags, int c);
static varargs mixed *file_list(string *files, int mode, int recursive, string dest, string mask);
-static mixed to_filename(string str);
+static string to_filename(string str);
static int _verfolge(string str);
static string glob2regexp(string str);