diff --git a/.idea/cmake.xml b/.idea/cmake.xml new file mode 100644 index 0000000..94ff76f --- /dev/null +++ b/.idea/cmake.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CMakeSharedSettings"> + <configurations> + <configuration PROFILE_NAME="Debug x86" ENABLED="true" CONFIG_NAME="Debug" TOOLCHAIN_NAME="Visual Studio x86" /> + <configuration PROFILE_NAME="Release x86" ENABLED="true" CONFIG_NAME="Release" TOOLCHAIN_NAME="Visual Studio x86" /> + <configuration PROFILE_NAME="Debug x64" ENABLED="true" CONFIG_NAME="Debug" TOOLCHAIN_NAME="Visual Studio x64" /> + <configuration PROFILE_NAME="Release x64" ENABLED="true" CONFIG_NAME="Release" TOOLCHAIN_NAME="Visual Studio x64" /> + </configurations> + </component> +</project> \ No newline at end of file diff --git a/.idea/runConfigurations/2015___Day_01.xml b/.idea/runConfigurations/2015___Day_01.xml index 54224e8..fe9ec80 100644 --- a/.idea/runConfigurations/2015___Day_01.xml +++ b/.idea/runConfigurations/2015___Day_01.xml @@ -1,5 +1,5 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="2015 - Day 01" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/01" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_01" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_01"> + <configuration default="false" name="2015 - Day 01" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/01" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_01" CONFIG_NAME="Debug x86" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_01"> <method v="2"> <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> </method> diff --git a/2015/.gitignore b/2015/.gitignore index 4475b96..61fee56 100644 --- a/2015/.gitignore +++ b/2015/.gitignore @@ -1,2 +1,4 @@ -/cmake-build-debug/ -/cmake-build-release/ +/cmake-build-debug-x86/ +/cmake-build-debug-x64/ +/cmake-build-release-x86/ +/cmake-build-release-x64/ diff --git a/2015/utils/file.h b/2015/utils/file.h index 32125fe..5ac48da 100644 --- a/2015/utils/file.h +++ b/2015/utils/file.h @@ -56,7 +56,7 @@ char* readFile(const char* filename) { fclose(file); if (position != fileSize) { - printf("Error reading whole file, read only %d bytes out of %d\n", position, fileSize); + printf("Error reading whole file, read only %zu bytes out of %d\n", position, fileSize); free(contents); return NULL; } diff --git a/README.md b/README.md index a44952a..7fbc91b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,9 @@ The source code is in `main.kt`. The run configuration executes the `main()` met ## NASM x86 / x64 Assembly -The repository contains a CMake project (`CMakeLists.txt`) in the respective year's folder, which sets up every day as a CMake subproject. You should be able to load the CMake project into [CLion](https://www.jetbrains.com/clion/). +The repository contains a CMake project (`CMakeLists.txt`) in the respective year's folder, which sets up every day as a CMake subproject. You should be able to load the CMake project into [CLion](https://www.jetbrains.com/clion/), as long as you have two toolchains set up: +- Visual Studio x86 +- Visual Studio x64 The source code is in `main.c`, which is either in the puzzle's own folder, or in `utils` if no adjustments are needed. By default, `main.c` reads the whole input file into a buffer, and passes it as a parameter to the `entryPoint` function defined in `main.asm` which implements the logic and output of each puzzle.