Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
596b121a
Commit
596b121a
authored
Jun 10, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix missing file and bad prototype
parent
114f5a6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletions
+42
-1
src/array.h
+41
-0
src/diff_driver.h
+1
-1
No files found.
src/array.h
0 → 100644
View file @
596b121a
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_array_h__
#define INCLUDE_array_h__
#include "util.h"
#define git_array_t(type) struct { type *ptr; size_t size, asize; }
#define git_array_init(a) \
do { (a).size = (a).asize = 0; (a).ptr = NULL; } while (0)
#define git_array_clear(a) \
do { git__free((a).ptr); git_array_init(a); } while (0)
#define git_array_grow(a) do { \
void *new_array; size_t new_size = \
((a).asize >= 256) ? (a).asize + 256 : ((a).asize >= 8) ? (a).asize * 2 : 8; \
new_array = git__realloc((a).ptr, new_size * sizeof(*(a).ptr)); \
if (!new_array) { git_array_clear(a); } \
else { (a).ptr = new_array; (a).asize = new_size; } \
} while (0)
#define GITERR_CHECK_ARRAY(a) GITERR_CHECK_ALLOC((a).ptr)
#define git_array_alloc(a, el) do { \
if ((a).size >= (a).asize) git_array_grow(a); \
(el) = (a).ptr ? &(a).ptr[(a).size++] : NULL; \
} while (0)
#define git_array_last(a) ((a).size ? &(a).ptr[(a).size - 1] : NULL)
#define git_array_get(a, i) (((i) < (a).size) ? &(a).ptr[(i)] : NULL)
#define git_array_size(a) (a).size
#endif
src/diff_driver.h
View file @
596b121a
...
...
@@ -11,7 +11,7 @@
typedef
struct
git_diff_driver_registry
git_diff_driver_registry
;
git_diff_driver_registry
*
git_diff_driver_registry_new
();
git_diff_driver_registry
*
git_diff_driver_registry_new
(
void
);
void
git_diff_driver_registry_free
(
git_diff_driver_registry
*
);
typedef
struct
git_diff_driver
git_diff_driver
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment