@@ -49,13 +49,13 @@ static bool _z_time_range_parse_duration(const _z_str_se_t *bound, double *durat
49
49
}
50
50
51
51
double multiplier = 1.0 ;
52
- switch (* ( _z_cptr_char_offset (bound -> end , -1 ) )) {
52
+ switch (* _z_cptr_char_offset (bound -> end , -1 )) {
53
53
case 'u' :
54
54
multiplier = _Z_TIME_RANGE_U_TO_SECS ;
55
55
len -- ;
56
56
break ;
57
57
case 's' :
58
- if (len > 1 && * ( _z_cptr_char_offset (bound -> end , -2 ) ) == 'm' ) {
58
+ if (len > 1 && * _z_cptr_char_offset (bound -> end , -2 ) == 'm' ) {
59
59
multiplier = _Z_TIME_RANGE_MS_TO_SECS ;
60
60
len -- ;
61
61
}
@@ -112,16 +112,16 @@ static bool _z_time_range_parse_time_bound(_z_str_se_t *str, bool inclusive, _z_
112
112
} else if (len >= 5 ) {
113
113
bound -> bound = inclusive ? _Z_TIME_BOUND_INCLUSIVE : _Z_TIME_BOUND_EXCLUSIVE ;
114
114
115
- if (* ( str -> start ) == 'n' && * ( _z_cptr_char_offset (str -> start , 1 ) ) == 'o' &&
116
- * ( _z_cptr_char_offset (str -> start , 2 )) == 'w' && * ( _z_cptr_char_offset (str -> start , 3 ) ) == '(' &&
117
- * ( _z_cptr_char_offset (str -> end , -1 ) ) == ')' ) {
115
+ if (* str -> start == 'n' && * _z_cptr_char_offset (str -> start , 1 ) == 'o' &&
116
+ * _z_cptr_char_offset (str -> start , 2 ) == 'w' && * _z_cptr_char_offset (str -> start , 3 ) == '(' &&
117
+ * _z_cptr_char_offset (str -> end , -1 ) == ')' ) {
118
118
if (len == 5 ) {
119
119
bound -> now_offset = 0 ;
120
120
} else {
121
121
_z_str_se_t duration = {.start = _z_cptr_char_offset (str -> start , 4 ),
122
122
.end = _z_cptr_char_offset (str -> end , -1 )};
123
123
124
- if (!_z_time_range_parse_duration (& duration , & ( bound -> now_offset ) )) {
124
+ if (!_z_time_range_parse_duration (& duration , & bound -> now_offset )) {
125
125
return false;
126
126
}
127
127
}
@@ -167,8 +167,8 @@ bool _z_time_range_from_str(const char *str, size_t len, _z_time_range_t *range)
167
167
_z_str_se_t start_str = {.start = _z_cptr_char_offset (str , 1 ), .end = separator };
168
168
_z_str_se_t end_str = {.start = _z_cptr_char_offset (separator , 2 ), .end = _z_cptr_char_offset (str , len - 1 )};
169
169
170
- if (!_z_time_range_parse_time_bound (& start_str , inclusive_start , & ( range -> start ) ) ||
171
- !_z_time_range_parse_time_bound (& end_str , inclusive_end , & ( range -> end ) )) {
170
+ if (!_z_time_range_parse_time_bound (& start_str , inclusive_start , & range -> start ) ||
171
+ !_z_time_range_parse_time_bound (& end_str , inclusive_end , & range -> end )) {
172
172
return false;
173
173
}
174
174
} else {
@@ -181,7 +181,7 @@ bool _z_time_range_from_str(const char *str, size_t len, _z_time_range_t *range)
181
181
_z_str_se_t start_str = {.start = _z_cptr_char_offset (str , 1 ), .end = separator };
182
182
_z_str_se_t end_str = {.start = _z_cptr_char_offset (separator , 1 ), .end = _z_cptr_char_offset (str , len - 1 )};
183
183
184
- if (!_z_time_range_parse_time_bound (& start_str , inclusive_start , & ( range -> start ) ) ||
184
+ if (!_z_time_range_parse_time_bound (& start_str , inclusive_start , & range -> start ) ||
185
185
range -> start .bound == _Z_TIME_BOUND_UNBOUNDED ) {
186
186
return false;
187
187
}
0 commit comments