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
bf192cdb
Commit
bf192cdb
authored
Dec 05, 2012
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
versions: MSVC build fixes
parent
43efaabd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
src/common.h
+5
-5
tests-clar/config/backend.c
+2
-1
No files found.
src/common.h
View file @
bf192cdb
...
@@ -68,21 +68,21 @@ int giterr_set_regex(const regex_t *regex, int error_code);
...
@@ -68,21 +68,21 @@ int giterr_set_regex(const regex_t *regex, int error_code);
/**
/**
* Check a versioned structure for validity
* Check a versioned structure for validity
*/
*/
GIT_INLINE
(
bool
)
giterr__check_version
(
const
void
*
structure
,
unsigned
int
expected_max
,
const
char
*
name
)
GIT_INLINE
(
int
)
giterr__check_version
(
const
void
*
structure
,
unsigned
int
expected_max
,
const
char
*
name
)
{
{
unsigned
int
actual
;
unsigned
int
actual
;
if
(
!
structure
)
if
(
!
structure
)
return
true
;
return
0
;
actual
=
*
(
const
unsigned
int
*
)
structure
;
actual
=
*
(
const
unsigned
int
*
)
structure
;
if
(
actual
>
0
&&
actual
<=
expected_max
)
if
(
actual
>
0
&&
actual
<=
expected_max
)
return
true
;
return
0
;
giterr_set
(
GITERR_INVALID
,
"Invalid version %d on %s"
,
actual
,
name
);
giterr_set
(
GITERR_INVALID
,
"Invalid version %d on %s"
,
actual
,
name
);
return
false
;
return
-
1
;
}
}
#define GITERR_CHECK_VERSION(S,V,N) if (
!giterr__check_version(S,V,N)
) return -1
#define GITERR_CHECK_VERSION(S,V,N) if (
giterr__check_version(S,V,N) < 0
) return -1
/**
/**
* Initialize a structure with a version.
* Initialize a structure with a version.
...
...
tests-clar/config/backend.c
View file @
bf192cdb
...
@@ -4,9 +4,10 @@ void test_config_backend__checks_version(void)
...
@@ -4,9 +4,10 @@ void test_config_backend__checks_version(void)
{
{
git_config
*
cfg
;
git_config
*
cfg
;
git_config_backend
backend
=
GIT_CONFIG_BACKEND_INIT
;
git_config_backend
backend
=
GIT_CONFIG_BACKEND_INIT
;
backend
.
version
=
1024
;
const
git_error
*
err
;
const
git_error
*
err
;
backend
.
version
=
1024
;
cl_git_pass
(
git_config_new
(
&
cfg
));
cl_git_pass
(
git_config_new
(
&
cfg
));
cl_git_fail
(
git_config_add_backend
(
cfg
,
&
backend
,
0
,
false
));
cl_git_fail
(
git_config_add_backend
(
cfg
,
&
backend
,
0
,
false
));
err
=
giterr_last
();
err
=
giterr_last
();
...
...
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