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
6460e8ab
Commit
6460e8ab
authored
Jun 23, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal: use off64_t instead of git_off_t
Prefer `off64_t` internally.
parent
05237ee5
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
78 additions
and
78 deletions
+78
-78
src/indexer.c
+19
-19
src/mwindow.c
+9
-9
src/mwindow.h
+4
-4
src/pack-objects.h
+1
-1
src/pack.c
+27
-27
src/pack.h
+11
-11
src/unix/map.c
+1
-1
src/win32/posix.h
+1
-1
src/win32/posix_w32.c
+1
-1
src/win32/w32_util.h
+1
-1
tests/core/ftruncate.c
+1
-1
tests/index/tests.c
+1
-1
tests/object/blob/filter.c
+1
-1
No files found.
src/indexer.c
View file @
6460e8ab
...
...
@@ -47,8 +47,8 @@ struct git_indexer {
struct
git_pack_header
hdr
;
struct
git_pack_file
*
pack
;
unsigned
int
mode
;
git_off
_t
off
;
git_off
_t
entry_start
;
off64
_t
off
;
off64
_t
entry_start
;
git_object_t
entry_type
;
git_buf
entry_data
;
git_packfile_stream
stream
;
...
...
@@ -75,7 +75,7 @@ struct git_indexer {
};
struct
delta_info
{
git_off
_t
delta_off
;
off64
_t
delta_off
;
};
const
git_oid
*
git_indexer_hash
(
const
git_indexer
*
idx
)
...
...
@@ -220,7 +220,7 @@ static int store_delta(git_indexer *idx)
return
0
;
}
static
int
hash_header
(
git_hash_ctx
*
ctx
,
git_off
_t
len
,
git_object_t
type
)
static
int
hash_header
(
git_hash_ctx
*
ctx
,
off64
_t
len
,
git_object_t
type
)
{
char
buffer
[
64
];
size_t
hdrlen
;
...
...
@@ -265,7 +265,7 @@ static int advance_delta_offset(git_indexer *idx, git_object_t type)
if
(
type
==
GIT_OBJECT_REF_DELTA
)
{
idx
->
off
+=
GIT_OID_RAWSZ
;
}
else
{
git_off
_t
base_off
=
get_delta_base
(
idx
->
pack
,
&
w
,
&
idx
->
off
,
type
,
idx
->
entry_start
);
off64
_t
base_off
=
get_delta_base
(
idx
->
pack
,
&
w
,
&
idx
->
off
,
type
,
idx
->
entry_start
);
git_mwindow_close
(
&
w
);
if
(
base_off
<
0
)
return
(
int
)
base_off
;
...
...
@@ -291,7 +291,7 @@ static int read_object_stream(git_indexer *idx, git_packfile_stream *stream)
return
0
;
}
static
int
crc_object
(
uint32_t
*
crc_out
,
git_mwindow_file
*
mwf
,
git_off_t
start
,
git_off
_t
size
)
static
int
crc_object
(
uint32_t
*
crc_out
,
git_mwindow_file
*
mwf
,
off64_t
start
,
off64
_t
size
)
{
void
*
ptr
;
uint32_t
crc
;
...
...
@@ -414,9 +414,9 @@ static int store_object(git_indexer *idx)
int
i
,
error
;
git_oid
oid
;
struct
entry
*
entry
;
git_off
_t
entry_size
;
off64
_t
entry_size
;
struct
git_pack_entry
*
pentry
;
git_off
_t
entry_start
=
idx
->
entry_start
;
off64
_t
entry_start
=
idx
->
entry_start
;
entry
=
git__calloc
(
1
,
sizeof
(
*
entry
));
GIT_ERROR_CHECK_ALLOC
(
entry
);
...
...
@@ -485,7 +485,7 @@ GIT_INLINE(bool) has_entry(git_indexer *idx, git_oid *id)
return
git_oidmap_exists
(
idx
->
pack
->
idx_cache
,
id
);
}
static
int
save_entry
(
git_indexer
*
idx
,
struct
entry
*
entry
,
struct
git_pack_entry
*
pentry
,
git_off
_t
entry_start
)
static
int
save_entry
(
git_indexer
*
idx
,
struct
entry
*
entry
,
struct
git_pack_entry
*
pentry
,
off64
_t
entry_start
)
{
int
i
;
...
...
@@ -515,7 +515,7 @@ static int save_entry(git_indexer *idx, struct entry *entry, struct git_pack_ent
return
0
;
}
static
int
hash_and_save
(
git_indexer
*
idx
,
git_rawobj
*
obj
,
git_off
_t
entry_start
)
static
int
hash_and_save
(
git_indexer
*
idx
,
git_rawobj
*
obj
,
off64
_t
entry_start
)
{
git_oid
oid
;
size_t
entry_size
;
...
...
@@ -596,12 +596,12 @@ static void hash_partially(git_indexer *idx, const uint8_t *data, size_t size)
idx
->
inbuf_len
+=
size
-
to_expell
;
}
static
int
write_at
(
git_indexer
*
idx
,
const
void
*
data
,
git_off
_t
offset
,
size_t
size
)
static
int
write_at
(
git_indexer
*
idx
,
const
void
*
data
,
off64
_t
offset
,
size_t
size
)
{
git_file
fd
=
idx
->
pack
->
mwf
.
fd
;
size_t
mmap_alignment
;
size_t
page_offset
;
git_off
_t
page_start
;
off64
_t
page_start
;
unsigned
char
*
map_data
;
git_map
map
;
int
error
;
...
...
@@ -627,11 +627,11 @@ static int write_at(git_indexer *idx, const void *data, git_off_t offset, size_t
static
int
append_to_pack
(
git_indexer
*
idx
,
const
void
*
data
,
size_t
size
)
{
git_off
_t
new_size
;
off64
_t
new_size
;
size_t
mmap_alignment
;
size_t
page_offset
;
git_off
_t
page_start
;
git_off
_t
current_size
=
idx
->
pack
->
mwf
.
size
;
off64
_t
page_start
;
off64
_t
current_size
=
idx
->
pack
->
mwf
.
size
;
int
fd
=
idx
->
pack
->
mwf
.
fd
;
int
error
;
...
...
@@ -661,7 +661,7 @@ static int append_to_pack(git_indexer *idx, const void *data, size_t size)
static
int
read_stream_object
(
git_indexer
*
idx
,
git_indexer_progress
*
stats
)
{
git_packfile_stream
*
stream
=
&
idx
->
stream
;
git_off
_t
entry_start
=
idx
->
off
;
off64
_t
entry_start
=
idx
->
off
;
size_t
entry_size
;
git_object_t
type
;
git_mwindow
*
w
=
NULL
;
...
...
@@ -865,7 +865,7 @@ static int inject_object(git_indexer *idx, git_oid *id)
git_oid
foo
=
{{
0
}};
unsigned
char
hdr
[
64
];
git_buf
buf
=
GIT_BUF_INIT
;
git_off
_t
entry_start
;
off64
_t
entry_start
;
const
void
*
data
;
size_t
len
,
hdr_len
;
int
error
;
...
...
@@ -939,7 +939,7 @@ static int fix_thin_pack(git_indexer *idx, git_indexer_progress *stats)
size_t
size
;
git_object_t
type
;
git_mwindow
*
w
=
NULL
;
git_off
_t
curpos
=
0
;
off64
_t
curpos
=
0
;
unsigned
char
*
base_info
;
unsigned
int
left
=
0
;
git_oid
base
;
...
...
@@ -1054,7 +1054,7 @@ static int update_header_and_rehash(git_indexer *idx, git_indexer_progress *stat
{
void
*
ptr
;
size_t
chunk
=
1024
*
1024
;
git_off
_t
hashed
=
0
;
off64
_t
hashed
=
0
;
git_mwindow
*
w
=
NULL
;
git_mwindow_file
*
mwf
;
unsigned
int
left
;
...
...
src/mwindow.c
View file @
6460e8ab
...
...
@@ -167,11 +167,11 @@ void git_mwindow_free_all_locked(git_mwindow_file *mwf)
/*
* Check if a window 'win' contains the address 'offset'
*/
int
git_mwindow_contains
(
git_mwindow
*
win
,
git_off
_t
offset
)
int
git_mwindow_contains
(
git_mwindow
*
win
,
off64
_t
offset
)
{
git_off
_t
win_off
=
win
->
offset
;
off64
_t
win_off
=
win
->
offset
;
return
win_off
<=
offset
&&
offset
<=
(
git_off
_t
)(
win_off
+
win
->
window_map
.
len
);
&&
offset
<=
(
off64
_t
)(
win_off
+
win
->
window_map
.
len
);
}
/*
...
...
@@ -246,12 +246,12 @@ static int git_mwindow_close_lru(git_mwindow_file *mwf)
static
git_mwindow
*
new_window
(
git_mwindow_file
*
mwf
,
git_file
fd
,
git_off
_t
size
,
git_off
_t
offset
)
off64
_t
size
,
off64
_t
offset
)
{
git_mwindow_ctl
*
ctl
=
&
mem_ctl
;
size_t
walign
=
git_mwindow__window_size
/
2
;
git_off
_t
len
;
off64
_t
len
;
git_mwindow
*
w
;
w
=
git__malloc
(
sizeof
(
*
w
));
...
...
@@ -263,8 +263,8 @@ static git_mwindow *new_window(
w
->
offset
=
(
offset
/
walign
)
*
walign
;
len
=
size
-
w
->
offset
;
if
(
len
>
(
git_off
_t
)
git_mwindow__window_size
)
len
=
(
git_off
_t
)
git_mwindow__window_size
;
if
(
len
>
(
off64
_t
)
git_mwindow__window_size
)
len
=
(
off64
_t
)
git_mwindow__window_size
;
ctl
->
mapped
+=
(
size_t
)
len
;
...
...
@@ -311,7 +311,7 @@ static git_mwindow *new_window(
unsigned
char
*
git_mwindow_open
(
git_mwindow_file
*
mwf
,
git_mwindow
**
cursor
,
git_off
_t
offset
,
off64
_t
offset
,
size_t
extra
,
unsigned
int
*
left
)
{
...
...
src/mwindow.h
View file @
6460e8ab
...
...
@@ -16,7 +16,7 @@
typedef
struct
git_mwindow
{
struct
git_mwindow
*
next
;
git_map
window_map
;
git_off
_t
offset
;
off64
_t
offset
;
size_t
last_used
;
size_t
inuse_cnt
;
}
git_mwindow
;
...
...
@@ -24,7 +24,7 @@ typedef struct git_mwindow {
typedef
struct
git_mwindow_file
{
git_mwindow
*
windows
;
int
fd
;
git_off
_t
size
;
off64
_t
size
;
}
git_mwindow_file
;
typedef
struct
git_mwindow_ctl
{
...
...
@@ -37,10 +37,10 @@ typedef struct git_mwindow_ctl {
git_vector
windowfiles
;
}
git_mwindow_ctl
;
int
git_mwindow_contains
(
git_mwindow
*
win
,
git_off
_t
offset
);
int
git_mwindow_contains
(
git_mwindow
*
win
,
off64
_t
offset
);
void
git_mwindow_free_all
(
git_mwindow_file
*
mwf
);
/* locks */
void
git_mwindow_free_all_locked
(
git_mwindow_file
*
mwf
);
/* run under lock */
unsigned
char
*
git_mwindow_open
(
git_mwindow_file
*
mwf
,
git_mwindow
**
cursor
,
git_off
_t
offset
,
size_t
extra
,
unsigned
int
*
left
);
unsigned
char
*
git_mwindow_open
(
git_mwindow_file
*
mwf
,
git_mwindow
**
cursor
,
off64
_t
offset
,
size_t
extra
,
unsigned
int
*
left
);
int
git_mwindow_file_register
(
git_mwindow_file
*
mwf
);
void
git_mwindow_file_deregister
(
git_mwindow_file
*
mwf
);
void
git_mwindow_close
(
git_mwindow
**
w_cursor
);
...
...
src/pack-objects.h
View file @
6460e8ab
...
...
@@ -30,7 +30,7 @@
typedef
struct
git_pobject
{
git_oid
id
;
git_object_t
type
;
git_off
_t
offset
;
off64
_t
offset
;
size_t
size
;
...
...
src/pack.c
View file @
6460e8ab
...
...
@@ -20,12 +20,12 @@
bool
git_disable_pack_keep_file_checks
=
false
;
static
int
packfile_open
(
struct
git_pack_file
*
p
);
static
git_off
_t
nth_packed_object_offset
(
const
struct
git_pack_file
*
p
,
uint32_t
n
);
static
off64
_t
nth_packed_object_offset
(
const
struct
git_pack_file
*
p
,
uint32_t
n
);
static
int
packfile_unpack_compressed
(
git_rawobj
*
obj
,
struct
git_pack_file
*
p
,
git_mwindow
**
w_curs
,
git_off
_t
*
curpos
,
off64
_t
*
curpos
,
size_t
size
,
git_object_t
type
);
...
...
@@ -37,7 +37,7 @@ static int packfile_unpack_compressed(
* GIT_OID_MINPREFIXLEN and GIT_OID_HEXSZ.
*/
static
int
pack_entry_find_offset
(
git_off
_t
*
offset_out
,
off64
_t
*
offset_out
,
git_oid
*
found_oid
,
struct
git_pack_file
*
p
,
const
git_oid
*
short_oid
,
...
...
@@ -109,7 +109,7 @@ static int cache_init(git_pack_cache *cache)
return
0
;
}
static
git_pack_cache_entry
*
cache_get
(
git_pack_cache
*
cache
,
git_off
_t
offset
)
static
git_pack_cache_entry
*
cache_get
(
git_pack_cache
*
cache
,
off64
_t
offset
)
{
git_pack_cache_entry
*
entry
;
...
...
@@ -128,7 +128,7 @@ static git_pack_cache_entry *cache_get(git_pack_cache *cache, git_off_t offset)
/* Run with the cache lock held */
static
void
free_lowest_entry
(
git_pack_cache
*
cache
)
{
git_off
_t
offset
;
off64
_t
offset
;
git_pack_cache_entry
*
entry
;
git_offmap_foreach
(
cache
->
entries
,
offset
,
entry
,
{
...
...
@@ -144,7 +144,7 @@ static int cache_add(
git_pack_cache_entry
**
cached_out
,
git_pack_cache
*
cache
,
git_rawobj
*
base
,
git_off
_t
offset
)
off64
_t
offset
)
{
git_pack_cache_entry
*
entry
;
int
exists
;
...
...
@@ -345,7 +345,7 @@ static int pack_index_open(struct git_pack_file *p)
static
unsigned
char
*
pack_window_open
(
struct
git_pack_file
*
p
,
git_mwindow
**
w_cursor
,
git_off
_t
offset
,
off64
_t
offset
,
unsigned
int
*
left
)
{
if
(
p
->
mwf
.
fd
==
-
1
&&
packfile_open
(
p
)
<
0
)
...
...
@@ -441,7 +441,7 @@ int git_packfile_unpack_header(
git_object_t
*
type_p
,
git_mwindow_file
*
mwf
,
git_mwindow
**
w_curs
,
git_off
_t
*
curpos
)
off64
_t
*
curpos
)
{
unsigned
char
*
base
;
unsigned
int
left
;
...
...
@@ -474,13 +474,13 @@ int git_packfile_resolve_header(
size_t
*
size_p
,
git_object_t
*
type_p
,
struct
git_pack_file
*
p
,
git_off
_t
offset
)
off64
_t
offset
)
{
git_mwindow
*
w_curs
=
NULL
;
git_off
_t
curpos
=
offset
;
off64
_t
curpos
=
offset
;
size_t
size
;
git_object_t
type
;
git_off
_t
base_offset
;
off64
_t
base_offset
;
int
error
;
error
=
git_packfile_unpack_header
(
&
size
,
&
type
,
&
p
->
mwf
,
&
w_curs
,
&
curpos
);
...
...
@@ -528,13 +528,13 @@ int git_packfile_resolve_header(
* cache, we stop calculating there.
*/
static
int
pack_dependency_chain
(
git_dependency_chain
*
chain_out
,
git_pack_cache_entry
**
cached_out
,
git_off
_t
*
cached_off
,
git_pack_cache_entry
**
cached_out
,
off64
_t
*
cached_off
,
struct
pack_chain_elem
*
small_stack
,
size_t
*
stack_sz
,
struct
git_pack_file
*
p
,
git_off
_t
obj_offset
)
struct
git_pack_file
*
p
,
off64
_t
obj_offset
)
{
git_dependency_chain
chain
=
GIT_ARRAY_INIT
;
git_mwindow
*
w_curs
=
NULL
;
git_off
_t
curpos
=
obj_offset
,
base_offset
;
off64
_t
curpos
=
obj_offset
,
base_offset
;
int
error
=
0
,
use_heap
=
0
;
size_t
size
,
elem_pos
;
git_object_t
type
;
...
...
@@ -619,10 +619,10 @@ on_error:
int
git_packfile_unpack
(
git_rawobj
*
obj
,
struct
git_pack_file
*
p
,
git_off
_t
*
obj_offset
)
off64
_t
*
obj_offset
)
{
git_mwindow
*
w_curs
=
NULL
;
git_off
_t
curpos
=
*
obj_offset
;
off64
_t
curpos
=
*
obj_offset
;
int
error
,
free_base
=
0
;
git_dependency_chain
chain
=
GIT_ARRAY_INIT
;
struct
pack_chain_elem
*
elem
=
NULL
,
*
stack
;
...
...
@@ -777,7 +777,7 @@ static void use_git_free(void *opaq, void *ptr)
git__free
(
ptr
);
}
int
git_packfile_stream_open
(
git_packfile_stream
*
obj
,
struct
git_pack_file
*
p
,
git_off
_t
curpos
)
int
git_packfile_stream_open
(
git_packfile_stream
*
obj
,
struct
git_pack_file
*
p
,
off64
_t
curpos
)
{
int
st
;
...
...
@@ -846,7 +846,7 @@ static int packfile_unpack_compressed(
git_rawobj
*
obj
,
struct
git_pack_file
*
p
,
git_mwindow
**
w_curs
,
git_off
_t
*
curpos
,
off64
_t
*
curpos
,
size_t
size
,
git_object_t
type
)
{
...
...
@@ -909,16 +909,16 @@ static int packfile_unpack_compressed(
* curpos is where the data starts, delta_obj_offset is the where the
* header starts
*/
git_off
_t
get_delta_base
(
off64
_t
get_delta_base
(
struct
git_pack_file
*
p
,
git_mwindow
**
w_curs
,
git_off
_t
*
curpos
,
off64
_t
*
curpos
,
git_object_t
type
,
git_off
_t
delta_obj_offset
)
off64
_t
delta_obj_offset
)
{
unsigned
int
left
=
0
;
unsigned
char
*
base_info
;
git_off
_t
base_offset
;
off64
_t
base_offset
;
git_oid
unused
;
base_info
=
pack_window_open
(
p
,
w_curs
,
*
curpos
,
&
left
);
...
...
@@ -1045,7 +1045,7 @@ static int packfile_open(struct git_pack_file *p)
if
(
!
p
->
mwf
.
size
)
{
if
(
!
S_ISREG
(
st
.
st_mode
))
goto
cleanup
;
p
->
mwf
.
size
=
(
git_off
_t
)
st
.
st_size
;
p
->
mwf
.
size
=
(
off64
_t
)
st
.
st_size
;
}
else
if
(
p
->
mwf
.
size
!=
st
.
st_size
)
goto
cleanup
;
...
...
@@ -1182,7 +1182,7 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path)
*
***********************************************************/
static
git_off
_t
nth_packed_object_offset
(
const
struct
git_pack_file
*
p
,
uint32_t
n
)
static
off64
_t
nth_packed_object_offset
(
const
struct
git_pack_file
*
p
,
uint32_t
n
)
{
const
unsigned
char
*
index
=
p
->
index_map
.
data
;
const
unsigned
char
*
end
=
index
+
p
->
index_map
.
len
;
...
...
@@ -1270,7 +1270,7 @@ int git_pack_foreach_entry(
}
static
int
pack_entry_find_offset
(
git_off
_t
*
offset_out
,
off64
_t
*
offset_out
,
git_oid
*
found_oid
,
struct
git_pack_file
*
p
,
const
git_oid
*
short_oid
,
...
...
@@ -1280,7 +1280,7 @@ static int pack_entry_find_offset(
const
unsigned
char
*
index
;
unsigned
hi
,
lo
,
stride
;
int
pos
,
found
=
0
;
git_off
_t
offset
;
off64
_t
offset
;
const
unsigned
char
*
current
=
0
;
*
offset_out
=
0
;
...
...
@@ -1375,7 +1375,7 @@ int git_pack_entry_find(
const
git_oid
*
short_oid
,
size_t
len
)
{
git_off
_t
offset
;
off64
_t
offset
;
git_oid
found_oid
;
int
error
;
...
...
src/pack.h
View file @
6460e8ab
...
...
@@ -64,8 +64,8 @@ typedef struct git_pack_cache_entry {
}
git_pack_cache_entry
;
struct
pack_chain_elem
{
git_off
_t
base_key
;
git_off
_t
offset
;
off64
_t
base_key
;
off64
_t
offset
;
size_t
size
;
git_object_t
type
;
};
...
...
@@ -108,13 +108,13 @@ struct git_pack_file {
};
struct
git_pack_entry
{
git_off
_t
offset
;
off64
_t
offset
;
git_oid
sha1
;
struct
git_pack_file
*
p
;
};
typedef
struct
git_packfile_stream
{
git_off
_t
curpos
;
off64
_t
curpos
;
int
done
;
z_stream
zstream
;
struct
git_pack_file
*
p
;
...
...
@@ -130,23 +130,23 @@ int git_packfile_unpack_header(
git_object_t
*
type_p
,
git_mwindow_file
*
mwf
,
git_mwindow
**
w_curs
,
git_off
_t
*
curpos
);
off64
_t
*
curpos
);
int
git_packfile_resolve_header
(
size_t
*
size_p
,
git_object_t
*
type_p
,
struct
git_pack_file
*
p
,
git_off
_t
offset
);
off64
_t
offset
);
int
git_packfile_unpack
(
git_rawobj
*
obj
,
struct
git_pack_file
*
p
,
git_off
_t
*
obj_offset
);
int
git_packfile_unpack
(
git_rawobj
*
obj
,
struct
git_pack_file
*
p
,
off64
_t
*
obj_offset
);
int
git_packfile_stream_open
(
git_packfile_stream
*
obj
,
struct
git_pack_file
*
p
,
git_off
_t
curpos
);
int
git_packfile_stream_open
(
git_packfile_stream
*
obj
,
struct
git_pack_file
*
p
,
off64
_t
curpos
);
ssize_t
git_packfile_stream_read
(
git_packfile_stream
*
obj
,
void
*
buffer
,
size_t
len
);
void
git_packfile_stream_dispose
(
git_packfile_stream
*
obj
);
git_off
_t
get_delta_base
(
struct
git_pack_file
*
p
,
git_mwindow
**
w_curs
,
git_off
_t
*
curpos
,
git_object_t
type
,
git_off
_t
delta_obj_offset
);
off64
_t
get_delta_base
(
struct
git_pack_file
*
p
,
git_mwindow
**
w_curs
,
off64
_t
*
curpos
,
git_object_t
type
,
off64
_t
delta_obj_offset
);
void
git_packfile_close
(
struct
git_pack_file
*
p
,
bool
unlink_packfile
);
void
git_packfile_free
(
struct
git_pack_file
*
p
);
...
...
src/unix/map.c
View file @
6460e8ab
...
...
@@ -32,7 +32,7 @@ int git__mmap_alignment(size_t *alignment)
return
git__page_size
(
alignment
);
}
int
p_mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
git_off
_t
offset
)
int
p_mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
off64
_t
offset
)
{
int
mprot
=
PROT_READ
;
int
mflag
=
0
;
...
...
src/win32/posix.h
View file @
6460e8ab
...
...
@@ -47,7 +47,7 @@ extern int p_chdir(const char* path);
extern
int
p_chmod
(
const
char
*
path
,
mode_t
mode
);
extern
int
p_rmdir
(
const
char
*
path
);
extern
int
p_access
(
const
char
*
path
,
mode_t
mode
);
extern
int
p_ftruncate
(
int
fd
,
git_off
_t
size
);
extern
int
p_ftruncate
(
int
fd
,
off64
_t
size
);
/* p_lstat is almost but not quite POSIX correct. Specifically, the use of
* ENOTDIR is wrong, in that it does not mean precisely that a non-directory
...
...
src/win32/posix_w32.c
View file @
6460e8ab
...
...
@@ -210,7 +210,7 @@ on_error:
* We now take a "git_off_t" rather than "long" because
* files may be longer than 2Gb.
*/
int
p_ftruncate
(
int
fd
,
git_off
_t
size
)
int
p_ftruncate
(
int
fd
,
off64
_t
size
)
{
if
(
size
<
0
)
{
errno
=
EINVAL
;
...
...
src/win32/w32_util.h
View file @
6460e8ab
...
...
@@ -120,7 +120,7 @@ GIT_INLINE(void) git_win32__stat_init(
st
->
st_uid
=
0
;
st
->
st_nlink
=
1
;
st
->
st_mode
=
mode
;
st
->
st_size
=
((
git_off
_t
)
nFileSizeHigh
<<
32
)
+
nFileSizeLow
;
st
->
st_size
=
((
int64
_t
)
nFileSizeHigh
<<
32
)
+
nFileSizeLow
;
st
->
st_dev
=
_getdrive
()
-
1
;
st
->
st_rdev
=
st
->
st_dev
;
git_win32__filetime_to_timespec
(
&
ftLastAccessTime
,
&
(
st
->
st_atim
));
...
...
tests/core/ftruncate.c
View file @
6460e8ab
...
...
@@ -27,7 +27,7 @@ void test_core_ftruncate__cleanup(void)
p_unlink
(
filename
);
}
static
void
_extend
(
git_off
_t
i64len
)
static
void
_extend
(
off64
_t
i64len
)
{
struct
stat
st
;
int
error
;
...
...
tests/index/tests.c
View file @
6460e8ab
...
...
@@ -13,7 +13,7 @@ static const size_t index_entry_count_2 = 1437;
struct
test_entry
{
size_t
index
;
char
path
[
128
];
git_off
_t
file_size
;
off64
_t
file_size
;
git_time_t
mtime
;
};
...
...
tests/object/blob/filter.c
View file @
6460e8ab
...
...
@@ -19,7 +19,7 @@ static const char *g_crlf_raw[CRLF_NUM_TEST_OBJECTS] = {
"
\xFE\xFF\x00
T
\x00
h
\x00
i
\x00
s
\x00
!"
};
static
git_off
_t
g_crlf_raw_len
[
CRLF_NUM_TEST_OBJECTS
]
=
{
static
off64
_t
g_crlf_raw_len
[
CRLF_NUM_TEST_OBJECTS
]
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
17
,
-
1
,
-
1
,
12
};
...
...
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