Skip to content

Commit

Permalink
[OnGoing] Fixing warnings in Linux / GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
aleflm committed Apr 1, 2024
1 parent fe889ce commit 02c83ce
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/compat/glibcxx_sanity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool sanity_test_range_fmt()
{
std::string test;
try {
test.at(1);
(void) test.at(1);
} catch (const std::out_of_range&) {
return true;
} catch (...) {
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static const std::string COOKIEAUTH_FILE = ".cookie";
boost::filesystem::path GetAuthCookieFile()
{
boost::filesystem::path path(GetArg("-rpccookiefile", COOKIEAUTH_FILE));
if (!path.is_complete()) path = GetDataDir() / path;
if (!path.is_absolute()) path = GetDataDir() / path;
return path;
}

Expand Down
1 change: 1 addition & 0 deletions src/secp256k1/src/ecmult.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "group.h"
#include "scalar.h"
#include "scratch.h"
#include "scratch_impl.h"

typedef struct {
/* For accelerating the computation of a*P + b*G: */
Expand Down
7 changes: 0 additions & 7 deletions src/secp256k1/src/ecmult_const_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@
#include "ecmult_const.h"
#include "ecmult_impl.h"

#ifdef USE_ENDOMORPHISM
#define WNAF_BITS 128
#else
#define WNAF_BITS 256
#endif
#define WNAF_SIZE(w) ((WNAF_BITS + (w) - 1) / (w))

/* This is like `ECMULT_TABLE_GET_GE` but is constant time */
#define ECMULT_CONST_TABLE_GET_GE(r,pre,n,w) do { \
int m; \
Expand Down
1 change: 0 additions & 1 deletion src/secp256k1/src/ecmult_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,6 @@ static int secp256k1_pippenger_bucket_window(size_t n) {
* Returns the maximum optimal number of points for a bucket_window.
*/
static size_t secp256k1_pippenger_bucket_window_inv(int bucket_window) {
int i;
#ifdef USE_ENDOMORPHISM
int size[11]= {1, 4, 20, 57, 136, 235, 1260, 1260, 4420, 7880, 16050};
#else
Expand Down
1 change: 1 addition & 0 deletions src/secp256k1/src/scratch_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define _SECP256K1_SCRATCH_IMPL_H_

#include "scratch.h"
#include <string.h>

/* Using 16 bytes alignment because common architectures never have alignment
* requirements above 8 for any of the types we care about. In addition we
Expand Down
4 changes: 2 additions & 2 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ void ClearDatadirCache()
boost::filesystem::path GetConfigFile(const std::string& confPath)
{
boost::filesystem::path pathConfigFile(confPath);
if (!pathConfigFile.is_complete()) {
if (!pathConfigFile.is_absolute()) {
boost::filesystem::path dataDir = GetDataDir(false);

// upgrade heuristics: if dataDir ends with either "zcoin" or ".zcoin" and confPath is set
Expand Down Expand Up @@ -694,7 +694,7 @@ bool RenameDirectoriesFromZcoinToFiro()
boost::filesystem::path GetPidFile()
{
boost::filesystem::path pathPidFile(GetArg("-pid", BITCOIN_PID_FILENAME));
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
if (!pathPidFile.is_absolute()) pathPidFile = GetDataDir() / pathPidFile;
return pathPidFile;
}

Expand Down
6 changes: 4 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "wallet.h"
#include "boost/filesystem/operations.hpp"
#include "walletexcept.h"
#include "sigmaspendbuilder.h"
#include "lelantusjoinsplitbuilder.h"
Expand Down Expand Up @@ -671,7 +672,7 @@ bool CWallet::Verify()
uiInterface.InitMessage(_("Verifying wallet..."));

// Wallet file must be a plain filename without a directory
if (walletFile != boost::filesystem::basename(walletFile) + boost::filesystem::extension(walletFile))
if (walletFile != boost::filesystem::path(walletFile).stem().string() + boost::filesystem::path(walletFile).extension().string())
return InitError(strprintf(_("Wallet %s resides outside data directory %s"), walletFile, GetDataDir().string()));

if (!bitdb.Open(GetDataDir()))
Expand Down Expand Up @@ -7514,7 +7515,8 @@ bool CWallet::BackupWallet(const std::string& strDest)

try {
#if BOOST_VERSION >= 104000
boost::filesystem::copy_file(pathSrc, pathDest, boost::filesystem::copy_option::overwrite_if_exists);
const auto copyOptions = boost::filesystem::copy_options::overwrite_existing;
boost::filesystem::copy(pathSrc, pathDest, copyOptions);
#else
boost::filesystem::copy_file(pathSrc, pathDest);
#endif
Expand Down

0 comments on commit 02c83ce

Please sign in to comment.