Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 2f83091

Browse files
tsathoqquathefallentree
authored andcommitted
More array fixes - all daemons, cmds, adversary, body and std stuff loads now.
Added a sefun override called terminal_colour() to avoid an ANSI issue Fixed various misuse of less stringent parser.
1 parent d70b1d0 commit 2f83091

File tree

19 files changed

+52
-42
lines changed

19 files changed

+52
-42
lines changed

lib/cmds/player/random2.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ inherit CMD;
66
mapping data = ([ ]);
77
mapping reverse = ([ ]);
88

9-
*todo;
9+
string *todo;
1010

1111
void process() {
12-
*block = todo[0..99];
12+
string *block = todo[0..99];
1313
mapping m;
1414

1515
todo = todo[100..];
@@ -20,7 +20,7 @@ void process() {
2020
string soul = SOUL_D->query_emote(emote);
2121

2222
foreach (string rule, string value in soul) {
23-
*parts;
23+
mixed *parts;
2424
string l1, l2, tmp;
2525

2626
if (!stringp(value)) continue;
@@ -42,7 +42,7 @@ void process() {
4242

4343
tmp = part + " " + l1;
4444
if (!reverse[tmp]) {
45-
if ( sizeof(reverse) >= get_config(__MAX_MAPPING_SIZE__) )
45+
if ( sizeof(reverse) >= to_int(get_config(__MAX_MAPPING_SIZE__)) )
4646
return;
4747
reverse[tmp] = ([ ]);
4848
}
@@ -100,7 +100,7 @@ private void main(string str) {
100100
string ret;
101101

102102
if (str) {
103-
*choices = map(filter(keys(data), (: strsrch($1, $(str) + " ") == 0 :)), (: $1[strsrch($1, ' ')+1..] :));
103+
string *choices = map(filter(keys(data), (: strsrch($1, $(str) + " ") == 0 :)), (: $1[strsrch($1, ' ')+1..] :));
104104
string next;
105105

106106
if (!sizeof(choices)) {

lib/cmds/player/tell.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private void main(string arg)
121121

122122
if( arg[0] == ';' || arg[0] == ':' )
123123
{
124-
*soul_ret;
124+
string *soul_ret;
125125
arg = arg[1..];
126126
soul_ret = SOUL_D->parse_imud_soul(arg);
127127

@@ -176,7 +176,7 @@ private void main(string arg)
176176

177177
if( arg[0] == ':' || arg[0] == ';' )
178178
{
179-
*soul_ret;
179+
string *soul_ret;
180180
int tindex;
181181

182182
arg = arg[1..];

lib/cmds/verbs/load.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void do_load_obj_with_obj(object ob1, object ob2)
99

1010
void do_load_obj_with_obs( object ob1, object *ob2)
1111
{
12-
handle_obs(ob1, (: do_load_obj_with_obj :), ob2);
12+
handle_obs(({ob1}), (: do_load_obj_with_obj :), ob2);
1313
}
1414

1515
void do_load_obj_in_obj(object ob1, object ob2)

lib/daemons/doc_d.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ inherit M_DAEMON_DATA;
7272

7373
private void continue_scan();
7474
private int last_time;
75-
private *files_to_do, dirs_to_do;
75+
private mixed *files_to_do;
76+
private mixed *dirs_to_do;
7677

7778
private void delete_directory(string directory)
7879
{
@@ -169,7 +170,7 @@ void process_file(string fname)
169170
{
170171
string file = read_file(fname);
171172
string line, prototype;
172-
*lines, match;
173+
string *lines, match;
173174
string outfile = 0;
174175
int i;
175176

@@ -303,8 +304,8 @@ void process_file(string fname)
303304

304305
void continue_scan()
305306
{
306-
*files;
307-
*item;
307+
mixed *files;
308+
mixed *item;
308309

309310
for (int i = 0; i < 10; i++)
310311
{

lib/daemons/memcheck_d.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Do not remove the headers from this file! see /USAGE for more info. */
22

33
string *known = ({ "Performing memory tests ..." });
4-
string *last_post_*= ({});
4+
string *last_post_array= ({});
55
int last_post;
66

77
void create() {
@@ -11,7 +11,7 @@ void create() {
1111
function f = function(function f) {
1212
string *s = explode(check_memory(), "\n") - known;
1313

14-
if (sizeof(s - last_post_array) || sizeof(last_post_*- s)) {
14+
if (sizeof(s - last_post_array) || sizeof(last_post_array- s)) {
1515
if (last_post)
1616
NEWS_D->remove_post("driver.leaks", last_post);
1717

lib/daemons/news_d.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ nomask void remove_post(string group, int id)
654654

655655
varargs nomask int * get_messages(string group, int no_removed)
656656
{
657-
*ret = keys(data[group]) - ({ "next_id" });
657+
mixed *ret = keys(data[group]) - ({ "next_id" });
658658

659659
if(is_read_restricted(group))
660660
return 0;
@@ -863,7 +863,7 @@ void dump(string path) {
863863
}
864864

865865
*search_for(string what) {
866-
*ret = ({});
866+
mixed *ret = ({});
867867

868868
foreach (string group, mapping contents in data) {
869869
foreach (mixed id, class news_msg post in contents) {
@@ -878,7 +878,7 @@ void dump(string path) {
878878
}
879879

880880
*search_for_author(string who) {
881-
*ret = ({});
881+
mixed *ret = ({});
882882

883883
foreach (string group, mapping contents in data) {
884884
foreach (mixed id, class news_msg post in contents) {

lib/secure/daemons/imail_d.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void receive_ack(mapping ack_list)
183183
varargs private void handle_ack(mapping ack_list, int flag)
184184
{
185185
int id;
186-
string array errorset;
186+
string *errorset;
187187
class outgoing_info info;
188188
class mail_msg this_msg;
189189

@@ -235,7 +235,7 @@ private *prep_message(int id, class outgoing_info info)
235235
private void send_message(int id)
236236
{
237237
class outgoing_info this_info;
238-
array packet;
238+
mixed *packet;
239239

240240
this_info = outgoing_queue[id];
241241
if (!IMUD_D->mud_exists(this_info->mudname))
@@ -426,8 +426,8 @@ void enqueue_message(class mail_msg msg)
426426

427427
private string *get_local_recipients(mixed *mail_packet)
428428
{
429-
string array mudnames;
430-
string * local_recipients = ({});
429+
string *mudnames;
430+
string *local_recipients = ({});
431431

432432
mudnames = filter(keys(mail_packet[3]), // TO list
433433
(: mud_name() == IMUD_D->canon_mudname($1) :));
@@ -479,8 +479,8 @@ varargs string *targ_map_to_list(mapping info, int flag)
479479

480480
string *incoming_mail(string mudname, mixed *mail_packet)
481481
{
482-
string * local_recipients;
483-
string array errors = ({});
482+
string *local_recipients;
483+
string *errors = ({});
484484
int i;
485485

486486
if(previous_object() != find_object(IMUD_D))

lib/secure/simul_efun/overrides.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ void write(string str) {
1818
}
1919
}
2020

21+
//:FUNCTION terminal_colour
22+
//Override of efun to avoid some driver issues.
23+
string terminal_colour(string str, mapping m, int wrap, int indent)
24+
{
25+
str = efun::terminal_colour(str, m, wrap, indent);
26+
str = replace_string(str, "\e[0;10m", "");
27+
str = replace_string(str, "\e[49;49m", "");
28+
return str;
29+
}
30+
2131
//:FUNCTION ed
2232
//The ed() efun is not used by the LIMA mudlib, as we use the new ed
2333
//functionality. See ed_session.c

lib/std/adversary/armor/limbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ object *query_armors(string s)
5656
nomask int wear_item(object what, string where)
5757
{
5858
class wear_info wi;
59-
*also;
59+
mixed *also;
6060

6161
wi = find_wi(where);
6262
if(!wi || wi->primary)

lib/std/adversary/health/wounds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ varargs int hurt_us(int x, string limb)
7878
void heal_limb(string limb, int x)
7979
{
8080
int i = 0;
81-
*tmp = wounds[limb];
81+
mixed *tmp = wounds[limb];
8282
int n = sizeof(tmp);
8383
int left = x;
8484

@@ -133,7 +133,7 @@ void kill_us()
133133
void health_periodic()
134134
{
135135
string limb;
136-
*w;
136+
mixed *w;
137137
int i, n, severity, delta;
138138

139139
/* pick a random wound, and make it better or worse by up to 20%;
@@ -203,7 +203,7 @@ string *query_all_wounds()
203203
return keys(wounds);
204204
}
205205

206-
*query_wounds(string limb)
206+
int *query_wounds(string limb)
207207
{
208208
return wounds[limb];
209209
}

lib/std/adversary/wield/limbs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
void simple_action(string, object);
66
int query_health(string);
7-
varargs mixed call_hooks(string, mixed, mixed, array...);
7+
varargs mixed call_hooks(string, mixed, mixed, mixed *...);
88

99
private mapping weapons = ([ ]);
1010

@@ -27,7 +27,7 @@ varargs void wield(object ob, string limb)
2727
limb = find_an_open_limb();
2828
if(!limb)
2929
{
30-
*limbs = filter(query_wielding_limbs(), (: query_health($1) > 0 :));
30+
mixed *limbs = filter(query_wielding_limbs(), (: query_health($1) > 0 :));
3131

3232
if(!sizeof(limbs)) /* Houston, we have a problem. */
3333
{
@@ -66,7 +66,7 @@ varargs object query_weapon(string limb)
6666
{
6767
if(!limb)
6868
{
69-
*limbs = filter(query_wielding_limbs(), (: weapons[$1] :));
69+
mixed *limbs = filter(query_wielding_limbs(), (: weapons[$1] :));
7070
if(!sizeof(limbs))
7171
return this_object(); // return 0?
7272

@@ -91,7 +91,7 @@ int do_unwield(mixed limb)
9191
{
9292
if(objectp(limb))
9393
{
94-
*limbs = filter(query_wielding_limbs(),
94+
mixed *limbs = filter(query_wielding_limbs(),
9595
(: weapons[$1] == $(limb) :));
9696
if(!sizeof(limbs))
9797
return 0;

lib/std/bed.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ void mudlib_setup()
1515
add_relation("under",VERY_LARGE);
1616
set_max_capacity(VERY_LARGE*3, "on");
1717
/* NOTE: 'sit on' is already added by FURNITURE */
18-
add_method("lie on",this_object(),(:enter_check:),"$N $vlie on the bed");
18+
add_method("lie on",this_object(),(:enter_check:),({"$N $vlie on the bed"}));
1919
/* This probably isn't a very good capacity for under */
2020
add_method("crawl under",this_object(),(:enter_check:),
21-
"$N $vcrawl under the bed");
21+
({"$N $vcrawl under the bed"}));
2222
}
2323

lib/std/book.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void add_contents(mapping additions)
239239
void remove_contents(string *headings...)
240240
{
241241
foreach(string heading in flatten_array(headings))
242-
remove_synonym(headings);
242+
remove_synonym(heading);
243243
}
244244

245245
//:FUNCTION query_content_page

lib/std/fluid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void create(){
9595
set_quantity( 1 );
9696
}
9797

98-
varargs void set_fluid_level( int x, string y ){
98+
varargs void set_fluid_level( int x, int y ){
9999
#ifdef USE_SIZE
100100
set_size( x );
101101
#endif

lib/std/furniture.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ void mudlib_setup()
2121
::mudlib_setup();
2222
add_relation("on",VERY_LARGE);
2323

24-
add_method("sit on",this_object(),(: enter_check :),"$N $vsit on the $o,");
25-
add_method("stand",(:environment(this_object()):),1,"$N $vstand up");
24+
add_method("sit on",this_object(),(: enter_check :),({"$N $vsit on the $o,"}));
25+
add_method("stand",(:environment(this_object()):),1,({"$N $vstand up"}));
2626
}
27-

lib/std/room/exits.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inherit M_EXIT;
66
#include <hooks.h>
77

88
varargs mixed call_hooks(string tag, mixed func, mixed start,
9-
*args...);
9+
mixed *args...);
1010
string get_default_exit();
1111
void do_go_somewhere(string);
1212

lib/trans/cmds/findfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private void end_building()
3232
private void do_building()
3333
{
3434
int i = ITERS_PER_CALL;
35-
string array this_dir;
35+
string *this_dir;
3636

3737
while(i--)
3838
{

lib/trans/cmds/more.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inherit CMD;
1515

1616
private void main(mixed *arg, mapping flags, string stdin)
1717
{
18-
*files = arg[0];
18+
mixed *files = arg[0];
1919
if (!files) {
2020
if (!stdin) {
2121
out("Too few arguments.\n");

lib/trans/obj/dataedit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int save_data_file(string fname) {
4949
}
5050

5151
mixed expression(string str) {
52-
*parts = reg_assoc(str, ({ "\\$\\$", "\\$[a-zA-Z0-9_]+" }), ({ 1, 2 }));
52+
mixed *parts = reg_assoc(str, ({ "\\$\\$", "\\$[a-zA-Z0-9_]+" }), ({ 1, 2 }));
5353
string expr = "mixed expression(mapping internal_data) {\nreturn ";
5454
mixed value;
5555
object ob;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy