From 4f3d5a74645d904a9f5d8e81e00f6eb416a93fc7 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 12 Mar 2004 02:56:09 +0000 Subject: [PATCH] added '^' modifier which marks bit numbers git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1215 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/lib/listparser.hc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/util-vserver/lib/listparser.hc b/util-vserver/lib/listparser.hc index 4c5769a..140b5f2 100644 --- a/util-vserver/lib/listparser.hc +++ b/util-vserver/lib/listparser.hc @@ -27,13 +27,16 @@ #define TONUMBER_uint64(S,E,B) strtoll(S,E,B) #define TONUMBER_uint32(S,E,B) strtol (S,E,B) -#define ISNUMBER(TYPE,SHORT) \ - static inline ALWAYSINLINE bool \ - isNumber_##SHORT(char const *str,TYPE *res, char end_chr) \ - { \ - char *err_ptr; \ - *res = TONUMBER_##SHORT(str, &err_ptr, 0); \ - return err_ptr>str && *err_ptr==end_chr; \ +#define ISNUMBER(TYPE,SHORT) \ + static inline ALWAYSINLINE bool \ + isNumber_##SHORT(char const *str,TYPE *res, char end_chr) \ + { \ + char *err_ptr; \ + if (*str=='^') \ + *res = ((TYPE)(1)) << TONUMBER_##SHORT(str+1, &err_ptr, 0); \ + else \ + *res = TONUMBER_##SHORT(str, &err_ptr, 0); \ + return err_ptr>str && *err_ptr==end_chr; \ } -- 1.8.1.5