]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix minor GTK3 problems found by static checking.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 Apr 2012 07:34:29 +0000 (00:34 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 Apr 2012 07:34:29 +0000 (00:34 -0700)
* emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
(EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
(struct _EmacsFixedClass, emacs_fixed_get_type):
Move decls here from emacsgtkfixed.h, since they needn't be public.
(emacs_fixed_get_type): Now static.
(emacs_fixed_class_init): Omit unused local.
(emacs_fixed_child_type): Remove; unused.
* emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
(EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
(struct _EmacsFixedClass): Move to emacsgtkfixed.c.
(EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
(EMACS_FIXED_GET_CLASS): Remove; unused.
* gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.

src/ChangeLog
src/emacsgtkfixed.c
src/emacsgtkfixed.h
src/gtkutil.c

index 825211aa8cee683b8e494d0a8d605caf32b15a1e..1db958d8d6774abc013b42867da5311f02b05f9f 100644 (file)
@@ -1,5 +1,20 @@
 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Fix minor GTK3 problems found by static checking.
+       * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
+       (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
+       (struct _EmacsFixedClass, emacs_fixed_get_type):
+       Move decls here from emacsgtkfixed.h, since they needn't be public.
+       (emacs_fixed_get_type): Now static.
+       (emacs_fixed_class_init): Omit unused local.
+       (emacs_fixed_child_type): Remove; unused.
+       * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
+       (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
+       (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
+       (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
+       (EMACS_FIXED_GET_CLASS): Remove; unused.
+       * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
+
        * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
        Problem reported by Juanma Barranquero for Windows -Wunused-function.
 
index fba672ff74d651da1dca89ab40f1aef3eddf8be5..1a62b59b7afb7c8d69fea7ee117c5b9d5f284d04 100644 (file)
@@ -28,6 +28,27 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "frame.h"
 #include "xterm.h"
 
+#define EMACS_TYPE_FIXED emacs_fixed_get_type ()
+#define EMACS_FIXED(obj) \
+  G_TYPE_CHECK_INSTANCE_CAST (obj, EMACS_TYPE_FIXED, EmacsFixed)
+
+typedef struct _EmacsFixed EmacsFixed;
+typedef struct _EmacsFixedPrivate EmacsFixedPrivate;
+typedef struct _EmacsFixedClass EmacsFixedClass;
+
+struct _EmacsFixed
+{
+  GtkFixed container;
+
+  /*< private >*/
+  EmacsFixedPrivate *priv;
+};
+
+struct _EmacsFixedClass
+{
+  GtkFixedClass parent_class;
+};
+
 struct _EmacsFixedPrivate
 {
   struct frame *f;
@@ -40,28 +61,21 @@ static void emacs_fixed_get_preferred_width  (GtkWidget *widget,
 static void emacs_fixed_get_preferred_height (GtkWidget *widget,
                                               gint      *minimum,
                                               gint      *natural);
+static GType emacs_fixed_get_type (void);
 G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED)
 
 static void
 emacs_fixed_class_init (EmacsFixedClass *klass)
 {
   GtkWidgetClass *widget_class;
-  GtkFixedClass *fixed_class;
 
   widget_class = (GtkWidgetClass*) klass;
-  fixed_class = (GtkFixedClass*) klass;
 
   widget_class->get_preferred_width = emacs_fixed_get_preferred_width;
   widget_class->get_preferred_height = emacs_fixed_get_preferred_height;
   g_type_class_add_private (klass, sizeof (EmacsFixedPrivate));
 }
 
-static GType
-emacs_fixed_child_type (GtkFixed *container)
-{
-  return GTK_TYPE_WIDGET;
-}
-
 static void
 emacs_fixed_init (EmacsFixed *fixed)
 {
index 90fb37e521bc04ae3334ab976cfb579a24e37061..3fa294aa41eab95af5603605681986ac873f93fe 100644 (file)
@@ -27,33 +27,7 @@ G_BEGIN_DECLS
 
 struct frame;
 
-#define EMACS_TYPE_FIXED                  (emacs_fixed_get_type ())
-#define EMACS_FIXED(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMACS_TYPE_FIXED, EmacsFixed))
-#define EMACS_FIXED_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), EMACS_TYPE_FIXED, EmacsFixedClass))
-#define EMACS_IS_FIXED(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMACS_TYPE_FIXED))
-#define EMACS_IS_FIXED_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), EMACS_TYPE_FIXED))
-#define EMACS_FIXED_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), EMACS_TYPE_FIXED, EmacsFixedClass))
-
-typedef struct _EmacsFixed              EmacsFixed;
-typedef struct _EmacsFixedPrivate       EmacsFixedPrivate;
-typedef struct _EmacsFixedClass         EmacsFixedClass;
-
-struct _EmacsFixed
-{
-  GtkFixed container;
-
-  /*< private >*/
-  EmacsFixedPrivate *priv;
-};
-
-
-struct _EmacsFixedClass
-{
-  GtkFixedClass parent_class;
-};
-
 extern GtkWidget *emacs_fixed_new (struct frame *f);
-extern GType emacs_fixed_get_type (void);
 
 G_END_DECLS
 
index 4dbef65dedfa982514ba4b3bca5b3d8cb7c70473..c8a505273fe09b4e49d88afe16bbfc030f1693dc 100644 (file)
@@ -1090,7 +1090,9 @@ xg_create_frame_widgets (FRAME_PTR f)
   GtkWidget *wtop;
   GtkWidget *wvbox, *whbox;
   GtkWidget *wfixed;
+#ifndef HAVE_GTK3
   GtkRcStyle *style;
+#endif
   char *title = 0;
 
   BLOCK_INPUT;