From: Enrico Scholz Date: Fri, 12 Mar 2004 02:56:09 +0000 (+0000) Subject: added '^' modifier which marks bit numbers X-Git-Tag: VERSION_0_10~359 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f3d5a74645d904a9f5d8e81e00f6eb416a93fc7;p=util-vserver.git added '^' modifier which marks bit numbers git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1215 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- 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; \ }