mirror of
https://git.tesses.org/tesses50/crosslang.git
synced 2026-08-01 16:15:32 +00:00
Use new build setup
This commit is contained in:
@@ -85,7 +85,7 @@ TObject CrossLangShell(GCList &ls, std::vector<std::string> &argv) {
|
||||
"Tesses.CrossLang.ShellPackage-1.0.0.0-prod.crvm";
|
||||
if (argv.size() == 2 && argv[1] == "configdir") {
|
||||
std::cout << dir.ToString() << std::endl;
|
||||
return 0;
|
||||
return (int64_t)0;
|
||||
}
|
||||
if (argv.size() > 1 && argv[1] == "update-shell") {
|
||||
|
||||
@@ -101,15 +101,15 @@ TObject CrossLangShell(GCList &ls, std::vector<std::string> &argv) {
|
||||
auto strm = resp.ReadAsStream();
|
||||
CrossLang::CrossArchiveExtract(strm, subdir);
|
||||
|
||||
return 0;
|
||||
return (int64_t)0;
|
||||
} else {
|
||||
std::cout << "Error when fetching the script error: "
|
||||
<< std::to_string(resp.statusCode) << " "
|
||||
<< HttpUtils::StatusCodeString(resp.statusCode)
|
||||
<< std::endl;
|
||||
return 1;
|
||||
return (int64_t)1;
|
||||
}
|
||||
return 0;
|
||||
return (int64_t)0;
|
||||
}
|
||||
|
||||
if (!Tesses::Framework::Filesystem::LocalFS->RegularFileExists(filename)) {
|
||||
@@ -125,12 +125,12 @@ TObject CrossLangShell(GCList &ls, std::vector<std::string> &argv) {
|
||||
CrossLang::CrossArchiveExtract(strm, subdir);
|
||||
|
||||
} else {
|
||||
return 1;
|
||||
return (int64_t)1;
|
||||
}
|
||||
} else {
|
||||
if (!Download(filename, subdir))
|
||||
return 1;
|
||||
return 0;
|
||||
return (int64_t)1;
|
||||
return (int64_t)0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ TObject CrossLangVM(GCList &ls, TRootEnvironment *env,
|
||||
std::cout << "USAGE: "
|
||||
<< (argv.empty() ? (std::string) "crossvm" : argv[0])
|
||||
<< " <filename.crvm> <args...>" << std::endl;
|
||||
return 1;
|
||||
return (int64_t)1;
|
||||
}
|
||||
|
||||
env->LoadFileWithDependencies(
|
||||
@@ -33,7 +33,7 @@ TObject CrossLangVM(GCList &ls, TRootEnvironment *env,
|
||||
auto res = env->CallFunctionWithFatalError(ls, "WebAppMain", {args2});
|
||||
auto svr2 = Tesses::CrossLang::ToHttpServer(ls.GetGC(), res);
|
||||
if (svr2 == nullptr)
|
||||
return 1;
|
||||
return (int64_t)1;
|
||||
Tesses::Framework::Http::HttpServer svr(port, svr2);
|
||||
svr.StartAccepting();
|
||||
TF_RunEventLoop();
|
||||
@@ -46,7 +46,7 @@ TObject CrossLangVM(GCList &ls, TRootEnvironment *env,
|
||||
_co->CallMethod(ls, "", "Close", {});
|
||||
}
|
||||
TF_Quit();
|
||||
return 0;
|
||||
return (int64_t)0;
|
||||
} else {
|
||||
TList *args = TList::Create(ls);
|
||||
for (size_t arg = 1; arg < argv.size(); arg++)
|
||||
|
||||
@@ -79,11 +79,14 @@ TObject Console_Fatal(GCList &ls, std::vector<TObject> args) {
|
||||
exit(1);
|
||||
}
|
||||
TObject Console_WriteLine(GCList &ls, std::vector<TObject> args) {
|
||||
|
||||
if (args.size() < 1) {
|
||||
Tesses::Framework::Console::WriteLineView("");
|
||||
return Undefined();
|
||||
}
|
||||
Tesses::Framework::Console::WriteLine(ToString(ls.GetGC(), args[0]));
|
||||
std::string text = ToString(ls.GetGC(), args[0]);
|
||||
|
||||
Tesses::Framework::Console::WriteLine(text);
|
||||
|
||||
return Undefined();
|
||||
}
|
||||
@@ -153,7 +156,7 @@ TObject Console_List(GCList &ls, std::vector<TObject> args) {
|
||||
|
||||
return (int64_t)Tesses::Framework::Console::List(items);
|
||||
}
|
||||
return 0;
|
||||
return (int64_t)0;
|
||||
}
|
||||
void TStd::RegisterConsole(std::shared_ptr<GC> gc, TRootEnvironment *env) {
|
||||
env->permissions.canRegisterConsole = true;
|
||||
|
||||
@@ -215,7 +215,7 @@ class TServerContext : public TNativeObjectThatReturnsHttpDictionary {
|
||||
else if (key == "getIP")
|
||||
return ctx->ip;
|
||||
else if (key == "getPort")
|
||||
return ctx->port;
|
||||
return (int64_t)ctx->port;
|
||||
else if (key == "getOriginalPath")
|
||||
return ctx->originalPath;
|
||||
else if (key == "getPath")
|
||||
@@ -235,7 +235,7 @@ class TServerContext : public TNativeObjectThatReturnsHttpDictionary {
|
||||
return sc;
|
||||
}
|
||||
} else if (key == "getStatusCode")
|
||||
return ctx->statusCode;
|
||||
return (int64_t)ctx->statusCode;
|
||||
else if (key == "getQueryParams")
|
||||
return TNativeObject::Create<THttpDictionary>(ls, &ctx->queryParams,
|
||||
this);
|
||||
|
||||
@@ -16,8 +16,12 @@ TObject TRandom::CallMethod(GCList &ls, std::string name,
|
||||
|
||||
return (int64_t)random.Next((uint32_t)first);
|
||||
}
|
||||
|
||||
return random.Next();
|
||||
{
|
||||
uint64_t num = random.Next();
|
||||
int64_t val2 = 0;
|
||||
memcpy(&val2, &num, sizeof(int64_t));
|
||||
return val2;
|
||||
}
|
||||
}
|
||||
|
||||
if (name == "NextByte") {
|
||||
|
||||
@@ -3195,7 +3195,7 @@ bool InterperterThread::ExecuteMethod2(std::shared_ptr<GC> gc, TObject instance,
|
||||
if (GetArgument(args, 0, index) &&
|
||||
(size_t)index < bArray->data.size() &&
|
||||
(size_t)index + 8 <= bArray->data.size()) {
|
||||
uint64_t value = BitConverter::ToDoubleLE(
|
||||
double value = BitConverter::ToDoubleLE(
|
||||
bArray->data[(size_t)index]);
|
||||
|
||||
cse.back()->Push(gc, value);
|
||||
@@ -3218,7 +3218,7 @@ bool InterperterThread::ExecuteMethod2(std::shared_ptr<GC> gc, TObject instance,
|
||||
if (GetArgument(args, 0, index) &&
|
||||
(size_t)index < bArray->data.size() &&
|
||||
(size_t)index + 8 <= bArray->data.size()) {
|
||||
uint64_t value = BitConverter::ToDoubleBE(
|
||||
double value = BitConverter::ToDoubleBE(
|
||||
bArray->data[(size_t)index]);
|
||||
|
||||
cse.back()->Push(gc, value);
|
||||
|
||||
@@ -188,7 +188,7 @@ bool InterperterThread::GetField(std::shared_ptr<GC> gc) {
|
||||
|
||||
if (netStrm != nullptr) {
|
||||
if (key == "Port") {
|
||||
cse.back()->Push(gc, netStrm->GetPort());
|
||||
cse.back()->Push(gc, (int64_t)netStrm->GetPort());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user