[SVN] r470 - in /trunk/cyrus-imapd-2.2.13/debian/patches: 00list 72-faster-isdigit.dpatch

debian at incase.de debian at incase.de
Wed May 24 13:41:02 UTC 2006


Author: sven
Date: Wed May 24 15:41:00 2006
New Revision: 470

URL: https://mail.incase.de/viewcvs?rev=470&root=cyrus22&view=rev
Log:
Use a faster isdigit version than the standard Debian (libc?) implementation

Added:
    trunk/cyrus-imapd-2.2.13/debian/patches/72-faster-isdigit.dpatch   (with props)
Modified:
    trunk/cyrus-imapd-2.2.13/debian/patches/00list

Modified: trunk/cyrus-imapd-2.2.13/debian/patches/00list
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/debian/patches/00list?rev=470&root=cyrus22&r1=469&r2=470&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/debian/patches/00list (original)
+++ trunk/cyrus-imapd-2.2.13/debian/patches/00list Wed May 24 15:41:00 2006
@@ -37,4 +37,6 @@
 45-kolab2-annotations.dpatch
 61-64bit-quota.dpatch
 65-sieveshell-enhancements.dpatch
+70-allow-larger-buffers.dpatch
+72-faster-isdigit.dpatch
 99-update-autoconf.dpatch

