Skip to content

Commit 9d5f12f

Browse files
authored
Merge pull request libgit2#4018 from pks-t/pks/various-fixes
Various fixes
2 parents 8339c66 + 34b3205 commit 9d5f12f

File tree

8 files changed

+13
-12
lines changed

8 files changed

+13
-12
lines changed

src/graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int mark_parents(git_revwalk *walk, git_commit_list_node *one,
5959
/* as long as there are non-STALE commits */
6060
while (interesting(&list, roots)) {
6161
git_commit_list_node *commit = git_pqueue_pop(&list);
62-
int flags;
62+
unsigned int flags;
6363

6464
if (commit == NULL)
6565
break;

src/odb_mempack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct memobject {
2424
git_oid oid;
2525
size_t len;
2626
git_otype type;
27-
char data[];
27+
char data[GIT_FLEX_ARRAY];
2828
};
2929

3030
struct memory_packer_db {

src/pack.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,10 @@ int git_packfile_resolve_header(
509509
git_packfile_stream_free(&stream);
510510
if (error < 0)
511511
return error;
512-
} else
512+
} else {
513513
*size_p = size;
514+
base_offset = 0;
515+
}
514516

515517
while (type == GIT_OBJ_OFS_DELTA || type == GIT_OBJ_REF_DELTA) {
516518
curpos = base_offset;

src/patch_generate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static int create_binary(
284284
size_t b_datalen)
285285
{
286286
git_buf deflate = GIT_BUF_INIT, delta = GIT_BUF_INIT;
287-
size_t delta_data_len;
287+
size_t delta_data_len = 0;
288288
int error;
289289

290290
/* The git_delta function accepts unsigned long only */

src/path.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,6 @@ int git_path_diriter_init(
11451145
unsigned int flags)
11461146
{
11471147
git_win32_path path_filter;
1148-
git_buf hack = {0};
11491148

11501149
static int is_win7_or_later = -1;
11511150
if (is_win7_or_later < 0)

src/revwalk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static void mark_parents_uninteresting(git_commit_list_node *commit)
290290

291291

292292
while (parents) {
293-
git_commit_list_node *commit = git_commit_list_pop(&parents);
293+
commit = git_commit_list_pop(&parents);
294294

295295
while (commit) {
296296
if (commit->uninteresting)

src/transports/smart_protocol.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
412412

413413
if (i % 20 == 0 && t->rpc) {
414414
git_pkt_ack *pkt;
415-
unsigned int i;
415+
unsigned int j;
416416

417417
if ((error = git_pkt_buffer_wants(wants, count, &t->caps, &data)) < 0)
418418
goto on_error;
419419

420-
git_vector_foreach(&t->common, i, pkt) {
420+
git_vector_foreach(&t->common, j, pkt) {
421421
if ((error = git_pkt_buffer_have(&pkt->oid, &data)) < 0)
422422
goto on_error;
423423
}
@@ -432,12 +432,12 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
432432
/* Tell the other end that we're done negotiating */
433433
if (t->rpc && t->common.length > 0) {
434434
git_pkt_ack *pkt;
435-
unsigned int i;
435+
unsigned int j;
436436

437437
if ((error = git_pkt_buffer_wants(wants, count, &t->caps, &data)) < 0)
438438
goto on_error;
439439

440-
git_vector_foreach(&t->common, i, pkt) {
440+
git_vector_foreach(&t->common, j, pkt) {
441441
if ((error = git_pkt_buffer_have(&pkt->oid, &data)) < 0)
442442
goto on_error;
443443
}
@@ -728,7 +728,7 @@ static int add_push_report_pkt(git_push *push, git_pkt *pkt)
728728
static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt, git_buf *data_pkt_buf)
729729
{
730730
git_pkt *pkt;
731-
const char *line, *line_end;
731+
const char *line, *line_end = NULL;
732732
size_t line_len;
733733
int error;
734734
int reading_from_buf = data_pkt_buf->size > 0;

tests/clar_libgit2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ typedef struct {
7979
} \
8080
} while (0)
8181

82-
static void cl_git_thread_check(void *data)
82+
GIT_INLINE(void) cl_git_thread_check(void *data)
8383
{
8484
cl_git_thread_err *threaderr = (cl_git_thread_err *)data;
8585
if (threaderr->error != 0)

0 commit comments

Comments
 (0)