home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.1171 < prev    next >
Encoding:
Internet Message Format  |  2013-06-11  |  2.3 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1171
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.1171
  11. Problem:    Check for digits and ascii letters can be faster.
  12. Solution:   Use a trick with one comparison. (Dominique Pelle)
  13. Files:        src/macros.h
  14.  
  15.  
  16. *** ../vim-7.3.1170/src/macros.h    2013-06-08 18:19:40.000000000 +0200
  17. --- src/macros.h    2013-06-12 14:03:00.000000000 +0200
  18. ***************
  19. *** 109,123 ****
  20.   #else
  21.   # define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c))
  22.   # define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c))
  23. ! # define ASCII_ISLOWER(c) ((c) < 0x7f && islower(c))
  24. ! # define ASCII_ISUPPER(c) ((c) < 0x7f && isupper(c))
  25.   #endif
  26.   
  27.   /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
  28.    * non-zero for superscript 1.  Also avoids that isdigit() crashes for numbers
  29. !  * below 0 and above 255.  For complicated arguments and in/decrement use
  30. !  * vim_isdigit() instead. */
  31. ! #define VIM_ISDIGIT(c) ((c) >= '0' && (c) <= '9')
  32.   
  33.   /* macro version of chartab().
  34.    * Only works with values 0-255!
  35. --- 109,122 ----
  36.   #else
  37.   # define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c))
  38.   # define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c))
  39. ! # define ASCII_ISLOWER(c) ((unsigned)(c) - 'a' < 26)
  40. ! # define ASCII_ISUPPER(c) ((unsigned)(c) - 'A' < 26)
  41.   #endif
  42.   
  43.   /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
  44.    * non-zero for superscript 1.  Also avoids that isdigit() crashes for numbers
  45. !  * below 0 and above 255.  */
  46. ! #define VIM_ISDIGIT(c) ((unsigned)(c) - '0' < 10)
  47.   
  48.   /* macro version of chartab().
  49.    * Only works with values 0-255!
  50. *** ../vim-7.3.1170/src/version.c    2013-06-12 13:37:36.000000000 +0200
  51. --- src/version.c    2013-06-12 14:09:00.000000000 +0200
  52. ***************
  53. *** 730,731 ****
  54. --- 730,733 ----
  55.   {   /* Add new patch number below this line */
  56. + /**/
  57. +     1171,
  58.   /**/
  59.  
  60. -- 
  61. hundred-and-one symptoms of being an internet addict:
  62. 167. You have more than 200 websites bookmarked.
  63.  
  64.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  65. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  66. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  67.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  68.