Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): remove __predict_false



details:   https://anonhg.NetBSD.org/src/rev/802b470c67ea
branches:  trunk
changeset: 950763:802b470c67ea
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 30 21:18:14 2021 +0000

description:
make(1): remove __predict_false

The effect (at least on x86_64) is so minimal that it is not worth
cluttering the code.

diffstat:

 usr.bin/make/buf.c |  6 +++---
 usr.bin/make/buf.h |  9 ++-------
 2 files changed, 5 insertions(+), 10 deletions(-)

diffs (57 lines):

diff -r fcff758248d6 -r 802b470c67ea usr.bin/make/buf.c
--- a/usr.bin/make/buf.c        Sat Jan 30 21:03:32 2021 +0000
+++ b/usr.bin/make/buf.c        Sat Jan 30 21:18:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: buf.c,v 1.50 2021/01/30 21:03:32 rillig Exp $  */
+/*     $NetBSD: buf.c,v 1.51 2021/01/30 21:18:14 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,7 +75,7 @@
 #include "make.h"
 
 /*     "@(#)buf.c      8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: buf.c,v 1.50 2021/01/30 21:03:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.51 2021/01/30 21:18:14 rillig Exp $");
 
 /* Make space in the buffer for adding at least 16 more bytes. */
 void
@@ -92,7 +92,7 @@
        size_t old_len = buf->len;
        char *end;
 
-       if (__predict_false(old_len + bytes_len >= buf->cap)) {
+       if (old_len + bytes_len >= buf->cap) {
                size_t minIncr = bytes_len + 16;
                buf->cap += buf->cap > minIncr ? buf->cap : minIncr;
                buf->data = bmake_realloc(buf->data, buf->cap);
diff -r fcff758248d6 -r 802b470c67ea usr.bin/make/buf.h
--- a/usr.bin/make/buf.h        Sat Jan 30 21:03:32 2021 +0000
+++ b/usr.bin/make/buf.h        Sat Jan 30 21:18:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: buf.h,v 1.40 2021/01/30 21:03:32 rillig Exp $  */
+/*     $NetBSD: buf.h,v 1.41 2021/01/30 21:18:14 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -86,11 +86,6 @@
        char *data;     /* The buffer itself (always null-terminated) */
 } Buffer;
 
-/* If we aren't on NetBSD, __predict_false() might not be defined. */
-#ifndef __predict_false
-#define __predict_false(x) (x)
-#endif
-
 void Buf_Expand(Buffer *);
 
 /* Buf_AddByte adds a single byte to a buffer. */
@@ -99,7 +94,7 @@
 {
        size_t old_len = buf->len++;
        char *end;
-       if (__predict_false(old_len + 1 >= buf->cap))
+       if (old_len + 1 >= buf->cap)
                Buf_Expand(buf);
        end = buf->data + old_len;
        end[0] = byte;



Home | Main Index | Thread Index | Old Index