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



I think this 'const' issue deserves a separate e-mail.

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*'!

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 :-(.

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.

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?


> > -gda_row_get_model (GdaRow *row)
> > +gda_row_get_model (const GdaRow *row)
> >  {
> >
> hmm, again, this looks bad to me. I know it's not easy to come up with a
> good const/non-const setting, but this totally breaks GNOME standards.
> You've got always, in other GNOME libs, the first argument being the
> class object, with no const. Doing this now breaks that standard.
> 
> The same for all other similar functions. We should just use const for
> return values, I guess. If not, we are looking a lot different than
> other GNOME libs.



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