diff --git a/lib/modules/Array.pmod b/lib/modules/Array.pmod index eba288228d775b2a4e13f8f103a6853d7a6addda..20a5b93922d705b0287a527276344a266c59566f 100644 --- a/lib/modules/Array.pmod +++ b/lib/modules/Array.pmod @@ -147,28 +147,28 @@ array permute(array a,int n) return a; } -int search_array(mixed *arr, mixed fun, mixed ... args) +int search_array(array arr, mixed fun, mixed ... args) { int e; if(stringp(fun)) { for(e=0;e<sizeof(arr);e++) - if(arr[e][fun](@args)) + if(([array(object)]arr)[e][fun](@args)) return e; return -1; } else if(functionp(fun)) { for(e=0;e<sizeof(arr);e++) - if(fun(arr[e],@args)) + if(([function]fun)(arr[e],@args)) return e; return -1; } else if(intp(fun)) { for(e=0;e<sizeof(arr);e++) - if(arr[e](@args)) + if(([array(function)]arr)[e](@args)) return e; return -1; } @@ -178,9 +178,9 @@ int search_array(mixed *arr, mixed fun, mixed ... args) } } -mixed *sum_arrays(function foo, mixed * ... args) +array sum_arrays(function foo, array(mixed) ... args) { - mixed *ret; + array ret; int e,d; ret=allocate(sizeof(args[0])); for(e=0;e<sizeof(args[0]);e++) @@ -188,7 +188,7 @@ mixed *sum_arrays(function foo, mixed * ... args) return ret; } -mixed *sort_array(array foo,function|void cmp, mixed ... args) +array sort_array(array foo,function|void cmp, mixed ... args) { array bar,tmp; int len,start; @@ -447,16 +447,16 @@ array(array(array)) diff3 (array a, array b, array c) // diff3, complement to diff (alpha stage) -array(array(array(mixed))) diff3_old(array mid,array left,array right) +array(array(array)) diff3_old(array mid,array left,array right) { - array lmid,ldst; - array rmid,rdst; + array(array) lmid,ldst; + array(array) rmid,rdst; [lmid,ldst]=diff(mid,left); [rmid,rdst]=diff(mid,right); int l=0,r=0,n; - array res=({}); + array(array(array)) res=({}); int lpos=0,rpos=0; array eq=({}); int x; diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod index 3aadd377b2564ee0d6d4c85d749b3b3f87fcdd99..de5fe50649888b4aafdd941220b01f4ef4c796e2 100644 --- a/lib/modules/Process.pmod +++ b/lib/modules/Process.pmod @@ -32,11 +32,11 @@ string sh_quote(string s) ({"\\\\", "\\'", "\\\"","\\ "})); } -string *split_quoted_string(string s) +array(string) split_quoted_string(string s) { s=replace(s, ({"\"","'","\\"," "}), ({"\0\"","\0'","\0\\","\0 "})); - string *x=s/"\0"; - string *ret=({x[0]}); + array(string) x=s/"\0"; + array(string) ret=({x[0]}); for(int e=1;e<sizeof(x);e++) { @@ -173,7 +173,7 @@ class Spawn private object low_spawn(array(void|object(Stdio.File)) fdp, array(void|object(Stdio.File)) fd_to_close, - string cmd, void|string *args, + string cmd, void|array(string) args, void|mapping(string:string) env, string|void cwd) { diff --git a/lib/modules/Protocols.pmod/DNS.pmod b/lib/modules/Protocols.pmod/DNS.pmod index 198b64487ecd4485ed1e7b09d2cda7f3ccccf7be..3e841c4bd136aea628a5c6735471bd9c466c1485 100644 --- a/lib/modules/Protocols.pmod/DNS.pmod +++ b/lib/modules/Protocols.pmod/DNS.pmod @@ -66,13 +66,13 @@ class protocol return low_mkquery(random(65536),dname,cl,type); } - string decode_domain(string msg, int *n) + string decode_domain(string msg, array(int) n) { - string *domains=({}); + array(string) domains=({}); int pos=n[0]; int next=-1; - string *ret=({}); + array(string) ret=({}); while(pos < sizeof(msg)) { switch(int len=msg[pos]) @@ -96,30 +96,30 @@ class protocol } } - string decode_string(string s, int *next) + string decode_string(string s, array(int) next) { int len=s[next[0]]; next[0]+=len+1; return s[next[0]-len..next[0]-1]; } - int decode_short(string s, int *next) + int decode_short(string s, array(int) next) { sscanf(s[next[0]..next[0]+1],"%2c",int ret); next[0]+=2; return ret; } - int decode_int(string s, int *next) + int decode_int(string s, array(int) next) { sscanf(s[next[0]..next[0]+1],"%2c",int ret); next[0]+=2; return ret; } - mixed *decode_entries(string s,int num, int *next) + array decode_entries(string s,int num, array(int) next) { - string *ret=({}); + array(string) ret=({}); for(int e=0;e<num && next[0]<strlen(s);e++) { mapping m=([]); @@ -194,13 +194,13 @@ class protocol m->length=strlen(s); - string *tmp=({}); + array(string) tmp=({}); int e; if(m->qdcount!=1) return m; - int *next=({12}); + array(int) next=({12}); m->qd=decode_domain(s,next); sscanf(s[next[0]..next[0]+3],"%2c%2c",m->type, m->cl); next[0]+=4; @@ -417,7 +417,7 @@ class client //! </data_description> //! - mixed *gethostbyname(string s) + array gethostbyname(string s) { mapping m; if(sizeof(domains) && s[-1] != '.' && sizeof(s/".") < 3) { @@ -437,8 +437,8 @@ class client return ({ 0, ({}), ({}) }); } - string *names=({}); - string *ips=({}); + array(string) names=({}); + array(string) ips=({}); foreach(m->an, mapping x) { if(x->name) @@ -463,12 +463,12 @@ class client return reverse(arpa/".")[2..]*"."; } - mixed *gethostbyaddr(string s) + array gethostbyaddr(string s) { mapping m=do_sync_query(mkquery(arpa_from_ip(s), C_IN, T_PTR)); if (m) { - string *names=({}); - string *ips=({}); + array(string) names=({}); + array(string) ips=({}); foreach(m->an, mapping x) { @@ -527,7 +527,7 @@ class client return ret; } - string *get_mx(string host) + array(string) get_mx(string host) { mapping m; if(sizeof(domains) && host[-1] != '.' && sizeof(host/".") < 3) { @@ -570,7 +570,7 @@ class async_client function callback; int retries; int timestamp; - mixed *args; + array args; }; mapping requests=([]);