Re: Constification

2000-11-17 Thread Bodo Moeller
On Wed, Nov 08, 2000 at 07:34:33AM -0800, Geoff Thorpe wrote: [...] > whose internals are generally only managed inside OpenSSL anyway. Eg. the > caller may pass a const X509* pointer, but the caller is generally not > supposed to be using the structure's internals directly anyway - the use > of

Re: Constification

2000-11-13 Thread Paul D. Smith
%% Ben Laurie <[EMAIL PROTECTED]> writes: bl> "Paul D. Smith" wrote: >> It's worse than that: you have to provide two different data >> structures internally. Unless you're going to cast internally, and >> if so why bother to have two API's anyway? It quickly reaches the >> point of

Re: Constification

2000-11-11 Thread Ben Laurie
"Paul D. Smith" wrote: > > %% Ben Laurie <[EMAIL PROTECTED]> writes: > > >> Are you saying you just don't use const, or that you provide two > >> different functions or two interfaces to the same function? > > bl> The latter. > > To me, that's much more ugly than simply casting it. > >

Re: Constification

2000-11-11 Thread Paul D. Smith
%% Ben Laurie <[EMAIL PROTECTED]> writes: >> Are you saying you just don't use const, or that you provide two >> different functions or two interfaces to the same function? bl> The latter. To me, that's much more ugly than simply casting it. This is C, not C++, and we do the best we can

Re: Constification

2000-11-11 Thread Rob Neff
From: Geoff Thorpe <[EMAIL PROTECTED]> > Hi there, > [snip] > > > psmith> IMHO this is a legitimate reason to cast away const, and that > > > psmith> the "const" notation on the arguments to lhash is useful for > > > psmith> self-documentation purposes, at the least. > > > > > > Hmm, perhaps yo

Re: Constification

2000-11-10 Thread Geoff Thorpe
Hi there, I'm gonna spill my splein here because, just like Richard and Paul have done now and in the past, I have suffered at the hands of a well-meaning mission to constify parts of OpenSSL. On Wed, 8 Nov 2000, Ben Laurie wrote: > Richard Levitte - VMS Whacker wrote: > > > > From: "Paul D. S

Re: Constification

2000-11-10 Thread Rob Neff
uch a string must make a local copy first. My .02 cents worth... - Original Message - From: Lutz Jaenicke <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 08, 2000 10:08 AM Subject: Re: Constification > On Wed, Nov 08, 2000 at 04:01:13PM +0100, Richard L

Re: Constification

2000-11-10 Thread Ben Laurie
"Paul D. Smith" wrote: > > %% Ben Laurie <[EMAIL PROTECTED]> writes: > > bl> By wrapping them with correctly declared functions. > > Are you saying you just don't use const, or that you provide two > different functions or two interfaces to the same function? The latter. > I don't think eit

Re: Constification

2000-11-10 Thread Richard Levitte - VMS Whacker
From: Ben Laurie <[EMAIL PROTECTED]> ben> No, you have two, a const and a non-const version. Fine, I'll give it a shot. I do not believe in it, but I will. -- Richard Levitte \ Spannvägen 38, II \ [EMAIL PROTECTED] Chairman@Stacken \ S-168 35 BROMMA \ T: +46-8-26 52 47 Redakteur@Stacken

Re: Constification

2000-11-10 Thread Ben Laurie
Richard Levitte - VMS Whacker wrote: > > From: Ben Laurie <[EMAIL PROTECTED]> > > ben> > >> Like strstr()... > ben> > > ben> > bl> Just because the C libraries are broken doesn't mean we should > ben> > bl> break ours. In Apache we fix these rather than live with them. > ben> > > ben> > Ho

Re: Constification

