Skip to content

Commit bd656a5

Browse files
authored
Merge pull request #160 from igoropaniuk/sign-compare
Address more -Wsign-compare issues
2 parents 2db10bd + a3f6c1a commit bd656a5

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

firehose.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static int firehose_program(struct qdl_device *qdl, struct program *program, int
451451
void *buf;
452452
time_t t0;
453453
time_t t;
454-
int left;
454+
size_t left;
455455
int ret;
456456
int n;
457457
size_t i;
@@ -633,7 +633,7 @@ static int firehose_issue_read(struct qdl_device *qdl, struct read_op *read_op,
633633
void *buf;
634634
time_t t0;
635635
time_t t;
636-
int left;
636+
size_t left;
637637
int ret;
638638
int n;
639639
bool expect_empty;

gpt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ int gpt_find_by_name(struct qdl_device *qdl, const char *name, int *phys_partiti
252252
return -1;
253253

254254
for (gpt_part = gpt_partitions; gpt_part; gpt_part = gpt_part->next) {
255-
if (*phys_partition >= 0 && gpt_part->partition != *phys_partition)
255+
if (*phys_partition >= 0 && gpt_part->partition != (unsigned int)(*phys_partition))
256256
continue;
257257

258258
if (strcmp(gpt_part->name, name))

sahara.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#define SAHARA_DONE_RESP_LENGTH 0xc
5959
#define SAHARA_RESET_LENGTH 0x8
6060

61-
#define DEBUG_BLOCK_SIZE (512 * 1024)
61+
#define DEBUG_BLOCK_SIZE (512u * 1024u)
6262

6363
#define SAHARA_CMD_TIMEOUT_MS 1000
6464

@@ -283,7 +283,7 @@ static ssize_t sahara_debug64_one(struct qdl_device *qdl,
283283

284284
chunk = 0;
285285
while (chunk < region.length) {
286-
remain = MIN(region.length - chunk, DEBUG_BLOCK_SIZE);
286+
remain = MIN((uint64_t)(region.length - chunk), DEBUG_BLOCK_SIZE);
287287

288288
read_req.cmd = SAHARA_MEM_READ64_CMD;
289289
read_req.length = SAHARA_MEM_READ64_LENGTH;

util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void print_hex_dump(const char *prefix, const void *buf, size_t len)
4343
unsigned int j;
4444

4545
for (i = 0; i < len; i += 16) {
46-
linelen = MIN(16, len - i);
46+
linelen = MIN(16u, (size_t)(len - i));
4747
li = 0;
4848

4949
for (j = 0; j < linelen; j++) {

vip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int write_digests_to_table(char *src_table, char *dest_table, size_t star
210210
}
211211

212212
/* Seek to offset of start_digest */
213-
size_t offset = elem_size * start_digest;
213+
off_t offset = elem_size * start_digest;
214214

215215
if (lseek(fd, offset, SEEK_SET) != offset) {
216216
ux_err("Failed to seek in %s\n", src_table);

0 commit comments

Comments
 (0)