global: trivial conversions to fix -Wsign-compare warnings
We have a bunch of loops which iterate up to an unsigned boundary using a signed index, which generates warnigs because we compare a signed and unsigned value in the loop condition. Address these sites for trivial cases and enable `-Wsign-compare` warnings for these code units. This patch only adapts those code units where we can drop the `DISABLE_SIGN_COMPARE_WARNINGS` macro in the same step. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
25435e4ad8
commit
80c9e70ebe
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#define USE_THE_REPOSITORY_VARIABLE
|
||||
#define DISABLE_SIGN_COMPARE_WARNINGS
|
||||
|
||||
#include "builtin.h"
|
||||
#include "advice.h"
|
||||
@ -943,11 +942,10 @@ static int get_can_ff(struct object_id *orig_head,
|
||||
static int already_up_to_date(struct object_id *orig_head,
|
||||
struct oid_array *merge_heads)
|
||||
{
|
||||
int i;
|
||||
struct commit *ours;
|
||||
|
||||
ours = lookup_commit_reference(the_repository, orig_head);
|
||||
for (i = 0; i < merge_heads->nr; i++) {
|
||||
for (size_t i = 0; i < merge_heads->nr; i++) {
|
||||
struct commit_list *list = NULL;
|
||||
struct commit *theirs;
|
||||
int ok;
|
||||
|
||||
Reference in New Issue
Block a user