Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 4 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 19 additions and 23 deletions.
  1. +6 −6 Lib/scilab/scirun.swg
  2. +13 −17 Source/Modules/scilab.cxx
View
12 Lib/scilab/scirun.swg
@@ -41,15 +41,15 @@ extern "C" {
/* Function name management functions */
#include <stdlib.h>
-static char* g_fname = NULL;
+static char* fname = NULL;
static char* SWIG_Scilab_GetFname(void) {
- return g_fname;
+ return fname;
}
-static void SWIG_Scilab_SetFname(char* fname) {
- if (g_fname != NULL) {
- free(g_fname);
+static void SWIG_Scilab_SetFname(char* _fname) {
+ if (fname != NULL) {
+ free(fname);
}
- g_fname = strdup(fname);
+ fname = strdup(_fname);
}
#if SWIG_SCILAB_VERSION >= 600
static void *pvApiCtx = NULL;
View
30 Source/Modules/scilab.cxx
@@ -61,7 +61,6 @@ class SCILAB:public Language {
bool generateBuilder;
bool internalModule;
- bool extraWarning;
public:
/* ------------------------------------------------------------------------
@@ -83,7 +82,6 @@ class SCILAB:public Language {
libraryName = NULL;
generateBuilder = true;
internalModule = false;
- extraWarning = false;
/* Manage command line arguments */
for (int argIndex = 1; argIndex < argc; argIndex++) {
@@ -133,8 +131,6 @@ class SCILAB:public Language {
Swig_mark_arg(argIndex);
libraryName = NewString(argv[argIndex + 1]);
Swig_mark_arg(argIndex + 1);
- } else if (strcmp(argv[argIndex], "-Wextra") == 0) {
- extraWarning = true;
}
}
}
@@ -354,8 +350,8 @@ class SCILAB:public Language {
if (paramTypemap) {
// Replace $input by the position on Scilab stack
- char source[64];
- sprintf(source, "%d", paramIndex + 1);
+ String *source = NewString("");
+ Printf(source, "%d", paramIndex + 1);
Setattr(param, "emit:input", source);
Replaceall(paramTypemap, "$input", Getattr(param, "emit:input"));
@@ -426,8 +422,8 @@ class SCILAB:public Language {
minOutputArguments++;
maxOutputArguments++;
Printf(wrapper->code, "SWIG_Scilab_SetOutputPosition(%d);\n", minOutputArguments);
- char result[64] = { };
- sprintf(result, "%d", minOutputArguments);
+ String *result = NewString("");
+ Printf(result, "%d", minOutputArguments);
Replaceall(paramTypemap, "$result", result);
Printf(wrapper->code, "%s\n", paramTypemap);
Delete(paramTypemap);
@@ -466,14 +462,14 @@ class SCILAB:public Language {
if (minOutputArguments == 0) {
maxOutputArguments = 1;
}
- char argnumber[64] = { };
- sprintf(argnumber, "%d", minInputArguments);
+ String *argnumber = NewString("");
+ Printf(argnumber, "%d", minInputArguments);
Replaceall(wrapper->code, "$mininputarguments", argnumber);
- sprintf(argnumber, "%d", maxInputArguments);
+ Printf(argnumber, "%d", maxInputArguments);
Replaceall(wrapper->code, "$maxinputarguments", argnumber);
- sprintf(argnumber, "%d", minOutputArguments);
+ Printf(argnumber, "%d", minOutputArguments);
Replaceall(wrapper->code, "$minoutputarguments", argnumber);
- sprintf(argnumber, "%d", maxOutputArguments);
+ Printf(argnumber, "%d", maxOutputArguments);
Replaceall(wrapper->code, "$maxoutputarguments", argnumber);
/* Dump the function out */
@@ -737,10 +733,10 @@ class SCILAB:public Language {
void checkIdentifierName(String *name) {
if (Len(name) > 24) {
- if (extraWarning) {
- // Warning on too long identifiers
- Swig_warning(WARN_LANG_IDENTIFIER, input_file, line_number, "Identifier %s exceeds 24 characters, it may be impossible to use it.\n", name);
- }
+ // Warning on too long identifiers
+ Swig_warning(WARN_LANG_IDENTIFIER, input_file, line_number,
+ "Identifier name '%s' exceeds 24 characters, it is truncated to '%s'.\n",
+ name, DohNewStringWithSize(name, 24));
}
}

No commit comments for this range

Something went wrong with that request. Please try again.