Stupid design question: guint vs. gint




	This is a quickie :).

	I'm creating a child class of the GtkEditable.  I'm trying to
figure out if I should use gint or guint for some of the functions.  For
example, GtkEditable has

void gtk_editable_insert_text (GtkEditable       *editable,
                               const gchar      *new_text,
                               gint              new_text_length,
                               gint             *position);

	...and I want to add (notice the guints):

void gtk_editable_insert_text_with_style (GtkEditable       *editable,
                                          const gchar      *new_text,
                                          guint  new_text_length,
                                          guint             *position,
                                          GtkEtextStyle *style);

	I want to use guints (a) because it makes sense and (b) because
one underlying data structure is my GdkBufferGap, whose API is designed
around guints (for things like position and length).

	So which is better: maintaining convention with gints, or using
the more correct (as I see it) guints?


--Derek



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