Skip to content

Commit 625355b

Browse files
author
Erik McClure
committed
Fix linux and setup versions
1 parent 32f29fb commit 625355b

File tree

13 files changed

+21
-22
lines changed

13 files changed

+21
-22
lines changed

flatpak/org.freedesktop.Sdk.Extension.innative.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ modules:
1313
- mv bin lib include llvm
1414
- mkdir bin
1515
- mv llvm bin
16-
- sed -i "s@c++1.@c++17@g" innative{,-cmd}/Makefile
1716
- sed -i "s@-lstdc++fs@@g" innative-{cmd,test}/Makefile
1817
- make
1918
- install -d /usr/lib/sdk/innative/include/innative
@@ -24,11 +23,11 @@ modules:
2423
- cp bin/llvm/include/innative/*.h /usr/lib/sdk/innative/include/innative
2524
- cp bin/{innative-cmd,innative-test} /usr/lib/sdk/innative/bin
2625
- cp bin/{innative-env.a,innative-env-d.a,innative-test-embedding.a} /usr/lib/sdk/innative/lib
27-
- cp bin/libinnative.so /usr/lib/sdk/innative/lib/libinnative.so.0.1.4
26+
- cp bin/libinnative.so /usr/lib/sdk/innative/lib/libinnative.so.0.1.5
2827
- cp -r innative-test /usr/lib/sdk/innative/innative-test
2928
- cp -r scripts /usr/lib/sdk/innative/scripts
3029
- cp -r innative /usr/lib/sdk/innative/innative
31-
- ln -s libinnative.so.0.1.4 /usr/lib/sdk/innative/lib/libinnative.so
30+
- ln -s libinnative.so.0.1.5 /usr/lib/sdk/innative/lib/libinnative.so
3231
sources:
3332
- type: git
3433
url: https://github.com/innative-sdk/innative

innative-cmd/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ int main(int argc, char* argv[])
653653
for(auto item : commandline.whitelist.values)
654654
{
655655
char* ctx;
656-
char* first = STRTOK(item.data(), ":", &ctx);
656+
char* first = STRTOK(const_cast<char*>(item.data()), ":", &ctx);
657657
char* second = STRTOK(NULL, ":", &ctx);
658658

659659
if(!second)

innative-env/internal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ IN_COMPILER_DLLEXPORT extern void* _innative_internal_env_grow_memory(void* p, u
315315
if(max > 0) // If a maximum was specified, the memory should've been reserved already
316316
{
317317
// It's fine if we aren't aligned on page bounderies because the function won't fail on already committed pages.
318-
if(!VirtualAlloc(info + *size, i, MEM_COMMIT, PAGE_READWRITE))
318+
if(!VirtualAlloc(info + *size, (size_t)i, MEM_COMMIT, PAGE_READWRITE))
319319
return 0;
320320
i += *size;
321321
}
@@ -325,13 +325,13 @@ IN_COMPILER_DLLEXPORT extern void* _innative_internal_env_grow_memory(void* p, u
325325
SYSTEM_INFO sysinfo;
326326
GetSystemInfo(&sysinfo);
327327
size_t sz = *size % sysinfo.dwPageSize;
328-
sz = !sz ? *size : *size + sysinfo.dwPageSize - sz;
328+
sz = (size_t)(!sz ? *size : *size + sysinfo.dwPageSize - sz);
329329
i -= sz - *size; // Modify i by the difference
330330

331-
if(!VirtualAlloc(info + sz, i, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE))
331+
if(!VirtualAlloc(info + sz, (size_t)i, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE))
332332
{
333333
// If this fails, we ran into someone else's memory, so we need to move the entire allocation.
334-
void* mem = VirtualAlloc(0, i + sz, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
334+
void* mem = VirtualAlloc(0, (size_t)(i + sz), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
335335
if(!mem)
336336
return 0;
337337
_innative_internal_env_memcpy(mem, info, *size);
@@ -355,10 +355,10 @@ IN_COMPILER_DLLEXPORT extern void* _innative_internal_env_grow_memory(void* p, u
355355
if(max > 0 && i > max)
356356
return 0;
357357
#ifdef IN_PLATFORM_WIN32
358-
info = VirtualAlloc(0, !max ? i : max, MEM_RESERVE, PAGE_READWRITE);
358+
info = VirtualAlloc(0, (size_t)(!max ? i : max), MEM_RESERVE, PAGE_READWRITE);
359359
if(!info)
360360
return 0;
361-
if(!VirtualAlloc(info, i, MEM_COMMIT, PAGE_READWRITE))
361+
if(!VirtualAlloc(info, (size_t)i, MEM_COMMIT, PAGE_READWRITE))
362362
return 0;
363363

364364
#elif defined(IN_PLATFORM_POSIX)

innative-runtime-setup/Product.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<?error Unknown value for Platform variable ?>
1111
<?endif ?>
1212

13-
<?define Version="0.1.4" ?>
13+
<?define Version="0.1.5" ?>
1414
<Product
1515
Id="6A27F179-BADF-4580-821D-2892F229F335"
1616
Name="inNative Runtime v$(var.Version)"

innative-sdk-setup/Product.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<?error Unknown value for Platform variable ?>
1111
<?endif ?>
1212

13-
<?define Version="0.1.4" ?>
13+
<?define Version="0.1.5" ?>
1414
<Product
1515
Id="25A4AE98-4F30-4735-B29B-37B6EDC5A9E9"
1616
Name="inNative SDK v$(var.Version)"

innative/compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace innative {
116116
*out = str[i];
117117
break;
118118
}
119-
n = (n > diff) ? n - diff : 0;
119+
n = (static_cast<ptrdiff_t>(n) > diff) ? n - diff : 0;
120120
out += diff;
121121
}
122122
return out - start;

innative/debug_dwarf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void DebugDWARF::UpdateVariables(llvm::Function* fn, SourceMapScope& scope)
112112
expr = _dbuilder->createExpression(llvm::SmallVector<int64_t, 3>{ DW_OP_deref, DW_OP_stack_value });
113113

114114
if(static_cast<unsigned long long>(v.p_expr[2]) < _context->locals.size())
115-
_dbuilder->insertDbgValueIntrinsic(_context->locals[v.p_expr[2]], dparam, expr,
115+
_dbuilder->insertDbgValueIntrinsic(_context->locals[static_cast<size_t>(v.p_expr[2])], dparam, expr,
116116
llvm::DILocation::get(_context->context, v.original_line, v.original_column,
117117
_curscope),
118118
_context->builder.GetInsertBlock());
@@ -122,7 +122,7 @@ void DebugDWARF::UpdateVariables(llvm::Function* fn, SourceMapScope& scope)
122122
expr = _dbuilder->createExpression(llvm::SmallVector<int64_t, 3>{ DW_OP_deref, DW_OP_stack_value });
123123

124124
if(static_cast<unsigned long long>(v.p_expr[2]) < _context->globals.size())
125-
_dbuilder->insertDbgValueIntrinsic(_context->globals[v.p_expr[2]], dparam, expr,
125+
_dbuilder->insertDbgValueIntrinsic(_context->globals[static_cast<size_t>(v.p_expr[2])], dparam, expr,
126126
llvm::DILocation::get(_context->context, v.original_line, v.original_column,
127127
_curscope),
128128
_context->builder.GetInsertBlock());

innative/debug_pdb.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void DebugPDB::UpdateVariables(llvm::Function* fn, SourceMapScope& scope)
147147
expr = _dbuilder->createExpression(llvm::SmallVector<int64_t, 3>{ DW_OP_deref, DW_OP_stack_value });
148148

149149
if(static_cast<unsigned long long>(v.p_expr[2]) < _context->locals.size())
150-
_dbuilder->insertDbgValueIntrinsic(_context->locals[v.p_expr[2]], dparam, expr,
150+
_dbuilder->insertDbgValueIntrinsic(_context->locals[static_cast<size_t>(v.p_expr[2])], dparam, expr,
151151
llvm::DILocation::get(_context->context, v.original_line, v.original_column,
152152
_curscope),
153153
_context->builder.GetInsertBlock());
@@ -157,7 +157,7 @@ void DebugPDB::UpdateVariables(llvm::Function* fn, SourceMapScope& scope)
157157
expr = _dbuilder->createExpression(llvm::SmallVector<int64_t, 3>{ DW_OP_deref, DW_OP_stack_value });
158158

159159
if(static_cast<unsigned long long>(v.p_expr[2]) < _context->globals.size())
160-
_dbuilder->insertDbgValueIntrinsic(_context->globals[v.p_expr[2]], dparam, expr,
160+
_dbuilder->insertDbgValueIntrinsic(_context->globals[static_cast<size_t>(v.p_expr[2])], dparam, expr,
161161
llvm::DILocation::get(_context->context, v.original_line, v.original_column,
162162
_curscope),
163163
_context->builder.GetInsertBlock());

innative/dwarf_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ bool DWARFParser::ParseDWARFChild(DWARFContext& DICtx, SourceMapScope* parent, c
594594
if(auto file = die.find(DW_AT_decl_file))
595595
{
596596
if(const auto* LT = CU->getContext().getLineTableForUnit(CU))
597-
v.source_index = file->getAsUnsignedConstant().getValue() - 1;
597+
v.source_index = static_cast<decltype(v.source_index)>(file->getAsUnsignedConstant().getValue() - 1);
598598
}
599599

600600
if(auto addresses = die.getAddressRanges())

innative/parse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ IN_ERROR innative::ParseFunctionBody(Stream& s, FunctionBody& f, Module& m, cons
496496
IN_ERROR err = ParseVarUInt32(s, f.body_size);
497497
size_t end = s.pos + f.body_size; // body_size is the size of both local_entries and body in bytes.
498498
ptrdiff_t idx = &f - m.code.funcbody;
499-
if(idx >= m.function.n_funcdecl)
499+
if(idx >= static_cast<ptrdiff_t>(m.function.n_funcdecl))
500500
return ERR_FUNCTION_BODY_MISMATCH;
501501

502502
auto& sig = m.type.functypes[m.function.funcdecl[idx].type_index];

0 commit comments

Comments
 (0)