1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

libdm: Rename struct time_value variables.

warning: declaration of ‘time’ shadows a global declaration
This commit is contained in:
Alasdair G Kergon 2015-06-30 16:17:22 +01:00
parent ded279f826
commit f6ad48f0e5

View File

@ -2795,7 +2795,7 @@ static int _local_tz_offset(time_t t_local)
static void _get_final_time(time_range_t range, struct tm *tm, static void _get_final_time(time_range_t range, struct tm *tm,
int tz_supplied, int offset, int tz_supplied, int offset,
struct time_value *time) struct time_value *tval)
{ {
struct tm tm_up = *tm; struct tm tm_up = *tm;
@ -2834,9 +2834,9 @@ static void _get_final_time(time_range_t range, struct tm *tm,
break; break;
} }
time->range = (range != RANGE_NONE); tval->range = (range != RANGE_NONE);
time->t1 = mktime(tm); tval->t1 = mktime(tm);
time->t2 = mktime(&tm_up) - 1; tval->t2 = mktime(&tm_up) - 1;
if (tz_supplied) { if (tz_supplied) {
/* /*
@ -2845,13 +2845,13 @@ static void _get_final_time(time_range_t range, struct tm *tm,
* to our local timezone and adjust times * to our local timezone and adjust times
* so they represent time in our local timezone. * so they represent time in our local timezone.
*/ */
offset -= _local_tz_offset(time->t1); offset -= _local_tz_offset(tval->t1);
time->t1 -= offset; tval->t1 -= offset;
time->t2 -= offset; tval->t2 -= offset;
} }
} }
static int _parse_formatted_date_time(char *str, struct time_value *time) static int _parse_formatted_date_time(char *str, struct time_value *tval)
{ {
time_range_t range = RANGE_NONE; time_range_t range = RANGE_NONE;
struct tm tm; struct tm tm;
@ -2874,7 +2874,7 @@ static int _parse_formatted_date_time(char *str, struct time_value *time)
if (*str) if (*str)
return 0; return 0;
_get_final_time(range, &tm, tz_supplied, gmt_offset, time); _get_final_time(range, &tm, tz_supplied, gmt_offset, tval);
return 1; return 1;
} }
@ -2882,7 +2882,7 @@ static int _parse_formatted_date_time(char *str, struct time_value *time)
static const char *_tok_value_time(const struct dm_report_field_type *ft, static const char *_tok_value_time(const struct dm_report_field_type *ft,
struct dm_pool *mem, const char *s, struct dm_pool *mem, const char *s,
const char **begin, const char **end, const char **begin, const char **end,
struct time_value *time) struct time_value *tval)
{ {
char *time_str = NULL; char *time_str = NULL;
const char *r = NULL; const char *r = NULL;
@ -2906,9 +2906,9 @@ static const char *_tok_value_time(const struct dm_report_field_type *ft,
goto out; goto out;
} }
time->range = 0; tval->range = 0;
time->t1 = (time_t) t; tval->t1 = (time_t) t;
time->t2 = 0; tval->t2 = 0;
r = s; r = s;
} else { } else {
c = _get_and_skip_quote_char(&s); c = _get_and_skip_quote_char(&s);
@ -2920,7 +2920,7 @@ static const char *_tok_value_time(const struct dm_report_field_type *ft,
goto out; goto out;
} }
if (!_parse_formatted_date_time(time_str, time)) if (!_parse_formatted_date_time(time_str, tval))
goto_out; goto_out;
r = s; r = s;
} }
@ -2953,7 +2953,7 @@ static const char *_tok_value(struct dm_report *rh,
{ {
int expected_type = ft->flags & DM_REPORT_FIELD_TYPE_MASK; int expected_type = ft->flags & DM_REPORT_FIELD_TYPE_MASK;
struct selection_str_list **str_list; struct selection_str_list **str_list;
struct time_value *time; struct time_value *tval;
uint64_t *factor; uint64_t *factor;
const char *tmp; const char *tmp;
char c; char c;
@ -3041,8 +3041,8 @@ static const char *_tok_value(struct dm_report *rh,
break; break;
case DM_REPORT_FIELD_TYPE_TIME: case DM_REPORT_FIELD_TYPE_TIME:
time = (struct time_value *) custom; tval = (struct time_value *) custom;
if (!(s = _tok_value_time(ft, mem, s, begin, end, time))) { if (!(s = _tok_value_time(ft, mem, s, begin, end, tval))) {
log_error("Failed to parse time value " log_error("Failed to parse time value "
"for selection field %s.", ft->id); "for selection field %s.", ft->id);
return NULL; return NULL;
@ -3119,7 +3119,7 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
struct field_properties *fp, *found = NULL; struct field_properties *fp, *found = NULL;
struct field_selection *fs; struct field_selection *fs;
const char *field_id; const char *field_id;
struct time_value *time; struct time_value *tval;
uint64_t factor; uint64_t factor;
char *s; char *s;
@ -3287,10 +3287,10 @@ static struct field_selection *_create_field_selection(struct dm_report *rh,
if (rvw->reserved->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE) if (rvw->reserved->type & DM_REPORT_FIELD_RESERVED_VALUE_RANGE)
fs->value->next->v.t = (((time_t *) rvw->value)[1]); fs->value->next->v.t = (((time_t *) rvw->value)[1]);
} else { } else {
time = (struct time_value *) custom; tval = (struct time_value *) custom;
fs->value->v.t = time->t1; fs->value->v.t = tval->t1;
if (time->range) if (tval->range)
fs->value->next->v.t = time->t2; fs->value->next->v.t = tval->t2;
if (_check_value_is_strictly_reserved(rh, field_num, DM_REPORT_FIELD_TYPE_TIME, &fs->value->v.t, NULL)) { if (_check_value_is_strictly_reserved(rh, field_num, DM_REPORT_FIELD_TYPE_TIME, &fs->value->v.t, NULL)) {
log_error("Time value found in selection is reserved."); log_error("Time value found in selection is reserved.");
goto error; goto error;
@ -3433,7 +3433,7 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
const struct dm_report_field_type *ft; const struct dm_report_field_type *ft;
struct selection_str_list *str_list; struct selection_str_list *str_list;
struct reserved_value_wrapper rvw = {0}; struct reserved_value_wrapper rvw = {0};
struct time_value time; struct time_value tval;
uint64_t factor; uint64_t factor;
void *custom = NULL; void *custom = NULL;
char *tmp; char *tmp;
@ -3517,7 +3517,7 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
ft->flags == DM_REPORT_FIELD_TYPE_PERCENT) ft->flags == DM_REPORT_FIELD_TYPE_PERCENT)
custom = &factor; custom = &factor;
else if (ft->flags & DM_REPORT_FIELD_TYPE_TIME) else if (ft->flags & DM_REPORT_FIELD_TYPE_TIME)
custom = &time; custom = &tval;
else if (ft->flags == DM_REPORT_FIELD_TYPE_STRING_LIST) else if (ft->flags == DM_REPORT_FIELD_TYPE_STRING_LIST)
custom = &str_list; custom = &str_list;
else else