Skip to content

Commit 60e15ec

Browse files
author
Edward Thomson
committed
packbuilder: size_t all the things
After 1cd6599, we were passing a pointer to an `unsigned long` to a function that now expected a pointer to a `size_t`. These types differ on 64-bit Windows, which means that we trash the stack. Use `size_t`s in the packbuilder to avoid this.
1 parent 581a4d3 commit 60e15ec

File tree

5 files changed

+111
-81
lines changed

5 files changed

+111
-81
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ v0.24 + 1
5151

5252
### Breaking API changes
5353

54+
* `git_packbuilder_object_count` and `git_packbuilder_written` now
55+
return a `size_t` instead of a `uint32_t` for more thorough
56+
compatibility with the rest of the library.
57+
58+
* `git_packbuiler_progress` now provides explicitly sized `uint32_t`
59+
values instead of `unsigned int`.
60+
5461
v0.24
5562
-------
5663

include/git2/pack.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,21 @@ GIT_EXTERN(int) git_packbuilder_foreach(git_packbuilder *pb, git_packbuilder_for
196196
* @param pb the packbuilder
197197
* @return the number of objects in the packfile
198198
*/
199-
GIT_EXTERN(uint32_t) git_packbuilder_object_count(git_packbuilder *pb);
199+
GIT_EXTERN(size_t) git_packbuilder_object_count(git_packbuilder *pb);
200200

201201
/**
202202
* Get the number of objects the packbuilder has already written out
203203
*
204204
* @param pb the packbuilder
205205
* @return the number of objects which have already been written
206206
*/
207-
GIT_EXTERN(uint32_t) git_packbuilder_written(git_packbuilder *pb);
207+
GIT_EXTERN(size_t) git_packbuilder_written(git_packbuilder *pb);
208208

209209
/** Packbuilder progress notification function */
210210
typedef int (*git_packbuilder_progress)(
211211
int stage,
212-
unsigned int current,
213-
unsigned int total,
212+
uint32_t current,
213+
uint32_t total,
214214
void *payload);
215215

216216
/**

0 commit comments

Comments
 (0)