Browse Source

Makefile: generalize whitespace check.

Spread to individual Makefiles, and include headers.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
b7789bf065
  1. 6
      Makefile
  2. 2
      bitcoin/Makefile
  3. 2
      bitcoin/address.h
  4. 2
      daemon/Makefile
  5. 2
      daemon/options.h
  6. 2
      daemon/routing.h
  7. 5
      wire/Makefile
  8. 6
      wire/fromwire.c
  9. 4
      wire/towire.c

6
Makefile

@ -252,8 +252,10 @@ check-bolt: check-bolt.o $(CCAN_OBJS)
check-bolt.o: $(CCAN_HEADERS)
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
check-whitespace/%: %
@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 \
$(CORE_SRC:%=check-src-include-order/%) \

2
bitcoin/Makefile

@ -15,4 +15,6 @@ check: bitcoin-tests
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/%)

2
bitcoin/address.h

@ -7,5 +7,5 @@
/* An address is the RIPEMD160 of the SHA of the public key. */
struct bitcoin_address {
struct ripemd160 addr;
};
};
#endif /* LIGHTNING_BITCOIN_ADDRESS_H */

2
daemon/Makefile

@ -123,6 +123,8 @@ check-daemon-makefile:
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.
daemon/jsmn/jsmn.h:
git submodule update daemon/jsmn/

2
daemon/options.h

@ -5,7 +5,7 @@
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.
*/
bool handle_opts(struct lightningd_state *dstate, int argc, char *argv[]);

2
daemon/routing.h

@ -25,7 +25,7 @@ struct node_connection {
/* Minimum number of msatoshi in an HTLC */
u32 htlc_minimum_msat;
/* The channel ID, as determined by the anchor transaction */
struct channel_id channel_id;

5
wire/Makefile

@ -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-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
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:
$(RM) $(WIRE_OBJS) $(WIRE_GEN_SRC) $(WIRE_GEN_HEADERS) towire.c fromwire.c
include wire/test/Makefile
include wire/test/Makefile

6
wire/fromwire.c

@ -46,7 +46,7 @@ u16 fromwire_u16(const u8 **cursor, size_t *max)
return 0;
return be16_to_cpu(ret);
}
u32 fromwire_u32(const u8 **cursor, size_t *max)
{
be32 ret;
@ -102,7 +102,7 @@ void fromwire_channel_id(const u8 **cursor, size_t *max,
fromwire(cursor, max, &outnum, 1);
channel_id->outnum = outnum;
}
void fromwire_sha256(const u8 **cursor, size_t *max, struct sha256 *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);
}
void fromwire_signature_array(const u8 **cursor, size_t *max,
struct signature *arr, size_t num)
{

4
wire/towire.c

@ -59,7 +59,7 @@ void towire_channel_id(u8 **pptr, const struct channel_id *channel_id)
{
be32 txnum = cpu_to_be32(channel_id->txnum);
u8 outnum = channel_id->outnum;
towire_u32(pptr, channel_id->blocknum);
towire(pptr, (char *)&txnum + 1, 3);
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);
memset(*pptr + oldsize, 0, num);
}
void towire_signature_array(u8 **pptr, const struct signature *arr, size_t num)
{
size_t i;

Loading…
Cancel
Save