From nobody Tue May 24 20:59:49 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 911921B4F4E4; Tue, 24 May 2022 20:59:50 +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 4L765f2Tz5z4jmR; Tue, 24 May 2022 20:59:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653425990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgGxQFBkBO5MlisyX8JpBc89uLyyI+71cCRWCoodmYk=; b=Zt6IGhRpSC827qPoEdd3dQhEjsonL4x9Com5b+q8MqWIUdp7M3uJi84LY2SOl7GcNxPoZ1 k8qpJ97gJm4Jaq1tK6rOe07Y1IKP633WpUvLBl0H/NtDLJts6B7sDv7ry/GS6QvyR0CVgI KKLLrDFQVxO+Tj+JPKMsjYbPO6rFw5craK7REKQCaJtJIpnqLCvnTQl8yRMlBvUINRVo7K PMOLEH2l0zZGNm3IXtL0D0NGMB1qEkgtGJRfeNYH6iIZvsTpsU7ozEx8cxuaQDsAFAFKrl 0qfjlVgqXO4nwPLfvdoqbAnjm1i0Ij8rmtcH1UEcrKdJlPBiISJQwGhoTf2jTw== 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 E6C003AA4; Tue, 24 May 2022 20:59:49 +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 24OKxnTf036680; Tue, 24 May 2022 20:59:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24OKxnfe036679; Tue, 24 May 2022 20:59:49 GMT (envelope-from git) Date: Tue, 24 May 2022 20:59:49 GMT Message-Id: <202205242059.24OKxnfe036679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 7aecd12d9cbd - main - ifconfig: use c99 designated initializers for DEF_CMD List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7aecd12d9cbd9419dc07f7847055977cfbc8131f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653425990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgGxQFBkBO5MlisyX8JpBc89uLyyI+71cCRWCoodmYk=; b=uT0eri8sGeRQoHcc4p31HCGbDlH056w/ZCZ+5J+En2HL+7PLNhpP1Qq83r3vXzfbJa8MAp tPgfzAoCkh+F3D+1wGhctCQ9W/acCwMfZ7m++UgF5rBiSwxAJ3MdYyQ9L8BTtf7RzgaONy zReQy6pFdMzQXbbti/SAg459XxhGbWXOPkKOmQA7IxyAy8t63hLC6ULtcTJYTTOYP4dMds ACtVDScM0o71aHwr5S6XeLA/b4aygOikoLlq8dnkSvc2thNrTYaczJbrzZ4NriU/lhoTNo nhWFSDfH2Qp1YVS1IO07fRiWN5Ar4QEgVF5nZYawsvE3O8tH+AshHcn5MfD6fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653425990; a=rsa-sha256; cv=none; b=OCpF0dKVFCRIP71uT5zgGk9HSKQGUwWggLiyQX/H8B+wtP2zBARvJfThMe0hzymCS7/G4T uGHBq0hTh4BGvvnTioOafmbUVHHKiik+4fHibtlVZsRZDE5wWjDdwy2lXZXKX9LtCGv3YF R81EkhGf6OUHi40lucGlIUR6xLncHQG0G3XLmYAGuZ1JZC/4MdRSm10oTKpShC6wF91AMf D6HhDuKmyERpP3dqAL5LTG3Kjeomp0OVSwY8oW/7+fV4NItsA3n52PV7COLEfnr2+4uI1q Ha5lj00tJp0lzZ8JXMpMFJmZJv4fDc7LBtZNakO2Yjm0PG1JFReCFKbdywTz8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7aecd12d9cbd9419dc07f7847055977cfbc8131f commit 7aecd12d9cbd9419dc07f7847055977cfbc8131f Author: Konstantin Belousov AuthorDate: 2021-12-20 05:53:41 +0000 Commit: Konstantin Belousov CommitDate: 2022-05-24 20:59:32 +0000 ifconfig: use c99 designated initializers for DEF_CMD Reviewed by: hselasky, jhb, kp Sponsored by: NVIDIA Networking MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D32551 --- sbin/ifconfig/ifconfig.h | 56 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 8f4e494fdde0..76f6ef926a5c 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -76,13 +76,55 @@ void callback_register(callback_func *, void *); void name(const char *arg1, const char *arg2, int s, \ const struct afswtch *afp) -#define DEF_CMD(name, param, func) { name, param, { .c_func = func }, 0, NULL } -#define DEF_CMD_ARG(name, func) { name, NEXTARG, { .c_func = func }, 0, NULL } -#define DEF_CMD_OPTARG(name, func) { name, OPTARG, { .c_func = func }, 0, NULL } -#define DEF_CMD_ARG2(name, func) { name, NEXTARG2, { .c_func2 = func }, 0, NULL } -#define DEF_CLONE_CMD(name, param, func) { name, param, { .c_func = func }, 1, NULL } -#define DEF_CLONE_CMD_ARG(name, func) { name, NEXTARG, { .c_func = func }, 1, NULL } -#define DEF_CLONE_CMD_ARG2(name, func) { name, NEXTARG2, { .c_func2 = func }, 1, NULL } +#define DEF_CMD(name, param, func) { \ + .c_name = (name), \ + .c_parameter = (param), \ + .c_u = { .c_func = (func) }, \ + .c_iscloneop = 0, \ + .c_next = NULL, +} +#define DEF_CMD_ARG(name, func) { \ + .c_name = (name), \ + .c_parameter = NEXTARG, \ + .c_u = { .c_func = (func) }, \ + .c_iscloneop = 0, \ + .c_next = NULL, \ +} +#define DEF_CMD_OPTARG(name, func) { \ + .c_name = (name), \ + .c_parameter = OPTARG, \ + .c_u = { .c_func = (func) }, \ + .c_iscloneop = 0, \ + .c_next = NULL, \ +} +#define DEF_CMD_ARG2(name, func) { \ + .c_name = (name), \ + .c_parameter = NEXTARG2, \ + .c_u = { .c_func2 = (func) }, \ + .c_iscloneop = 0, \ + .c_next = NULL, \ +} +#define DEF_CLONE_CMD(name, param, func) { \ + .c_name = (name), \ + .c_parameter = (param), \ + .c_u = { .c_func = (func) }, \ + .c_iscloneop = 1, \ + .c_next = NULL, \ +} +#define DEF_CLONE_CMD_ARG(name, func) { \ + .c_name = (name), \ + .c_parameter = NEXTARG, \ + .c_u = { .c_func = (func) }, \ + .c_iscloneop = 1, \ + .c_next = NULL, \ +} +#define DEF_CLONE_CMD_ARG2(name, func) { \ + .c_name = (name), \ + .c_parameter = NEXTARG2, \ + .c_u = { .c_func2 = (func) }, \ + .c_iscloneop = 1, \ + .c_next = NULL, \ +} struct ifaddrs; struct addrinfo;