From 40d24ae6260e22e5b8bd01c8696461716293f598 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 30 Apr 2015 10:12:33 -0400 Subject: [PATCH] Switch GTK+ control implementations from calling g_strdup() directly to strdupText() for orthogonality. --- unix/button.c | 2 +- unix/checkbox.c | 2 +- unix/entry.c | 2 +- unix/label.c | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/unix/button.c b/unix/button.c index faae2f68..7f528634 100644 --- a/unix/button.c +++ b/unix/button.c @@ -32,7 +32,7 @@ static char *buttonText(uiButton *bb) { struct button *b = (struct button *) bb; - return g_strdup(gtk_button_get_label(b->button)); + return strdupText(gtk_button_get_label(b->button)); } static void buttonSetText(uiButton *bb, const char *text) diff --git a/unix/checkbox.c b/unix/checkbox.c index e002c784..19ba6614 100644 --- a/unix/checkbox.c +++ b/unix/checkbox.c @@ -35,7 +35,7 @@ static char *checkboxText(uiCheckbox *cc) { struct checkbox *c = (struct checkbox *) cc; - return g_strdup(gtk_button_get_label(c->button)); + return strdupText(gtk_button_get_label(c->button)); } static void checkboxSetText(uiCheckbox *cc, const char *text) diff --git a/unix/entry.c b/unix/entry.c index 2106d497..0675c499 100644 --- a/unix/entry.c +++ b/unix/entry.c @@ -18,7 +18,7 @@ static char *entryText(uiEntry *ee) { struct entry *e = (struct entry *) ee; - return g_strdup(gtk_entry_get_text(e->entry)); + return strdupText(gtk_entry_get_text(e->entry)); } static void entrySetText(uiEntry *ee, const char *text) diff --git a/unix/label.c b/unix/label.c index 50115f8a..bcae141f 100644 --- a/unix/label.c +++ b/unix/label.c @@ -18,8 +18,7 @@ static char *labelText(uiLabel *ll) { struct label *l = (struct label *) ll; - // TODO change g_strdup() to a wrapper function for export in ui_unix.h - return g_strdup(gtk_label_get_text(l->label)); + return strdupText(gtk_label_get_text(l->label)); } static void labelSetText(uiLabel *ll, const char *text)