diff --git a/packages/c/.clangd b/packages/c/.clangd index f6cb59a46..9b5f10e62 100644 --- a/packages/c/.clangd +++ b/packages/c/.clangd @@ -2,7 +2,7 @@ CompileFlags: # Use gcc in development for better diagnostics # & Ensure that compilation doesn't fail due to warnings Compiler: gcc - Add: [-Wno-error] + Add: [-Wno-error, -xc, -std=c99] Index: # Enable background indexing for better symbol information @@ -15,4 +15,3 @@ Diagnostics: # Avoid running slow clang-tidy checks ClangTidy: FastCheckFilter: Loose - diff --git a/packages/c/sshnpd/src/background_jobs.c b/packages/c/sshnpd/src/background_jobs.c index 52fd55a6d..5e65c1900 100644 --- a/packages/c/sshnpd/src/background_jobs.c +++ b/packages/c/sshnpd/src/background_jobs.c @@ -8,11 +8,14 @@ #include #include #include +#include #include #include #include #include +const int64_t THIRTY_DAYS_MS = (int64_t)30 * 24 * 60 * 60 * 1000; + #define LOGGER_TAG "refresh_device_entry" void *refresh_device_entry(void *void_refresh_device_entry_params) { @@ -70,7 +73,7 @@ void *refresh_device_entry(void *void_refresh_device_entry_params) { atclient_atkey_metadata_set_is_encrypted(metadata, true); atclient_atkey_metadata_set_ttr(metadata, -1); atclient_atkey_metadata_set_ccd(metadata, true); - atclient_atkey_metadata_set_ttl(metadata, (long)30 * 24 * 60 * 60 * 1000); // 30 days in ms + atclient_atkey_metadata_set_ttl(metadata, THIRTY_DAYS_MS); buffer_len = strlen(params->params->manager_list[index]) + usernamekey_base_len; // example: @client_atsign:device_info.device_name.sshnp@client_atsign