Simple replacement for unsigned type - usually in for() loops.
Version 2.02.85 -
===================================
+ Fix some unmatching sign comparation gcc warnings in the code.
Allow lv_extend() to work on zero length intrinsically layered LVs.
Keep the cache content when the exported vg buffer is matching.
Extend the set of memory regions, that are not locked to memory.
/* Propogate debug options */
if (clvmd_get_debug()) {
if (!(debug_arg = malloc(16)) ||
- dm_snprintf(debug_arg, 16, "-d%d", (int)clvmd_get_debug()) < 0)
+ dm_snprintf(debug_arg, 16, "-d%u", clvmd_get_debug()) < 0)
goto_out;
argv[argc++] = debug_arg;
debug_arg = NULL;
{
struct local_client *thisfd;
for (thisfd = &local_client_head; thisfd != NULL; thisfd = thisfd->next) {
- if (thisfd->fd == ntohl(clientid))
+ if (thisfd->fd == (int)ntohl(clientid))
return thisfd;
}
return NULL;
char outbuf[PIPE_BUF];
struct clvm_header *outheader = (struct clvm_header *) outbuf;
int len;
- int off;
+ unsigned off;
int buflen;
int err;
/* Check if there is other the type of fs operation stacked */
static int _other_fs_ops(fs_op_t type)
{
- int i;
+ unsigned i;
for (i = 0; i < NUM_FS_OPS; i++)
if (type != i && _count_fs_ops[i])
{
char buf[10];
uint64_t size;
- int page, ret = 0;
+ unsigned page;
+ int ret = 0;
if (!dev_get_size(dev, &size)) {
stack;
char outbuf[PIPE_BUF] __attribute__((aligned(8)));
struct clvm_header *outheader = (struct clvm_header *) outbuf;
int len;
- int off;
+ unsigned off;
int buflen;
int err;
(le - seg->le) / area_multiple,
area_len, NULL, max_seg_len, 0,
(stripes_per_mimage == 1) && only_single_area_segments ? 1U : 0U,
- top_level_area_index != -1 ? top_level_area_index : (int) s * stripes_per_mimage,
+ (top_level_area_index != -1) ? top_level_area_index : (int) (s * stripes_per_mimage),
only_single_area_segments, fn,
data)))
stack;
int (*fn)(struct logical_volume *lv, void *data),
void *data)
{
- int i, s;
+ unsigned i, s;
struct lv_segment *lvseg;
struct logical_volume *deps[] = {
static int _lv_mark_if_partial_single(struct logical_volume *lv, void *data)
{
- int s;
+ unsigned s;
struct _lv_mark_if_partial_baton baton;
struct lv_segment *lvseg;
struct validate_hash *vhash = data;
struct lv_segment *lvseg;
struct physical_volume *pv;
- int s;
+ unsigned s;
int r = 1;
if (lv != dm_hash_lookup_binary(vhash->lvid, &lv->lvid.id[1],
*/
int shift_mirror_images(struct lv_segment *mirrored_seg, unsigned mimage)
{
- int i;
+ unsigned i;
struct lv_segment_area area;
if (mimage >= mirrored_seg->area_count) {
int in_sync;
struct logical_volume *log_lv;
struct lvinfo info;
- int old_log_count;
+ unsigned old_log_count;
int r = 0;
if (dm_list_size(&lv->segments) != 1) {
* process several characters in one go.
*/
static void _unquote_characters(char *src, const char *orig_chars,
- const int num_orig_chars,
+ size_t num_orig_chars,
const char quote_char,
char *arr_substr_first_unquoted[])
{
{
const struct config_value *cv;
long from, to;
- int pos, i;
+ int pos;
+ unsigned i;
char fr, fw, fx, fp;
size_t sz;
goto fail_close_unlink;
}
- if ((write_out == 0) || (write_out < bufferlen)) {
+ if ((write_out == 0) || ((size_t)write_out < bufferlen)) {
log_error("Cannot write pid to pidfile [%s], shortwrite of"
"[%" PRIsize_t "] bytes, expected [%" PRIsize_t "]\n",
lockfile, write_out, bufferlen);
return 0;
}
- if ((strlen(field->report_string) > field->props->width))
- field->props->width = strlen(field->report_string);
+ if (((int) strlen(field->report_string) > field->props->width))
+ field->props->width = (int) strlen(field->report_string);
if ((rh->flags & RH_SORT_REQUIRED) &&
(field->props->flags & FLD_SORT_KEY)) {
}
dm_list_iterate_items(fp, &rh->field_props) {
- if (buf_size < fp->width)
- buf_size = fp->width;
+ if ((int) buf_size < fp->width)
+ buf_size = (size_t) fp->width;
}
/* Including trailing '\0'! */
buf_size++;
static void _create_bitsets(struct dm_regex *m)
{
- int i;
+ unsigned i;
for (i = 0; i < m->num_nodes; i++) {
struct rx_node *n = m->nodes[i];
static void _calc_functions(struct dm_regex *m)
{
- int i, j, final = 1;
+ unsigned i, j, final = 1;
struct rx_node *rx, *c1, *c2;
for (i = 0; i < m->num_nodes; i++) {
{
unsigned iwidth = (m->num_charsets / DM_BITS_PER_INT) + 1;
struct dfa_state *dfa;
- int i, a;
+ unsigned i;
+ int a;
m->tt = ttree_create(m->scratch, iwidth);
if (!m->tt)
unsigned num_patterns)
{
char *all, *ptr;
- int i;
+ unsigned i;
size_t len = 0;
struct rx_node *rx;
struct dm_regex *m;
void *private)
{
const struct dm_deps *deps = data;
- int i;
+ unsigned i;
char buf[DM_MAX_TYPE_NAME], *repstr;
if (!dm_pool_begin_object(mem, 16)) {
{
struct lv_segment *lvseg;
int ret = 0;
- int s;
+ unsigned s;
dm_list_iterate_items(lvseg, &lv->segments) {
if (!seg_is_mirrored(lvseg))
if (getenv("LVM_SUPPRESS_FD_WARNINGS"))
suppress_warnings = 1;
- for (fd = 3; fd < rlim.rlim_cur; fd++)
+ for (fd = 3; fd < (int)rlim.rlim_cur; fd++)
_close_descriptor(fd, suppress_warnings, command, ppid,
parent_cmdline);
}