pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
2016-03-12
2016-03-12 20:19:58 by Martin Nilsson <nilsson@fastmail.com>
2f6a60f3f53222308caa2423aca8fbb993cca4b7 (
6
lines) (+
3
/-
3
)
[
Show
|
Annotate
]
Branch:
8.1
Reduce copy and paste. No need to put the random function on the stack.
3166:
simple_mapping_string_lookup(get_builtin_constants(), "random"); if(!random || (TYPEOF(*random) != T_FUNCTION)) Pike_error("Unable to resolve random function.\n");
-
push_svalue(random);
+
push_int(4096); /* strlen(alphbet)**2 */
-
apply_svalue(
&Pike_sp[-2]
, 1);
+
apply_svalue(
random
, 1);
if(TYPEOF(Pike_sp[-1])!=T_INT) Pike_error("Couldn't generate random number.\n"); salt[0] = alphabet[ Pike_sp[-1].u.integer & 0x3f ]; salt[1] = alphabet[ (Pike_sp[-1].u.integer>>6) & 0x3f ];
-
pop_
n_elems
(
2
);
+
pop_
stack
();
saltp=salt; if (args > 1) {