vm: nuke unused (string>float) primitive

db4
Slava Pestov 2010-02-08 08:16:56 +13:00
parent 4e766a0a12
commit 747974f4ae
6 changed files with 0 additions and 21 deletions

View File

@ -327,9 +327,6 @@ M: bad-executable summary
\ bignum>float { bignum } { float } define-primitive \ bignum>float { bignum } { float } define-primitive
\ bignum>float make-foldable \ bignum>float make-foldable
\ (string>float) { byte-array } { float } define-primitive
\ (string>float) make-foldable
\ (float>string) { float } { byte-array } define-primitive \ (float>string) { float } { byte-array } define-primitive
\ (float>string) make-foldable \ (float>string) make-foldable

View File

@ -463,7 +463,6 @@ tuple
{ "double>bits" "math" "primitive_double_bits" (( x -- n )) } { "double>bits" "math" "primitive_double_bits" (( x -- n )) }
{ "float>bits" "math" "primitive_float_bits" (( x -- n )) } { "float>bits" "math" "primitive_float_bits" (( x -- n )) }
{ "(float>string)" "math.parser.private" "primitive_float_to_str" (( n -- str )) } { "(float>string)" "math.parser.private" "primitive_float_to_str" (( n -- str )) }
{ "(string>float)" "math.parser.private" "primitive_str_to_float" (( str -- n/f )) }
{ "bignum*" "math.private" "primitive_bignum_multiply" (( x y -- z )) } { "bignum*" "math.private" "primitive_bignum_multiply" (( x y -- z )) }
{ "bignum+" "math.private" "primitive_bignum_add" (( x y -- z )) } { "bignum+" "math.private" "primitive_bignum_add" (( x y -- z )) }
{ "bignum-" "math.private" "primitive_bignum_subtract" (( x y -- z )) } { "bignum-" "math.private" "primitive_bignum_subtract" (( x y -- z )) }

View File

@ -260,20 +260,6 @@ void factor_vm::primitive_bignum_to_float()
ctx->replace(allot_float(bignum_to_float(ctx->peek()))); ctx->replace(allot_float(bignum_to_float(ctx->peek())));
} }
void factor_vm::primitive_str_to_float()
{
byte_array *bytes = untag_check<byte_array>(ctx->peek());
cell capacity = array_capacity(bytes);
char *c_str = (char *)(bytes + 1);
char *end = c_str;
double f = strtod(c_str,&end);
if(end == c_str + capacity - 1)
ctx->replace(allot_float(f));
else
ctx->replace(false_object);
}
void factor_vm::primitive_float_to_str() void factor_vm::primitive_float_to_str()
{ {
byte_array *array = allot_byte_array(33); byte_array *array = allot_byte_array(33);

View File

@ -121,7 +121,6 @@ PRIMITIVE(set_string_nth_slow)
PRIMITIVE(size) PRIMITIVE(size)
PRIMITIVE(sleep) PRIMITIVE(sleep)
PRIMITIVE(special_object) PRIMITIVE(special_object)
PRIMITIVE(str_to_float)
PRIMITIVE(string) PRIMITIVE(string)
PRIMITIVE(string_nth) PRIMITIVE(string_nth)
PRIMITIVE(strip_stack_traces) PRIMITIVE(strip_stack_traces)

View File

@ -117,7 +117,6 @@ DECLARE_PRIMITIVE(set_string_nth_slow)
DECLARE_PRIMITIVE(size) DECLARE_PRIMITIVE(size)
DECLARE_PRIMITIVE(sleep) DECLARE_PRIMITIVE(sleep)
DECLARE_PRIMITIVE(special_object) DECLARE_PRIMITIVE(special_object)
DECLARE_PRIMITIVE(str_to_float)
DECLARE_PRIMITIVE(string) DECLARE_PRIMITIVE(string)
DECLARE_PRIMITIVE(string_nth) DECLARE_PRIMITIVE(string_nth)
DECLARE_PRIMITIVE(strip_stack_traces) DECLARE_PRIMITIVE(strip_stack_traces)

View File

@ -441,7 +441,6 @@ struct factor_vm
cell unbox_array_size_slow(); cell unbox_array_size_slow();
void primitive_fixnum_to_float(); void primitive_fixnum_to_float();
void primitive_bignum_to_float(); void primitive_bignum_to_float();
void primitive_str_to_float();
void primitive_float_to_str(); void primitive_float_to_str();
void primitive_float_eq(); void primitive_float_eq();
void primitive_float_add(); void primitive_float_add();