summaryrefslogtreecommitdiffhomepage
path: root/ir/adt
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-02-15 11:08:51 +0100
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-04-27 13:18:47 +0200
commitc0a95531983586f651cf6f0b298cb2b843689fad (patch)
tree82bf9b2dfdffe6fa174fce0eff6582e09d3e5c42 /ir/adt
parentf444ac1088814d7ef643dbd234687786de2bbba1 (diff)
util: Add and use is_digit().
Diffstat (limited to 'ir/adt')
-rw-r--r--ir/adt/util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/ir/adt/util.h b/ir/adt/util.h
index 1025a3c..23ebc7c 100644
--- a/ir/adt/util.h
+++ b/ir/adt/util.h
@@ -12,6 +12,7 @@
#ifndef FIRM_ADT_UTIL_H
#define FIRM_ADT_UTIL_H
+#include <stdbool.h>
#include <string.h>
/**
@@ -58,4 +59,9 @@ static inline void *safe_memcpy(void* const dst, void const* const src, size_t c
#define MEMCPY(dst, src, n) safe_memcpy((dst), (src), (n) * sizeof(*(1 ? (dst) : (src))))
+static inline bool is_digit(char const c)
+{
+ return '0' <= c && c <= '9';
+}
+
#endif