Re: [PATCH] 2 G_CONST_RETURNs



On Tue, 2001-10-23 at 18:04, Owen Taylor wrote:
> 
> murrayc t-online de (Murray Cumming) writes:
> 
> > On Tue, 2001-10-23 at 15:41, Owen Taylor wrote:
> > > 
> > > murrayc t-online de (Murray Cumming) writes:
> > > 
> > > > On Mon, 2001-10-22 at 02:04, Murray Cumming wrote:
> > > > > On Mon, 2001-10-22 at 01:47, Havoc Pennington wrote:
> > > > > > 
> > > > > > murrayc t-online de (Murray Cumming) writes:
> > > > > > > May I commit this patch, which adds some G_CONST_RETURNs so that
> > > > > > > language bindings (and people) know that they should free the gchar*
> > > > > > > return values?
> > > > > > 
> > > > > > Presumably you mean "not free" rather than "free"
> > > > > 
> > > > > Yes.
> > > > 
> > > > Do I have permission to commit this?
> > > 
> > > IMO, this falls under the "clist is deprecated don't touch it category", 
> > > so no, I'd rather not see this change made.
> > 
> > OK. But what about the 2 FontSelection functions?
> 
> Noticed when looking at that, that we had G_DISABLE_CONST_RETURNS in the
> makefile which kept the compiler from catching this problem. Just
> committed the following.

Wow, it was actually useful. Gotta love type-safety. 

> Thanks,
>                                         Owen
> 
> Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor redhat com>
> 
> 	* gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
> 
> 	* gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
> 	G_CONST_RETURN. (Murray Cumming)	
> 
> 	* gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
> 	Make G_CONST_RETURN.
> 
> 	* gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
> 	results of g_get_home_dir().
> 
> 	* gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated 
> 	copy. Storing the return from gtk_entry_get_text() is evil.
> 
> 	* gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c 
> 	gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c 
> 	gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
> 	gtk/gtksignal.c: Add const.
> 
> 	* gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
> 
> 	* gtk/gtktreeview.c: Namespace object data keys to be safe, even 
> 	if we are setting them on private widgets.
> 
> 	* gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): 
> 	Duplicate entry->text before setting it as object data.
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
> 
> 
-- 
Murray Cumming
murrayc usa net
www.murrayc.com




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