diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/checkcloudconnection.cpp | 2 | ||||
-rw-r--r-- | core/git-access.h | 3 | ||||
-rw-r--r-- | core/load-git.c | 1 |
3 files changed, 3 insertions, 3 deletions
diff --git a/core/checkcloudconnection.cpp b/core/checkcloudconnection.cpp index b8e9fc26f..7b86eaaa7 100644 --- a/core/checkcloudconnection.cpp +++ b/core/checkcloudconnection.cpp @@ -106,7 +106,7 @@ bool CheckCloudConnection::nextServer() { CLOUD_HOST_US, false } }; const char *server = nullptr; - for (int i = 0; i < CLOUD_NUM_HOSTS; i++) { + for (unsigned int i = 0; i < ARRAY_SIZE(cloudServers); i++) { if (strstr(prefs.cloud_base_url, cloudServers[i].server)) cloudServers[i].tried = true; else if (cloudServers[i].tried == false) diff --git a/core/git-access.h b/core/git-access.h index 0ac5294c6..77cf309d3 100644 --- a/core/git-access.h +++ b/core/git-access.h @@ -15,12 +15,13 @@ extern "C" { #include <stdbool.h> #endif -#define CLOUD_NUM_HOSTS 2 #define CLOUD_HOST_US "ssrf-cloud-us.subsurface-divelog.org" #define CLOUD_HOST_EU "ssrf-cloud-eu.subsurface-divelog.org" #define CLOUD_HOST_PATTERN "ssrf-cloud-..\\.subsurface-divelog\\.org" #define CLOUD_HOST_GENERIC "cloud.subsurface-divelog.org" +#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0])) + enum remote_transport { RT_OTHER, RT_HTTPS, RT_SSH }; struct git_oid; diff --git a/core/load-git.c b/core/load-git.c index 94eae3275..9753e0586 100644 --- a/core/load-git.c +++ b/core/load-git.c @@ -58,7 +58,6 @@ struct keyword_action { const char *keyword; void (*fn)(char *, struct membuffer *, struct git_parser_state *); }; -#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0])) static git_blob *git_tree_entry_blob(git_repository *repo, const git_tree_entry *entry); |