From nobody Tue Jan 02 00:42:47 2024 X-Original-To: dev-commits-src-all@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 4T3vG01yN5z560MX; Tue, 2 Jan 2024 00:42:48 +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 4T3vFz6vR1z3S8V; Tue, 2 Jan 2024 00:42:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704156168; 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=xtlrtSqzqCja8yRh0BQSOUx4+2UXyqs3OcxCFjAiIKE=; b=Yqf4SuEWMskXaPb98K7Qvkr7Mt1Z7JKRqTnm5dvNYIY2HJ5w5FFrv0EybocjnSojx8NlMb G9Ew7hUNZIKVPBaRPVcfHy04GU+6zzst7Abc7JJsc4/o4WlQGlwzvJyerT4A29cEnwGG0h dM//lfpXvuxhxc9Q1PGiOubh9LQXLCmknzmDoeebDYNqn6PDqeqZWaiAN/fHt/y2SVDBFn kTgAvMiPyIVWmBh2S5c1li4WuWruhUfZeJbsxSm5FkX14S8nJxvXLklOMPQc8RYJw2GkP3 CJTQHo3grn+H4BlhJZqI8FrIS4bSr8U6IzArkVbI2rgEb6J16NRO1eFJprYR1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704156168; a=rsa-sha256; cv=none; b=xmnsUBKyhgANrG8KJ0q+foJFJ72yGetWQDgxF8P0oOFtLnpyzeEO53vLGpxjOzZzjiFeMf 5E/K5n9cHiaeKqJYMAPFpDqsiQIYkKlL3uK8k2ZWknmQNIT7Wyl9sq9NLAKon38my6QA4J Vi1i7PJMoYgEnA1n3xD1qp0cJNrDcugj7YadHlS+r7axtrUGQnbyHnt5PJnjQqBR0BRPok NGHmlVHHyuoOTDxFgn8hNscc1bsXrS2WtBgSpacJW6fkZaLoLejFZhHGh2GYbph9YoKJpD ZI3kZqjfDrUKlJCVhcrJvlHXVs9oa/XntJMvzicN6vzh4aFFCXM9hwLf8wQfKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704156168; 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=xtlrtSqzqCja8yRh0BQSOUx4+2UXyqs3OcxCFjAiIKE=; b=OEnKRAR2s8ycc/XuO6Eo6HKzr4g1OOIlPyf7fwtCn4LG5FFjDt29KssIDPvLS1d8G6xV9R ArxE2d6Gq/Fl5095iYOVakBJ7XbJkYOU7kibxNrrBizP+a+mC5zTUoP98zlSoKYiPu1J5s 4khabrWLSDlcxknjtH4pdik91/UJF/OTseErzbT+1GTC8e7J8Mwm5aOp9pvLllkM1pp+xy d/XcNCa4c3xOsqPiO8FOJlUxvtnnNcrX0y12FXg3M5KMG3XpuibQ9aGxOzh+TnA98KCyrL nWAPYy9Li0En2DKLmcz0F5Iz+wSJ00gtDdr0fVoE6p9lOkxFTlAMxNYuS8kn2g== 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 4T3vFz5h1Lzg0H; Tue, 2 Jan 2024 00:42:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4020glj7004344; Tue, 2 Jan 2024 00:42:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020glWc004341; Tue, 2 Jan 2024 00:42:47 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:42:47 GMT Message-Id: <202401020042.4020glWc004341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d850efed891a - stable/13 - ofed: use ANSI C functions definitions in opensm/sm.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d850efed891a89d2522895455ef5d9945cdd7af1 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d850efed891a89d2522895455ef5d9945cdd7af1 commit d850efed891a89d2522895455ef5d9945cdd7af1 Author: Konstantin Belousov AuthorDate: 2023-12-26 19:16:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-02 00:42:13 +0000 ofed: use ANSI C functions definitions in opensm/sm.c (cherry picked from commit bf7830d79dd02a84225c93130c2dce68e0a541d6) --- contrib/ofed/opensm/opensm/st.c | 71 ++++++++++++----------------------------- 1 file changed, 21 insertions(+), 50 deletions(-) diff --git a/contrib/ofed/opensm/opensm/st.c b/contrib/ofed/opensm/opensm/st.c index c2ee01474c23..7dba30644d61 100644 --- a/contrib/ofed/opensm/opensm/st.c +++ b/contrib/ofed/opensm/opensm/st.c @@ -174,7 +174,7 @@ static int new_size(int size) static int collision = 0; static int init_st = 0; -static void stat_col() +static void stat_col(void) { FILE *f = fopen("/var/log/osm_st_col", "w"); fprintf(f, "collision: %d\n", collision); @@ -182,9 +182,7 @@ static void stat_col() } #endif -st_table *st_init_table_with_size(type, size) -struct st_hash_type *type; -size_t size; +st_table *st_init_table_with_size(struct st_hash_type *type, size_t size) { st_table *tbl; @@ -208,8 +206,7 @@ size_t size; return tbl; } -st_table *st_init_table(type) -struct st_hash_type *type; +st_table *st_init_table(struct st_hash_type *type) { return st_init_table_with_size(type, 0); } @@ -219,8 +216,7 @@ st_table *st_init_numtable(void) return st_init_table(&type_numhash); } -st_table *st_init_numtable_with_size(size) -size_t size; +st_table *st_init_numtable_with_size(size_t size) { return st_init_table_with_size(&type_numhash, size); } @@ -230,14 +226,12 @@ st_table *st_init_strtable(void) return st_init_table(&type_strhash); } -st_table *st_init_strtable_with_size(size) -size_t size; +st_table *st_init_strtable_with_size(size_t size) { return st_init_table_with_size(&type_strhash, size); } -void st_free_table(table) -st_table *table; +void st_free_table(st_table *table) { register st_table_entry *ptr, *next; int i; @@ -276,10 +270,7 @@ st_table *table; }\ } while (0) -int st_lookup(table, key, value) -st_table *table; -register st_data_t key; -st_data_t *value; +int st_lookup(st_table *table, st_data_t key, st_data_t *value) { unsigned int hash_val, bin_pos; register st_table_entry *ptr; @@ -315,10 +306,7 @@ do {\ table->num_entries++;\ } while (0); -int st_insert(table, key, value) -register st_table *table; -register st_data_t key; -st_data_t value; +int st_insert(st_table *table, st_data_t key, st_data_t value) { unsigned int hash_val, bin_pos; register st_table_entry *ptr; @@ -335,10 +323,7 @@ st_data_t value; } } -void st_add_direct(table, key, value) -st_table *table; -st_data_t key; -st_data_t value; +void st_add_direct(st_table *table, st_data_t key, st_data_t value) { unsigned int hash_val, bin_pos; @@ -347,8 +332,7 @@ st_data_t value; ADD_DIRECT(table, key, value, hash_val, bin_pos); } -static void rehash(table) -register st_table *table; +static void rehash(st_table *table) { register st_table_entry *ptr, *next, **new_bins; int i, old_num_bins = table->num_bins, new_num_bins; @@ -376,8 +360,7 @@ register st_table *table; table->bins = new_bins; } -st_table *st_copy(old_table) -st_table *old_table; +st_table *st_copy(st_table *old_table) { st_table *new_table; st_table_entry *ptr, *entry; @@ -416,10 +399,7 @@ st_table *old_table; return new_table; } -int st_delete(table, key, value) -register st_table *table; -register st_data_t *key; -st_data_t *value; +int st_delete(st_table *table, st_data_t *key, st_data_t *value) { unsigned int hash_val; st_table_entry *tmp; @@ -460,11 +440,8 @@ st_data_t *value; return 0; } -int st_delete_safe(table, key, value, never) -register st_table *table; -register st_data_t *key; -st_data_t *value; -st_data_t never; +int st_delete_safe(st_table *table, st_data_t *key, st_data_t *value, + st_data_t never) { unsigned int hash_val; register st_table_entry *ptr; @@ -499,9 +476,7 @@ static int delete_never(st_data_t key, st_data_t value, st_data_t never) return ST_CONTINUE; } -void st_cleanup_safe(table, never) -st_table *table; -st_data_t never; +void st_cleanup_safe(st_table *table, st_data_t never) { int num_entries = table->num_entries; @@ -509,10 +484,9 @@ st_data_t never; table->num_entries = num_entries; } -void st_foreach(table, func, arg) -st_table *table; -int (*func) (st_data_t key, st_data_t val, st_data_t arg); -st_data_t arg; +void st_foreach(st_table *table, + int (*func)(st_data_t key, st_data_t val, st_data_t arg), + st_data_t arg) { st_table_entry *ptr, *last, *tmp; enum st_retval retval; @@ -544,8 +518,7 @@ st_data_t arg; } } -static int strhash(string) -register const char *string; +static int strhash(const char *string) { register int c; @@ -578,14 +551,12 @@ register const char *string; #endif } -static int numcmp(x, y) -void *x, *y; +static int numcmp(void *x, void *y) { return (st_ptr_t) x != (st_ptr_t) y; } -static st_ptr_t numhash(n) -void *n; +static st_ptr_t numhash(void *n) { return (st_ptr_t) n; }