Merge branch 'main' of https://github.com/Timerix22/kerep
This commit is contained in:
commit
d2eb241d0d
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@ -5,10 +5,10 @@
|
||||
"name": "(gdb) Debug",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "$kerep.com",
|
||||
"program": "${workspaceFolder}/bin/kerep.com",
|
||||
"cwd": "${workspaceFolder}/bin",
|
||||
"preLaunchTask": "build_exec_dbg",
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${fileDirname}/bin",
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb",
|
||||
@ -31,8 +31,8 @@
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build_exec_dbg",
|
||||
"program": "${workspaceFolder}/bin/kerep.com",
|
||||
"cwd": "${workspaceFolder}/bin",
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"externalConsole": false,
|
||||
"miDebuggerPath": "/usr/bin/gdb",
|
||||
"MIMode": "gdb",
|
||||
@ -48,8 +48,8 @@
|
||||
"type": "cppvsdbg",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build_dbg",
|
||||
"cwd": "${workspaceFolder}\\bin",
|
||||
"program": "${workspaceFolder}\\bin\\kerep.com",
|
||||
"cwd": "${workspaceFolder}\\bin",
|
||||
"stopAtEntry": false,
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
|
||||
26
.vscode/tasks.json
vendored
26
.vscode/tasks.json
vendored
@ -3,32 +3,6 @@
|
||||
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build_exec",
|
||||
"detail": "build project",
|
||||
"type": "cppbuild",
|
||||
"command": "make",
|
||||
"args": [
|
||||
"build_exec"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"problemMatcher": ["$gcc"],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": true,
|
||||
"panel": "shared",
|
||||
"showReuseMessage": false,
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"label": "build_exec_dbg",
|
||||
"detail": "build project with debug symbols",
|
||||
|
||||
2
cbuild
2
cbuild
@ -1 +1 @@
|
||||
Subproject commit 47808ee989c85b6d011851dbec24c39580b55cbb
|
||||
Subproject commit 15a9661c467facf65b2155eab3fad1ecf5f0c945
|
||||
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
CBUILD_VERSION=3
|
||||
CBUILD_VERSION=4
|
||||
CONFIG_VERSION=4
|
||||
|
||||
PROJECT=kerep
|
||||
@ -26,7 +26,7 @@ case $TASK in
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS=""
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
PRE_TASK_SCRIPT=tasks/pre_build.sh
|
||||
PRE_TASK_SCRIPT=
|
||||
POST_TASK_SCRIPT=
|
||||
;;
|
||||
build_exec_dbg)
|
||||
@ -34,7 +34,7 @@ case $TASK in
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS=""
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_exec.sh
|
||||
PRE_TASK_SCRIPT=tasks/pre_build.sh
|
||||
PRE_TASK_SCRIPT=
|
||||
POST_TASK_SCRIPT=
|
||||
;;
|
||||
build_shared_lib)
|
||||
@ -42,7 +42,7 @@ case $TASK in
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS="-Wl,-soname,$SHARED_LIB_FILE"
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_shared_lib.sh
|
||||
PRE_TASK_SCRIPT=tasks/pre_build.sh
|
||||
PRE_TASK_SCRIPT=
|
||||
POST_TASK_SCRIPT=
|
||||
;;
|
||||
build_shared_lib_dbg)
|
||||
@ -50,21 +50,21 @@ case $TASK in
|
||||
CPP_ARGS="$C_ARGS"
|
||||
LINKER_ARGS="-Wl,-soname,$SHARED_LIB_FILE"
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_shared_lib.sh
|
||||
PRE_TASK_SCRIPT=tasks/pre_build.sh
|
||||
PRE_TASK_SCRIPT=
|
||||
POST_TASK_SCRIPT=
|
||||
;;
|
||||
build_static_lib)
|
||||
C_ARGS="-O2 -fpic"
|
||||
CPP_ARGS="$C_ARGS"
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_static_lib.sh
|
||||
PRE_TASK_SCRIPT=tasks/pre_build.sh
|
||||
PRE_TASK_SCRIPT=
|
||||
POST_TASK_SCRIPT=
|
||||
;;
|
||||
build_static_lib_dbg)
|
||||
C_ARGS="-O0 -g"
|
||||
CPP_ARGS="$C_ARGS"
|
||||
TASK_SCRIPT=cbuild/default_tasks/build_static_lib.sh
|
||||
PRE_TASK_SCRIPT=tasks/pre_build.sh
|
||||
PRE_TASK_SCRIPT=
|
||||
POST_TASK_SCRIPT=
|
||||
;;
|
||||
exec)
|
||||
@ -75,3 +75,14 @@ case $TASK in
|
||||
TASK_SCRIPT=cbuild/default_tasks/valgrind.sh
|
||||
;;
|
||||
esac
|
||||
|
||||
case $OS in
|
||||
WINDOWS)
|
||||
;;
|
||||
LINUX)
|
||||
;;
|
||||
*)
|
||||
printf "${RED}operating system $OS has no configuration variants\n"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -19,46 +19,88 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\Array\Array.c" />
|
||||
<ClCompile Include="src\Autoarr\Autoarr.c" />
|
||||
<ClCompile Include="src\Autoarr\Autoarr_KVPair_exported.c" />
|
||||
<ClCompile Include="src\Autoarr\Autoarr_Unitype.c" />
|
||||
<ClCompile Include="src\Autoarr\Autoarr_Unitype_exported.c" />
|
||||
<ClCompile Include="src\base\cptr.c" />
|
||||
<ClCompile Include="src\base\endian.c" />
|
||||
<ClCompile Include="src\base\errors.c" />
|
||||
<ClCompile Include="src\base\types.c" />
|
||||
<ClCompile Include="src\base\type_system\base_toString.c" />
|
||||
<ClCompile Include="src\base\type_system\init.c" />
|
||||
<ClCompile Include="src\base\type_system\kt_functions.c" />
|
||||
<ClCompile Include="src\base\type_system\unitype.c" />
|
||||
<ClCompile Include="src\DtsodParser\DtsodV24.c" />
|
||||
<ClCompile Include="src\DtsodParser\DtsodV24_deserialize.c" />
|
||||
<ClCompile Include="src\DtsodParser\DtsodV24_exported.c" />
|
||||
<ClCompile Include="src\DtsodParser\DtsodV24_serialize.c" />
|
||||
<ClCompile Include="src\Filesystem\dir.c" />
|
||||
<ClCompile Include="src\Filesystem\file.c" />
|
||||
<ClCompile Include="src\Filesystem\path.c" />
|
||||
<ClCompile Include="src\HashFunctions\hash.c" />
|
||||
<ClCompile Include="src\Hashtable\Hashtable.c" />
|
||||
<ClCompile Include="src\Hashtable\KeyValuePair.c" />
|
||||
<ClCompile Include="src\kprint\kprint.c" />
|
||||
<ClCompile Include="src\kprint\kprintf.c" />
|
||||
<ClCompile Include="src\random\splitmix64\splitmix64.c" />
|
||||
<ClCompile Include="src\random\xoroshiro\32bitValue\xoroshiro64star.c" />
|
||||
<ClCompile Include="src\random\xoroshiro\32bitValue\xoroshiro64starstar.c" />
|
||||
<ClCompile Include="src\random\xoroshiro\64bitValue\xoroshiro128plus.c" />
|
||||
<ClCompile Include="src\random\xoroshiro\64bitValue\xoroshiro128plusplus.c" />
|
||||
<ClCompile Include="src\random\xoroshiro\64bitValue\xoroshiro128starstar.c" />
|
||||
<ClCompile Include="src\random\xoshiro\32bitValue\xoshiro128plus.c" />
|
||||
<ClCompile Include="src\random\xoshiro\32bitValue\xoshiro128plusplus.c" />
|
||||
<ClCompile Include="src\random\xoshiro\32bitValue\xoshiro128starstar.c" />
|
||||
<ClCompile Include="src\random\xoshiro\64bitValue\xoshiro256plus.c" />
|
||||
<ClCompile Include="src\random\xoshiro\64bitValue\xoshiro256plusplus.c" />
|
||||
<ClCompile Include="src\random\xoshiro\64bitValue\xoshiro256starstar.c" />
|
||||
<ClCompile Include="src\SearchTree\SearchTree.c" />
|
||||
<ClCompile Include="src\String\string.c" />
|
||||
<ClCompile Include="src\String\StringBuilder.c" />
|
||||
<ClCompile Include="tests\main.cpp" />
|
||||
<ClCompile Include="tests\test_autoarr.c" />
|
||||
<ClCompile Include="tests\test_dtsod.c" />
|
||||
<ClCompile Include="tests\test_hashtable.c" />
|
||||
<ClCompile Include="tests\test_hash_functions.c" />
|
||||
<ClCompile Include="tests\test_marshalling.c" />
|
||||
<ClCompile Include="tests\test_safethrow.c" />
|
||||
<ClCompile Include="tests\test_searchtree.c" />
|
||||
<ClCompile Include="tests\test_string.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\Array\Array.h" />
|
||||
<ClInclude Include="src\Array\Array_declare.h" />
|
||||
<ClInclude Include="src\Array\Array_define.h" />
|
||||
<ClInclude Include="src\Autoarr\Autoarr.h" />
|
||||
<ClInclude Include="src\Autoarr\Autoarr_declare.h" />
|
||||
<ClInclude Include="src\Autoarr\Autoarr_define.h" />
|
||||
<ClInclude Include="src\Autoarr\Autoarr_Unitype.h" />
|
||||
<ClInclude Include="src\base\base.h" />
|
||||
<ClInclude Include="src\base\cptr.h" />
|
||||
<ClInclude Include="src\base\endian.h" />
|
||||
<ClInclude Include="src\base\errors.h" />
|
||||
<ClInclude Include="src\base\optime.h" />
|
||||
<ClInclude Include="src\base\std.h" />
|
||||
<ClInclude Include="src\base\types.h" />
|
||||
<ClInclude Include="src\base\type_system\base_toString.h" />
|
||||
<ClInclude Include="src\base\type_system\init.h" />
|
||||
<ClInclude Include="src\base\type_system\ktDescriptor.h" />
|
||||
<ClInclude Include="src\base\type_system\ktid.h" />
|
||||
<ClInclude Include="src\base\type_system\kt_functions.h" />
|
||||
<ClInclude Include="src\base\type_system\type_system.h" />
|
||||
<ClInclude Include="src\base\type_system\unitype.h" />
|
||||
<ClInclude Include="src\DtsodParser\DtsodV24.h" />
|
||||
<ClInclude Include="src\Filesystem\dir.h" />
|
||||
<ClInclude Include="src\Filesystem\file.h" />
|
||||
<ClInclude Include="src\Filesystem\filesystem.h" />
|
||||
<ClInclude Include="src\Filesystem\path.h" />
|
||||
<ClInclude Include="src\HashFunctions\hash.h" />
|
||||
<ClInclude Include="src\Hashtable\Hashtable.h" />
|
||||
<ClInclude Include="src\Hashtable\KeyValuePair.h" />
|
||||
<ClInclude Include="src\kprint\kprint.h" />
|
||||
<ClInclude Include="src\kprint\kprintf.h" />
|
||||
<ClInclude Include="src\kprint\kprint_colors.h" />
|
||||
<ClInclude Include="src\kprint\kprint_format.h" />
|
||||
<ClInclude Include="src\random\krandom.h" />
|
||||
<ClInclude Include="src\random\splitmix64\splitmix64.h" />
|
||||
<ClInclude Include="src\random\xoroshiro\32bitValue\xoroshiro64.h" />
|
||||
<ClInclude Include="src\random\xoroshiro\64bitValue\xoroshiro128.h" />
|
||||
<ClInclude Include="src\random\xoroshiro\xoroshiro.h" />
|
||||
<ClInclude Include="src\random\xoshiro\32bitValue\xoshiro128.h" />
|
||||
<ClInclude Include="src\random\xoshiro\64bitValue\xoshiro256.h" />
|
||||
<ClInclude Include="src\random\xoshiro\xoshiro.h" />
|
||||
<ClInclude Include="src\SearchTree\SearchTree.h" />
|
||||
<ClInclude Include="src\String\string.h" />
|
||||
<ClInclude Include="src\String\StringBuilder.h" />
|
||||
@ -156,7 +198,7 @@
|
||||
<LanguageStandard_C>stdc17</LanguageStandard_C>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<PrecompiledHeaderOutputFile />
|
||||
<AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 -Wno-clang-analyzer-valist.Uninitialized %(AdditionalOptions)</AdditionalOptions>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
@ -182,7 +224,7 @@
|
||||
<LanguageStandard_C>stdc17</LanguageStandard_C>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<PrecompiledHeaderOutputFile />
|
||||
<AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 -Wno-clang-analyzer-valist.Uninitialized %(AdditionalOptions)</AdditionalOptions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
@ -208,7 +250,7 @@
|
||||
<LanguageStandard_C>stdc17</LanguageStandard_C>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<PrecompiledHeaderOutputFile />
|
||||
<AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 -Wno-clang-analyzer-valist.Uninitialized %(AdditionalOptions)</AdditionalOptions>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
@ -235,7 +277,7 @@
|
||||
<LanguageStandard_C>stdc17</LanguageStandard_C>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<PrecompiledHeaderOutputFile />
|
||||
<AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/Zc:twoPhase- /MP -fms-compatibility-version=14 -Wno-clang-analyzer-valist.Uninitialized %(AdditionalOptions)</AdditionalOptions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
@ -252,4 +294,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@ -67,7 +67,7 @@ typedef uint8 bool;
|
||||
#endif
|
||||
|
||||
#ifndef sprintf_s
|
||||
#define sprintf_s(BUF, BUFSIZE, FORMAT, ...) sprintf(BUF, FORMAT, ## __VA_ARGS__)
|
||||
//#define sprintf_s(BUF, BUFSIZE, FORMAT, ...) sprintf(BUF, FORMAT, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -67,7 +67,10 @@ char* toString_uint(uint64 n, bool withPostfix, bool uppercase){
|
||||
throw("too big precision");\
|
||||
if(precision==0)\
|
||||
precision=toString_float_default_precision;\
|
||||
int cn=sprintf(str, "%.*f", precision, n);\
|
||||
int cn=IFMSC(\
|
||||
sprintf_s(str, bufsize, "%.*f", precision, n),\
|
||||
sprintf(str, "%.*f", precision, n)\
|
||||
);\
|
||||
/* remove trailing zeroes except .0*/\
|
||||
while(str[cn-1]=='0' && str[cn-2]!='.')\
|
||||
cn--;\
|
||||
|
||||
@ -133,7 +133,7 @@ void kprintf(const char* format, ...){
|
||||
putc(c,stdout);
|
||||
}
|
||||
#if defined(_WIN64) || defined(_WIN32)
|
||||
end_iteration:
|
||||
end_iteration:;
|
||||
#endif
|
||||
}
|
||||
va_end(vl);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user