2000-11-08 Thread Lutz Jaenicke
On Wed, Nov 08, 2000 at 04:01:13PM +0100, Richard Levitte - VMS Whacker wrote: > So, either: > > const char *correct_strstr(const char *s1, const char *s2) > { > return strstr(s1, s2); > } > > or: > > char *correct_strstr(char *s1, const char *s2) > { > return st

Re: Constification

2000-11-08 Thread Paul D. Smith
%% Ben Laurie <[EMAIL PROTECTED]> writes: bl> By wrapping them with correctly declared functions. Are you saying you just don't use const, or that you provide two different functions or two interfaces to the same function? I don't think either of these two options is better than deconstifying

Re: Constification

2000-11-08 Thread Richard Levitte - VMS Whacker
From: Ben Laurie <[EMAIL PROTECTED]> ben> > >> Like strstr()... ben> > ben> > bl> Just because the C libraries are broken doesn't mean we should ben> > bl> break ours. In Apache we fix these rather than live with them. ben> > ben> > How exactly do you fix them? ben> ben> By wrapping them

Re: Constification

2000-11-08 Thread Ben Laurie
"Paul D. Smith" wrote: > > %% Ben Laurie <[EMAIL PROTECTED]> writes: > > >> Like strstr()... > > bl> Just because the C libraries are broken doesn't mean we should > bl> break ours. In Apache we fix these rather than live with them. > > How exactly do you fix them? By wrapping them with

Re: Constification

2000-11-08 Thread Paul D. Smith
%% Ben Laurie <[EMAIL PROTECTED]> writes: >> Like strstr()... bl> Just because the C libraries are broken doesn't mean we should bl> break ours. In Apache we fix these rather than live with them. How exactly do you fix them? -- ---

Re: Constification

2000-11-08 Thread Ben Laurie
Richard Levitte - VMS Whacker wrote: > > From: "Paul D. Smith" <[EMAIL PROTECTED]> > > psmith> This is similar to standard C functions which take a const > psmith> char*, for example, and return a char* that points into the > psmith> string. > > Like strstr()... Just because the C libraries ar

RE: Constification

2000-11-08 Thread Bernard Dautrevaux
> -Original Message- > From: Richard Levitte - VMS Whacker [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 07, 2000 8:55 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: Constification > > > From: "Paul D. Smith" <[EMAIL PROTEC

Re: Constification

2000-11-07 Thread Ulf Moeller
On Tue, Nov 07, 2000, Paul D. Smith wrote: > I sent this patch back on 05 May 2000, constifying crypto/lhash. Your patch can only be accepted if you CC it to [EMAIL PROTECTED] __ OpenSSL Project

Re: Constification

2000-11-07 Thread Paul D. Smith
%% Richard Levitte - VMS Whacker <[EMAIL PROTECTED]> writes: rl> From: "Paul D. Smith" <[EMAIL PROTECTED]> psmith> This is similar to standard C functions which take a const psmith> char*, for example, and return a char* that points into the psmith> string. rl> Like strstr()... Yep.

Re: Constification

2000-11-07 Thread Richard Levitte - VMS Whacker
From: "Paul D. Smith" <[EMAIL PROTECTED]> psmith> This is similar to standard C functions which take a const psmith> char*, for example, and return a char* that points into the psmith> string. Like strstr()... psmith> IMHO this is a legitimate reason to cast away const, and that psmith> the "co

Re: Constification

2000-11-07 Thread Paul D. Smith
I sent this patch back on 05 May 2000, constifying crypto/lhash. --- Note that this is a special case where you send data to the lhash library to be stored; I declared that data to be const void* since the lhash library d

Re: Constification

2000-11-07 Thread Richard Levitte - VMS Whacker
From: Dr S N Henson <[EMAIL PROTECTED]> drh> There's a couple of areas I noticed that could be constified. The EVP drh> library's use of EVP_MD and EVP_CIPHER is the main one. I also noticed drh> that the version strings for some reason weren't constified. Thanks, I'll look at those next (after

Re: Constification

2000-11-07 Thread Dr S N Henson
Richard Levitte - VMS Whacker wrote: > > I've become irritated enough with some functions not having const used > properly (or at least what appears proper), so I've started working on > bringing better use of const to OpenSSL, as some may already have > noticed. > > This may, for a few days, br

Re: Constification

2000-11-06 Thread rsalz
>I've started working on bringing better use of const to OpenSSL Huzzah. >Also, this will bring about a few ugly casts in the ASN.1 macros or >direct callers of them. Perhaps something like #define CONST(t, p) (const t)(p) #define UNCONST(t, p) (t)(p) As in extern voi