From a711dd4ba8f2c71a260a3f7539c0e86175f97a21 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 21 Apr 2000 16:15:11 +0000 Subject: Update. 2000-04-21 Ulrich Drepper * iconv/iconv.c (iconv): Add __builtin_expect where useful. * iconv/iconv_close.c (iconv_close): Likewise. * iconv/iconv_open.c (iconv_open): Likewise. * grp/putgrent.c (putgrent): Unlock steam if fprintf failed. Add __builtin_expect where useful. * grp/initgroups.c (initgroups): Test for result of memory allocation and punt if it fails. * dirent/scandir.c (scandir): Add __builtin_expect where useful. * grp/fgetgrent.c (fgetfrent): Likewise. * grp/fgetgrent_r.c (__fgetgrent_r): Likewise. --- dirent/scandir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'dirent') diff --git a/dirent/scandir.c b/dirent/scandir.c index ed9071df6e..9b4548cd16 100644 --- a/dirent/scandir.c +++ b/dirent/scandir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc. +/* Copyright (C) 1992-1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,8 +25,8 @@ int scandir (dir, namelist, select, cmp) const char *dir; struct dirent ***namelist; - int (*select) __P ((const struct dirent *)); - int (*cmp) __P ((const void *, const void *)); + int (*select) (const struct dirent *); + int (*cmp) (const void *, const void *); { DIR *dp = __opendir (dir); struct dirent **v = NULL; @@ -50,7 +50,7 @@ scandir (dir, namelist, select, cmp) /* Ignore errors from select or readdir */ __set_errno (0); - if (i == vsize) + if (__builtin_expect (i == vsize, 0)) { struct dirent **new; if (vsize == 0) @@ -71,7 +71,7 @@ scandir (dir, namelist, select, cmp) v[i++] = (struct dirent *) memcpy (vnew, d, dsize); } - if (errno != 0) + if (__builtin_expect (errno, 0) != 0) { save = errno; (void) __closedir (dp); -- cgit v1.2.3-65-gdbad