Skip to content

Commit 2fa96d7

Browse files
committed
refactor: use include guards in gridcoin specific code
1 parent 3ffe2c9 commit 2fa96d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+297
-144
lines changed

src/gridcoin/account.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_ACCOUNT_H
6+
#define GRIDCOIN_ACCOUNT_H
67

78
#include "amount.h"
89
#include <optional>
@@ -305,3 +306,5 @@ class ResearchAccountRange
305306
const StorageType& m_accounts; //!< The accounts stored in the tally.
306307
};
307308
}
309+
310+
#endif // GRIDCOIN_AMOUNT_H

src/gridcoin/accrual/computer.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_ACCRUAL_COMPUTER_H
6+
#define GRIDCOIN_ACCRUAL_COMPUTER_H
67

78
#include "amount.h"
89
#include "gridcoin/account.h"
@@ -108,3 +109,5 @@ class IAccrualComputer
108109
//!
109110
typedef std::unique_ptr<IAccrualComputer> AccrualComputer;
110111
}
112+
113+
#endif // GRIDCOIN_ACCRUAL_COMPUTER_H

src/gridcoin/accrual/newbie.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_ACCRUAL_NEWBIE_H
6+
#define GRIDCOIN_ACCRUAL_NEWBIE_H
67

78
#include "amount.h"
89
#include "gridcoin/accrual/computer.h"
@@ -135,3 +136,5 @@ class NewbieAccrualComputer : public IAccrualComputer
135136
const double m_magnitude; //!< CPID's magnitude in the last superblock.
136137
}; // NewbieAccrualComputer
137138
} // anonymous namespace
139+
140+
#endif // GRIDCOIN_ACCRUAL_NEWBIE_H

src/gridcoin/accrual/null.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_ACCRUAL_NULL_H
6+
#define GRIDCOIN_ACCRUAL_NULL_H
67

78
#include "amount.h"
89
#include "gridcoin/accrual/computer.h"
@@ -77,3 +78,5 @@ class NullAccrualComputer : public IAccrualComputer
7778
}
7879
}; // NullAccrualComputer
7980
} // anonymous namespace
81+
82+
#endif // GRIDCOIN_ACCRUAL_NULL_H

src/gridcoin/accrual/research_age.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_ACCRUAL_RESEARCH_AGE_H
6+
#define GRIDCOIN_ACCRUAL_RESEARCH_AGE_H
67

78
#include "amount.h"
89
#include "gridcoin/accrual/computer.h"
@@ -300,3 +301,5 @@ class ResearchAgeComputer : public IAccrualComputer
300301
}
301302
}; // ResearchAgeComputer
302303
} // anonymous namespace
304+
305+
#endif // GRIDCOIN_ACCRUAL_RESEARCH_AGE_H

src/gridcoin/accrual/snapshot.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_ACCRUAL_SNAPSHOT_H
6+
#define GRIDCOIN_ACCRUAL_SNAPSHOT_H
67

78
#include "amount.h"
89
#include "arith_uint256.h"
@@ -1671,3 +1672,5 @@ class SnapshotBaselineBuilder
16711672
}
16721673
}; // SnapshotBaselineBuilder
16731674
} // anonymous namespace
1675+
1676+
#endif // GRIDCOIN_ACCRUAL_SNAPSHOT_H

src/gridcoin/appcache.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_APPCACHE_H
6+
#define GRIDCOIN_APPCACHE_H
67

78
#include <string>
89
#include <map>
@@ -99,3 +100,5 @@ void ClearCache(Section section);
99100
void DeleteCache(Section section, const std::string& key);
100101

101102
Section StringToSection(const std::string& section);
103+
104+
#endif // GRIDCOIN_APPCACHE_H

src/gridcoin/backup.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_BACKUP_H
6+
#define GRIDCOIN_BACKUP_H
67

78
#include "fs.h"
89

