Make format buffers const correct

This commit is contained in:
zeffy 2020-01-22 20:19:55 +00:00 committed by GitHub
parent 820b9e31ba
commit 6d6b70288b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -907,7 +907,7 @@ struct chrono_formatter {
if (ns == numeric_system::standard) return write(hour(), 2); if (ns == numeric_system::standard) return write(hour(), 2);
auto time = tm(); auto time = tm();
time.tm_hour = to_nonnegative_int(hour(), 24); time.tm_hour = to_nonnegative_int(hour(), 24);
char_type format[] { '%', 'O', 'H', 0 }; const char_type format[] { '%', 'O', 'H', 0 };
format_localized(time, format); format_localized(time, format);
} }
@ -917,7 +917,7 @@ struct chrono_formatter {
if (ns == numeric_system::standard) return write(hour12(), 2); if (ns == numeric_system::standard) return write(hour12(), 2);
auto time = tm(); auto time = tm();
time.tm_hour = to_nonnegative_int(hour12(), 12); time.tm_hour = to_nonnegative_int(hour12(), 12);
char_type format[] { '%', 'O', 'I', 0 }; const char_type format[] { '%', 'O', 'I', 0 };
format_localized(time, format); format_localized(time, format);
} }
@ -927,7 +927,7 @@ struct chrono_formatter {
if (ns == numeric_system::standard) return write(minute(), 2); if (ns == numeric_system::standard) return write(minute(), 2);
auto time = tm(); auto time = tm();
time.tm_min = to_nonnegative_int(minute(), 60); time.tm_min = to_nonnegative_int(minute(), 60);
char_type format[] { '%', 'O', 'M', 0 }; const char_type format[] { '%', 'O', 'M', 0 };
format_localized(time, format); format_localized(time, format);
} }
@ -953,14 +953,14 @@ struct chrono_formatter {
} }
auto time = tm(); auto time = tm();
time.tm_sec = to_nonnegative_int(second(), 60); time.tm_sec = to_nonnegative_int(second(), 60);
char_type format[] { '%', 'O', 'S', 0 }; const char_type format[] { '%', 'O', 'S', 0 };
format_localized(time, format); format_localized(time, format);
} }
void on_12_hour_time() { void on_12_hour_time() {
if (handle_nan_inf()) return; if (handle_nan_inf()) return;
char_type format[] { '%', 'r', 0 }; const char_type format[] { '%', 'r', 0 };
format_localized(time(), format); format_localized(time(), format);
} }
@ -985,7 +985,7 @@ struct chrono_formatter {
void on_am_pm() { void on_am_pm() {
if (handle_nan_inf()) return; if (handle_nan_inf()) return;
char_type format[] { '%', 'p', 0 }; const char_type format[] { '%', 'p', 0 };
format_localized(time(), format); format_localized(time(), format);
} }