diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-05-26 14:55:14 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-05-26 14:55:14 +0400 |
commit | 0690be7eca2fa56231ee6a250bc13c76ebcc7e94 (patch) | |
tree | 1332ab66414d818245d414918360877de57c8043 /LibGit2Sharp/ContentChanges.cs | |
parent | f28c2698bbed159e5184ec646f522a8bc3d9fef5 (diff) |
Fix wrongly declared interop signature
Diffstat (limited to 'LibGit2Sharp/ContentChanges.cs')
-rw-r--r-- | LibGit2Sharp/ContentChanges.cs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/LibGit2Sharp/ContentChanges.cs b/LibGit2Sharp/ContentChanges.cs index 8e8bc4dd..b9913538 100644 --- a/LibGit2Sharp/ContentChanges.cs +++ b/LibGit2Sharp/ContentChanges.cs @@ -10,6 +10,7 @@ namespace LibGit2Sharp public class ContentChanges { private readonly StringBuilder patchBuilder = new StringBuilder(); + private static readonly Utf8Marshaler marshaler = (Utf8Marshaler)Utf8Marshaler.GetInstance(string.Empty); protected ContentChanges() { @@ -44,22 +45,17 @@ namespace LibGit2Sharp return delta.OldFile.Flags.Has(GitDiffFileFlags.GIT_DIFF_FILE_BINARY) || delta.NewFile.Flags.Has(GitDiffFileFlags.GIT_DIFF_FILE_BINARY); } - private static string NativeToString(IntPtr content, IntPtr contentlen) + private int HunkCallback(IntPtr data, GitDiffDelta delta, GitDiffRange range, IntPtr header, uint headerlen) { - return ((Utf8Marshaler)(Utf8Marshaler.GetInstance(string.Empty))).NativeToString(content, contentlen.ToInt32()); - } - - private int HunkCallback(IntPtr data, GitDiffDelta delta, GitDiffRange range, IntPtr header, IntPtr headerlen) - { - string decodedContent = NativeToString(header, headerlen); + string decodedContent = marshaler.NativeToString(header, headerlen); PatchBuilder.AppendFormat("{0}", decodedContent); return 0; } - private int LineCallback(IntPtr data, GitDiffDelta delta, GitDiffRange range, GitDiffLineOrigin lineorigin, IntPtr content, IntPtr contentlen) + private int LineCallback(IntPtr data, GitDiffDelta delta, GitDiffRange range, GitDiffLineOrigin lineorigin, IntPtr content, uint contentlen) { - string decodedContent = NativeToString(content, contentlen); + string decodedContent = marshaler.NativeToString(content, contentlen); string prefix; |