use size_t for loop indices to avoid signedness warnings; by emaste@freebsd Same change as 16aeacf7088d, for subdirectories other than lib/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
diff --git a/got/got.c b/got/got.c
index a25e475..5f87f8a 100644
--- a/got/got.c
+++ b/got/got.c
@@ -173,7 +173,7 @@ static struct got_cmd got_commands[] = {
static void
list_commands(FILE *fp)
{
- int i;
+ size_t i;
fprintf(fp, "commands:");
for (i = 0; i < nitems(got_commands); i++) {
@@ -193,7 +193,7 @@ int
main(int argc, char *argv[])
{
struct got_cmd *cmd;
- unsigned int i;
+ size_t i;
int ch;
int hflag = 0, Vflag = 0;
static struct option longopts[] = {
@@ -7853,7 +7853,8 @@ write_cmd_list(FILE *f, const char *branch_name,
struct got_object_id_queue *commits)
{
const struct got_error *err = NULL;
- int n, i;
+ size_t i;
+ int n;
char *id_str;
struct got_object_qid *qid;
@@ -8047,9 +8048,9 @@ histedit_parse_list(struct got_histedit_list *histedit_cmds,
{
const struct got_error *err = NULL;
char *line = NULL, *p, *end;
- size_t size;
+ size_t i, size;
ssize_t len;
- int lineno = 0, i;
+ int lineno = 0;
const struct got_histedit_cmd *cmd;
struct got_object_id *commit_id = NULL;
struct got_histedit_list_entry *hle = NULL;
diff --git a/libexec/got-fetch-pack/got-fetch-pack.c b/libexec/got-fetch-pack/got-fetch-pack.c
index 90f2ff6..9d32767 100644
--- a/libexec/got-fetch-pack/got-fetch-pack.c
+++ b/libexec/got-fetch-pack/got-fetch-pack.c
@@ -437,7 +437,7 @@ match_capabilities(char **my_capabilities, struct got_pathlist_head *symrefs,
{
const struct got_error *err = NULL;
char *capa, *equalsign;
- int i;
+ size_t i;
*my_capabilities = NULL;
do {
@@ -512,7 +512,7 @@ send_fetch_done(struct imsgbuf *ibuf, uint8_t *pack_sha1)
static const struct got_error *
fetch_progress(struct imsgbuf *ibuf, const char *buf, size_t len)
{
- int i;
+ size_t i;
if (len == 0)
return NULL;
@@ -540,7 +540,7 @@ static const struct got_error *
fetch_error(const char *buf, size_t len)
{
static char msg[1024];
- int i;
+ size_t i;
for (i = 0; i < len && i < sizeof(msg) - 1; i++) {
if (!isprint(buf[i]))
diff --git a/libexec/got-index-pack/got-index-pack.c b/libexec/got-index-pack/got-index-pack.c
index 5288649..9b4ff26 100644
--- a/libexec/got-index-pack/got-index-pack.c
+++ b/libexec/got-index-pack/got-index-pack.c
@@ -974,7 +974,8 @@ main(int argc, char **argv)
const struct got_error *err = NULL, *close_err;
struct imsgbuf ibuf;
struct imsg imsg;
- int idxfd = -1, tmpfd = -1, i;
+ size_t i;
+ int idxfd = -1, tmpfd = -1;
FILE *tmpfiles[3];
struct got_pack pack;
uint8_t pack_hash[SHA1_DIGEST_LENGTH];
diff --git a/regress/delta/delta_test.c b/regress/delta/delta_test.c
index 7d362ee..5a34b46 100644
--- a/regress/delta/delta_test.c
+++ b/regress/delta/delta_test.c
@@ -59,7 +59,7 @@ static int
delta_apply(void)
{
const struct got_error *err = NULL;
- int i;
+ size_t i;
FILE *result_file;
result_file = got_opentemp();
diff --git a/regress/fetch/fetch_test.c b/regress/fetch/fetch_test.c
index f8fea68..9b4589c 100644
--- a/regress/fetch/fetch_test.c
+++ b/regress/fetch/fetch_test.c
@@ -127,7 +127,7 @@ fetch_parse_uri(void)
"ssh", "127.0.0.1", NULL, "22/git/myrepo", "myrepo",
GOT_ERR_OK },
};
- int i;
+ size_t i;
for (i = 0; i < nitems(test_data); i++) {
const char *uri = test_data[i].uri;
diff --git a/regress/path/path_test.c b/regress/path/path_test.c
index 9e6ab48..792c8cd 100644
--- a/regress/path/path_test.c
+++ b/regress/path/path_test.c
@@ -79,7 +79,7 @@ path_cmp(void)
{ "/bar.sub.sub2", "/bar", 1 },
{ "/bar/sub/sub2", "/bar.c", -1 },
};
- int i;
+ size_t i;
for (i = 0; i < nitems(test_data); i++) {
const char *path1 = test_data[i].path1;
@@ -139,7 +139,7 @@ path_list(void)
const struct got_error *err = NULL;
struct got_pathlist_head paths;
struct got_pathlist_entry *pe;
- int i;
+ size_t i;
TAILQ_INIT(&paths);
for (i = 0; i < nitems(path_list_input); i++) {
@@ -175,7 +175,7 @@ path_list_reverse_input(void)
const struct got_error *err = NULL;
struct got_pathlist_head paths;
struct got_pathlist_entry *pe;
- int i;
+ size_t i;
TAILQ_INIT(&paths);
for (i = nitems(path_list_input) - 1; i >= 0; i--) {
diff --git a/tog/tog.c b/tog/tog.c
index 8306375..334d9a6 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -6269,7 +6269,7 @@ done:
static void
list_commands(FILE *fp)
{
- int i;
+ size_t i;
fprintf(fp, "commands:");
for (i = 0; i < nitems(tog_commands); i++) {
@@ -6463,7 +6463,7 @@ main(int argc, char *argv[])
argc = 1;
cmd_argv = make_argv(argc, cmd->name);
} else {
- int i;
+ size_t i;
/* Did the user specify a command? */
for (i = 0; i < nitems(tog_commands); i++) {