Some fixes for Windows x64 warnings
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
diff --git a/include/git2/blame.h b/include/git2/blame.h
index 73bcc5b..b98c6f0 100644
--- a/include/git2/blame.h
+++ b/include/git2/blame.h
@@ -183,7 +183,7 @@ GIT_EXTERN(int) git_blame_buffer(
git_blame **out,
git_blame *reference,
const char *buffer,
- uint32_t buffer_len);
+ size_t buffer_len);
/**
* Free memory allocated by git_blame_file or git_blame_buffer.
diff --git a/src/blame.c b/src/blame.c
index 0f2d906..71bc460 100644
--- a/src/blame.c
+++ b/src/blame.c
@@ -450,7 +450,7 @@ int git_blame_buffer(
git_blame **out,
git_blame *reference,
const char *buffer,
- uint32_t buffer_len)
+ size_t buffer_len)
{
git_blame *blame;
git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT;
diff --git a/src/indexer.c b/src/indexer.c
index 9b60ef4..346870f 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -659,7 +659,7 @@ static int inject_object(git_indexer *idx, git_oid *id)
hdr_len = git_packfile__object_header(hdr, len, git_odb_object_type(obj));
git_filebuf_write(&idx->pack_file, hdr, hdr_len);
idx->pack->mwf.size += hdr_len;
- entry->crc = crc32(entry->crc, hdr, hdr_len);
+ entry->crc = crc32(entry->crc, hdr, (uInt)hdr_len);
if ((error = git_zstream_deflatebuf(&buf, data, len)) < 0)
goto cleanup;
diff --git a/src/pack-objects.c b/src/pack-objects.c
index 1774b07..8475f64 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -348,7 +348,7 @@ static int write_object(
}
if (written < 0) {
- error = written;
+ error = (int)written;
goto done;
}
diff --git a/src/userdiff.h b/src/userdiff.h
index 9318b54..7eb0952 100644
--- a/src/userdiff.h
+++ b/src/userdiff.h
@@ -193,9 +193,9 @@ PATTERNS("php",
"|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
PATTERNS("javascript",
- "^[ \t]*(function[ \t][a-zA-Z_][^\{]*)\n"
- "^[ \t]*(var[ \t]+[a-zA-Z_][a-zA-Z0-9_]*[ \t]*=[ \t]*function[ \t\(][^\{]*)\n"
- "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*[ \t]*:[ \t]*function[ \t\(][^\{]*)",
+ "^[ \t]*(function[ \t][a-zA-Z_][^\\{]*)\n"
+ "^[ \t]*(var[ \t]+[a-zA-Z_][a-zA-Z0-9_]*[ \t]*=[ \t]*function[ \t\\(][^\\{]*)\n"
+ "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*[ \t]*:[ \t]*function[ \t\\(][^\\{]*)",
/* -- */
"[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+[fFlL]?|0[xX]?[0-9a-fA-F]+[lL]?"