summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnanmay Suri2021-04-21 17:18:26 +0530
committerAnanmay Suri2021-04-21 17:18:26 +0530
commit20085f1e0c1629b76f4f56a22ce74028148a1dc7 (patch)
tree070bc9bbe5dd8eaf061b94cfaa7d4aa5d1ac49d9
parent8c6df40237b718d34c4f3cadc82386d362b2592c (diff)
downloadfossee-scilab-octave-toolbox-20085f1e0c1629b76f4f56a22ce74028148a1dc7.tar.gz
fossee-scilab-octave-toolbox-20085f1e0c1629b76f4f56a22ce74028148a1dc7.tar.bz2
fossee-scilab-octave-toolbox-20085f1e0c1629b76f4f56a22ce74028148a1dc7.zip
Removed unwanted error statements
-rw-r--r--jar/scilab_en_US_help.jarbin16524 -> 16524 bytes
-rw-r--r--macros/octave_fun.binbin5099 -> 5099 bytes
-rwxr-xr-xsci_gateway/cpp/libscilab_octave.sobin27400 -> 27400 bytes
-rw-r--r--sci_gateway/cpp/sci_octave.cpp39
4 files changed, 19 insertions, 20 deletions
diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar
index 8dd28e5..02270d7 100644
--- a/jar/scilab_en_US_help.jar
+++ b/jar/scilab_en_US_help.jar
Binary files differ
diff --git a/macros/octave_fun.bin b/macros/octave_fun.bin
index ea3dc49..065f472 100644
--- a/macros/octave_fun.bin
+++ b/macros/octave_fun.bin
Binary files differ
diff --git a/sci_gateway/cpp/libscilab_octave.so b/sci_gateway/cpp/libscilab_octave.so
index 5802301..e5c4f0f 100755
--- a/sci_gateway/cpp/libscilab_octave.so
+++ b/sci_gateway/cpp/libscilab_octave.so
Binary files differ
diff --git a/sci_gateway/cpp/sci_octave.cpp b/sci_gateway/cpp/sci_octave.cpp
index 2e22b97..5f1f685 100644
--- a/sci_gateway/cpp/sci_octave.cpp
+++ b/sci_gateway/cpp/sci_octave.cpp
@@ -58,7 +58,7 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o
char* c;
double* n = NULL;
int row = 0;
- int col = 0;
+ int col = 0;
double* in_real;
double* in_img;
@@ -149,27 +149,26 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o
}
}
else
- {
- Scierror(999, _("%s: Wrong type of input argument %d.\n"), fname, i);
- return STATUS_ERROR;
- }
+ {
+ Scierror(999, _("%s: Wrong type of input argument %d.\n"), fname, i);
+ return STATUS_ERROR;
+ }
}
- // Capturing Errors and warnings
- std::stringstream buffer_err;
-
- // set our error buffer
- std::cerr.rdbuf(buffer_err.rdbuf());
+ // Capturing Errors and warnings
+ std::stringstream buffer_err;
- int status_fun = fun(argptr, funptr);
+ // set our error buffer
+ std::cerr.rdbuf(buffer_err.rdbuf());
- // grab error buffer contents
- std::string err = buffer_err.str();
- if(!err.empty())
- sciprint("%s", err.c_str());
- buffer_err.str("");
+ int status_fun = fun(argptr, funptr);
+ // grab error buffer contents
+ std::string err = buffer_err.str();
+ if(!err.empty() && status_fun==0)
+ sciprint("Warning from Octave\n%s", err.c_str());
+ buffer_err.str("");
//printf("in scilab status_fun is: %d\n", status_fun);
//printf("in scilab funcall.n_out_arguments is: %d\n", funcall.n_out_arguments);
//printf("in scilab funcall.n_out_user is: %d\n", funcall.n_out_user);
@@ -180,7 +179,7 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o
//printf("in scilab ouput args are: %d\n", funcall.n_out_arguments);
if(status_fun==1)
{
- Scierror(999, "");
+ Scierror(999,"Error from Octave\n%s", err.c_str());
return 1;
}
else if(funcall.n_out_user <= funcall.n_out_arguments)
@@ -227,9 +226,9 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o
}
else
{
- Scierror(77, _("%s: Wrong number of output arguments: This function can return a maximum of %d output(s).\n"), fname, funcall.n_out_arguments);
- return 1;
- }
+ Scierror(77, _("%s: Wrong number of output arguments: This function can return a maximum of %d output(s).\n"), fname, funcall.n_out_arguments);
+ return 1;
+ }