From 05643f74b27eaee731a367d2cb4d20b8e0b81e75 Mon Sep 17 00:00:00 2001 From: Marco Michele Mosca Date: Mon, 30 Jun 2025 20:24:29 +0100 Subject: [PATCH 1/2] Move static variables --- cmd-api/include/cmd-api.h | 5 ++++- cmd-api/src/cmd-api.c | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd-api/include/cmd-api.h b/cmd-api/include/cmd-api.h index 2a3ba9b..7310676 100644 --- a/cmd-api/include/cmd-api.h +++ b/cmd-api/include/cmd-api.h @@ -27,7 +27,10 @@ Author Marco M. Mosca, email: marcomichele.mosca@gmail.com #include #include -#include +#include + +static int optind = 1, argvind = 2, formatind = -1, argformatind = 0; +static char *optargW = NULL, *curr_option; int isCharInString(char c, char* str); int AreStringsEqualFrom(const char* s1, const char* s2, int from); diff --git a/cmd-api/src/cmd-api.c b/cmd-api/src/cmd-api.c index 18675a7..54e0182 100644 --- a/cmd-api/src/cmd-api.c +++ b/cmd-api/src/cmd-api.c @@ -101,8 +101,6 @@ char* strsep(char** elem_pointer, char* pattern) { char* getoptW(int argc, char** argv, char* format) { - static int optind = 1, argvind = 2, formatind = -1, argformatind = 0; - static char *optargW = NULL, *curr_option; /*if optind is one means that there are no more options*/ if (optind == -1) { return NULL; From 7189659f80895f2708559c0f2af5d75e7c862464 Mon Sep 17 00:00:00 2001 From: Marco Michele Mosca Date: Mon, 30 Jun 2025 20:25:20 +0100 Subject: [PATCH 2/2] Remove unused variable in CI --- .github/workflows/run_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index c9148ee..4eef2bb 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install + run: cmake -B ${{github.workspace}}/build -S . -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install - name: Build run: cmake --build ${{github.workspace}}/build --target install --config ${{env.BUILD_TYPE}}