[sparse] now sparse([]) is sparse
[scilab.git] / scilab / modules / sparse / sci_gateway / cpp / sci_sparse.cpp
index 1069478..1dfead1 100644 (file)
@@ -47,7 +47,7 @@ types::Function::ReturnValue sci_sparse(types::typed_list &in, int _piRetCount,
             case types::InternalType::ScilabBool :
             case types::InternalType::ScilabSparseBool :
             {
-                isValid = (i == (in.size() > 1 ? 1 : 0));
+                isValid = (i == (in.size() > 1) ? 1 : 0);
             }
             case types::InternalType::ScilabDouble :
             case types::InternalType::ScilabSparse :
@@ -88,8 +88,8 @@ types::Function::ReturnValue sci_sparse(types::typed_list &in, int _piRetCount,
             {
                 if (in[0]->getAs<types::Double>()->isEmpty())
                 {
-                    out.push_back(types::Double::Empty());
-                    return types::Function::OK;
+                    pRetVal = new types::Sparse(0,0,false);
+                    break;
                 }
 
                 if (in[0]->getAs<types::Double>()->isIdentity())