src: Add more constexpr

This commit is contained in:
Tatsuhiro Tsujikawa 2017-01-09 17:17:48 +09:00
parent 6595ae26ea
commit 3444b42d44
1 changed files with 5 additions and 4 deletions

View File

@ -205,9 +205,10 @@ Iterator cpydig(Iterator d, uint32_t n, size_t len) {
} // namespace } // namespace
namespace { namespace {
const char *MONTH[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", constexpr const char *MONTH[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
const char *DAY_OF_WEEK[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; constexpr const char *DAY_OF_WEEK[] = {"Sun", "Mon", "Tue", "Wed",
"Thu", "Fri", "Sat"};
} // namespace } // namespace
std::string http_date(time_t t) { std::string http_date(time_t t) {
@ -369,7 +370,7 @@ char upcase(char c) {
} }
namespace { namespace {
const char LOWER_XDIGITS[] = "0123456789abcdef"; constexpr char LOWER_XDIGITS[] = "0123456789abcdef";
} // namespace } // namespace
std::string format_hex(const unsigned char *s, size_t len) { std::string format_hex(const unsigned char *s, size_t len) {