Trivial: Do not shadow global variable fileout #8656

pull paveljanik wants to merge 1 commits into bitcoin:master from paveljanik:20160902_Wshadow_fileout changing 2 files +7 −7
  1. paveljanik commented at 6:57 PM on September 2, 2016: contributor

    This continues #8105.

    There is a global variable fileout and the same name is used as an argument for FileCommit().

    The change here fixes the following warning:

    util.cpp:604:23: warning: declaration shadows a variable in the global namespace [-Wshadow]
    void FileCommit(FILE *fileout)
                          ^
    util.cpp:192:14: note: previous declaration is here
    static FILE* fileout = __null;
                 ^
    1 warning generated.
    

    The function FileCommit is used also for other files, not only the global fileout, so I have changed the argument name to file to match other functions there.

  2. Do not shadow global variable 7c069a7093
  3. in src/util.h:None in 7c069a7093
      92 | @@ -93,7 +93,7 @@ bool error(const char* fmt, const Args&... args)
      93 |  
      94 |  void PrintExceptionContinue(const std::exception *pex, const char* pszThread);
      95 |  void ParseParameters(int argc, const char*const argv[]);
    


    paveljanik commented at 7:11 PM on September 2, 2016:

    Should I add space after char* here?

  4. fanquake added the label Refactoring on Sep 3, 2016
  5. paveljanik renamed this:
    Do not shadow global variable fileout
    Trivial: Do not shadow global variable fileout
    on Sep 21, 2016
  6. paveljanik commented at 6:06 AM on September 21, 2016: contributor

    Common. This is super-trivial.

  7. in src/util.h:None in 7c069a7093
      92 | @@ -93,7 +93,7 @@ bool error(const char* fmt, const Args&... args)
      93 |  
      94 |  void PrintExceptionContinue(const std::exception *pex, const char* pszThread);
      95 |  void ParseParameters(int argc, const char*const argv[]);
      96 | -void FileCommit(FILE *fileout);
      97 | +void FileCommit(FILE *file);
    


    MarcoFalke commented at 7:48 AM on September 21, 2016:

    This diff will make the heat death of the universe come a little bit closer.


    laanwj commented at 12:13 PM on September 21, 2016:

    Besides immamentizing the heat death of the universe, the only reason for having argument names in the interface specification at all is for documentation, I don't think file is any clearer than fileout, and I don't think this change here should have been made.

    Then again as @MarcoFalke already did the binary comparison it's too late to make changes, and I'll just go ahead and merge...

  8. MarcoFalke commented at 7:48 AM on September 21, 2016: member

    Binaries match ACK 7c069a70931a6bb27d060927765146d4c6ceced4

  9. laanwj merged this on Sep 21, 2016
  10. laanwj closed this on Sep 21, 2016

  11. laanwj referenced this in commit cf5ebaa921 on Sep 21, 2016
  12. codablock referenced this in commit 9abc00cc00 on Sep 19, 2017
  13. codablock referenced this in commit 97b63420dd on Jan 11, 2018
  14. andvgal referenced this in commit cd1e141d09 on Jan 6, 2019
  15. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-22 06:15 UTC

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