diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/coding.c | 6 | ||||
| -rw-r--r-- | src/keyboard.c | 12 | ||||
| -rw-r--r-- | src/regex.c | 14 | ||||
| -rw-r--r-- | src/w32heap.c | 6 | ||||
| -rw-r--r-- | src/xfaces.c | 2 |
5 files changed, 24 insertions, 16 deletions
diff --git a/src/coding.c b/src/coding.c index 3bee16c4f0c..e591bedc3e5 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -6828,11 +6828,11 @@ decode_eol (struct coding_system *coding) | |||
| 6828 | } | 6828 | } |
| 6829 | else | 6829 | else |
| 6830 | { | 6830 | { |
| 6831 | ptrdiff_t pos_byte = coding->dst_pos_byte; | ||
| 6832 | ptrdiff_t pos = coding->dst_pos; | 6831 | ptrdiff_t pos = coding->dst_pos; |
| 6833 | ptrdiff_t pos_end = pos + coding->produced_char - 1; | 6832 | ptrdiff_t pos_byte = coding->dst_pos_byte; |
| 6833 | ptrdiff_t pos_end = pos_byte + coding->produced - 1; | ||
| 6834 | 6834 | ||
| 6835 | while (pos < pos_end) | 6835 | while (pos_byte < pos_end) |
| 6836 | { | 6836 | { |
| 6837 | p = BYTE_POS_ADDR (pos_byte); | 6837 | p = BYTE_POS_ADDR (pos_byte); |
| 6838 | if (*p == '\r' && p[1] == '\n') | 6838 | if (*p == '\r' && p[1] == '\n') |
diff --git a/src/keyboard.c b/src/keyboard.c index 3431cd8fbd2..4d107277634 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -11622,10 +11622,10 @@ It's called with one argument, the help string to display. */); | |||
| 11622 | DEFVAR_LISP ("disable-point-adjustment", Vdisable_point_adjustment, | 11622 | DEFVAR_LISP ("disable-point-adjustment", Vdisable_point_adjustment, |
| 11623 | doc: /* If non-nil, suppress point adjustment after executing a command. | 11623 | doc: /* If non-nil, suppress point adjustment after executing a command. |
| 11624 | 11624 | ||
| 11625 | After a command is executed, if point is moved into a region that has | 11625 | After a command is executed, if point moved into a region that has |
| 11626 | special properties (e.g. composition, display), we adjust point to | 11626 | special properties (e.g. composition, display), Emacs adjusts point to |
| 11627 | the boundary of the region. But, when a command sets this variable to | 11627 | the boundary of the region. But when a command binds this variable to |
| 11628 | non-nil, we suppress the point adjustment. | 11628 | non-nil, this point adjustment is suppressed. |
| 11629 | 11629 | ||
| 11630 | This variable is set to nil before reading a command, and is checked | 11630 | This variable is set to nil before reading a command, and is checked |
| 11631 | just after executing the command. */); | 11631 | just after executing the command. */); |
| @@ -11633,9 +11633,9 @@ just after executing the command. */); | |||
| 11633 | 11633 | ||
| 11634 | DEFVAR_LISP ("global-disable-point-adjustment", | 11634 | DEFVAR_LISP ("global-disable-point-adjustment", |
| 11635 | Vglobal_disable_point_adjustment, | 11635 | Vglobal_disable_point_adjustment, |
| 11636 | doc: /* If non-nil, always suppress point adjustment. | 11636 | doc: /* If non-nil, always suppress point adjustments. |
| 11637 | 11637 | ||
| 11638 | The default value is nil, in which case, point adjustment are | 11638 | The default value is nil, in which case point adjustments are |
| 11639 | suppressed only after special commands that set | 11639 | suppressed only after special commands that set |
| 11640 | `disable-point-adjustment' (which see) to non-nil. */); | 11640 | `disable-point-adjustment' (which see) to non-nil. */); |
| 11641 | Vglobal_disable_point_adjustment = Qnil; | 11641 | Vglobal_disable_point_adjustment = Qnil; |
diff --git a/src/regex.c b/src/regex.c index dd3f2b3cd67..164eb4612ae 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -5444,7 +5444,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, | |||
| 5444 | case charset: | 5444 | case charset: |
| 5445 | case charset_not: | 5445 | case charset_not: |
| 5446 | { | 5446 | { |
| 5447 | register unsigned int c; | 5447 | register unsigned int c, corig; |
| 5448 | boolean not = (re_opcode_t) *(p - 1) == charset_not; | 5448 | boolean not = (re_opcode_t) *(p - 1) == charset_not; |
| 5449 | int len; | 5449 | int len; |
| 5450 | 5450 | ||
| @@ -5473,7 +5473,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, | |||
| 5473 | } | 5473 | } |
| 5474 | 5474 | ||
| 5475 | PREFETCH (); | 5475 | PREFETCH (); |
| 5476 | c = RE_STRING_CHAR_AND_LENGTH (d, len, target_multibyte); | 5476 | corig = c = RE_STRING_CHAR_AND_LENGTH (d, len, target_multibyte); |
| 5477 | if (target_multibyte) | 5477 | if (target_multibyte) |
| 5478 | { | 5478 | { |
| 5479 | int c1; | 5479 | int c1; |
| @@ -5517,11 +5517,17 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, | |||
| 5517 | { | 5517 | { |
| 5518 | int class_bits = CHARSET_RANGE_TABLE_BITS (&p[-1]); | 5518 | int class_bits = CHARSET_RANGE_TABLE_BITS (&p[-1]); |
| 5519 | 5519 | ||
| 5520 | if ( (class_bits & BIT_LOWER && ISLOWER (c)) | 5520 | if ( (class_bits & BIT_LOWER |
| 5521 | && (ISLOWER (c) | ||
| 5522 | || (corig != c | ||
| 5523 | && c == upcase (corig) && ISUPPER(c)))) | ||
| 5521 | | (class_bits & BIT_MULTIBYTE) | 5524 | | (class_bits & BIT_MULTIBYTE) |
| 5522 | | (class_bits & BIT_PUNCT && ISPUNCT (c)) | 5525 | | (class_bits & BIT_PUNCT && ISPUNCT (c)) |
| 5523 | | (class_bits & BIT_SPACE && ISSPACE (c)) | 5526 | | (class_bits & BIT_SPACE && ISSPACE (c)) |
| 5524 | | (class_bits & BIT_UPPER && ISUPPER (c)) | 5527 | | (class_bits & BIT_UPPER |
| 5528 | && (ISUPPER (c) | ||
| 5529 | || (corig != c | ||
| 5530 | && c == downcase (corig) && ISLOWER (c)))) | ||
| 5525 | | (class_bits & BIT_WORD && ISWORD (c)) | 5531 | | (class_bits & BIT_WORD && ISWORD (c)) |
| 5526 | | (class_bits & BIT_ALPHA && ISALPHA (c)) | 5532 | | (class_bits & BIT_ALPHA && ISALPHA (c)) |
| 5527 | | (class_bits & BIT_ALNUM && ISALNUM (c)) | 5533 | | (class_bits & BIT_ALNUM && ISALNUM (c)) |
diff --git a/src/w32heap.c b/src/w32heap.c index 69706a3a57d..b908169b96c 100644 --- a/src/w32heap.c +++ b/src/w32heap.c | |||
| @@ -641,12 +641,14 @@ mmap_alloc (void **var, size_t nbytes) | |||
| 641 | advance, and the buffer is enlarged several times as the data is | 641 | advance, and the buffer is enlarged several times as the data is |
| 642 | decompressed on the fly. */ | 642 | decompressed on the fly. */ |
| 643 | if (nbytes < MAX_BUFFER_SIZE) | 643 | if (nbytes < MAX_BUFFER_SIZE) |
| 644 | p = VirtualAlloc (NULL, (nbytes * 2), MEM_RESERVE, PAGE_READWRITE); | 644 | p = VirtualAlloc (NULL, ROUND_UP (nbytes * 2, get_allocation_unit ()), |
| 645 | MEM_RESERVE, PAGE_READWRITE); | ||
| 645 | 646 | ||
| 646 | /* If it fails, or if the request is above 512MB, try with the | 647 | /* If it fails, or if the request is above 512MB, try with the |
| 647 | requested size. */ | 648 | requested size. */ |
| 648 | if (p == NULL) | 649 | if (p == NULL) |
| 649 | p = VirtualAlloc (NULL, nbytes, MEM_RESERVE, PAGE_READWRITE); | 650 | p = VirtualAlloc (NULL, ROUND_UP (nbytes, get_allocation_unit ()), |
| 651 | MEM_RESERVE, PAGE_READWRITE); | ||
| 650 | 652 | ||
| 651 | if (p != NULL) | 653 | if (p != NULL) |
| 652 | { | 654 | { |
diff --git a/src/xfaces.c b/src/xfaces.c index 2880eedc1e5..7762e0f61e9 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -6207,7 +6207,7 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */) | |||
| 6207 | int num; | 6207 | int num; |
| 6208 | 6208 | ||
| 6209 | while (fgets (buf, sizeof (buf), fp) != NULL) { | 6209 | while (fgets (buf, sizeof (buf), fp) != NULL) { |
| 6210 | if (sscanf (buf, "%u %u %u %n", &red, &green, &blue, &num) == 3) | 6210 | if (sscanf (buf, "%d %d %d %n", &red, &green, &blue, &num) == 3) |
| 6211 | { | 6211 | { |
| 6212 | #ifdef HAVE_NTGUI | 6212 | #ifdef HAVE_NTGUI |
| 6213 | int color = RGB (red, green, blue); | 6213 | int color = RGB (red, green, blue); |