util/NumberParser: add noexcept

This commit is contained in:
Max Kellermann 2019-06-06 13:15:00 +02:00
parent 80ec6f976c
commit e556cd20f7

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2013 Max Kellermann <max.kellermann@gmail.com> * Copyright 2009-2019 Max Kellermann <max.kellermann@gmail.com>
* http://www.musicpd.org * http://www.musicpd.org
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -36,7 +36,7 @@
#include <stdlib.h> #include <stdlib.h>
static inline unsigned static inline unsigned
ParseUnsigned(const char *p, char **endptr=nullptr, int base=10) ParseUnsigned(const char *p, char **endptr=nullptr, int base=10) noexcept
{ {
assert(p != nullptr); assert(p != nullptr);
@ -44,7 +44,7 @@ ParseUnsigned(const char *p, char **endptr=nullptr, int base=10)
} }
static inline int static inline int
ParseInt(const char *p, char **endptr=nullptr, int base=10) ParseInt(const char *p, char **endptr=nullptr, int base=10) noexcept
{ {
assert(p != nullptr); assert(p != nullptr);
@ -52,7 +52,7 @@ ParseInt(const char *p, char **endptr=nullptr, int base=10)
} }
static inline uint64_t static inline uint64_t
ParseUint64(const char *p, char **endptr=nullptr, int base=10) ParseUint64(const char *p, char **endptr=nullptr, int base=10) noexcept
{ {
assert(p != nullptr); assert(p != nullptr);
@ -60,7 +60,7 @@ ParseUint64(const char *p, char **endptr=nullptr, int base=10)
} }
static inline int64_t static inline int64_t
ParseInt64(const char *p, char **endptr=nullptr, int base=10) ParseInt64(const char *p, char **endptr=nullptr, int base=10) noexcept
{ {
assert(p != nullptr); assert(p != nullptr);
@ -68,7 +68,7 @@ ParseInt64(const char *p, char **endptr=nullptr, int base=10)
} }
static inline double static inline double
ParseDouble(const char *p, char **endptr=nullptr) ParseDouble(const char *p, char **endptr=nullptr) noexcept
{ {
assert(p != nullptr); assert(p != nullptr);
@ -76,7 +76,7 @@ ParseDouble(const char *p, char **endptr=nullptr)
} }
static inline float static inline float
ParseFloat(const char *p, char **endptr=nullptr) ParseFloat(const char *p, char **endptr=nullptr) noexcept
{ {
#if defined(__BIONIC__) && __ANDROID_API__ < 21 #if defined(__BIONIC__) && __ANDROID_API__ < 21
/* strtof() requires API level 21 */ /* strtof() requires API level 21 */