mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
Makefile: generalize whitespace check.
Spread to individual Makefiles, and include headers. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
6
Makefile
6
Makefile
@@ -252,8 +252,10 @@ check-bolt: check-bolt.o $(CCAN_OBJS)
|
|||||||
|
|
||||||
check-bolt.o: $(CCAN_HEADERS)
|
check-bolt.o: $(CCAN_HEADERS)
|
||||||
|
|
||||||
check-whitespace:
|
check-whitespace/%: %
|
||||||
@if grep -n '[ ]$$' Makefile daemon/test/Makefile daemon/Makefile bitcoin/Makefile check-bolt.c $(CORE_SRC) $(BITCOIN_SRC) $(DAEMON_SRC); then echo Extraneous whitespace found >&2; exit 1; fi
|
@if grep -Hn '[ ]$$' $<; then echo Extraneous whitespace found >&2; exit 1; fi
|
||||||
|
|
||||||
|
check-whitespace: check-whitespace/Makefile check-whitespace/check-bolt.c $(CORE_SRC:%=check-whitespace/%) $(CORE_HEADERS:%=check-whitespace/%)
|
||||||
|
|
||||||
check-source: check-makefile check-source-bolt check-whitespace \
|
check-source: check-makefile check-source-bolt check-whitespace \
|
||||||
$(CORE_SRC:%=check-src-include-order/%) \
|
$(CORE_SRC:%=check-src-include-order/%) \
|
||||||
|
|||||||
@@ -15,4 +15,6 @@ check: bitcoin-tests
|
|||||||
|
|
||||||
check-source-bolt: $(BITCOIN_SRC:%=bolt-check/%) $(BITCOIN_HEADERS:%=bolt-check/%)
|
check-source-bolt: $(BITCOIN_SRC:%=bolt-check/%) $(BITCOIN_HEADERS:%=bolt-check/%)
|
||||||
|
|
||||||
|
check-whitespace: $(BITCOIN_SRC:%=check-whitespace/%) $(BITCOIN_HEADERS:%=check-whitespace/%) check-whitespace/bitcoin/Makefile
|
||||||
|
|
||||||
bitcoin-tests: $(BITCOIN_TEST_PROGRAMS:%=unittest/%)
|
bitcoin-tests: $(BITCOIN_TEST_PROGRAMS:%=unittest/%)
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
/* An address is the RIPEMD160 of the SHA of the public key. */
|
/* An address is the RIPEMD160 of the SHA of the public key. */
|
||||||
struct bitcoin_address {
|
struct bitcoin_address {
|
||||||
struct ripemd160 addr;
|
struct ripemd160 addr;
|
||||||
};
|
};
|
||||||
#endif /* LIGHTNING_BITCOIN_ADDRESS_H */
|
#endif /* LIGHTNING_BITCOIN_ADDRESS_H */
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ check-daemon-makefile:
|
|||||||
|
|
||||||
check-source-bolt: $(DAEMON_SRC:%=bolt-check/%) $(DAEMON_HEADERS:%=bolt-check/%)
|
check-source-bolt: $(DAEMON_SRC:%=bolt-check/%) $(DAEMON_HEADERS:%=bolt-check/%)
|
||||||
|
|
||||||
|
check-whitespace: $(DAEMON_SRC:%=check-whitespace/%) $(DAEMON_HEADERS:%=check-whitespace/%) check-whitespace/daemon/Makefile
|
||||||
|
|
||||||
# Git submodules are seriously broken.
|
# Git submodules are seriously broken.
|
||||||
daemon/jsmn/jsmn.h:
|
daemon/jsmn/jsmn.h:
|
||||||
git submodule update daemon/jsmn/
|
git submodule update daemon/jsmn/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
struct lightningd_state;
|
struct lightningd_state;
|
||||||
|
|
||||||
/* After this, we're in the .lightning dir, config file parsed.
|
/* After this, we're in the .lightning dir, config file parsed.
|
||||||
* If we just created the dir, returns true.
|
* If we just created the dir, returns true.
|
||||||
*/
|
*/
|
||||||
bool handle_opts(struct lightningd_state *dstate, int argc, char *argv[]);
|
bool handle_opts(struct lightningd_state *dstate, int argc, char *argv[]);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ struct node_connection {
|
|||||||
|
|
||||||
/* Minimum number of msatoshi in an HTLC */
|
/* Minimum number of msatoshi in an HTLC */
|
||||||
u32 htlc_minimum_msat;
|
u32 htlc_minimum_msat;
|
||||||
|
|
||||||
/* The channel ID, as determined by the anchor transaction */
|
/* The channel ID, as determined by the anchor transaction */
|
||||||
struct channel_id channel_id;
|
struct channel_id channel_id;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ wire/gen_wire.o: wire/gen_wire.h
|
|||||||
check-source: $(WIRE_SRC:%=check-src-include-order/%) $(WIRE_HEADERS:%=check-hdr-include-order/%)
|
check-source: $(WIRE_SRC:%=check-src-include-order/%) $(WIRE_HEADERS:%=check-hdr-include-order/%)
|
||||||
|
|
||||||
check-source-bolt: $(WIRE_SRC:%=bolt-check/%) $(WIRE_HEADERS:%=bolt-check/%)
|
check-source-bolt: $(WIRE_SRC:%=bolt-check/%) $(WIRE_HEADERS:%=bolt-check/%)
|
||||||
|
|
||||||
|
check-whitespace: $(WIRE_SRC:%=check-whitespace/%) $(WIRE_HEADERS:%=check-whitespace/%) check-whitespace/wire/Makefile
|
||||||
|
|
||||||
clean: wire-clean
|
clean: wire-clean
|
||||||
|
|
||||||
wire-all: wire/gen_wire.o wire/fromwire.o wire/towire.o
|
wire-all: wire/gen_wire.o wire/fromwire.o wire/towire.o
|
||||||
@@ -35,4 +38,4 @@ wire-all: wire/gen_wire.o wire/fromwire.o wire/towire.o
|
|||||||
wire-clean:
|
wire-clean:
|
||||||
$(RM) $(WIRE_OBJS) $(WIRE_GEN_SRC) $(WIRE_GEN_HEADERS) towire.c fromwire.c
|
$(RM) $(WIRE_OBJS) $(WIRE_GEN_SRC) $(WIRE_GEN_HEADERS) towire.c fromwire.c
|
||||||
|
|
||||||
include wire/test/Makefile
|
include wire/test/Makefile
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ u16 fromwire_u16(const u8 **cursor, size_t *max)
|
|||||||
return 0;
|
return 0;
|
||||||
return be16_to_cpu(ret);
|
return be16_to_cpu(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 fromwire_u32(const u8 **cursor, size_t *max)
|
u32 fromwire_u32(const u8 **cursor, size_t *max)
|
||||||
{
|
{
|
||||||
be32 ret;
|
be32 ret;
|
||||||
@@ -102,7 +102,7 @@ void fromwire_channel_id(const u8 **cursor, size_t *max,
|
|||||||
fromwire(cursor, max, &outnum, 1);
|
fromwire(cursor, max, &outnum, 1);
|
||||||
channel_id->outnum = outnum;
|
channel_id->outnum = outnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fromwire_sha256(const u8 **cursor, size_t *max, struct sha256 *sha256)
|
void fromwire_sha256(const u8 **cursor, size_t *max, struct sha256 *sha256)
|
||||||
{
|
{
|
||||||
fromwire(cursor, max, sha256, sizeof(*sha256));
|
fromwire(cursor, max, sha256, sizeof(*sha256));
|
||||||
@@ -122,7 +122,7 @@ void fromwire_pad_array(const u8 **cursor, size_t *max, u8 *arr, size_t num)
|
|||||||
{
|
{
|
||||||
fromwire(cursor, max, arr, num);
|
fromwire(cursor, max, arr, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fromwire_signature_array(const u8 **cursor, size_t *max,
|
void fromwire_signature_array(const u8 **cursor, size_t *max,
|
||||||
struct signature *arr, size_t num)
|
struct signature *arr, size_t num)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void towire_channel_id(u8 **pptr, const struct channel_id *channel_id)
|
|||||||
{
|
{
|
||||||
be32 txnum = cpu_to_be32(channel_id->txnum);
|
be32 txnum = cpu_to_be32(channel_id->txnum);
|
||||||
u8 outnum = channel_id->outnum;
|
u8 outnum = channel_id->outnum;
|
||||||
|
|
||||||
towire_u32(pptr, channel_id->blocknum);
|
towire_u32(pptr, channel_id->blocknum);
|
||||||
towire(pptr, (char *)&txnum + 1, 3);
|
towire(pptr, (char *)&txnum + 1, 3);
|
||||||
towire(pptr, &outnum, 1);
|
towire(pptr, &outnum, 1);
|
||||||
@@ -88,7 +88,7 @@ void towire_pad_array(u8 **pptr, const u8 *arr, size_t num)
|
|||||||
tal_resize(pptr, oldsize + num);
|
tal_resize(pptr, oldsize + num);
|
||||||
memset(*pptr + oldsize, 0, num);
|
memset(*pptr + oldsize, 0, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void towire_signature_array(u8 **pptr, const struct signature *arr, size_t num)
|
void towire_signature_array(u8 **pptr, const struct signature *arr, size_t num)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|||||||
Reference in New Issue
Block a user