mirror of
https://github.com/git/git.git
synced 2026-01-09 01:34:00 +00:00
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
5
base85.c
5
base85.c
@@ -1,5 +1,3 @@
|
||||
#define DISABLE_SIGN_COMPARE_WARNINGS
|
||||
|
||||
#include "git-compat-util.h"
|
||||
#include "base85.h"
|
||||
|
||||
@@ -31,10 +29,9 @@ static const char en85[] = {
|
||||
static char de85[256];
|
||||
static void prep_base85(void)
|
||||
{
|
||||
int i;
|
||||
if (de85['Z'])
|
||||
return;
|
||||
for (i = 0; i < ARRAY_SIZE(en85); i++) {
|
||||
for (size_t i = 0; i < ARRAY_SIZE(en85); i++) {
|
||||
int ch = en85[i];
|
||||
de85[ch] = i + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user