8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:03:02 +01:00

Cleanup: get rid of unused variables.

This commit is contained in:
Adriano dos Santos Fernandes 2021-09-16 11:18:50 -03:00
parent e259c6c0fd
commit d3be1780b7
22 changed files with 29 additions and 38 deletions

View File

@ -365,7 +365,6 @@ namespace
unsigned charSavePos = patternPos;
UChar32 c = getPatternChar();
bool range = false;
bool charClass = false;
if (useEscape && c == escapeChar)

View File

@ -133,7 +133,7 @@ bool Synchronize::sleep(int milliseconds)
if (ret)
system_call_failed::raise("pthread_mutex_lock", ret);
int seconds = nanoTime.tv_sec - microTime.tv_sec;
///int seconds = nanoTime.tv_sec - microTime.tv_sec;
while (!wakeup)
{

View File

@ -69,8 +69,11 @@ static const char* DEFAULT_PATH =
#endif
static const char* const NAME_PATTERN = "XXXXXX";
#ifdef WIN_NT
static const char* const NAME_LETTERS = "abcdefghijklmnopqrstuvwxyz0123456789";
static const FB_SIZE_T MAX_TRIES = 256;
#endif
// we need a class here only to return memory on shutdown and avoid
// false memory leak reports

View File

@ -203,6 +203,7 @@ namespace
initDone = 1;
#ifdef HAVE_PTHREAD_ATFORK
int ret = pthread_atfork(NULL, NULL, child);
(void) ret;
#endif
Firebird::MemoryPool::contextPoolInit();

View File

@ -340,7 +340,6 @@ bool ISC_get_user(Firebird::string* name, int* id, int* group)
**************************************/
// egid and euid need to be signed, uid_t is unsigned on SUN!
SLONG egid, euid;
TEXT user_name[256];
const TEXT* p = NULL;
euid = (SLONG) geteuid();

View File

@ -70,7 +70,9 @@
#include "../common/classes/array.h"
#include "../common/StatusHolder.h"
#ifdef WIN_NT
static int process_id;
#endif
// Unix specific stuff

View File

@ -106,7 +106,7 @@ const USHORT SIG_user = 0; // Our routine
const USHORT SIG_client = 1; // Not our routine
const USHORT SIG_informs = 2; // routine tells us whether to chain
const SLONG SIG_informs_continue = 0; // continue on signal processing
//const SLONG SIG_informs_continue = 0; // continue on signal processing
const SLONG SIG_informs_stop = 1; // stop signal processing
namespace {

View File

@ -422,6 +422,7 @@ static const char* const COLL_30_VERSION = "41.128.4.4"; // ICU 3.0 collator ver
static GlobalPtr<UnicodeUtil::ICUModules> icuModules;
#ifdef LINUX
static bool extractVersionFromPath(const PathName& realPath, int& major, int& minor)
{
major = 0;
@ -460,6 +461,7 @@ static bool extractVersionFromPath(const PathName& realPath, int& major, int& mi
return major != 0;
}
#endif
static ModuleLoader::Module* formatAndLoad(const char* templateName,
int& majorVersion, int& minorVersion)

View File

@ -854,8 +854,11 @@ FetchPassResult fetchPassword(const Firebird::PathName& name, const char*& passw
const SINT64 BILLION = 1000000000;
#ifdef WIN_NT
static SINT64 saved_frequency = 0;
#elif defined(HAVE_CLOCK_GETTIME)
const SINT64 BILLION = 1000000000;
#endif
// Returns current value of performance counter
SINT64 query_performance_counter()

View File

@ -214,7 +214,6 @@ namespace Jrd {
fb_assert(pageSpace);
Jrd::jrd_file* file = pageSpace->file;
const bool isTempPage = pageSpace->isTemporary();
Jrd::BackupManager::StateReadGuard stateGuard(tdbb);
Jrd::BackupManager* bm = dbb->dbb_backup_manager;

View File

@ -412,8 +412,6 @@ Connection* Provider::getBoundConnection(Jrd::thread_db* tdbb,
void Provider::jrdAttachmentEnd(thread_db* tdbb, Jrd::Attachment* att, bool forced)
{
Database* dbb = tdbb->getDatabase();
HalfStaticArray<Connection*, 16> toRelease(getPool());
{ // scope

View File

@ -301,8 +301,6 @@ int BaseAggWinStream<ThisType, NextType>::lookForChange(thread_db* tdbb, jrd_req
if (!group)
return false;
Impure* const impure = getImpure(request);
for (const NestConst<ValueExprNode>* ptrValue = group->begin(), *endValue = group->end();
ptrValue != endValue;
++ptrValue)

View File

@ -743,8 +743,6 @@ namespace Jrd
if (!group)
return;
Impure* const impure = getImpure(request);
for (const NestConst<ValueExprNode>* ptrValue = group->begin(), *endValue = group->end();
ptrValue != endValue;
++ptrValue)

View File

@ -168,8 +168,6 @@ Config* Config::get(const PathName& lookupName)
const PathName filename =
fb_utils::getPrefix(IConfigManager::DIR_CONF, REPLICATION_CFGFILE);
MemoryPool& pool = *getDefaultMemoryPool();
ConfigFile cfgFile(filename, ConfigFile::HAS_SUB_CONF |
ConfigFile::NATIVE_ORDER |
ConfigFile::CUSTOM_MACROS);
@ -334,15 +332,13 @@ void Config::enumerate(Firebird::Array<Config*>& replicas)
const PathName filename =
fb_utils::getPrefix(IConfigManager::DIR_CONF, REPLICATION_CFGFILE);
MemoryPool& pool = *getDefaultMemoryPool();
ConfigFile cfgFile(filename, ConfigFile::HAS_SUB_CONF |
ConfigFile::NATIVE_ORDER |
ConfigFile::CUSTOM_MACROS);
AutoPtr<Config> defConfig(FB_NEW Config);
bool defaultFound = false, exactMatch = false;
bool defaultFound = false;
for (const auto& section : cfgFile.getParameters())
{

View File

@ -2605,9 +2605,6 @@ void LockManager::post_blockage(thread_db* tdbb, lrq* request, lbl* lock)
const SRQ_PTR owner_offset = request->lrq_owner;
const own* owner = (own*) SRQ_ABS_PTR(owner_offset);
const SRQ_PTR request_offset = SRQ_REL_PTR(request);
const SRQ_PTR lock_offset = SRQ_REL_PTR(lock);
ASSERT_ACQUIRED;
CHECK(request->lrq_flags & LRQ_pending);

View File

@ -95,22 +95,23 @@
const char* const PROTOCOL_INET = "inet";
const char* const PROTOCOL_INET4 = "inet4";
const char* const PROTOCOL_INET6 = "inet6";
#ifdef WIN_NT
const char* const PROTOCOL_WNET = "wnet";
const char* const PROTOCOL_XNET = "xnet";
const char* const INET_SEPARATOR = "/";
const char* const WNET_SEPARATOR = "@";
const char* const WNET_LOCALHOST = "\\\\.";
#endif
const char* const INET_SEPARATOR = "/";
const char* const INET_LOCALHOST = "localhost";
const char* const WNET_LOCALHOST = "\\\\.";
using namespace Firebird;
namespace {
// Success vector for general use
const ISC_STATUS success_vector[] = {isc_arg_gds, FB_SUCCESS, isc_arg_end};
void handle_error(ISC_STATUS code)
{
Arg::Gds(code).raise();

View File

@ -1282,7 +1282,6 @@ rem_port* INET_server(SOCKET sock)
* established. Set up port block with the appropriate socket.
*
**************************************/
int n = 0;
rem_port* const port = alloc_port(NULL);
port->port_flags |= PORT_server;
port->port_server_flags |= SRVR_server;

View File

@ -67,7 +67,6 @@ RMessage* PARSE_messages(const UCHAR* blr, size_t blr_length)
return NULL;
RMessage* message = NULL;
ULONG net_length = 0;
bool error = false;

View File

@ -45,6 +45,8 @@
#include "firebird/Interface.h"
#include <type_traits> // std::is_unsigned
#ifndef WIN_NT
#include <signal.h>
#include <fcntl.h>
@ -425,8 +427,7 @@ public:
m_flags(0)
{
// Require base flags field to be unsigned.
// This is a compile-time assertion; it won't build if you use a signed flags field.
typedef int dummy[T(-1) > 0];
static_assert(std::is_unsigned<T>::value, "T must be unsigned");
}
explicit RFlags(const T flags) :
m_flags(flags)

View File

@ -189,8 +189,6 @@ namespace
usage(uSvc, isc_nbackup_allowed_switches);
}
const int MSG_LEN = 1024;
// HPUX has non-posix-conformant method to return error codes from posix_fadvise().
// Instead of error code, directly returned by function (like specified by posix),
// -1 is returned in case of error and errno is set. Luckily, we can easily detect it runtime.

View File

@ -329,7 +329,6 @@ static const UCHAR
byte_line[] = { op_byte, op_line, 0},
byte_args[] = { op_byte, op_line, op_args, 0},
byte_verb[] = { op_byte, op_line, op_verb, 0},
byte_verb_verb[] = { op_byte, op_line, op_verb, op_verb, 0},
byte_literal[] = { op_byte, op_literal, op_line, 0},
byte_byte_verb[] = { op_byte, op_byte, op_line, op_verb, 0},
verb_byte_verb[] = { op_verb, op_byte, op_line, op_verb, 0},

View File

@ -51,7 +51,6 @@ enum pp_vals {
};
const size_t MAX_TOKEN_SIZE = 1024;
static void generate_error(const Firebird::NoCaseString&, SSHORT, char = 0);
struct pp_table