Skip to content

Commit 660a616

Browse files
committed
Fix mismatched-new-delete warnings
1 parent 5d7bec2 commit 660a616

File tree

7 files changed

+16
-41
lines changed

7 files changed

+16
-41
lines changed

src/common/call_service.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ void callRemoteServiceManager(ISC_STATUS* status,
465465
{
466466
const char request[] = {isc_info_svc_get_users};
467467
int startQuery = 0;
468-
Auth::StackUserData uData;
468+
Auth::UserData uData;
469469

470470
for (;;)
471471
{

src/common/security.h

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class IntField :
155155

156156
typedef Firebird::Array<UCHAR> AuthenticationBlock;
157157

158-
class UserData :
158+
class UserData final :
159159
public Firebird::VersionedIface<Firebird::IUserImpl<UserData, Firebird::CheckStatusWrapper> >
160160
{
161161
public:
@@ -232,31 +232,6 @@ class UserData :
232232
IntField u, g;
233233
};
234234

235-
class StackUserData final : public UserData
236-
{
237-
public:
238-
void* operator new(size_t, void* memory) throw()
239-
{
240-
return memory;
241-
}
242-
};
243-
244-
class DynamicUserData final : public UserData
245-
{
246-
public:
247-
#ifdef DEBUG_GDS_ALLOC
248-
void* operator new(size_t size, Firebird::MemoryPool& pool, const char* fileName, int line)
249-
{
250-
return pool.allocate(size, fileName, line);
251-
}
252-
#else // DEBUG_GDS_ALLOC
253-
void* operator new(size_t size, Firebird::MemoryPool& pool)
254-
{
255-
return pool.allocate(size);
256-
}
257-
#endif // DEBUG_GDS_ALLOC
258-
};
259-
260235
class Get : public Firebird::GetPlugins<Firebird::IManagement>
261236
{
262237
public:

src/dsql/DdlNodes.epp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11103,7 +11103,7 @@ void CreateAlterUserNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScra
1110311103
// run all statements under savepoint control
1110411104
AutoSavePoint savePoint(tdbb, transaction);
1110511105

11106-
Auth::DynamicUserData* userData = FB_NEW_POOL(*transaction->tra_pool) Auth::DynamicUserData;
11106+
Auth::UserData* userData = FB_NEW_POOL(*transaction->tra_pool) Auth::UserData;
1110711107

1110811108
MetaName text(name);
1110911109
if (text.isEmpty() && mode == USER_MOD)
@@ -11218,7 +11218,7 @@ void DropUserNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jr
1121811218
// run all statements under savepoint control
1121911219
AutoSavePoint savePoint(tdbb, transaction);
1122011220

11221-
Auth::DynamicUserData* userData = FB_NEW_POOL(*transaction->tra_pool) Auth::DynamicUserData;
11221+
Auth::UserData* userData = FB_NEW_POOL(*transaction->tra_pool) Auth::UserData;
1122211222

1122311223
string text = name.c_str();
1122411224

src/jrd/UserManagement.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void UserManagement::commit()
314314
}
315315
}
316316

317-
USHORT UserManagement::put(Auth::DynamicUserData* userData)
317+
USHORT UserManagement::put(Auth::UserData* userData)
318318
{
319319
const FB_SIZE_T ret = commands.getCount();
320320
if (ret > MAX_USHORT)
@@ -379,7 +379,7 @@ void UserManagement::execute(USHORT id)
379379

380380
if (command->attr.entered() || command->op == Auth::ADDMOD_OPER)
381381
{
382-
Auth::StackUserData cmd;
382+
Auth::UserData cmd;
383383
cmd.op = Auth::DIS_OPER;
384384
cmd.user.set(&statusWrapper, command->userName()->get());
385385
check(&statusWrapper);
@@ -609,7 +609,7 @@ RecordBuffer* UserManagement::getList(thread_db* tdbb, jrd_rel* relation)
609609

610610
for (FillSnapshot fillSnapshot(this); fillSnapshot.pos < managers.getCount(); ++fillSnapshot.pos)
611611
{
612-
Auth::StackUserData u;
612+
Auth::UserData u;
613613
u.op = Auth::DIS_OPER;
614614

615615
*ec = managers[fillSnapshot.pos].second->execute(currentWrapper, &u, &fillSnapshot);

src/jrd/UserManagement.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class UserManagement : public SnapshotData
5959
~UserManagement();
6060

6161
// store userData for DFW-time processing
62-
USHORT put(Auth::DynamicUserData* userData);
62+
USHORT put(Auth::UserData* userData);
6363
// execute command with ID
6464
void execute(USHORT id);
6565
// commit transaction in security database
@@ -71,7 +71,7 @@ class UserManagement : public SnapshotData
7171

7272
private:
7373
thread_db* threadDbb;
74-
Firebird::HalfStaticArray<Auth::DynamicUserData*, 8> commands;
74+
Firebird::HalfStaticArray<Auth::UserData*, 8> commands;
7575
typedef Firebird::Pair<Firebird::NonPooled<MetaName, Firebird::IManagement*> > Manager;
7676
Firebird::ObjectsArray<Manager> managers;
7777
Firebird::NoCaseString plugins;

src/utilities/gsec/gsec.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ namespace {
308308
public Firebird::AutoIface<Firebird::IListUsersImpl<Callback, Firebird::CheckStatusWrapper> >
309309
{
310310
public:
311-
explicit Callback(StackUserData* pu)
311+
explicit Callback(UserData* pu)
312312
: u(pu)
313313
{ }
314314

@@ -329,7 +329,7 @@ namespace {
329329
}
330330

331331
private:
332-
StackUserData* u;
332+
UserData* u;
333333
};
334334
} // anonymous namespace
335335

@@ -356,7 +356,7 @@ int gsec(Firebird::UtilSvc* uSvc)
356356
tsec* tdsec = &tsecInstance;
357357
tsec::putSpecific(tdsec);
358358

359-
StackUserData u;
359+
UserData u;
360360
tdsec->tsec_user_data = &u;
361361

362362
Firebird::LocalStatus lsManager;
@@ -549,7 +549,7 @@ int gsec(Firebird::UtilSvc* uSvc)
549549
if (user_data->operation() == MOD_OPER && user_data->userName()->entered() &&
550550
(fieldSet(&user_data->u) || fieldSet(&user_data->g) || fieldSet(&user_data->group)))
551551
{
552-
StackUserData u;
552+
UserData u;
553553
u.op = DIS_OPER;
554554
u.user.set(&statusWrapper, user_data->userName()->get());
555555
check(&statusWrapper);

src/yvalve/alt.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ ISC_STATUS API_ROUTINE isc_add_user(ISC_STATUS* status, const USER_SEC_DATA* inp
862862
* Return > 0 if any error occurs.
863863
*
864864
**************************************/
865-
Auth::StackUserData userInfo;
865+
Auth::UserData userInfo;
866866
userInfo.op = Auth::ADD_OPER;
867867
Firebird::LocalStatus s;
868868
Firebird::CheckStatusWrapper statusWrapper(&s);
@@ -925,7 +925,7 @@ ISC_STATUS API_ROUTINE isc_delete_user(ISC_STATUS* status, const USER_SEC_DATA*
925925
* Return > 0 if any error occurs.
926926
*
927927
**************************************/
928-
Auth::StackUserData userInfo;
928+
Auth::UserData userInfo;
929929
userInfo.op = Auth::DEL_OPER;
930930
Firebird::LocalStatus s;
931931
Firebird::CheckStatusWrapper statusWrapper(&s);
@@ -970,7 +970,7 @@ ISC_STATUS API_ROUTINE isc_modify_user(ISC_STATUS* status, const USER_SEC_DATA*
970970
* Return > 0 if any error occurs.
971971
*
972972
**************************************/
973-
Auth::StackUserData userInfo;
973+
Auth::UserData userInfo;
974974
userInfo.op = Auth::MOD_OPER;
975975
Firebird::LocalStatus s;
976976
Firebird::CheckStatusWrapper statusWrapper(&s);

0 commit comments

Comments
 (0)