Skip to content

Commit e88f729

Browse files
committed
Fix unused variable warnings
1 parent abec538 commit e88f729

Some content is hidden

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

48 files changed

+49
-160
lines changed

src/alice/tdr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ void TDR_list_limbo(FB_API_HANDLE handle, const TEXT* name, const SINT64 switche
296296
if (item == isc_info_end)
297297
break;
298298

299-
const USHORT length = (USHORT) p.getClumpLength();
300299
switch (item)
301300
{
302301
case isc_info_limbo:

src/burp/burp.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,6 @@ void BURP_print_warning(const Firebird::IStatus* status, bool printErrorAsWarnin
18431843
return;
18441844

18451845
BurpMaster master;
1846-
BurpGlobals* tdgbl = master.get();
18471846

18481847
// print the warning message
18491848
SCHAR s[1024];

src/burp/restore.epp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ SLONG get_compressed(BurpGlobals* tdgbl, UCHAR* buffer, SLONG length)
13321332
// msg 202: adjusting a decompression length error: invalid length %d was adjusted to %d
13331333
count = -length;
13341334
}
1335-
const UCHAR c = *p = get(tdgbl);
1335+
*p = get(tdgbl);
13361336
++p;
13371337
length -= -count;
13381338
}

src/common/ThreadStart.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ Thread Thread::start(ThreadEntryPoint* routine, void* arg, int priority_arg, Han
119119
**************************************/
120120
pthread_t thread;
121121
pthread_t* p_thread = p_handle ? p_handle : &thread;
122-
pthread_attr_t pattr;
123122
int state;
124123

125124
#if defined (LINUX) || defined (FREEBSD)
@@ -132,6 +131,7 @@ Thread Thread::start(ThreadEntryPoint* routine, void* arg, int priority_arg, Han
132131
Firebird::system_call_failed::raise("pthread_detach", state);
133132
}
134133
#else
134+
pthread_attr_t pattr;
135135
state = pthread_attr_init(&pattr);
136136
if (state)
137137
Firebird::system_call_failed::raise("pthread_attr_init", state);

src/common/classes/DbImplementation.cpp

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,44 @@
3131

3232
namespace {
3333

34-
static constexpr UCHAR CpuIntel = 0;
35-
static constexpr UCHAR CpuAmd = 1;
36-
static constexpr UCHAR CpuUltraSparc = 2;
37-
static constexpr UCHAR CpuPowerPc = 3;
38-
static constexpr UCHAR CpuPowerPc64 = 4;
39-
static constexpr UCHAR CpuMipsel = 5;
40-
static constexpr UCHAR CpuMips = 6;
41-
static constexpr UCHAR CpuArm = 7;
42-
static constexpr UCHAR CpuIa64 = 8;
43-
static constexpr UCHAR CpuS390 = 9;
44-
static constexpr UCHAR CpuS390x = 10;
45-
static constexpr UCHAR CpuSh = 11;
46-
static constexpr UCHAR CpuSheb = 12;
47-
static constexpr UCHAR CpuHppa = 13;
48-
static constexpr UCHAR CpuAlpha = 14;
49-
static constexpr UCHAR CpuArm64 = 15;
50-
static constexpr UCHAR CpuPowerPc64el = 16;
51-
static constexpr UCHAR CpuM68k = 17;
52-
static constexpr UCHAR CpuRiscV64 = 18;
53-
static constexpr UCHAR CpuMips64el = 19;
54-
static constexpr UCHAR CpuLoongArch = 20;
55-
56-
static constexpr UCHAR OsWindows = 0;
57-
static constexpr UCHAR OsLinux = 1;
58-
static constexpr UCHAR OsDarwin = 2;
59-
static constexpr UCHAR OsSolaris = 3;
60-
static constexpr UCHAR OsHpux = 4;
61-
static constexpr UCHAR OsAix = 5;
62-
static constexpr UCHAR OsMms = 6;
63-
static constexpr UCHAR OsFreeBsd = 7;
64-
static constexpr UCHAR OsNetBsd = 8;
65-
66-
static constexpr UCHAR CcMsvc = 0;
67-
static constexpr UCHAR CcGcc = 1;
68-
static constexpr UCHAR CcXlc = 2;
69-
static constexpr UCHAR CcAcc = 3;
70-
static constexpr UCHAR CcSunStudio = 4;
71-
static constexpr UCHAR CcIcc = 5;
34+
[[maybe_unused]] static constexpr UCHAR CpuIntel = 0;
35+
[[maybe_unused]] static constexpr UCHAR CpuAmd = 1;
36+
[[maybe_unused]] static constexpr UCHAR CpuUltraSparc = 2;
37+
[[maybe_unused]] static constexpr UCHAR CpuPowerPc = 3;
38+
[[maybe_unused]] static constexpr UCHAR CpuPowerPc64 = 4;
39+
[[maybe_unused]] static constexpr UCHAR CpuMipsel = 5;
40+
[[maybe_unused]] static constexpr UCHAR CpuMips = 6;
41+
[[maybe_unused]] static constexpr UCHAR CpuArm = 7;
42+
[[maybe_unused]] static constexpr UCHAR CpuIa64 = 8;
43+
[[maybe_unused]] static constexpr UCHAR CpuS390 = 9;
44+
[[maybe_unused]] static constexpr UCHAR CpuS390x = 10;
45+
[[maybe_unused]] static constexpr UCHAR CpuSh = 11;
46+
[[maybe_unused]] static constexpr UCHAR CpuSheb = 12;
47+
[[maybe_unused]] static constexpr UCHAR CpuHppa = 13;
48+
[[maybe_unused]] static constexpr UCHAR CpuAlpha = 14;
49+
[[maybe_unused]] static constexpr UCHAR CpuArm64 = 15;
50+
[[maybe_unused]] static constexpr UCHAR CpuPowerPc64el = 16;
51+
[[maybe_unused]] static constexpr UCHAR CpuM68k = 17;
52+
[[maybe_unused]] static constexpr UCHAR CpuRiscV64 = 18;
53+
[[maybe_unused]] static constexpr UCHAR CpuMips64el = 19;
54+
[[maybe_unused]] static constexpr UCHAR CpuLoongArch = 20;
55+
56+
[[maybe_unused]] static constexpr UCHAR OsWindows = 0;
57+
[[maybe_unused]] static constexpr UCHAR OsLinux = 1;
58+
[[maybe_unused]] static constexpr UCHAR OsDarwin = 2;
59+
[[maybe_unused]] static constexpr UCHAR OsSolaris = 3;
60+
[[maybe_unused]] static constexpr UCHAR OsHpux = 4;
61+
[[maybe_unused]] static constexpr UCHAR OsAix = 5;
62+
[[maybe_unused]] static constexpr UCHAR OsMms = 6;
63+
[[maybe_unused]] static constexpr UCHAR OsFreeBsd = 7;
64+
[[maybe_unused]] static constexpr UCHAR OsNetBsd = 8;
65+
66+
[[maybe_unused]] static constexpr UCHAR CcMsvc = 0;
67+
[[maybe_unused]] static constexpr UCHAR CcGcc = 1;
68+
[[maybe_unused]] static constexpr UCHAR CcXlc = 2;
69+
[[maybe_unused]] static constexpr UCHAR CcAcc = 3;
70+
[[maybe_unused]] static constexpr UCHAR CcSunStudio = 4;
71+
[[maybe_unused]] static constexpr UCHAR CcIcc = 5;
7272

7373
static constexpr UCHAR EndianLittle = 0;
7474
static constexpr UCHAR EndianBig = 1;

src/common/classes/InternalMessageBuffer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ MetadataFromBlr::MetadataFromBlr(unsigned aBlrLength, const unsigned char* aBlr,
7676
fb_assert(!(count & 1));
7777
count /= 2;
7878

79-
unsigned offset = 0;
8079
items.grow(count);
8180

8281
for (unsigned index = 0; index < count; index++)

src/common/classes/alloc.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ void corrupt(const char* text) noexcept
171171
}
172172

173173
Firebird::Mutex* cache_mutex = NULL;
174-
int dev_zero_fd = 0;
175174

176175
#if defined(WIN_NT)
177176
size_t get_page_size()

src/common/config/config.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,13 +624,13 @@ bool Config::getDefaultValue(unsigned int key, string& str)
624624

625625
#define DECLARE_GLOBAL_KEY(KEY) \
626626
static_assert(entries[KEY].is_global, "Requires global key"); \
627-
const ConfigKey key = KEY; \
628-
const Config* config = getDefaultConfig();
627+
[[maybe_unused]] const ConfigKey key = KEY; \
628+
[[maybe_unused]] const Config* config = getDefaultConfig();
629629

630630
#define DECLARE_PER_DB_KEY(KEY) \
631631
static_assert(!entries[KEY].is_global, "Requires per-database key"); \
632-
const ConfigKey key = KEY; \
633-
const Config* config = this;
632+
[[maybe_unused]] const ConfigKey key = KEY; \
633+
[[maybe_unused]] const Config* config = this;
634634

635635
int Config::getServerMode()
636636
{

src/common/pretty.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,6 @@ constexpr const char *sdl_table[] =
115115
NULL
116116
};
117117

118-
constexpr const char *map_strings[] =
119-
{
120-
"FIELD2",
121-
"FIELD1",
122-
"MESSAGE",
123-
"TERMINATOR",
124-
"TERMINATING_FIELD",
125-
"OPAQUE",
126-
"TRANSPARENT",
127-
"TAG",
128-
"SUB_FORM",
129-
"ITEM_INDEX",
130-
"SUB_FIELD"
131-
};
132-
133118
//____________________________________________________________
134119
//
135120
// Pretty print create database parameter buffer thru callback routine.

src/common/xdr.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ inline bool_t PUTLONG(xdr_t* xdrs, const SLONG* lp)
9191
return xdrs->x_putbytes(reinterpret_cast<const char*>(&l), 4);
9292
}
9393

94-
static SCHAR zeros[4] = { 0, 0, 0, 0 };
95-
9694

9795
bool_t xdr_hyper( xdr_t* xdrs, void* pi64)
9896
{

0 commit comments

Comments
 (0)