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
11b5beb7
Commit
11b5beb7
authored
Feb 27, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use cdecl for hashsig sorting functions on Windows
parent
e68e33f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/hashsig.c
+10
-3
No files found.
src/hashsig.c
View file @
11b5beb7
...
@@ -19,7 +19,14 @@ typedef uint64_t hashsig_state;
...
@@ -19,7 +19,14 @@ typedef uint64_t hashsig_state;
#define HASHSIG_HEAP_SIZE ((1 << 7) - 1)
#define HASHSIG_HEAP_SIZE ((1 << 7) - 1)
typedef
int
(
*
hashsig_cmp
)(
const
void
*
a
,
const
void
*
b
);
/* going to use qsort so jump through some Windows hoops */
#ifdef GIT_WIN32
#define GIT_CDECL __cdecl
#else
#define GIT_CDECL
#endif
typedef
int
(
GIT_CDECL
*
hashsig_cmp
)(
const
void
*
a
,
const
void
*
b
);
typedef
struct
{
typedef
struct
{
int
size
,
asize
;
int
size
,
asize
;
...
@@ -53,13 +60,13 @@ static void hashsig_heap_init(hashsig_heap *h, hashsig_cmp cmp)
...
@@ -53,13 +60,13 @@ static void hashsig_heap_init(hashsig_heap *h, hashsig_cmp cmp)
h
->
cmp
=
cmp
;
h
->
cmp
=
cmp
;
}
}
static
int
hashsig_cmp_max
(
const
void
*
a
,
const
void
*
b
)
static
int
GIT_CDECL
hashsig_cmp_max
(
const
void
*
a
,
const
void
*
b
)
{
{
hashsig_t
av
=
*
(
const
hashsig_t
*
)
a
,
bv
=
*
(
const
hashsig_t
*
)
b
;
hashsig_t
av
=
*
(
const
hashsig_t
*
)
a
,
bv
=
*
(
const
hashsig_t
*
)
b
;
return
(
av
<
bv
)
?
-
1
:
(
av
>
bv
)
?
1
:
0
;
return
(
av
<
bv
)
?
-
1
:
(
av
>
bv
)
?
1
:
0
;
}
}
static
int
hashsig_cmp_min
(
const
void
*
a
,
const
void
*
b
)
static
int
GIT_CDECL
hashsig_cmp_min
(
const
void
*
a
,
const
void
*
b
)
{
{
hashsig_t
av
=
*
(
const
hashsig_t
*
)
a
,
bv
=
*
(
const
hashsig_t
*
)
b
;
hashsig_t
av
=
*
(
const
hashsig_t
*
)
a
,
bv
=
*
(
const
hashsig_t
*
)
b
;
return
(
av
>
bv
)
?
-
1
:
(
av
<
bv
)
?
1
:
0
;
return
(
av
>
bv
)
?
-
1
:
(
av
<
bv
)
?
1
:
0
;
...
...
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