Commit e9d5e5f3d41846b5f3be1bfb6a5cb1e501f428c8

Russell Belfer 2014-01-28T16:25:42

Some fixes for Windows x64 warnings

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]?"