| parrotcode: Some utility functions | |
| Contents | C |

src/utils.c - Some utility functions

Prototypes are in src/misc.h.
Opcode helper functions that don't really fit elsewhere.

intval_mod x mod y = x - y * floor(x / y)
floatval_modn2 mod n3.lcc compiler.
Based on the rand48() family of functions.
next_randX._erand48double in the interval [0.0, 1.0)._drand48double in the interval [0.0, 1.0)._jrand48long in the interval [-2^31, 2^31)._nrand48long in the interval [0, 2^31)._lrand48long in the interval [0, 2^31)._mrand48long in the interval [-2^31, 2^31)._srand48seed. The low order 16 bits are set to the arbitrary value 0x330e.Parrot_float_randFLOATVAL in the interval [0.0, 1.0).how_random is ignored.Parrot_uint_randINTVAL in the interval [0, 2^31).how_random is ignored.Parrot_int_randINTVAL in the interval [-2^31, 2^31).how_random is ignored.Parrot_range_randINTVAL in the range [from, to].how_random is ignored.Parrot_srandseed.
Parrot_make_lalongs with one more element than the number of elements in *array. The elements are then copied from *array to the new array, and the last (extra) element is set to 0.src/nci.c.Parrot_destroy_laParrot_make_la().Parrot_make_cpachar *s with one more element than the number of elements in *array. The elements are then copied from *array to the new array, and the last (extra) element is set to 0.Parrot_destroy_cpa().Parrot_destroy_cpaParrot_make_cpa().tm_to_arrayrec_climb_back_and_mark node_index ... the index of a destination (i.e. with a pred.) register
c ... the graph and all the needed params : the context
process_cycle_without_exit node_index ... the index of a destination (i.e. with a pred.) register
c ... the graph and all the needed params : the context

Initial version by leo 2003.09.09.
|
|
|