Re: [AGGREGATED PATCH] Fix in-place editing functions in convert.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Friday, October 5, 2007 - 11:05 am

On Fri, 5 Oct 2007, Sam Ravnborg wrote:

I agree with the "no sane person", but the problem is that the insane 
people seem to be in no short supply.

Go look at string libraries, and they all do something like that. Or 
worse.

 - ustr: yes, it uses *exactly* what I described: "ustr_cstr()" and 
   "ustr_len()" instead of having the data/length available easily 
   (although it claims to do it for size reasons - perhaps valid in some 
   cases!)

 - libast: SPIF_CHARPTR_C(x). No, really.

 - Vstr: doesn't have a linear data representation. Needs explicit 
   flattening - although it appears to be something you're not ever 
   supposed to do - it has 200+ functions to do various magic things. 

 - Qt (QString): QString::"data()", "ascii()" or "utf8()" or something.

   At least this has the excuse of really being able to handle different 
   locales (it didn't do that originally, though!), but they end up having 
   a million helper functions exactly because you cannot use the normal 
   string routines on anything!

 - safesrtr, bstring: you just cast the pointer to "char *". Now *that* is 
   classy and safe.

So there's a few sane out there, but I actually think they are in the 
minority (Glib, others)

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix memory leak in apply_filter., Pierre Habouzit, (Fri Oct 5, 1:27 am)
[PATCH] Fix memory leak in apply_filter., Pierre Habouzit, (Fri Oct 5, 1:29 am)
Re: [PATCH] Fix in-place editing in crlf_to_git and ident_ ..., Johannes Schindelin, (Fri Oct 5, 1:30 am)
Re: [AGGREGATED PATCH] Fix in-place editing functions in c ..., Linus Torvalds, (Fri Oct 5, 11:05 am)