lkml.org 
[lkml]   [2012]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf tools: Allow multiple threads or processes in record, stat, top

* David Ahern <dsahern@gmail.com> wrote:

> > I was trying to remove ctype.h, you might use util.h here.
>
> Right, knew that. But, in this case I am adding a call to
> isdigit which means a direct dependency on ctype.h. I would
> prefer a direct relationship versus an indirect via util.h

Please just remove ctype.h *altogether* from perf, it's just an
insane header.

Have a look at how Git solves these types of problems, it
defines sane string functions in git-compat-util.h:

/* Sane ctype - no locale, and works with signed chars */
#undef isascii
#undef isspace
#undef isdigit
#undef isalpha
#undef isalnum
#undef tolower
#undef toupper
extern unsigned char sane_ctype[256];
#define GIT_SPACE 0x01
#define GIT_DIGIT 0x02
#define GIT_ALPHA 0x04
#define GIT_GLOB_SPECIAL 0x08
#define GIT_REGEX_SPECIAL 0x10

Thanks,

Ingo


\
 
 \ /
  Last update: 2012-02-09 08:41    [W:0.080 / U:4.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site