Re: [gnome-db] Minor API change and MySQL [update/delete]_row



On Tue, 2003-10-28 at 08:00, Paisa Seeluangsawat wrote:
> I think this 'const' issue deserves a separate e-mail.
> 
yes

> Forcing users to cast off const is a Wrong Thing.  No standard
> overrides this.  If our standard is to refuse 'const GdaRow*', don't
> give the users 'const GdaRow*'!
> 
well, the thing is that if we return from a function something that
doesnt have to be changed by any means, we need to mark it as such. And
const is the best thing for that.

But...

> However, I advocate accepting 'const GdaRow*'.  Looking at our current
> gda-value.h, I see plenty of functions taking 'const' as the first
> argument.  "Why can't I do the same thing?," cried little gda-row :-(.
> 
those functions are wrong. As I said, all GNOME libs never use constas
the object argument (object_whatever (Object *object...), so we
shouldn't do the same.

Of course, we've got the problem of having the const returns :-(

> I'm oblivion to this "no const in the first argument" standard.  But
> my guess is it applies only to GtkWidget or G/GtkObject, right?  Our
> GdaRow is neither.
> 
well, it doesn't apply only to GObject's, it applies to all object-like
APIs, and our GdaRow/GdaValue are such.

> Paisa
> 
> 
> P.S. I would like to read more about this standards, but coudn't find
> it in the doc section at developer.gnome.com.  Could you give me a
> pointer?
> 
hmm, no standard there I think, just look at the header files of some
GNOME libs.

cheers




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