From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 03ED7138A87 for ; Tue, 24 Feb 2015 01:26:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 88650E08C4; Tue, 24 Feb 2015 01:26:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D921AE08B8 for ; Tue, 24 Feb 2015 01:26:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 00D19340956 for ; Tue, 24 Feb 2015 01:26:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1906A126AE for ; Tue, 24 Feb 2015 01:26:04 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1424595358.2d17adcdcd2c9a16879998d3ab362b6dbfaa4150.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/virtuals.c X-VCS-Directories: libq/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 2d17adcdcd2c9a16879998d3ab362b6dbfaa4150 X-VCS-Branch: master Date: Tue, 24 Feb 2015 01:26:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4c1498bb-11d0-4f83-ae47-bb10099f2ab8 X-Archives-Hash: 5bccfcfb4017afb5737627bcf884f0bd commit: 2d17adcdcd2c9a16879998d3ab362b6dbfaa4150 Author: Mike Frysinger gentoo org> AuthorDate: Sun Feb 22 08:55:58 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Sun Feb 22 08:55:58 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=2d17adcd virtuals: delete unused code, mark things static, and constify --- libq/virtuals.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/libq/virtuals.c b/libq/virtuals.c index 8d8da03..18663e0 100644 --- a/libq/virtuals.c +++ b/libq/virtuals.c @@ -20,10 +20,8 @@ struct queue_t { typedef struct queue_t queue; -queue *del_set(char *s, queue *q, int *ok); -queue *add_set(const char *vv, const char *ss, queue *q); - -static queue *append_set(queue *q, queue *ll) +_q_static queue * +append_set(queue *q, queue *ll) { queue *z; @@ -39,7 +37,8 @@ static queue *append_set(queue *q, queue *ll) } /* add a set to a cache */ -queue *add_set(const char *vv, const char *ss, queue *q) +_q_static queue * +add_set(const char *vv, const char *ss, queue *q) { queue *ll; char *s, *ptr; @@ -83,7 +82,8 @@ queue *add_set(const char *vv, const char *ss, queue *q) } /* remove a set from a cache. matches ->name and frees name,item */ -queue *del_set(char *s, queue *q, int *ok) +_q_static queue * +del_set(char *s, queue *q, int *ok) { queue *ll, *list, *old; ll = q; @@ -117,8 +117,8 @@ queue *del_set(char *s, queue *q, int *ok) } /* clear out a list */ -void free_sets(queue *list); -void free_sets(queue *list) +_q_static void +free_sets(queue *list) { queue *ll, *q; ll = list; @@ -131,20 +131,10 @@ void free_sets(queue *list) } } -char *virtual(char *name, queue *list); -char *virtual(char *name, queue *list) +void print_sets(const queue *list); +void print_sets(const queue *list) { - queue *ll; - for (ll = list; ll != NULL; ll = ll->next) - if ((strcmp(ll->name, name)) == 0) - return ll->item; - return NULL; -} - -void print_sets(queue *list); -void print_sets(queue *list) -{ - queue *ll; + const queue *ll; for (ll = list; ll != NULL; ll = ll->next) printf("%s -> %s\n", ll->name, ll->item); }