From ef9463f6b1394133a3a940fc376814acabaf3f63 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 12 Jun 2015 12:26:59 +0930 Subject: [PATCH] Sort include lines (ignoring hacky cli test utils). Put ccan first, openssl next, then standard headers, then locals. Signed-off-by: Rusty Russell --- anchor.c | 8 ++++---- bitcoin/address.c | 2 +- bitcoin/address.h | 2 +- bitcoin/base58.c | 10 +++++----- bitcoin/base58.h | 2 +- bitcoin/pubkey.c | 4 ++-- bitcoin/script.c | 12 ++++++------ bitcoin/shadouble.h | 1 - bitcoin/signature.c | 8 ++++---- bitcoin/signature.h | 2 +- bitcoin/tx.c | 6 +++--- close_tx.c | 6 +++--- commit_tx.c | 6 +++--- find_p2sh_out.c | 8 ++++---- permute_tx.c | 2 +- pkt.c | 6 +++--- pkt.h | 2 +- protobuf_convert.c | 6 +++--- protobuf_convert.h | 2 +- 19 files changed, 47 insertions(+), 48 deletions(-) diff --git a/anchor.c b/anchor.c index 63ed2216d..839b19d48 100644 --- a/anchor.c +++ b/anchor.c @@ -1,11 +1,11 @@ +#include #include "anchor.h" +#include "bitcoin/pubkey.h" +#include "bitcoin/script.h" #include "bitcoin/tx.h" #include "overflows.h" -#include "pkt.h" #include "permute_tx.h" -#include "bitcoin/script.h" -#include "bitcoin/pubkey.h" -#include +#include "pkt.h" #include "protobuf_convert.h" struct bitcoin_tx *anchor_tx_create(const tal_t *ctx, diff --git a/bitcoin/address.c b/bitcoin/address.c index ee4c8e2ca..3d39cd759 100644 --- a/bitcoin/address.c +++ b/bitcoin/address.c @@ -1,6 +1,6 @@ +#include #include "address.h" #include "pubkey.h" -#include void bitcoin_address(const struct pubkey *key, struct bitcoin_address *addr) { diff --git a/bitcoin/address.h b/bitcoin/address.h index c77aa6c03..abf74efa4 100644 --- a/bitcoin/address.h +++ b/bitcoin/address.h @@ -1,7 +1,7 @@ #ifndef LIGHTNING_BITCOIN_ADDRESS_H #define LIGHTNING_BITCOIN_ADDRESS_H -#include #include +#include struct pubkey; diff --git a/bitcoin/base58.c b/bitcoin/base58.c index bf9de7351..52d0a428d 100644 --- a/bitcoin/base58.c +++ b/bitcoin/base58.c @@ -3,16 +3,16 @@ // Copyright (c) 2009-2012 The Bitcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "base58.h" -#include "shadouble.h" -#include "address.h" -#include "pubkey.h" -#include #include #include #include #include +#include #include +#include "address.h" +#include "base58.h" +#include "pubkey.h" +#include "shadouble.h" static const char enc_16[] = "0123456789abcdef"; static const char enc_58[] = diff --git a/bitcoin/base58.h b/bitcoin/base58.h index ec528a32d..f4be09ffc 100644 --- a/bitcoin/base58.h +++ b/bitcoin/base58.h @@ -1,8 +1,8 @@ #ifndef LIGHTNING_BITCOIN_BASE58_H #define LIGHTNING_BITCOIN_BASE58_H /* FIXME: Use libsecpk1 */ -#include #include +#include #include #include #include diff --git a/bitcoin/pubkey.c b/bitcoin/pubkey.c index bb6729d00..6c46554d4 100644 --- a/bitcoin/pubkey.c +++ b/bitcoin/pubkey.c @@ -1,7 +1,7 @@ -#include "pubkey.h" -#include #include +#include #include +#include "pubkey.h" /* Must agree on key validity with bitcoin! Stolen from bitcoin/src/pubkey.h's * GetLen: diff --git a/bitcoin/script.c b/bitcoin/script.c index 18f5402ed..1407831f7 100644 --- a/bitcoin/script.c +++ b/bitcoin/script.c @@ -1,11 +1,11 @@ -#include "script.h" -#include "address.h" -#include "signature.h" -#include "pubkey.h" -#include -#include #include +#include +#include #include +#include "address.h" +#include "pubkey.h" +#include "script.h" +#include "signature.h" /* Some standard ops */ #define OP_PUSHBYTES(val) (val) diff --git a/bitcoin/shadouble.h b/bitcoin/shadouble.h index f447df7f1..7c1f6a404 100644 --- a/bitcoin/shadouble.h +++ b/bitcoin/shadouble.h @@ -1,6 +1,5 @@ #ifndef LIGHTNING_BITCOIN_SHADOUBLE_H #define LIGHTNING_BITCOIN_SHADOUBLE_H -#include "config.h" #include /* To explicitly distinguish between single sha and bitcoin's standard double */ diff --git a/bitcoin/signature.c b/bitcoin/signature.c index 620e91a3b..fc9f47139 100644 --- a/bitcoin/signature.c +++ b/bitcoin/signature.c @@ -1,12 +1,12 @@ -#include "signature.h" -#include "shadouble.h" -#include "tx.h" +#include #include "pubkey.h" #include "script.h" +#include "shadouble.h" +#include "signature.h" +#include "tx.h" #include #include #include -#include #undef DEBUG #ifdef DEBUG diff --git a/bitcoin/signature.h b/bitcoin/signature.h index cc8310358..8d004f26d 100644 --- a/bitcoin/signature.h +++ b/bitcoin/signature.h @@ -1,8 +1,8 @@ #ifndef LIGHTNING_BITCOIN_SIGNATURE_H #define LIGHTNING_BITCOIN_SIGNATURE_H #include -#include #include +#include enum sighash_type { SIGHASH_ALL = 1, diff --git a/bitcoin/tx.c b/bitcoin/tx.c index 32814f2d9..4028a80b4 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -1,10 +1,10 @@ -#include "tx.h" #include +#include #include -#include #include -#include +#include #include +#include "tx.h" static void add_varint(varint_t v, void (*add)(const void *, size_t, void *), void *addp) diff --git a/close_tx.c b/close_tx.c index 5a3441adf..cb8d9dff5 100644 --- a/close_tx.c +++ b/close_tx.c @@ -1,9 +1,9 @@ -#include "close_tx.h" +#include "bitcoin/pubkey.h" +#include "bitcoin/script.h" #include "bitcoin/shadouble.h" #include "bitcoin/tx.h" -#include "bitcoin/script.h" +#include "close_tx.h" #include "permute_tx.h" -#include "bitcoin/pubkey.h" #include "pkt.h" #include "protobuf_convert.h" diff --git a/commit_tx.c b/commit_tx.c index 780f153a0..98979cac6 100644 --- a/commit_tx.c +++ b/commit_tx.c @@ -1,9 +1,9 @@ -#include "commit_tx.h" +#include "bitcoin/pubkey.h" +#include "bitcoin/script.h" #include "bitcoin/shadouble.h" #include "bitcoin/tx.h" -#include "bitcoin/script.h" +#include "commit_tx.h" #include "permute_tx.h" -#include "bitcoin/pubkey.h" #include "pkt.h" #include "protobuf_convert.h" diff --git a/find_p2sh_out.c b/find_p2sh_out.c index ccc5f6e66..acc1ad2d5 100644 --- a/find_p2sh_out.c +++ b/find_p2sh_out.c @@ -1,9 +1,9 @@ -#include "find_p2sh_out.h" -#include "bitcoin/tx.h" -#include "bitcoin/script.h" -#include #include #include +#include +#include "bitcoin/script.h" +#include "bitcoin/tx.h" +#include "find_p2sh_out.h" u32 find_p2sh_out(const struct bitcoin_tx *tx, u8 *redeemscript) { diff --git a/permute_tx.c b/permute_tx.c index 06295ef16..0aea2c975 100644 --- a/permute_tx.c +++ b/permute_tx.c @@ -1,7 +1,7 @@ -#include "permute_tx.h" #include #include #include +#include "permute_tx.h" static u32 get_next_rand(struct sha256 *h, size_t *randidx) { diff --git a/pkt.c b/pkt.c index dc32a7e80..46666c839 100644 --- a/pkt.c +++ b/pkt.c @@ -1,11 +1,11 @@ #include -#include #include -#include "pkt.h" -#include "bitcoin/tx.h" +#include #include "bitcoin/address.h" #include "bitcoin/pubkey.h" #include "bitcoin/signature.h" +#include "bitcoin/tx.h" +#include "pkt.h" #include "protobuf_convert.h" static struct pkt *to_pkt(const tal_t *ctx, Pkt__PktCase type, void *msg) diff --git a/pkt.h b/pkt.h index bea570f13..3e6d4735e 100644 --- a/pkt.h +++ b/pkt.h @@ -5,10 +5,10 @@ * This could be a simple set of macros, if the protobuf-c people hadn't * insisted on "prettifing" the names they generate into CamelCase. */ -#include "lightning.pb-c.h" #include #include #include +#include "lightning.pb-c.h" /* A packet, ready to be de-protobuf'ed. */ struct pkt { diff --git a/protobuf_convert.c b/protobuf_convert.c index e173ab88b..1d86bfc9f 100644 --- a/protobuf_convert.c +++ b/protobuf_convert.c @@ -1,7 +1,7 @@ -#include "protobuf_convert.h" -#include "bitcoin/signature.h" -#include "bitcoin/pubkey.h" #include +#include "bitcoin/pubkey.h" +#include "bitcoin/signature.h" +#include "protobuf_convert.h" Signature *signature_to_proto(const tal_t *ctx, const struct signature *sig) { diff --git a/protobuf_convert.h b/protobuf_convert.h index 58744f991..be6999b38 100644 --- a/protobuf_convert.h +++ b/protobuf_convert.h @@ -1,8 +1,8 @@ #ifndef LIGHTNING_PROTOBUF_CONVERT_H #define LIGHTNING_PROTOBUF_CONVERT_H -#include "lightning.pb-c.h" #include #include +#include "lightning.pb-c.h" /* Convert to-from protobuf to internal representation. */ struct signature;