]> git.proxmox.com Git - libgit2.git/blobdiff - src/win32/w32_stack.c
New upstream version 1.1.0+dfsg.1
[libgit2.git] / src / win32 / w32_stack.c
index 15af3dcb7de675a59212b8843544c850c5a707ee..78c78dbbdeb5d68920cba76a9fa49a4bad19891f 100644 (file)
@@ -5,18 +5,14 @@
  * a Linking Exception. For full terms see the included COPYING file.
  */
 
+#include "w32_stack.h"
+
 #if defined(GIT_MSVC_CRTDBG)
 #include "Windows.h"
 #include "Dbghelp.h"
 #include "win32/posix.h"
-#include "w32_stack.h"
 #include "hash.h"
 
-/**
- * This is supposedly defined in WinBase.h (from Windows.h) but there were linker issues.
- */
-USHORT WINAPI RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG);
-
 static bool   g_win32_stack_initialized = false;
 static HANDLE g_win32_stack_process = INVALID_HANDLE_VALUE;
 static git_win32__stack__aux_cb_alloc  g_aux_cb_alloc  = NULL;
@@ -54,7 +50,7 @@ void git_win32__stack_cleanup(void)
 int git_win32__stack_capture(git_win32__stack__raw_data *pdata, int skip)
 {
        if (!g_win32_stack_initialized) {
-               giterr_set(GITERR_INVALID, "git_win32_stack not initialized.");
+               git_error_set(GIT_ERROR_INVALID, "git_win32_stack not initialized.");
                return GIT_ERROR;
        }
 
@@ -80,7 +76,7 @@ int git_win32__stack_compare(
 }
 
 int git_win32__stack_format(
-       char *pbuf, int buf_len,
+       char *pbuf, size_t buf_len,
        const git_win32__stack__raw_data *pdata,
        const char *prefix, const char *suffix)
 {
@@ -95,13 +91,13 @@ int git_win32__stack_format(
        } s;
 
        IMAGEHLP_LINE64 line;
-       int buf_used = 0;
+       size_t buf_used = 0;
        unsigned int k;
        char detail[MY_MAX_FILENAME * 2]; /* filename plus space for function name and formatting */
-       int detail_len;
+       size_t detail_len;
 
        if (!g_win32_stack_initialized) {
-               giterr_set(GITERR_INVALID, "git_win32_stack not initialized.");
+               git_error_set(GIT_ERROR_INVALID, "git_win32_stack not initialized.");
                return GIT_ERROR;
        }
 
@@ -175,7 +171,7 @@ int git_win32__stack_format(
 }
 
 int git_win32__stack(
-       char * pbuf, int buf_len,
+       char * pbuf, size_t buf_len,
        int skip,
        const char *prefix, const char *suffix)
 {