Skip to content

Commit d6e609a

Browse files
committed
Fix conversion warnings in ISQL
+ Remove unused local variables
1 parent 7835b21 commit d6e609a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/isql/isql.epp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ static void readNextInputLine(const char* prompt)
10611061
{
10621062
buffer = charBuffer->getBuffer(MAX_USHORT);
10631063
if (fgets(buffer, charBuffer->getCapacity(), Filelist->Ifp().indev_fpointer) != NULL)
1064-
lineSize = strlen(buffer);
1064+
lineSize = static_cast<int>(strlen(buffer));
10651065
else
10661066
lineSize = -1;
10671067
}
@@ -1708,8 +1708,6 @@ SLONG ISQL_get_index_segments(TEXT* segs,
17081708
* returns the list of columns in an index.
17091709
*
17101710
**************************************/
1711-
TEXT SQL_identifier[BUFFER_LENGTH256];
1712-
17131711
*segs = '\0';
17141712

17151713
if (!frontendTransaction())
@@ -4107,8 +4105,9 @@ static processing_state create_db(const FrontendParser::CreateDatabaseNode& node
41074105

41084106
dpb.insertString(isc_dpb_blr_request_search_path, SYSTEM_SCHEMA);
41094107

4110-
DB = UtilInterfacePtr()->executeCreateDatabase2(fbStatus, statement.length(),
4111-
statement.c_str(), dialect, dpb.getBufferLength(), dpb.getBuffer(), nullptr);
4108+
DB = UtilInterfacePtr()->executeCreateDatabase2(fbStatus,
4109+
static_cast<unsigned>(statement.length()), statement.c_str(), dialect,
4110+
dpb.getBufferLength(), dpb.getBuffer(), nullptr);
41124111

41134112
if (!DB && createWithRole && fbStatus->getErrors()[1] == isc_dsql_error)
41144113
{
@@ -6190,8 +6189,8 @@ static processing_state newdb(const TEXT* dbname,
61906189
// out. We will restore it after the disconnect. The save_database buffer
61916190
// will also be used to translate dbname to the proper character set.
61926191

6193-
const SLONG len = strnlen(dbname, MAXPATHLEN - 1);
6194-
SCHAR* save_database = (SCHAR*) ISQL_ALLOC(len + 1);
6192+
const size_t len = strnlen(dbname, MAXPATHLEN - 1);
6193+
SCHAR* save_database = (SCHAR*) ISQL_ALLOC(static_cast<SLONG>(len + 1));
61956194
if (!save_database)
61966195
return ps_ERR;
61976196

src/isql/show.epp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,6 @@ processing_state SHOW_grants(const std::optional<QualifiedMetaString>& name,
10671067
BASED_ON RDB$USER_PRIVILEGES.RDB$GRANT_OPTION prev_grant_option;
10681068
MetaString prev_grantor;
10691069
string user_string;
1070-
SCHAR obj_string[QUOTED_NAME_SIZE + 20];
10711070

10721071
PrivilegeFields priv_fields[] =
10731072
{
@@ -1657,10 +1656,6 @@ void SHOW_grant_roles(const SCHAR* terminator, bool* first, const TEXT* optional
16571656
* All membership privilege may have the with_admin or/and default options set.
16581657
*
16591658
**************************************/
1660-
BASED_ON RDB$USER_PRIVILEGES.RDB$GRANTOR dummy; // used to declare buf_grantor
1661-
FB_UNUSED_VAR(dummy); // Silence compiler warning about unused variable
1662-
SCHAR buf_grantor[sizeof(dummy) + 20];
1663-
16641659
// process role "object"
16651660

16661661
FOR PRV IN RDB$USER_PRIVILEGES WITH

0 commit comments

Comments
 (0)