Module Name: src Committed By: rillig Date: Sat Jan 30 21:18:14 UTC 2021
Modified Files: src/usr.bin/make: buf.c buf.h Log Message: make(1): remove __predict_false The effect (at least on x86_64) is so minimal that it is not worth cluttering the code. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/usr.bin/make/buf.c cvs rdiff -u -r1.40 -r1.41 src/usr.bin/make/buf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/buf.c diff -u src/usr.bin/make/buf.c:1.50 src/usr.bin/make/buf.c:1.51 --- src/usr.bin/make/buf.c:1.50 Sat Jan 30 21:03:32 2021 +++ src/usr.bin/make/buf.c Sat Jan 30 21:18:14 2021 @@ -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 @@ Buf_AddBytes(Buffer *buf, const char *by 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); Index: src/usr.bin/make/buf.h diff -u src/usr.bin/make/buf.h:1.40 src/usr.bin/make/buf.h:1.41 --- src/usr.bin/make/buf.h:1.40 Sat Jan 30 21:03:32 2021 +++ src/usr.bin/make/buf.h Sat Jan 30 21:18:14 2021 @@ -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 @@ typedef struct Buffer { 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 @@ Buf_AddByte(Buffer *buf, char byte) { 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;