@@ -24,3 +25,5 @@ bool MaintainBackups(fs::path wallet_backup_path, std::vector<std::string> backu
2425
bool BackupWallet(const CWallet& wallet, const std::string& strDest);
2526
bool BackupPrivateKeys(const CWallet& wallet, std::string& sTarget, std::string& sErrors);
2627
}
28+
29+
#endif // GRIDCOIN_BACKUP_H

src/gridcoin/beacon.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_BEACON_H
6+
#define GRIDCOIN_BEACON_H
67

78
#include "amount.h"
89
#include "dbwrapper.h"
@@ -1012,3 +1013,5 @@ class BeaconRegistry : public IContractHandler
10121013
//!
10131014
BeaconRegistry& GetBeaconRegistry();
10141015
}
1016+
1017+
#endif // GRIDCOIN_BEACON_H

src/gridcoin/block_index.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_BLOCK_INDEX_H
6+
#define GRIDCOIN_BLOCK_INDEX_H
67

78
#include "gridcoin/cpid.h"
89

@@ -136,3 +137,5 @@ class BlockIndexPool
136137
static Pool<ResearcherContext> m_researcher_context_pool;
137138
}; // BlockIndexPool
138139
} // namespace GRC
140+
141+
#endif // GRIDCOIN_BLOCK_INDEX_H

src/gridcoin/boinc.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_BOINC_H
6+
#define GRIDCOIN_BOINC_H
67

78
#include <fs.h>
89

910
namespace GRC {
1011
fs::path GetBoincDataDir();
1112
}
13+
14+
#endif // GRIDCOIN_BOINC_H

src/gridcoin/claim.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_CLAIM_H
6+
#define GRIDCOIN_CLAIM_H
67

78
#include "amount.h"
89
#include "gridcoin/contract/payload.h"
@@ -396,3 +397,5 @@ class Claim : public IContractPayload
396397
}
397398
}; // Claim
398399
}
400+
401+
#endif // GRIDCOIN_CLAIM_H

src/gridcoin/contract/contract.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_CONTRACT_CONTRACT_H
6+
#define GRIDCOIN_CONTRACT_CONTRACT_H
67

78
#include "amount.h"
89
#include "gridcoin/contract/payload.h"
@@ -516,3 +517,5 @@ bool ValidateContracts(const CTransaction& tx);
516517
//!
517518
void RevertContracts(const CTransaction& tx, const CBlockIndex* const pindex);
518519
}
520+
521+
#endif // GRIDCOIN_CONTRACT_CONTRACT_H

src/gridcoin/contract/handler.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_CONTRACT_HANDLER_H
6+
#define GRIDCOIN_CONTRACT_HANDLER_H
67

78
class CBlockIndex;
89
class CTransaction;
@@ -114,3 +115,5 @@ struct IContractHandler
114115
virtual void Revert(const ContractContext& ctx);
115116
};
116117
}
118+
119+
#endif // GRIDCOIN_CONTRACT_HANDLER_H

src/gridcoin/contract/message.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_CONTRACT_MESSAGE_H
6+
#define GRIDCOIN_CONTRACT_MESSAGE_H
67

78
#include <string>
89

@@ -35,3 +36,5 @@ std::pair<CWalletTx, std::string> SendContract(Contract contract);
3536
//!
3637
std::pair<CWalletTx, std::string> SendContract(CWalletTx wtx);
3738
}
39+
40+
#endif // GRIDCOIN_CONTRACT_MESSAGE_H

src/gridcoin/contract/payload.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_CONTRACT_PAYLOAD_H
6+
#define GRIDCOIN_CONTRACT_PAYLOAD_H
67

78
#include "amount.h"
89
#include "streams.h"
@@ -289,3 +290,5 @@ class ReadOnlyContractPayload
289290
const ContractPayload m_payload; //!< The wrapped payload.
290291
};
291292
}
293+
294+
#endif // GRIDCOIN_CONTRACT_PAYLOAD_H

