Some strdup avoidance
authorMatthias Clasen <mclasen@redhat.com>
Thu, 25 Aug 2022 18:33:30 +0000 (14:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 25 Aug 2022 18:33:30 +0000 (14:33 -0400)
gdk/gdk-private.h
gdk/gdkclipboard.c
gdk/gdkcontentprovider.c
gdk/gdkpaintable.c
gdk/gdktoplevel.c

index 1100087775ad3ff20a7fee2018041ae9d34373c7..3c125a9a2c36c6c354f14cddbb4e1257d2b10ce3 100644 (file)
@@ -59,4 +59,8 @@ void gdk_source_set_static_name_by_id (guint       tag,
 #define g_source_set_static_name(source, name) g_source_set_name ((source), (name))
 #endif
 
+#ifndef I_
+#define I_(string) g_intern_static_string (string)
+#endif
+
 #endif /* __GDK__PRIVATE_H__ */
index 95e0fda40ef7bd24aa718bb337bb7008f8a18466..2600999f2a0694068da76a816765fc8b052fd6dd 100644 (file)
@@ -29,6 +29,7 @@
 #include "gdkintl.h"
 #include "gdkpipeiostreamprivate.h"
 #include "gdktexture.h"
+#include "gdk-private.h"
 
 #include <gobject/gvaluecollector.h>
 
@@ -408,7 +409,7 @@ gdk_clipboard_class_init (GdkClipboardClass *class)
    * Emitted when the clipboard changes ownership.
    */
   signals[CHANGED] =
-    g_signal_new ("changed",
+    g_signal_new (I_("changed"),
                   G_TYPE_FROM_CLASS (class),
                   G_SIGNAL_RUN_LAST,
                   G_STRUCT_OFFSET (GdkClipboardClass, changed),
index 043e165d591ae4ccf043d1d9940cd6a98f17a939..f4d6d316a644159cc99ee517afea0a6da80c07d6 100644 (file)
@@ -23,6 +23,7 @@
 #include "gdkclipboard.h"
 #include "gdkcontentformats.h"
 #include "gdkintl.h"
+#include "gdk-private.h"
 
 /**
  * GdkContentProvider:
@@ -197,7 +198,7 @@ gdk_content_provider_class_init (GdkContentProviderClass *class)
    * Emitted whenever the content provided by this provider has changed.
    */
   signals[CONTENT_CHANGED] =
-    g_signal_new ("content-changed",
+    g_signal_new (I_("content-changed"),
                   G_TYPE_FROM_CLASS (class),
                   G_SIGNAL_RUN_LAST,
                   G_STRUCT_OFFSET (GdkContentProviderClass, content_changed),
index 51d0e1347c23468e8dce9e763d292ad881adac61..c6e64a4fdbe96a111f069ef7c0bb889381531019 100644 (file)
@@ -22,6 +22,7 @@
 #include "gdkpaintable.h"
 
 #include "gdksnapshotprivate.h"
+#include "gdk-private.h"
 
 /* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
 void            gtk_snapshot_push_debug                 (GdkSnapshot            *snapshot,
@@ -170,7 +171,7 @@ gdk_paintable_default_init (GdkPaintableInterface *iface)
    * the icon theme for an icon changing.
    */
   signals[INVALIDATE_CONTENTS] =
-    g_signal_new ("invalidate-contents",
+    g_signal_new (I_("invalidate-contents"),
                   GDK_TYPE_PAINTABLE,
                   G_SIGNAL_RUN_LAST,
                   0,
@@ -194,7 +195,7 @@ gdk_paintable_default_init (GdkPaintableInterface *iface)
    * the contents of a toplevel surface being resized.
    */
   signals[INVALIDATE_SIZE] =
-    g_signal_new ("invalidate-size",
+    g_signal_new (I_("invalidate-size"),
                   GDK_TYPE_PAINTABLE,
                   G_SIGNAL_RUN_LAST,
                   0,
index 8c92cd9c973c65fc2197689288afc831ab5ab557..e64905355a456ee0fa3896c4e220c46fd24f7ac0 100644 (file)
@@ -24,6 +24,7 @@
 #include "gdkdisplay.h"
 #include "gdkenumtypes.h"
 #include "gdkintl.h"
+#include "gdk-private.h"
 
 #include <graphene-gobject.h>
 #include <math.h>
@@ -247,7 +248,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
    * will result in an arbitrary size being used as a result.
    */
   signals[COMPUTE_SIZE] =
-    g_signal_new ("compute-size",
+    g_signal_new (I_("compute-size"),
                   GDK_TYPE_TOPLEVEL,
                   G_SIGNAL_RUN_LAST,
                   0,