bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] Const craziness.


From: Jeff Bailey
Subject: Re: [bug-mailutils] Const craziness.
Date: Wed, 28 Jan 2004 09:13:03 -0500

On Wed, 2004-01-28 at 03:47, Sergey Poznyakoff wrote:
> Jeff Bailey <address@hidden> wrote:
> 
> >   name = strdup (path);
> >   free (url->name);
> >   url->name = name;
> > 
> > I suspect those last three lines are best wrapped in a function that's
> > supposed to see url internals without the constness, but I want to make
> > sure before I touch the code.
> 
> I guess you mean something like url_set_name (url_t, const char *),
> right? It is a good idea, though I am not sure whether it is
> worth while: functions in */url.c are supposed to fiddle with url_t
> internals anyway.

The problem is that right now, "url->name = name" causes the compiler to
complain a little - name is const, and url->name is not.

The other easy possibility is to have a second variable, char *newname;
to hold this for those couple of lines.

Tks,
Jeff Bailey

-- 
I never know what to expect when you respond to my postings. No insult
intended, you are merely a surprise :)
 - Carlos O'Donnell

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]