Added: trunk/cyrus-imapd-2.2.13/debian/patches/72-faster-isdigit.dpatch
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/debian/patches/72-faster-isdigit.dpatch?rev=470&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2.13/debian/patches/72-faster-isdigit.dpatch (added)
+++ trunk/cyrus-imapd-2.2.13/debian/patches/72-faster-isdigit.dpatch Wed May 24 15:41:00 2006
@@ -1,0 +1,145 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 72-faster-isdigit.dpatch by Sven Mueller <debian at incase.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Use a smaller (but less intelligent) isdigit() implementation,
+## DP: a simple range-check. Patch backported from:
+## DP: http://cyrus.brong.fastmail.fm/patches/cyrus-isdigit-2.3.3.diff
+
+ at DPATCH@
+diff -urNad cyrus-imapd-2.2.13/imap/index.c /tmp/dpep.diZCKJ/cyrus-imapd-2.2.13/imap/index.c
+--- cyrus-imapd-2.2.13/imap/index.c	2006-05-24 14:47:49.000000000 +0200
++++ /tmp/dpep.diZCKJ/cyrus-imapd-2.2.13/imap/index.c	2006-05-24 14:49:15.509369880 +0200
+@@ -490,8 +490,8 @@
+      */
+     old = seenuids;
+     new = newseenuids;
+-    while (isdigit((int) *old)) oldnext = oldnext * 10 + *old++ - '0';
+-    while (isdigit((int) *new)) newnext = newnext * 10 + *new++ - '0';
++    while (cyrus_isdigit((int) *old)) oldnext = oldnext * 10 + *old++ - '0';
++    while (cyrus_isdigit((int) *new)) newnext = newnext * 10 + *new++ - '0';
+ 
+     for (msgno = 1; msgno <= imapd_exists; msgno++) {
+ 	uid = UID(msgno);
+@@ -505,7 +505,7 @@
+ 		oldnext = 0;
+ 		if (!*old) oldnext = mailbox->last_uid+1;
+ 		else old++;
+-		while (isdigit((int) *old)) {
++		while (cyrus_isdigit((int) *old)) {
+ 		    oldnext = oldnext * 10 + *old++ - '0';
+ 		}
+ 		oldnext += oldseen;
+@@ -524,7 +524,7 @@
+ 		    neweof++;
+ 		}
+ 		else new++;
+-		while (isdigit((int) *new)) {
++		while (cyrus_isdigit((int) *new)) {
+ 		    newnext = newnext * 10 + *new++ - '0';
+ 		}
+ 		newnext += newseen;
+@@ -643,7 +643,7 @@
+ 		neweof++;
+ 	    }
+ 	    else new++;
+-	    while (isdigit((int) *new)) newnext = newnext * 10 + *new++ - '0';
++	    while (cyrus_isdigit((int) *new)) newnext = newnext * 10 + *new++ - '0';
+ 	    newnext += newseen;
+ 	}
+     }
+@@ -661,7 +661,7 @@
+ 		/* There's a ":M" after the ",N".  Parse/include that too. */
+ 		new++;
+ 		newnext = 0;
+-		while (isdigit((int) *new)) newnext = newnext * 10 + *new++ - '0';
++		while (cyrus_isdigit((int) *new)) newnext = newnext * 10 + *new++ - '0';
+ 	    }
+ 	    uid = newnext;
+ 	    newseen++;		/* Forget we parsed ",N" */
+@@ -1504,7 +1504,7 @@
+     }
+ 
+     for (;;) {
+-	if (isdigit((int) *sequence)) {
++	if (cyrus_isdigit((int) *sequence)) {
+ 	    start = start*10 + *sequence - '0';
+ 	}
+ 	else if (*sequence == '*') {
+@@ -1513,7 +1513,7 @@
+ 	else if (*sequence == ':') {
+ 	    end = 0;
+ 	    sequence++;
+-	    while (isdigit((int) *sequence)) {
++	    while (cyrus_isdigit((int) *sequence)) {
+ 		end = end*10 + *sequence++ - '0';
+ 	    }
+ 	    if (*sequence == '*') {
+@@ -1571,7 +1571,7 @@
+     unsigned i, start = 0, end;
+ 
+     for (;;) {
+-	if (isdigit((int) *sequence)) {
++	if (cyrus_isdigit((int) *sequence)) {
+ 	    start = start*10 + *sequence - '0';
+ 	}
+ 	else if (*sequence == '*') {
+@@ -1581,7 +1581,7 @@
+ 	else if (*sequence == ':') {
+ 	    end = 0;
+ 	    sequence++;
+-	    while (isdigit((int) *sequence)) {
++	    while (cyrus_isdigit((int) *sequence)) {
+ 		end = end*10 + *sequence++ - '0';
+ 	    }
+ 	    if (*sequence == '*') {
+@@ -1705,7 +1705,7 @@
+     while (*p != ']' && *p != 'M') {
+ 	/* Generate the actual part number */
+ 	skip = 0;
+-	while (isdigit((int) *p)) {
++	while (cyrus_isdigit((int) *p)) {
+             skip = skip * 10 + *p++ - '0';
+             /* xxx overflow */
+         }
+@@ -1834,7 +1834,7 @@
+ 
+     while (*p != 'H') {
+ 	skip = 0;
+-	while (isdigit((int) *p)) {
++	while (cyrus_isdigit((int) *p)) {
+             skip = skip * 10 + *p++ - '0';
+             /* xxx overflow */
+         }
+@@ -3378,7 +3378,7 @@
+ 	case '{':			/* literal */
+ 	    c++;			/* skip open brace */
+ 	    len = 0;			/* determine length of literal */
+-	    while (isdigit((int) *c)) {
++	    while (cyrus_isdigit((int) *c)) {
+ 		len = len*10 + *c - '0';
+ 		c++;
+ 	    }
+@@ -3532,7 +3532,7 @@
+ 			break;
+ 		    			/* if we have a digit, and we're still
+ 					   counting, keep building the count */
+-		    } else if (isdigit((int) *x) && count != -1) {
++		    } else if (cyrus_isdigit((int) *x) && count != -1) {
+ 			count = count * 10 + *x - '0';
+                         if (count < 0) {                /* overflow */
+                             count = -1; /* abort counting */
+diff -urNad cyrus-imapd-2.2.13/lib/util.h /tmp/dpep.diZCKJ/cyrus-imapd-2.2.13/lib/util.h
+--- cyrus-imapd-2.2.13/lib/util.h	2005-03-12 23:09:22.000000000 +0100
++++ /tmp/dpep.diZCKJ/cyrus-imapd-2.2.13/lib/util.h	2006-05-24 14:48:36.634022360 +0200
+@@ -107,4 +107,10 @@
+  */
+ extern int cyrus_mkdir(const char *path, mode_t mode);
+ 
++/* Some systems have very inefficient implementations of isdigit,
++ * and we use it in a lot of inner loops
++ */
++
++#define cyrus_isdigit(x) ((x) >= '0' && (x) <= '9')
++
+ #endif /* INCLUDED_UTIL_H */

Propchange: trunk/cyrus-imapd-2.2.13/debian/patches/72-faster-isdigit.dpatch
------------------------------------------------------------------------------
    svn:executable = *



More information about the Pkg-Cyrus-imapd-Debian-devel mailing list