diff options
| author | Jan Djärv | 2005-12-12 08:08:56 +0000 |
|---|---|---|
| committer | Jan Djärv | 2005-12-12 08:08:56 +0000 |
| commit | 93c579e00ef064b6bd7e819d9920b3f90815d72b (patch) | |
| tree | 066e1ef95f275abea62ee8aaa4a91667153426f5 /src | |
| parent | b79c8219e88f33e55a58789e4ea42f3c2b23c728 (diff) | |
| download | emacs-93c579e00ef064b6bd7e819d9920b3f90815d72b.tar.gz emacs-93c579e00ef064b6bd7e819d9920b3f90815d72b.zip | |
* gtkutil.c (SSDATA): New macro to remove compiler warnings.
(xg_get_image_for_pixmap, xg_create_frame_widgets)
(xg_get_file_with_chooser): Use SSDATA instead of SDATA.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gtkutil.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index 84ce64beb56..54cb43b8398 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -41,6 +41,9 @@ Boston, MA 02110-1301, USA. */ | |||
| 41 | #define FRAME_TOTAL_PIXEL_HEIGHT(f) \ | 41 | #define FRAME_TOTAL_PIXEL_HEIGHT(f) \ |
| 42 | (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f)) | 42 | (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f)) |
| 43 | 43 | ||
| 44 | /* Avoid "differ in sign" warnings */ | ||
| 45 | #define SSDATA(x) ((char *) SDATA (x)) | ||
| 46 | |||
| 44 | 47 | ||
| 45 | /*********************************************************************** | 48 | /*********************************************************************** |
| 46 | Display handling functions | 49 | Display handling functions |
| @@ -347,9 +350,9 @@ xg_get_image_for_pixmap (f, img, widget, old_widget) | |||
| 347 | xassert (STRINGP (file) != 0); | 350 | xassert (STRINGP (file) != 0); |
| 348 | 351 | ||
| 349 | if (! old_widget) | 352 | if (! old_widget) |
| 350 | old_widget = GTK_IMAGE (gtk_image_new_from_file (SDATA (file))); | 353 | old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file))); |
| 351 | else | 354 | else |
| 352 | gtk_image_set_from_file (old_widget, SDATA (file)); | 355 | gtk_image_set_from_file (old_widget, SSDATA (file)); |
| 353 | 356 | ||
| 354 | UNGCPRO; | 357 | UNGCPRO; |
| 355 | return GTK_WIDGET (old_widget); | 358 | return GTK_WIDGET (old_widget); |
| @@ -735,11 +738,11 @@ xg_create_frame_widgets (f) | |||
| 735 | /* Use same names as the Xt port does. I.e. Emacs.pane.emacs by default */ | 738 | /* Use same names as the Xt port does. I.e. Emacs.pane.emacs by default */ |
| 736 | gtk_widget_set_name (wtop, EMACS_CLASS); | 739 | gtk_widget_set_name (wtop, EMACS_CLASS); |
| 737 | gtk_widget_set_name (wvbox, "pane"); | 740 | gtk_widget_set_name (wvbox, "pane"); |
| 738 | gtk_widget_set_name (wfixed, SDATA (Vx_resource_name)); | 741 | gtk_widget_set_name (wfixed, SSDATA (Vx_resource_name)); |
| 739 | 742 | ||
| 740 | /* If this frame has a title or name, set it in the title bar. */ | 743 | /* If this frame has a title or name, set it in the title bar. */ |
| 741 | if (! NILP (f->title)) title = SDATA (ENCODE_UTF_8 (f->title)); | 744 | if (! NILP (f->title)) title = SSDATA (ENCODE_UTF_8 (f->title)); |
| 742 | else if (! NILP (f->name)) title = SDATA (ENCODE_UTF_8 (f->name)); | 745 | else if (! NILP (f->name)) title = SSDATA (ENCODE_UTF_8 (f->name)); |
| 743 | 746 | ||
| 744 | if (title) gtk_window_set_title (GTK_WINDOW (wtop), title); | 747 | if (title) gtk_window_set_title (GTK_WINDOW (wtop), title); |
| 745 | 748 | ||
| @@ -780,8 +783,8 @@ xg_create_frame_widgets (f) | |||
| 780 | can't shrink the window from its starting size. */ | 783 | can't shrink the window from its starting size. */ |
| 781 | gtk_window_set_policy (GTK_WINDOW (wtop), TRUE, TRUE, TRUE); | 784 | gtk_window_set_policy (GTK_WINDOW (wtop), TRUE, TRUE, TRUE); |
| 782 | gtk_window_set_wmclass (GTK_WINDOW (wtop), | 785 | gtk_window_set_wmclass (GTK_WINDOW (wtop), |
| 783 | SDATA (Vx_resource_name), | 786 | SSDATA (Vx_resource_name), |
| 784 | SDATA (Vx_resource_class)); | 787 | SSDATA (Vx_resource_class)); |
| 785 | 788 | ||
| 786 | /* Add callback to do nothing on WM_DELETE_WINDOW. The default in | 789 | /* Add callback to do nothing on WM_DELETE_WINDOW. The default in |
| 787 | GTK is to destroy the widget. We want Emacs to do that instead. */ | 790 | GTK is to destroy the widget. We want Emacs to do that instead. */ |
| @@ -1245,7 +1248,7 @@ xg_get_file_with_chooser (f, prompt, default_filename, | |||
| 1245 | if (default_filename[0] != '/') | 1248 | if (default_filename[0] != '/') |
| 1246 | file = Fexpand_file_name (file, Qnil); | 1249 | file = Fexpand_file_name (file, Qnil); |
| 1247 | 1250 | ||
| 1248 | default_filename = SDATA (file); | 1251 | default_filename = SSDATA (file); |
| 1249 | if (Ffile_directory_p (file)) | 1252 | if (Ffile_directory_p (file)) |
| 1250 | gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin), | 1253 | gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin), |
| 1251 | default_filename); | 1254 | default_filename); |