search for: __likely

Displaying 4 results from an estimated 4 matches for "__likely".

Did you mean: __like_a
2004 Jul 07
0
[PATCH] __likely -> likely conversion
Hi hpa, the following patch corrects the usage of '__likely', which has been replaced by 'likely()' in recent kernels. Plus it adds a missing include 'klibc/compiler.h' for sys/types.h as the bitops on S/390 insist on using 'likely'. Please apply. THX, Hannes -- Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 &...
2006 Jun 20
1
[patch] compiler.h fix use of likely/unlikely
...mpiler.h index 893f8a9..b7d9b50 100644 --- a/usr/include/klibc/compiler.h +++ b/usr/include/klibc/compiler.h @@ -91,12 +91,12 @@ # define __mallocfunc #endif /* likely/unlikely */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -# define __likely(x) __builtin_expect((x), 1) -# define __unlikely(x) __builtin_expect((x), 0) +#if defined(__GNUC__) +# define likely(x) __builtin_expect((x), 1) +# define unlikely(x) __builtin_expect((x), 0) #else -# define __likely(x) (x) -# define __unlikely(x) (x) +# define likely(x) (x) +# define unli...
2004 Sep 17
1
latest klibc for udev
...177/klibc/strncat.c 2004-08-26 08:03:41.000000000 +0200 +++ klibc/klibc/strncat.c 2004-09-17 21:02:33.004357774 +0200 @@ -8,13 +8,18 @@ char *strncat(char *dst, const char *src, size_t n) { char *q = strchr(dst, '\0'); + const char *p = src; + char ch; size_t nn = q-dst; if ( __likely(nn <= n) ) - n = nn; + n -= nn; - memcpy(q, src, n); - q[n] = '\0'; + while (n--) { + *q++ = ch = *p++; + if ( !ch ) + break; + } return dst; }
2005 Jan 21
1
[PATCH] strncat appends not enough, doesnt terminate correctly
...file: /home/cvs/klibc/klibc/klibc/strncat.c,v retrieving revision 1.3 diff -u -p -r1.3 strncat.c --- klibc/strncat.c 1 Oct 2004 05:28:35 -0000 1.3 +++ klibc/strncat.c 21 Jan 2005 18:26:47 -0000 @@ -12,14 +12,12 @@ char *strncat(char *dst, const char *src char ch; size_t nn = q-dst; - if ( __likely(nn <= n) ) - n -= nn; - while (n--) { *q++ = ch = *p++; if ( !ch ) - break; + return dst; } + *q = '\0'; return dst; }