From owner-dev-commits-src-main@freebsd.org Mon Jan 25 15:11:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 033284E5EAE; Mon, 25 Jan 2021 15:11:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPYGq63kmz4YXw; Mon, 25 Jan 2021 15:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFF8C186DB; Mon, 25 Jan 2021 15:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PFBFsd039528; Mon, 25 Jan 2021 15:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PFBFjO039527; Mon, 25 Jan 2021 15:11:15 GMT (envelope-from git) Date: Mon, 25 Jan 2021 15:11:15 GMT Message-Id: <202101251511.10PFBFjO039527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 8d55837dc133 - main - qeueue.h: Add {SLIST, STAILQ, LIST, TAILQ}_END() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d55837dc1331a5cdacad539b1788ab1070159b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 15:11:16 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8d55837dc1331a5cdacad539b1788ab1070159b4 commit 8d55837dc1331a5cdacad539b1788ab1070159b4 Author: Alex Richardson AuthorDate: 2021-01-25 14:11:45 +0000 Commit: Alex Richardson CommitDate: 2021-01-25 15:09:35 +0000 qeueue.h: Add {SLIST,STAILQ,LIST,TAILQ}_END() We provide these for compat with other queue.h headers since some software assumes it exists (e.g. the libevent contrib code), but we are not encouraging their use (NULL should be used instead). This fixes the following warning (which should arguable be an error since it results in a function call to an undefined function): .../contrib/libevent/buffer.c:495:16: warning: implicit declaration of function 'LIST_END' is invalid in C99 [-Wimplicit-function-declaration] cbent != LIST_END(&buffer->callbacks); ^ .../contrib/libevent/buffer.c:495:13: warning: comparison between pointer and integer ('struct evbuffer_cb_entry *' and 'int') [-Wpointer-integer-compare] cbent != LIST_END(&buffer->callbacks); ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27151 --- sys/fs/nfs/nfsport.h | 2 ++ sys/sys/queue.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 7d1c3b1c8cea..9f2789f57bec 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -880,9 +880,11 @@ int nfsmsleep(void *, void *, int, const char *, struct timespec *); /* * Some queue.h files don't have these dfined in them. */ +#ifndef LIST_END #define LIST_END(head) NULL #define SLIST_END(head) NULL #define TAILQ_END(head) NULL +#endif /* * This must be defined to be a global variable that increments once diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 14d55905dfc0..25091ec815f1 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -91,6 +91,7 @@ * _CLASS_ENTRY + + + + * _INIT + + + + * _EMPTY + + + + + * _END + + + + * _FIRST + + + + * _NEXT + + + + * _PREV - + - + @@ -305,6 +306,8 @@ struct { \ SLIST_FIRST(head2) = swap_first; \ } while (0) +#define SLIST_END(head) NULL + /* * Singly-linked Tail queue declarations. */ @@ -437,6 +440,9 @@ struct { \ (head2)->stqh_last = &STAILQ_FIRST(head2); \ } while (0) +#define STAILQ_END(head) NULL + + /* * List declarations. */ @@ -611,6 +617,8 @@ struct { \ swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ } while (0) +#define LIST_END(head) NULL + /* * Tail queue declarations. */ @@ -867,4 +875,6 @@ struct { \ (head2)->tqh_last = &(head2)->tqh_first; \ } while (0) +#define TAILQ_END(head) NULL + #endif /* !_SYS_QUEUE_H_ */