aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2008-04-05 23:01:26 +0000
committerMiles Bader2008-04-05 23:01:26 +0000
commit5bc6ddff00c50acf546530ef0e08a27140614d27 (patch)
tree22f92034de583fe3df108e166385e30220b426fe /src
parentd8c852509f6218db43e5f2ca8baace02d4fa1294 (diff)
parent37128b5497b54367b25ed149ead91821adc65876 (diff)
downloademacs-5bc6ddff00c50acf546530ef0e08a27140614d27.tar.gz
emacs-5bc6ddff00c50acf546530ef0e08a27140614d27.zip
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1107
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog26
-rw-r--r--src/ccl.c4
-rw-r--r--src/ccl.h3
-rw-r--r--src/image.c42
-rw-r--r--src/mac.c2
-rw-r--r--src/macmenu.c26
-rw-r--r--src/macselect.c6
-rw-r--r--src/macterm.h1
-rw-r--r--src/w32.c15
9 files changed, 108 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0071dc3b220..c683d77ad17 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,29 @@
12008-04-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * macmenu.c (fill_menu) [TARGET_API_MAC_CARBON]: Use
4 SetMenuItemHierarchicalMenu.
5
62008-04-05 Jason Rumney <jasonr@gnu.org>
7
8 * image.c (pbm_load): Allow color values up to 65535.
9 Throw an error if max_color_idx is outside the supported range.
10 Report an error when image size is invalid.
11 Read two bytes at a time when raw images have max_color_idx above 255.
12
132008-04-05 Eli Zaretskii <eliz@gnu.org>
14
15 * w32.c (readdir): If FindFirstFile/FindNextFile return in
16 cFileName a file name that includes `?' characters, use the 8+3
17 alias in cAlternateFileName instead.
18
192008-04-05 Kenichi Handa <handa@ni.aist.go.jp>
20
21 * ccl.c (ccl_driver): If ccl->quit_silently is nonzero, don't
22 append "CCL: Quitted" when the CCL program is quitted.
23 (setup_ccl_program): Initialize ccl->quit_silently to zero.
24
25 * ccl.h (struct ccl_program): New member quit_silently.
26
12008-04-05 Chong Yidong <cyd@stupidchicken.com> 272008-04-05 Chong Yidong <cyd@stupidchicken.com>
2 28
3 * search.c (compile_pattern_1): Treat non-nil and non-string of 29 * search.c (compile_pattern_1): Treat non-nil and non-string of
diff --git a/src/ccl.c b/src/ccl.c
index 6fc6f29d422..380403c6ecd 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1745,7 +1745,8 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
1745 break; 1745 break;
1746 1746
1747 case CCL_STAT_QUIT: 1747 case CCL_STAT_QUIT:
1748 sprintf(msg, "\nCCL: Quited."); 1748 if (! ccl->quit_silently)
1749 sprintf(msg, "\nCCL: Quited.");
1749 break; 1750 break;
1750 1751
1751 default: 1752 default:
@@ -1948,6 +1949,7 @@ setup_ccl_program (ccl, ccl_prog)
1948 ccl->stack_idx = 0; 1949 ccl->stack_idx = 0;
1949 ccl->suppress_error = 0; 1950 ccl->suppress_error = 0;
1950 ccl->eight_bit_control = 0; 1951 ccl->eight_bit_control = 0;
1952 ccl->quit_silently = 0;
1951 return 0; 1953 return 0;
1952} 1954}
1953 1955
diff --git a/src/ccl.h b/src/ccl.h
index 4ac8b990fee..18c6ae1ebc7 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -77,6 +77,9 @@ struct ccl_program {
77 CCL_WRITE_CHAR. After execution, 77 CCL_WRITE_CHAR. After execution,
78 if no such byte is written, set 78 if no such byte is written, set
79 this value to zero. */ 79 this value to zero. */
80 int quit_silently; /* If nonzero, don't append "CCL:
81 Quitted" to the generated text when
82 CCL program is quitted. */
80}; 83};
81 84
82/* This data type is used for the spec field of the structure 85/* This data type is used for the spec field of the structure
diff --git a/src/image.c b/src/image.c
index 81754ca68d2..fbf6a15cef6 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5801,13 +5801,18 @@ pbm_load (f, img)
5801 if (type != PBM_MONO) 5801 if (type != PBM_MONO)
5802 { 5802 {
5803 max_color_idx = pbm_scan_number (&p, end); 5803 max_color_idx = pbm_scan_number (&p, end);
5804 if (raw_p && max_color_idx > 255) 5804 if (max_color_idx > 65535 || max_color_idx < 0)
5805 max_color_idx = 255; 5805 {
5806 image_error ("Unsupported maximum PBM color value", Qnil, Qnil);
5807 goto error;
5808 }
5806 } 5809 }
5807 5810
5808 if (!check_image_size (f, width, height) 5811 if (!check_image_size (f, width, height))
5809 || (type != PBM_MONO && max_color_idx < 0)) 5812 {
5810 goto error; 5813 image_error ("Invalid image size", Qnil, Qnil);
5814 goto error;
5815 }
5811 5816
5812 if (!x_create_x_image_and_pixmap (f, width, height, 0, 5817 if (!x_create_x_image_and_pixmap (f, width, height, 0,
5813 &ximg, &img->pixmap)) 5818 &ximg, &img->pixmap))
@@ -5867,10 +5872,13 @@ pbm_load (f, img)
5867 } 5872 }
5868 else 5873 else
5869 { 5874 {
5870 if (raw_p 5875 int expected_size = height * width;
5871 && ((type == PBM_GRAY) 5876 if (max_color_idx > 255)
5872 ? (p + height * width > end) 5877 expected_size *= 2;
5873 : (p + 3 * height * width > end))) 5878 if (type == PBM_COLOR)
5879 expected_size *= 3;
5880
5881 if (raw_p && p + expected_size > end)
5874 { 5882 {
5875 x_destroy_x_image (ximg); 5883 x_destroy_x_image (ximg);
5876 x_clear_image (f, img); 5884 x_clear_image (f, img);
@@ -5884,13 +5892,25 @@ pbm_load (f, img)
5884 { 5892 {
5885 int r, g, b; 5893 int r, g, b;
5886 5894
5887 if (type == PBM_GRAY) 5895 if (type == PBM_GRAY && raw_p)
5888 r = g = b = raw_p ? *p++ : pbm_scan_number (&p, end); 5896 {
5897 r = g = b = *p++;
5898 if (max_color_idx > 255)
5899 r = g = b = r * 256 + *p++;
5900 }
5901 else if (type == PBM_GRAY)
5902 r = g = b = pbm_scan_number (&p, end);
5889 else if (raw_p) 5903 else if (raw_p)
5890 { 5904 {
5891 r = *p++; 5905 r = *p++;
5906 if (max_color_idx > 255)
5907 r = r * 256 + *p++;
5892 g = *p++; 5908 g = *p++;
5909 if (max_color_idx > 255)
5910 g = g * 256 + *p++;
5893 b = *p++; 5911 b = *p++;
5912 if (max_color_idx > 255)
5913 b = b * 256 + *p++;
5894 } 5914 }
5895 else 5915 else
5896 { 5916 {
diff --git a/src/mac.c b/src/mac.c
index 5a8c8823ec4..74cfeb24865 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -79,7 +79,7 @@ static ComponentInstance as_scripting_component;
79/* The single script context used for all script executions. */ 79/* The single script context used for all script executions. */
80static OSAID as_script_context; 80static OSAID as_script_context;
81 81
82#ifndef MAC_OS_X 82#ifndef MAC_OSX
83#if TARGET_API_MAC_CARBON 83#if TARGET_API_MAC_CARBON
84static int wakeup_from_rne_enabled_p = 0; 84static int wakeup_from_rne_enabled_p = 0;
85#define ENABLE_WAKEUP_FROM_RNE (wakeup_from_rne_enabled_p = 1) 85#define ENABLE_WAKEUP_FROM_RNE (wakeup_from_rne_enabled_p = 1)
diff --git a/src/macmenu.c b/src/macmenu.c
index 1d2e89ddd25..ddc6e3c2b84 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -39,7 +39,7 @@ Boston, MA 02110-1301, USA. */
39#if !TARGET_API_MAC_CARBON 39#if !TARGET_API_MAC_CARBON
40#include <MacTypes.h> 40#include <MacTypes.h>
41#include <Menus.h> 41#include <Menus.h>
42#include <QuickDraw.h> 42#include <Quickdraw.h>
43#include <ToolUtils.h> 43#include <ToolUtils.h>
44#include <Fonts.h> 44#include <Fonts.h>
45#include <Controls.h> 45#include <Controls.h>
@@ -2752,7 +2752,7 @@ create_and_show_dialog (f, first_wv)
2752 SendEventToEventTarget (event, toolbox_dispatcher); 2752 SendEventToEventTarget (event, toolbox_dispatcher);
2753 ReleaseEvent (event); 2753 ReleaseEvent (event);
2754 } 2754 }
2755#ifdef MAC_OSX 2755#if 0 /* defined (MAC_OSX) */
2756 else if (err != eventLoopTimedOutErr) 2756 else if (err != eventLoopTimedOutErr)
2757 { 2757 {
2758 if (err == eventLoopQuitErr) 2758 if (err == eventLoopQuitErr)
@@ -3194,7 +3194,11 @@ fill_menu (menu, wv, kind, submenu_id)
3194 MenuRef submenu = NewMenu (submenu_id, "\pX"); 3194 MenuRef submenu = NewMenu (submenu_id, "\pX");
3195 3195
3196 InsertMenu (submenu, -1); 3196 InsertMenu (submenu, -1);
3197#if TARGET_API_MAC_CARBON
3198 SetMenuItemHierarchicalMenu (menu, pos, submenu);
3199#else
3197 SetMenuItemHierarchicalID (menu, pos, submenu_id); 3200 SetMenuItemHierarchicalID (menu, pos, submenu_id);
3201#endif
3198 submenu_id = fill_menu (submenu, wv->contents, kind, submenu_id + 1); 3202 submenu_id = fill_menu (submenu, wv->contents, kind, submenu_id + 1);
3199 } 3203 }
3200 } 3204 }
@@ -3256,7 +3260,23 @@ fill_menubar (wv, deep_p)
3256 if (err == noErr) 3260 if (err == noErr)
3257 { 3261 {
3258 if (CFStringCompare (title, old_title, 0) != kCFCompareEqualTo) 3262 if (CFStringCompare (title, old_title, 0) != kCFCompareEqualTo)
3259 err = SetMenuTitleWithCFString (menu, title); 3263 {
3264#ifdef MAC_OSX
3265 if (id + 1 == min_menu_id[MAC_MENU_MENU_BAR + 1]
3266 || GetMenuRef (id + 1) == NULL)
3267 {
3268 /* This is a workaround for Mac OS X 10.5 where
3269 just calling SetMenuTitleWithCFString fails
3270 to change the title of the last (Help) menu
3271 in the menu bar. */
3272 DeleteMenu (id);
3273 DisposeMenu (menu);
3274 menu = NULL;
3275 }
3276 else
3277#endif /* MAC_OSX */
3278 err = SetMenuTitleWithCFString (menu, title);
3279 }
3260 CFRelease (old_title); 3280 CFRelease (old_title);
3261 } 3281 }
3262 else 3282 else
diff --git a/src/macselect.c b/src/macselect.c
index 55466d4a54b..51a30e3a6b5 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -468,7 +468,11 @@ x_own_selection (selection_name, selection_value)
468 468
469 selection_time = long_to_cons (last_event_timestamp); 469 selection_time = long_to_cons (last_event_timestamp);
470 if (sel) 470 if (sel)
471 ownership_info = mac_get_selection_ownership_info (sel); 471 {
472 BLOCK_INPUT;
473 ownership_info = mac_get_selection_ownership_info (sel);
474 UNBLOCK_INPUT;
475 }
472 else 476 else
473 ownership_info = Qnil; /* dummy value for local-only selection */ 477 ownership_info = Qnil; /* dummy value for local-only selection */
474 selection_data = Fcons (selection_name, 478 selection_data = Fcons (selection_name,
diff --git a/src/macterm.h b/src/macterm.h
index ddbf0f04182..1e0ffbab263 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -631,6 +631,7 @@ extern void x_free_frame_resources P_ ((struct frame *));
631extern void x_destroy_window P_ ((struct frame *)); 631extern void x_destroy_window P_ ((struct frame *));
632extern void x_wm_set_size_hint P_ ((struct frame *, long, int)); 632extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
633extern void x_delete_display P_ ((struct x_display_info *)); 633extern void x_delete_display P_ ((struct x_display_info *));
634extern void mac_initialize P_ ((void));
634extern Pixmap XCreatePixmap P_ ((Display *, WindowRef, unsigned int, 635extern Pixmap XCreatePixmap P_ ((Display *, WindowRef, unsigned int,
635 unsigned int, unsigned int)); 636 unsigned int, unsigned int));
636extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowRef, char *, 637extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowRef, char *,
diff --git a/src/w32.c b/src/w32.c
index 1108f22b112..af7de20bc3a 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1935,6 +1935,21 @@ readdir (DIR *dirp)
1935 dir_static.d_namlen = strlen (dir_static.d_name); 1935 dir_static.d_namlen = strlen (dir_static.d_name);
1936 dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 + 1936 dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 +
1937 dir_static.d_namlen - dir_static.d_namlen % 4; 1937 dir_static.d_namlen - dir_static.d_namlen % 4;
1938
1939 /* If the file name in cFileName[] includes `?' characters, it means
1940 the original file name used characters that cannot be represented
1941 by the current ANSI codepage. To avoid total lossage, retrieve
1942 the short 8+3 alias of the long file name. */
1943 if (_mbspbrk (dir_find_data.cFileName, "?"))
1944 {
1945 strcpy (dir_static.d_name, dir_find_data.cAlternateFileName);
1946 /* 8+3 aliases are returned in all caps, which could break
1947 various alists that look at filenames' extensions. */
1948 downcase = 1;
1949 }
1950 else
1951 strcpy (dir_static.d_name, dir_find_data.cFileName);
1952 dir_static.d_namlen = strlen (dir_static.d_name);
1938 if (dir_is_fat) 1953 if (dir_is_fat)
1939 _strlwr (dir_static.d_name); 1954 _strlwr (dir_static.d_name);
1940 else if (downcase) 1955 else if (downcase)