diff options
| author | Paul Eggert | 2012-04-23 00:34:29 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-04-23 00:34:29 -0700 |
| commit | 1068fe4d1bde1f532aedb612244f0f3c4ad555be (patch) | |
| tree | 55328f6213ec8c47bb225e560bd96de88f0aaee6 /src | |
| parent | 0ba2624f7dd2253853c6caf4fbfdc272822de3e3 (diff) | |
| download | emacs-1068fe4d1bde1f532aedb612244f0f3c4ad555be.tar.gz emacs-1068fe4d1bde1f532aedb612244f0f3c4ad555be.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 15 | ||||
| -rw-r--r-- | src/emacsgtkfixed.c | 30 | ||||
| -rw-r--r-- | src/emacsgtkfixed.h | 26 | ||||
| -rw-r--r-- | src/gtkutil.c | 2 |
4 files changed, 39 insertions, 34 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 825211aa8ce..1db958d8d67 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,20 @@ | |||
| 1 | 2012-04-23 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-04-23 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Fix minor GTK3 problems found by static checking. | ||
| 4 | * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed) | ||
| 5 | (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed) | ||
| 6 | (struct _EmacsFixedClass, emacs_fixed_get_type): | ||
| 7 | Move decls here from emacsgtkfixed.h, since they needn't be public. | ||
| 8 | (emacs_fixed_get_type): Now static. | ||
| 9 | (emacs_fixed_class_init): Omit unused local. | ||
| 10 | (emacs_fixed_child_type): Remove; unused. | ||
| 11 | * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed) | ||
| 12 | (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed) | ||
| 13 | (struct _EmacsFixedClass): Move to emacsgtkfixed.c. | ||
| 14 | (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS) | ||
| 15 | (EMACS_FIXED_GET_CLASS): Remove; unused. | ||
| 16 | * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local. | ||
| 17 | |||
| 3 | * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO. | 18 | * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO. |
| 4 | Problem reported by Juanma Barranquero for Windows -Wunused-function. | 19 | Problem reported by Juanma Barranquero for Windows -Wunused-function. |
| 5 | 20 | ||
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index fba672ff74d..1a62b59b7af 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c | |||
| @@ -28,6 +28,27 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 28 | #include "frame.h" | 28 | #include "frame.h" |
| 29 | #include "xterm.h" | 29 | #include "xterm.h" |
| 30 | 30 | ||
| 31 | #define EMACS_TYPE_FIXED emacs_fixed_get_type () | ||
| 32 | #define EMACS_FIXED(obj) \ | ||
| 33 | G_TYPE_CHECK_INSTANCE_CAST (obj, EMACS_TYPE_FIXED, EmacsFixed) | ||
| 34 | |||
| 35 | typedef struct _EmacsFixed EmacsFixed; | ||
| 36 | typedef struct _EmacsFixedPrivate EmacsFixedPrivate; | ||
| 37 | typedef struct _EmacsFixedClass EmacsFixedClass; | ||
| 38 | |||
| 39 | struct _EmacsFixed | ||
| 40 | { | ||
| 41 | GtkFixed container; | ||
| 42 | |||
| 43 | /*< private >*/ | ||
| 44 | EmacsFixedPrivate *priv; | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct _EmacsFixedClass | ||
| 48 | { | ||
| 49 | GtkFixedClass parent_class; | ||
| 50 | }; | ||
| 51 | |||
| 31 | struct _EmacsFixedPrivate | 52 | struct _EmacsFixedPrivate |
| 32 | { | 53 | { |
| 33 | struct frame *f; | 54 | struct frame *f; |
| @@ -40,28 +61,21 @@ static void emacs_fixed_get_preferred_width (GtkWidget *widget, | |||
| 40 | static void emacs_fixed_get_preferred_height (GtkWidget *widget, | 61 | static void emacs_fixed_get_preferred_height (GtkWidget *widget, |
| 41 | gint *minimum, | 62 | gint *minimum, |
| 42 | gint *natural); | 63 | gint *natural); |
| 64 | static GType emacs_fixed_get_type (void); | ||
| 43 | G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED) | 65 | G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED) |
| 44 | 66 | ||
| 45 | static void | 67 | static void |
| 46 | emacs_fixed_class_init (EmacsFixedClass *klass) | 68 | emacs_fixed_class_init (EmacsFixedClass *klass) |
| 47 | { | 69 | { |
| 48 | GtkWidgetClass *widget_class; | 70 | GtkWidgetClass *widget_class; |
| 49 | GtkFixedClass *fixed_class; | ||
| 50 | 71 | ||
| 51 | widget_class = (GtkWidgetClass*) klass; | 72 | widget_class = (GtkWidgetClass*) klass; |
| 52 | fixed_class = (GtkFixedClass*) klass; | ||
| 53 | 73 | ||
| 54 | widget_class->get_preferred_width = emacs_fixed_get_preferred_width; | 74 | widget_class->get_preferred_width = emacs_fixed_get_preferred_width; |
| 55 | widget_class->get_preferred_height = emacs_fixed_get_preferred_height; | 75 | widget_class->get_preferred_height = emacs_fixed_get_preferred_height; |
| 56 | g_type_class_add_private (klass, sizeof (EmacsFixedPrivate)); | 76 | g_type_class_add_private (klass, sizeof (EmacsFixedPrivate)); |
| 57 | } | 77 | } |
| 58 | 78 | ||
| 59 | static GType | ||
| 60 | emacs_fixed_child_type (GtkFixed *container) | ||
| 61 | { | ||
| 62 | return GTK_TYPE_WIDGET; | ||
| 63 | } | ||
| 64 | |||
| 65 | static void | 79 | static void |
| 66 | emacs_fixed_init (EmacsFixed *fixed) | 80 | emacs_fixed_init (EmacsFixed *fixed) |
| 67 | { | 81 | { |
diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h index 90fb37e521b..3fa294aa41e 100644 --- a/src/emacsgtkfixed.h +++ b/src/emacsgtkfixed.h | |||
| @@ -27,33 +27,7 @@ G_BEGIN_DECLS | |||
| 27 | 27 | ||
| 28 | struct frame; | 28 | struct frame; |
| 29 | 29 | ||
| 30 | #define EMACS_TYPE_FIXED (emacs_fixed_get_type ()) | ||
| 31 | #define EMACS_FIXED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMACS_TYPE_FIXED, EmacsFixed)) | ||
| 32 | #define EMACS_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMACS_TYPE_FIXED, EmacsFixedClass)) | ||
| 33 | #define EMACS_IS_FIXED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMACS_TYPE_FIXED)) | ||
| 34 | #define EMACS_IS_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMACS_TYPE_FIXED)) | ||
| 35 | #define EMACS_FIXED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMACS_TYPE_FIXED, EmacsFixedClass)) | ||
| 36 | |||
| 37 | typedef struct _EmacsFixed EmacsFixed; | ||
| 38 | typedef struct _EmacsFixedPrivate EmacsFixedPrivate; | ||
| 39 | typedef struct _EmacsFixedClass EmacsFixedClass; | ||
| 40 | |||
| 41 | struct _EmacsFixed | ||
| 42 | { | ||
| 43 | GtkFixed container; | ||
| 44 | |||
| 45 | /*< private >*/ | ||
| 46 | EmacsFixedPrivate *priv; | ||
| 47 | }; | ||
| 48 | |||
| 49 | |||
| 50 | struct _EmacsFixedClass | ||
| 51 | { | ||
| 52 | GtkFixedClass parent_class; | ||
| 53 | }; | ||
| 54 | |||
| 55 | extern GtkWidget *emacs_fixed_new (struct frame *f); | 30 | extern GtkWidget *emacs_fixed_new (struct frame *f); |
| 56 | extern GType emacs_fixed_get_type (void); | ||
| 57 | 31 | ||
| 58 | G_END_DECLS | 32 | G_END_DECLS |
| 59 | 33 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 4dbef65dedf..c8a505273fe 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1090,7 +1090,9 @@ xg_create_frame_widgets (FRAME_PTR f) | |||
| 1090 | GtkWidget *wtop; | 1090 | GtkWidget *wtop; |
| 1091 | GtkWidget *wvbox, *whbox; | 1091 | GtkWidget *wvbox, *whbox; |
| 1092 | GtkWidget *wfixed; | 1092 | GtkWidget *wfixed; |
| 1093 | #ifndef HAVE_GTK3 | ||
| 1093 | GtkRcStyle *style; | 1094 | GtkRcStyle *style; |
| 1095 | #endif | ||
| 1094 | char *title = 0; | 1096 | char *title = 0; |
| 1095 | 1097 | ||
| 1096 | BLOCK_INPUT; | 1098 | BLOCK_INPUT; |