Karsten Hopp 5bcb62
To: vim_dev@googlegroups.com
Karsten Hopp 5bcb62
Subject: Patch 7.3.1171
Karsten Hopp 5bcb62
Fcc: outbox
Karsten Hopp 5bcb62
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 5bcb62
Mime-Version: 1.0
Karsten Hopp 5bcb62
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 5bcb62
Content-Transfer-Encoding: 8bit
Karsten Hopp 5bcb62
------------
Karsten Hopp 5bcb62
Karsten Hopp 5bcb62
Patch 7.3.1171
Karsten Hopp 5bcb62
Problem:    Check for digits and ascii letters can be faster.
Karsten Hopp 5bcb62
Solution:   Use a trick with one comparison. (Dominique Pelle)
Karsten Hopp 5bcb62
Files:	    src/macros.h
Karsten Hopp 5bcb62
Karsten Hopp 5bcb62
Karsten Hopp 5bcb62
*** ../vim-7.3.1170/src/macros.h	2013-06-08 18:19:40.000000000 +0200
Karsten Hopp 5bcb62
--- src/macros.h	2013-06-12 14:03:00.000000000 +0200
Karsten Hopp 5bcb62
***************
Karsten Hopp 5bcb62
*** 109,123 ****
Karsten Hopp 5bcb62
  #else
Karsten Hopp 5bcb62
  # define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c))
Karsten Hopp 5bcb62
  # define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c))
Karsten Hopp 5bcb62
! # define ASCII_ISLOWER(c) ((c) < 0x7f && islower(c))
Karsten Hopp 5bcb62
! # define ASCII_ISUPPER(c) ((c) < 0x7f && isupper(c))
Karsten Hopp 5bcb62
  #endif
Karsten Hopp 5bcb62
  
Karsten Hopp 5bcb62
  /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
Karsten Hopp 5bcb62
   * non-zero for superscript 1.  Also avoids that isdigit() crashes for numbers
Karsten Hopp 5bcb62
!  * below 0 and above 255.  For complicated arguments and in/decrement use
Karsten Hopp 5bcb62
!  * vim_isdigit() instead. */
Karsten Hopp 5bcb62
! #define VIM_ISDIGIT(c) ((c) >= '0' && (c) <= '9')
Karsten Hopp 5bcb62
  
Karsten Hopp 5bcb62
  /* macro version of chartab().
Karsten Hopp 5bcb62
   * Only works with values 0-255!
Karsten Hopp 5bcb62
--- 109,122 ----
Karsten Hopp 5bcb62
  #else
Karsten Hopp 5bcb62
  # define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c))
Karsten Hopp 5bcb62
  # define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c))
Karsten Hopp 5bcb62
! # define ASCII_ISLOWER(c) ((unsigned)(c) - 'a' < 26)
Karsten Hopp 5bcb62
! # define ASCII_ISUPPER(c) ((unsigned)(c) - 'A' < 26)
Karsten Hopp 5bcb62
  #endif
Karsten Hopp 5bcb62
  
Karsten Hopp 5bcb62
  /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
Karsten Hopp 5bcb62
   * non-zero for superscript 1.  Also avoids that isdigit() crashes for numbers
Karsten Hopp 5bcb62
!  * below 0 and above 255.  */
Karsten Hopp 5bcb62
! #define VIM_ISDIGIT(c) ((unsigned)(c) - '0' < 10)
Karsten Hopp 5bcb62
  
Karsten Hopp 5bcb62
  /* macro version of chartab().
Karsten Hopp 5bcb62
   * Only works with values 0-255!
Karsten Hopp 5bcb62
*** ../vim-7.3.1170/src/version.c	2013-06-12 13:37:36.000000000 +0200
Karsten Hopp 5bcb62
--- src/version.c	2013-06-12 14:09:00.000000000 +0200
Karsten Hopp 5bcb62
***************
Karsten Hopp 5bcb62
*** 730,731 ****
Karsten Hopp 5bcb62
--- 730,733 ----
Karsten Hopp 5bcb62
  {   /* Add new patch number below this line */
Karsten Hopp 5bcb62
+ /**/
Karsten Hopp 5bcb62
+     1171,
Karsten Hopp 5bcb62
  /**/
Karsten Hopp 5bcb62
Karsten Hopp 5bcb62
-- 
Karsten Hopp 5bcb62
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 5bcb62
167. You have more than 200 websites bookmarked.
Karsten Hopp 5bcb62
Karsten Hopp 5bcb62
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 5bcb62
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 5bcb62
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 5bcb62
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///