Remove extra semicolon outside of a function Without this change, compiling with gcc and pedantic generates warning: ISO C does not allow extra ‘;’ outside of a function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
diff --git a/src/attr.c b/src/attr.c
index 2e1ef7c..44593da 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -7,7 +7,7 @@
#include "git2/oid.h"
#include <ctype.h>
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
const char *git_attr__true = "[internal]__TRUE__";
const char *git_attr__false = "[internal]__FALSE__";
diff --git a/src/attrcache.c b/src/attrcache.c
index 9a9b9d0..018fa48 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -5,7 +5,7 @@
#include "sysdir.h"
#include "ignore.h"
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
GIT_INLINE(int) attr_cache_lock(git_attr_cache *cache)
{
diff --git a/src/checkout.c b/src/checkout.c
index 3953840..880af3d 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -32,7 +32,7 @@
#include "pool.h"
#include "strmap.h"
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
/* See docs/checkout-internals.md for more information */
diff --git a/src/commit.c b/src/commit.c
index 78c4b9d..beb2c64 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -400,7 +400,7 @@ GIT_COMMIT_GETTER(const char *, raw_header, commit->raw_header)
GIT_COMMIT_GETTER(git_time_t, time, commit->committer->when.time)
GIT_COMMIT_GETTER(int, time_offset, commit->committer->when.offset)
GIT_COMMIT_GETTER(unsigned int, parentcount, (unsigned int)git_array_size(commit->parent_ids))
-GIT_COMMIT_GETTER(const git_oid *, tree_id, &commit->tree_id);
+GIT_COMMIT_GETTER(const git_oid *, tree_id, &commit->tree_id)
const char *git_commit_message(const git_commit *commit)
{
diff --git a/src/config_file.c b/src/config_file.c
index b0ffd61..168dd54 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -21,7 +21,7 @@
#include <sys/types.h>
#include <regex.h>
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
typedef struct cvar_t {
struct cvar_t *next;
diff --git a/src/diff_driver.c b/src/diff_driver.c
index e4d9a06..7313ab5 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -17,7 +17,7 @@
#include "config.h"
#include "repository.h"
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
typedef enum {
DIFF_DRIVER_AUTO = 0,
diff --git a/src/fileops.c b/src/fileops.c
index 9509b27..ec536bf 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -13,7 +13,7 @@
#include "win32/findfile.h"
#endif
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
int git_futils_mkpath2file(const char *file_path, const mode_t mode)
{
diff --git a/src/mwindow.c b/src/mwindow.c
index 0444cd9..55c8d89 100644
--- a/src/mwindow.c
+++ b/src/mwindow.c
@@ -14,7 +14,7 @@
#include "strmap.h"
#include "pack.h"
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
#define DEFAULT_WINDOW_SIZE \
(sizeof(void*) >= 8 \
diff --git a/src/odb_mempack.c b/src/odb_mempack.c
index 32bc844..3435527 100644
--- a/src/odb_mempack.c
+++ b/src/odb_mempack.c
@@ -18,7 +18,7 @@
#include "git2/types.h"
#include "git2/pack.h"
-GIT__USE_OIDMAP;
+GIT__USE_OIDMAP
struct memobject {
git_oid oid;
diff --git a/src/offmap.h b/src/offmap.h
index 9471e7b..0d0e512 100644
--- a/src/offmap.h
+++ b/src/offmap.h
@@ -17,11 +17,11 @@
#define kfree git__free
#include "khash.h"
-__KHASH_TYPE(off, git_off_t, void *);
+__KHASH_TYPE(off, git_off_t, void *)
typedef khash_t(off) git_offmap;
#define GIT__USE_OFFMAP \
- __KHASH_IMPL(off, static kh_inline, git_off_t, void *, 1, kh_int64_hash_func, kh_int64_hash_equal);
+ __KHASH_IMPL(off, static kh_inline, git_off_t, void *, 1, kh_int64_hash_func, kh_int64_hash_equal)
#define git_offmap_alloc() kh_init(off)
#define git_offmap_free(h) kh_destroy(off, h), h = NULL
diff --git a/src/oidmap.h b/src/oidmap.h
index 5e3b44b..d2c451e 100644
--- a/src/oidmap.h
+++ b/src/oidmap.h
@@ -17,7 +17,7 @@
#define kfree git__free
#include "khash.h"
-__KHASH_TYPE(oid, const git_oid *, void *);
+__KHASH_TYPE(oid, const git_oid *, void *)
typedef khash_t(oid) git_oidmap;
GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
diff --git a/src/pack.h b/src/pack.h
index 34d37d9..3cebd10 100644
--- a/src/pack.h
+++ b/src/pack.h
@@ -72,8 +72,8 @@ typedef git_array_t(struct pack_chain_elem) git_dependency_chain;
#include "offmap.h"
-GIT__USE_OFFMAP;
-GIT__USE_OIDMAP;
+GIT__USE_OFFMAP
+GIT__USE_OIDMAP
#define GIT_PACK_CACHE_MEMORY_LIMIT 16 * 1024 * 1024
#define GIT_PACK_CACHE_SIZE_LIMIT 1024 * 1024 /* don't bother caching anything over 1MB */
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 5cd2112..77cb1a8 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -26,7 +26,7 @@
#include <git2/sys/refs.h>
#include <git2/sys/reflog.h>
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
#define DEFAULT_NESTING_LEVEL 5
#define MAX_NESTING_LEVEL 10
diff --git a/src/refs.c b/src/refs.c
index 2e88c26..e315752 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -24,7 +24,7 @@
#include <git2/signature.h>
#include <git2/commit.h>
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
#define DEFAULT_NESTING_LEVEL 5
#define MAX_NESTING_LEVEL 10
diff --git a/src/revwalk.h b/src/revwalk.h
index 72ddedc..1148a2a 100644
--- a/src/revwalk.h
+++ b/src/revwalk.h
@@ -14,7 +14,7 @@
#include "pool.h"
#include "vector.h"
-GIT__USE_OIDMAP;
+GIT__USE_OIDMAP
struct git_revwalk {
git_repository *repo;
diff --git a/src/sortedcache.c b/src/sortedcache.c
index 1195ea3..1151757 100644
--- a/src/sortedcache.c
+++ b/src/sortedcache.c
@@ -1,6 +1,6 @@
#include "sortedcache.h"
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
int git_sortedcache_new(
git_sortedcache **out,
diff --git a/src/strmap.h b/src/strmap.h
index dfbe563..5209847 100644
--- a/src/strmap.h
+++ b/src/strmap.h
@@ -16,7 +16,7 @@
#define kfree git__free
#include "khash.h"
-__KHASH_TYPE(str, const char *, void *);
+__KHASH_TYPE(str, const char *, void *)
typedef khash_t(str) git_strmap;
typedef khiter_t git_strmap_iter;
diff --git a/src/submodule.c b/src/submodule.c
index 03714b4..80f1b37 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -85,7 +85,7 @@ static kh_inline int str_equal_no_trailing_slash(const char *a, const char *b)
__KHASH_IMPL(
str, static kh_inline, const char *, void *, 1,
- str_hash_no_trailing_slash, str_equal_no_trailing_slash);
+ str_hash_no_trailing_slash, str_equal_no_trailing_slash)
static int submodule_cache_init(git_repository *repo, int refresh);
static void submodule_cache_free(git_submodule_cache *cache);
diff --git a/src/transaction.c b/src/transaction.c
index 1a4fffb..7b45b8b 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -17,7 +17,7 @@
#include "git2/sys/refs.h"
#include "git2/sys/refdb_backend.h"
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
typedef struct {
const char *name;
diff --git a/src/tree.c b/src/tree.c
index 9fd4e0a..47ed20d 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -17,7 +17,7 @@
#define DEFAULT_TREE_SIZE 16
#define MAX_FILEMODE_BYTES 6
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
static bool valid_filemode(const int filemode)
{
diff --git a/tests/core/oidmap.c b/tests/core/oidmap.c
index ec4b5e7..556a6ca 100644
--- a/tests/core/oidmap.c
+++ b/tests/core/oidmap.c
@@ -1,7 +1,7 @@
#include "clar_libgit2.h"
#include "oidmap.h"
-GIT__USE_OIDMAP;
+GIT__USE_OIDMAP
typedef struct {
git_oid oid;
diff --git a/tests/core/strmap.c b/tests/core/strmap.c
index a120f1f..3b4276a 100644
--- a/tests/core/strmap.c
+++ b/tests/core/strmap.c
@@ -1,7 +1,7 @@
#include "clar_libgit2.h"
#include "strmap.h"
-GIT__USE_STRMAP;
+GIT__USE_STRMAP
git_strmap *g_table;