-version = 1.2
+version = 1.3
# 共有ライブラリの拡張子を自動設定
ifeq ($(shell uname),Linux)
-commit 8c34166f0be1d754582695083d96f774921f4ff7
+commit 6d4b686a97d30fcbe0c92d73169f45ad1e21f409
VALUE vsop_totalval(VALUE self){
Vsop_Ruby* rmod;
Data_Get_Struct(self,Vsop_Ruby,rmod);
- int val = rmod->cmod->TotalVal().GetInt();
- return INT2NUM(val);
+
+ CtoI a = rmod->cmod->TotalVal();
+ if(a.IsConst())
+ {
+ if(a.TopItem() > 0) a = a.MaxVal();
+ int d = a.TopDigit() / 3 + 14;
+ kgAutoPtr2<char> a_ptr;
+ char *s;
+ try{
+ a_ptr.set(new char[d]);
+ s = a_ptr.get();
+ }catch(...){
+ rb_raise(rb_eRuntimeError,\"memory allocation error\");
+ }
+ int err = a.StrNum10(s);
+ if (err) { rb_raise(rb_eRuntimeError,\"StrNum10 error\"); }
+ return rb_cstr2inum(s,10);
+ }
+ return 0;
}
"
SCP_EOF
Vsop_Ruby* rmod;
Data_Get_Struct(self,Vsop_Ruby,rmod);
- if(rmod->cmod->IsConst()){
- int val = rmod->cmod->GetInt();
- return INT2NUM(val);
+ CtoI a = *(rmod->cmod);
+
+ if(a.IsConst()){
+ if(a.TopItem() > 0) a = a.MaxVal();
+ int d = a.TopDigit() / 3 + 14;
+ kgAutoPtr2<char> a_ptr;
+ char *s;
+ try{
+ a_ptr.set(new char[d]);
+ s = a_ptr.get();
+ }catch(...){
+ rb_raise(rb_eRuntimeError,"memory allocation error");
+ }
+ int err = a.StrNum10(s);
+ if (err) { rb_raise(rb_eRuntimeError,"StrNum10 error"); }
+ return rb_cstr2inum(s,10);
}else{
return Qnil;
}