Use quoted form when including primitives/transaction.h and wallet/wallet.h #10752

pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:transaction-h changing 2 files +2 −2
  1. practicalswift commented at 9:22 pm on July 5, 2017: contributor
    Nit: We expect to find primitives/transaction.h locally in src/.
  2. jtimon commented at 10:07 pm on July 5, 2017: contributor
    ACK 0357ce0 (trivial review)
  3. TheBlueMatt commented at 10:07 pm on July 5, 2017: member

    All aboard the obvious-ACK train :).

    utACK.

  4. fanquake added the label Refactoring on Jul 6, 2017
  5. fanquake commented at 0:21 am on July 6, 2017: member
    utACK 0357ce0
  6. laanwj commented at 2:29 pm on July 6, 2017: member

    Nit: We expect to find primitives/transaction.h locally in src/.

    utACK as it matches the common convention better.

    Though sometimes I wonder whether this convention is a good idea. include <> searches relative to the include paths, include "" relative to the directory of the current source file, then the include paths. We know primitives/ is relative to the source root of the repository, so it doesn’t really need to look anywhere else. Especially not if it is already in primitives/, e.g.

    • when primitives/block.h includes "primitives/transaction.h", then it makes it look in src/primitives/primitives
    • when src/wallet/feebumper.h includes "primitives/transaction.h", it makes it look in src/wallet/primitives!

    So with regard to unambiguity, this is a change for the worse.

  7. in src/wallet/feebumper.h:8 in 0357ce0740 outdated
    4@@ -5,7 +5,7 @@
    5 #ifndef BITCOIN_WALLET_FEEBUMPER_H
    6 #define BITCOIN_WALLET_FEEBUMPER_H
    7 
    8-#include <primitives/transaction.h>
    9+#include "primitives/transaction.h"
    


    promag commented at 9:54 am on July 7, 2017:

    With quotes should be relative?

    0#include "../primitives/transaction.h"
    
  8. jtimon commented at 7:28 pm on July 7, 2017: contributor
    The advantage of using #include “primitives/transaction.h” instead of simply #include “transaction.h” is that one day we may want to search and replace all #include “primitives/transaction.h” say, to a new directory. If you moved primitives/block.o to the same directory at the same time it would be fine though.
  9. practicalswift force-pushed on Jul 26, 2017
  10. practicalswift renamed this:
    Use quoted form when including primitives/transaction.h
    Use quoted form when including primitives/transaction.h and wallet/wallet.h
    on Jul 26, 2017
  11. practicalswift commented at 3:14 pm on July 26, 2017: contributor
    Added a commit fixing the same thing when importing wallet/wallet.h :-) Introduced in 97375727b8f3b7d26c7c813630a6139005b5c5c9.
  12. practicalswift force-pushed on Jul 27, 2017
  13. Use quoted form when including wallet.h 6bfce90431
  14. Use quoted form when including transaction.h a9ea61afa5
  15. practicalswift force-pushed on Aug 3, 2017
  16. laanwj commented at 7:40 am on August 15, 2017: member
    If you don’t mind, I’m going to close this. There has been talk of moving to absolute inclusion (e.g. #include <>) instead on the longer run (https://github.com/bitcoin/bitcoin/pull/10976#issuecomment-322397113) and I think that’d be superior.
  17. laanwj closed this on Aug 15, 2017

  18. practicalswift commented at 7:45 am on August 15, 2017: contributor
    Makes sense! :-)
  19. practicalswift deleted the branch on Apr 10, 2021
  20. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me