From 826c6dc7f0964f593dbe568248560e6940dd2371 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 20 May 2017 09:31:20 +0000 Subject: reorg node struct so it's packed tighter (found by clang actually) mark usage __dead okay millert@ --- usr.bin/tsort/tsort.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'usr.bin/tsort') diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c index 08258135bfd..5caa733f430 100644 --- a/usr.bin/tsort/tsort.c +++ b/usr.bin/tsort/tsort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tsort.c,v 1.35 2016/01/05 16:10:57 espie Exp $ */ +/* $OpenBSD: tsort.c,v 1.36 2017/05/20 09:31:19 espie Exp $ */ /* ex:ts=8 sw=4: * * Copyright (c) 1999-2004 Marc Espie @@ -92,15 +92,15 @@ struct node { unsigned int refs; /* Number of arcs left, coming into this node. * Note that nodes with a null count can't * be part of cycles. */ - struct link *arcs; /* List of forward arcs. */ - unsigned int order; /* Order of nodes according to a hint file. */ + struct link *arcs; /* List of forward arcs. */ + /* Cycle detection algorithms build a free path of nodes. */ struct node *from; /* Previous node in the current path. */ - - unsigned int mark; /* Mark processed nodes in cycle discovery. */ struct link *traverse; /* Next link to traverse when backtracking. */ + unsigned int mark; /* Mark processed nodes in cycle discovery. */ + char k[1]; /* Name of this node. */ }; @@ -113,7 +113,7 @@ struct array { static void nodes_init(struct ohash *); static struct node *node_lookup(struct ohash *, const char *, const char *); -static void usage(void); +static __dead void usage(void); static struct node *new_node(const char *, const char *); static unsigned int read_pairs(FILE *, struct ohash *, int, -- cgit v1.2.3