From 797c2e6a4597cf9f9b3b3785e5304845b2f217a7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 11 Sep 2005 05:39:45 +0000 Subject: New function to avoid pointless strdups when creating atoms from static 2005-09-11 Matthias Clasen * gdk/gdk.symbols: * gdk/gdkproperty.h: * gdk/x11/gdkproperty-x11.c (gdk_atom_intern_static_string): New function to avoid pointless strdups when creating atoms from static strings. * gdk/x11/gdkdisplay-x11.c: * gdk/x11/gdkdnd-x11.c: * gdk/x11/gdkevents-x11.c: * gdk/x11/gdkmain-x11.c: * gdk/x11/gdkproperty-x11.c: * gdk/x11/gdkselection-x11.c: * gdk/x11/gdkwindow-x11.c: Use gdk_atom_intern_static_string() where appropriate. --- ChangeLog | 17 +++++++++++++++++ ChangeLog.pre-2-10 | 17 +++++++++++++++++ docs/reference/ChangeLog | 7 +++++++ docs/reference/gdk/gdk-sections.txt | 1 + gdk/gdk.symbols | 1 + gdk/gdkpixbuf-drawable.c | 6 ++---- gdk/gdkproperty.h | 1 + 7 files changed, 46 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3a1a96cb9..6186993907 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2005-09-11 Matthias Clasen + + * gdk/gdk.symbols: + * gdk/gdkproperty.h: + * gdk/x11/gdkproperty-x11.c (gdk_atom_intern_static_string): + New function to avoid pointless strdups when creating atoms + from static strings. + + * gdk/x11/gdkdisplay-x11.c: + * gdk/x11/gdkdnd-x11.c: + * gdk/x11/gdkevents-x11.c: + * gdk/x11/gdkmain-x11.c: + * gdk/x11/gdkproperty-x11.c: + * gdk/x11/gdkselection-x11.c: + * gdk/x11/gdkwindow-x11.c: Use gdk_atom_intern_static_string() + where appropriate. + 2005-09-09 Matthias Clasen * gtk/gtkcellrendererkeys.h: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a3a1a96cb9..6186993907 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,20 @@ +2005-09-11 Matthias Clasen + + * gdk/gdk.symbols: + * gdk/gdkproperty.h: + * gdk/x11/gdkproperty-x11.c (gdk_atom_intern_static_string): + New function to avoid pointless strdups when creating atoms + from static strings. + + * gdk/x11/gdkdisplay-x11.c: + * gdk/x11/gdkdnd-x11.c: + * gdk/x11/gdkevents-x11.c: + * gdk/x11/gdkmain-x11.c: + * gdk/x11/gdkproperty-x11.c: + * gdk/x11/gdkselection-x11.c: + * gdk/x11/gdkwindow-x11.c: Use gdk_atom_intern_static_string() + where appropriate. + 2005-09-09 Matthias Clasen * gtk/gtkcellrendererkeys.h: diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 8fc51cd21b..7889b1a530 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,5 +1,12 @@ +2005-09-11 Matthias Clasen + + * gdk/gdk-sections.txt: Add gdk_intern_static_string. + 2005-09-09 Matthias Clasen + * gtk/gtk-docs.sgml: + * gtk/gtk-sections.txt: Add a section for GtkCellRendererKeys + * gdk/tmpl/event_structs.sgml: Document GdkEventKey.is_modifier. 2005-09-06 Matthias Clasen diff --git a/docs/reference/gdk/gdk-sections.txt b/docs/reference/gdk/gdk-sections.txt index 85263d33d4..ebbc824ed8 100644 --- a/docs/reference/gdk/gdk-sections.txt +++ b/docs/reference/gdk/gdk-sections.txt @@ -825,6 +825,7 @@ gdk_utf8_to_string_target gdk_utf8_to_compound_text gdk_utf8_to_compound_text_for_display gdk_atom_intern +gdk_atom_intern_static_string gdk_atom_name gdk_property_get gdk_property_change diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index 8b3f48b271..efcccc41d7 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -170,6 +170,7 @@ gdk_utf8_to_compound_text #if IN_HEADER(__GDK_PROPERTY_H__) #if IN_FILE(__GDK_PROPERTY_X11_C__) gdk_atom_intern +gdk_atom_intern_static_string gdk_atom_name gdk_property_change gdk_property_delete diff --git a/gdk/gdkpixbuf-drawable.c b/gdk/gdkpixbuf-drawable.c index c1f69ab0e2..c2f2a06c74 100644 --- a/gdk/gdkpixbuf-drawable.c +++ b/gdk/gdkpixbuf-drawable.c @@ -925,7 +925,6 @@ convert_real_slow (GdkImage *image, gboolean alpha) { int xx, yy; - int bpl; guint8 *orow = pixels; guint8 *o; guint32 pixel; @@ -933,8 +932,7 @@ convert_real_slow (GdkImage *image, guint8 component; int i; - bpl = image->bpl; - v = gdk_colormap_get_visual(cmap); + v = gdk_colormap_get_visual (cmap); if (image->depth != v->depth) { @@ -954,7 +952,7 @@ convert_real_slow (GdkImage *image, o = orow; for (xx = x1; xx < x2; xx++) { - pixel = gdk_image_get_pixel(image, xx, yy); + pixel = gdk_image_get_pixel (image, xx, yy); switch (v->type) { /* I assume this is right for static & greyscale's too? */ diff --git a/gdk/gdkproperty.h b/gdk/gdkproperty.h index 9d72eed92b..81b6c540b7 100644 --- a/gdk/gdkproperty.h +++ b/gdk/gdkproperty.h @@ -40,6 +40,7 @@ typedef enum GdkAtom gdk_atom_intern (const gchar *atom_name, gboolean only_if_exists); +GdkAtom gdk_atom_intern_static_string (const gchar *atom_name); gchar* gdk_atom_name (GdkAtom atom); gboolean gdk_property_get (GdkWindow *window, -- cgit v1.2.1