aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorevgeny <me@ch1p.com>2016-09-17 14:58:25 +0300
committerevgeny <me@ch1p.com>2016-09-17 14:58:25 +0300
commit5c92afe26a3164eb89ea26b34034753124da91b3 (patch)
tree14dad1d2ac9b36b33a13520cc5731f4a05db4bcd
parentb82d8703b74dd8f1f2e1feec83f2957048ee5afd (diff)
code fixes
-rwxr-xr-xindex.cpp16
-rw-r--r--vkext_flex.c1
2 files changed, 13 insertions, 4 deletions
diff --git a/index.cpp b/index.cpp
index 92deba9..8ec48bd 100755
--- a/index.cpp
+++ b/index.cpp
@@ -27,10 +27,18 @@ void flex(const FunctionCallbackInfo<Value>& args) {
string typeString(*typeArg);
string ctypeStringWindows1251 = utf2cp(typeString);
- int sex = args[1]->NumberValue();
- int lang = args[4]->NumberValue();
-
- char *result = do_flex(nameStringWindows1251.c_str(), nameStringWindows1251.length(), caseStringWindows1251.c_str(), caseStringWindows1251.length(), sex, ctypeStringWindows1251.c_str(), ctypeStringWindows1251.length(), lang);
+ int sex = (int)args[1]->NumberValue();
+ int lang = (int)args[4]->NumberValue();
+
+ char *result = do_flex(
+ nameStringWindows1251.c_str(),
+ nameStringWindows1251.length(),
+ caseStringWindows1251.c_str(),
+ caseStringWindows1251.length(),
+ sex,
+ ctypeStringWindows1251.c_str(),
+ ctypeStringWindows1251.length(),
+ lang);
string resultStringWindows1251(result);
string resultString = cp2utf(resultStringWindows1251);
diff --git a/vkext_flex.c b/vkext_flex.c
index ade09c0..244ac37 100644
--- a/vkext_flex.c
+++ b/vkext_flex.c
@@ -23,6 +23,7 @@
*/
#include <string.h>
+#include <stdlib.h>
#include <assert.h>
#include "vkext_flex.h"
#include "vkext_flex_auto.c"