src/gridcoin/cpid.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_CPID_H
6+
#define GRIDCOIN_CPID_H
67

78
#include "serialize.h"
89

@@ -477,3 +478,5 @@ struct hash<GRC::Cpid>
477478
}
478479
};
479480
}
481+
482+
#endif // GRIDCOIN_CPID_H

src/gridcoin/gridcoin.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_GRIDCOIN_H
6+
#define GRIDCOIN_GRIDCOIN_H
67

78
#include "fwd.h"
89

@@ -32,3 +33,5 @@ void CloseResearcherRegistryFile();
3233
//!
3334
void ScheduleBackgroundJobs(CScheduler& scheduler);
3435
} // namespace GRC
36+
37+
#endif // GRIDCOIN_GRIDCOIN_H

src/gridcoin/magnitude.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_MAGNITUDE_H
6+
#define GRIDCOIN_MAGNITUDE_H
67

78
#include <tinyformat.h>
89

@@ -291,3 +292,5 @@ class Magnitude
291292
}
292293
}; // Magnitude
293294
}
295+
296+
#endif // GRIDCOIN_MAGNITUDE_H

src/gridcoin/project.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_PROJECT_H
6+
#define GRIDCOIN_PROJECT_H
67

78
#include "amount.h"
89
#include "gridcoin/contract/handler.h"
@@ -340,3 +341,5 @@ class Whitelist : public IContractHandler
340341
//!
341342
Whitelist& GetWhitelist();
342343
}
344+
345+
#endif // GRIDCOIN_PROJECT_H

src/gridcoin/quorum.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_QUORUM_H
6+
#define GRIDCOIN_QUORUM_H
67

78
#include <string>
89
#include <vector>
@@ -237,3 +238,5 @@ class Quorum
237238
static bool CommitSuperblock(const uint32_t height);
238239
};
239240
}
241+
242+
#endif // GRIDCOIN_QUORUM_H

src/gridcoin/researcher.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_RESEARCHER_H
6+
#define GRIDCOIN_RESEARCHER_H
67

78
#include "amount.h"
89
#include "key.h"
@@ -638,3 +639,5 @@ class Researcher
638639
GRC::BeaconError m_beacon_error; //!< Last beacon error that occurred, if any.
639640
}; // Researcher
640641
}
642+
643+
#endif // GRIDCOIN_RESEARCHER_H

src/gridcoin/scraper/fwd.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_SCRAPER_FWD_H
6+
#define GRIDCOIN_SCRAPER_FWD_H
67

78
#include <string>
89
#include <vector>
@@ -342,3 +343,5 @@ struct AppCacheEntryExt
342343
};
343344

344345
typedef std::unordered_map<std::string, AppCacheEntryExt> AppCacheSectionExt;
346+
347+
#endif // GRIDCOIN_SCRAPER_FWD_H

src/gridcoin/scraper/http.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_SCRAPER_HTTP_H
6+
#define GRIDCOIN_SCRAPER_HTTP_H
67

78
#include <fs.h>
89

@@ -323,3 +324,5 @@ class Http
323324

324325
void EvaluateResponse(int code, const std::string& url);
325326
};
327+
328+
#endif // GRIDCOIN_SCRAPER_HTTP_H

src/gridcoin/scraper/scraper.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or https://opensource.org/licenses/mit-license.php.
44

5-
#pragma once
5+
#ifndef GRIDCOIN_SCRAPER_SCRAPER_H
6+
#define GRIDCOIN_SCRAPER_SCRAPER_H
67

78
#include <atomic>
89
#include <inttypes.h>
@@ -153,3 +154,5 @@ unsigned int NumScrapersForSupermajority(unsigned int nScraperCount)
153154
scraper();
154155
};
155156
*/
157+
158+
#endif // GRIDCOIN_SCRAPER_SCRAPER_H

0 commit comments

Comments
 (0)