summaryrefslogtreecommitdiff
path: root/node/Utils.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-16 12:28:43 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-16 12:28:43 -0700
commite09c1a1c11522c11c6ea81dcb1c52a4e8a2f5c6c (patch)
treeba6d0381aa472ec1811bd9f16627e10f48f2d203 /node/Utils.hpp
parentb104bb4762a07dcb0a950b33c7419b298c2b6267 (diff)
downloadinfinitytier-e09c1a1c11522c11c6ea81dcb1c52a4e8a2f5c6c.tar.gz
infinitytier-e09c1a1c11522c11c6ea81dcb1c52a4e8a2f5c6c.zip
Big refactor mostly builds. We now have a uniform backward compatible netconf.
Diffstat (limited to 'node/Utils.hpp')
-rw-r--r--node/Utils.hpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/node/Utils.hpp b/node/Utils.hpp
index 04838f1c..cfe56501 100644
--- a/node/Utils.hpp
+++ b/node/Utils.hpp
@@ -49,7 +49,6 @@ public:
* @return True if strings are equal
*/
static inline bool secureEq(const void *a,const void *b,unsigned int len)
- throw()
{
uint8_t diff = 0;
for(unsigned int i=0;i<len;++i)
@@ -235,23 +234,7 @@ public:
* @param src Source string (if NULL, dest will receive a zero-length string and true is returned)
* @return True on success, false on overflow (buffer will still be 0-terminated)
*/
- static inline bool scopy(char *dest,unsigned int len,const char *src)
- {
- if (!len)
- return false; // sanity check
- if (!src) {
- *dest = (char)0;
- return true;
- }
- char *end = dest + len;
- while ((*dest++ = *src++)) {
- if (dest == end) {
- *(--dest) = (char)0;
- return false;
- }
- }
- return true;
- }
+ static bool scopy(char *dest,unsigned int len,const char *src);
/**
* Variant of snprintf that is portable and throws an exception
@@ -275,7 +258,6 @@ public:
* @return Number of bits set in this integer (0-32)
*/
static inline uint32_t countBits(uint32_t v)
- throw()
{
v = v - ((v >> 1) & (uint32_t)0x55555555);
v = (v & (uint32_t)0x33333333) + ((v >> 2) & (uint32_t)0x33333333);
@@ -290,7 +272,6 @@ public:
* @return True if memory is all zero
*/
static inline bool isZero(const void *p,unsigned int len)
- throw()
{
for(unsigned int i=0;i<len;++i) {
if (((const unsigned char *)p)[i])