int count=0;
while(*range) {
int length = snprintf(output+loc, buf_size-loc, "%lu-%lu,",
- (*range)->start, (*range)->end);
+ (long unsigned)(*range)->start,
+ (long unsigned)(*range)->end);
if(length < 0) {
zck_log(ZCK_LOG_ERROR, "Unable to get range: %s\n",
strerror(errno));
if(read == 0)
break;
if(read > BLK_SIZE)
- printf("read: %lu\n", read);
+ printf("read: %lu\n", (long unsigned)read);
if(write(dst_fd, data, read) != read) {
printf("Error writing to %s\n", out_name);
goto error;
}
prev_srpm = next_srpm;
- printf("Compressing %li bytes\n", next-found);
+ printf("Compressing %li bytes\n", (long)(next-found));
if(zck_write(zck, found, next-found) < 0)
exit(1);
if(zck_end_chunk(zck) < 0)
if(search > data + in_size)
search = data + in_size;
} else {
- printf("Completing %li bytes\n", data+in_size-found);
+ printf("Completing %li bytes\n",
+ (long)(data+in_size-found));
if(zck_write(zck, found, data+in_size-found) < 0)
exit(1);
if(zck_end_chunk(zck) < 0)
} else {
cur_loc = data + in_size;
}
- printf("Completing %li bytes\n", cur_loc-start);
+ printf("Completing %li bytes\n", (long)(cur_loc-start));
if(zck_write(zck, start, cur_loc-start) < 0)
exit(1);
if(zck_end_chunk(zck) < 0)
total_size += tgt_idx->comp_length;
tgt_idx = tgt_idx->next;
}
- printf("Would download %li of %li bytes\n", dl_size, total_size);
- printf("Matched %li of %lu chunks\n", matched_chunks, zck_get_index_count(zck_tgt));
+ printf("Would download %li of %li bytes\n", (long)dl_size,
+ (long)total_size);
+ printf("Matched %li of %lu chunks\n", (long)matched_chunks,
+ (long unsigned)zck_get_index_count(zck_tgt));
zck_free(&zck_tgt);
zck_free(&zck_src);
}
exit(1);
- printf("Downloaded %lu bytes\n", zck_dl_get_bytes_downloaded(dl));
+ printf("Downloaded %lu bytes\n",
+ (long unsigned)zck_dl_get_bytes_downloaded(dl));
int exit_val = 0;
switch(zck_hash_check_data(dl->zck, dl->dst_fd)) {
case -1:
digest = zck_get_data_digest(zck);
printf("Data checksum: %s\n", digest);
free(digest);
- printf("Index count: %lu\n", zck_get_index_count(zck));
+ printf("Index count: %lu\n", (long unsigned)zck_get_index_count(zck));
printf("Chunk checksum type: %s\n", zck_hash_name_from_type(zck_get_chunk_hash_type(zck)));
zckIndex *idxi = zck_get_index(zck);
if(idxi == NULL)
char *digest = zck_get_chunk_digest(idx);
if(digest == NULL)
exit(1);
- printf("%s %12lu %12lu %12lu\n", digest, idx->start + zck_get_header_length(zck), idx->comp_length, idx->length);
+ printf("%s %12lu %12lu %12lu\n", digest,
+ (long unsigned)(idx->start + zck_get_header_length(zck)),
+ (long unsigned)idx->comp_length, (long unsigned)idx->length);
free(digest);
idx = idx->next;
}