@@ -108,7 +108,7 @@ enum gbak_action
108108static void close_out_transaction (gbak_action, Firebird::ITransaction**);
109109// static void enable_signals();
110110// static void excp_handler();
111- static SLONG get_number (const SCHAR*);
111+ static SLONG get_number (const SCHAR*) noexcept ;
112112static ULONG get_size (const SCHAR*, burp_fil*);
113113static gbak_action open_files (const TEXT *, const TEXT**, USHORT,
114114 const Firebird::ClumpletWriter&);
@@ -134,8 +134,8 @@ struct StatFormat
134134static inline constexpr const char * STAT_CHARS = " TDRW" ;
135135static inline constexpr StatFormat STAT_FORMATS[] =
136136{
137- {" time" , " %4lu .%03u " , 9 },
138- {" delta" , " %2lu .%03u " , 7 },
137+ {" time" , " %4u .%03u " , 9 },
138+ {" delta" , " %2u .%03u " , 7 },
139139 {" reads" , " %6" UQUADFORMAT" " , 7 },
140140 {" writes" , " %6" UQUADFORMAT" " , 7 }
141141};
@@ -260,7 +260,7 @@ static int svc_api_gbak(Firebird::UtilSvc* uSvc, const Switches& switches)
260260 case IN_SW_BURP_SE: // service name
261261 if (itr >= argc - 1 )
262262 {
263- int errnum = inSw->in_sw == IN_SW_BURP_USER ? 188 : // user name parameter missing
263+ const int errnum = inSw->in_sw == IN_SW_BURP_USER ? 188 : // user name parameter missing
264264 inSw->in_sw == IN_SW_BURP_PASS ? 189 : // password parameter missing
265265 273 ; // service name parameter missing
266266
@@ -953,7 +953,7 @@ int gbak(Firebird::UtilSvc* uSvc)
953953 if (++itr >= argc)
954954 BURP_error (326 , true ); // verbose interval parameter missing
955955
956- SLONG verbint_val = get_number (argv[itr]);
956+ const SLONG verbint_val = get_number (argv[itr]);
957957 if (verbint_val < MIN_VERBOSE_INTERVAL)
958958 {
959959 // verbose interval value cannot be smaller than @1
@@ -1170,7 +1170,7 @@ int gbak(Firebird::UtilSvc* uSvc)
11701170 uSvc->fillDpb (dpb);
11711171
11721172 const UCHAR* authBlock;
1173- unsigned int authSize = uSvc->getAuthBlock (&authBlock);
1173+ const unsigned int authSize = uSvc->getAuthBlock (&authBlock);
11741174 if (authBlock)
11751175 {
11761176 dpb.insertBytes (isc_dpb_auth_block, authBlock, authSize);
@@ -1521,7 +1521,7 @@ int gbak(Firebird::UtilSvc* uSvc)
15211521
15221522
15231523
1524- void BURP_abort (Firebird::IStatus* status)
1524+ void BURP_abort (const Firebird::IStatus* status)
15251525{
15261526/* *************************************
15271527 *
@@ -1536,7 +1536,7 @@ void BURP_abort(Firebird::IStatus* status)
15361536 BurpMaster master;
15371537 BurpGlobals* tdgbl = master.get ();
15381538
1539- USHORT code = tdgbl->action && tdgbl->action ->act_action == ACT_backup_fini ? 351 : 83 ;
1539+ const USHORT code = tdgbl->action && tdgbl->action ->act_action == ACT_backup_fini ? 351 : 83 ;
15401540 // msg 351 Error closing database, but backup file is OK
15411541 // msg 83 Exiting before completion due to errors
15421542
@@ -1606,7 +1606,7 @@ void BURP_error(USHORT errcode, bool abort, const char* str)
16061606}
16071607
16081608
1609- void BURP_error_redirect (Firebird::IStatus* status_vector, USHORT errcode, const SafeArg& arg)
1609+ void BURP_error_redirect (const Firebird::IStatus* status_vector, USHORT errcode, const SafeArg& arg)
16101610{
16111611/* *************************************
16121612 *
@@ -1759,7 +1759,7 @@ void BURP_print(bool err, USHORT number, const char* str)
17591759}
17601760
17611761
1762- void BURP_print_status (bool err, Firebird::IStatus* status_vector, USHORT secondNumber)
1762+ void BURP_print_status (bool err, const Firebird::IStatus* status_vector, USHORT secondNumber)
17631763{
17641764/* *************************************
17651765 *
@@ -1814,7 +1814,7 @@ void BURP_print_status(bool err, Firebird::IStatus* status_vector, USHORT second
18141814}
18151815
18161816
1817- void BURP_print_warning (Firebird::IStatus* status, bool printErrorAsWarning)
1817+ void BURP_print_warning (const Firebird::IStatus* status, bool printErrorAsWarning)
18181818{
18191819/* *************************************
18201820 *
@@ -1977,7 +1977,7 @@ static void close_out_transaction(gbak_action action, Firebird::ITransaction** t
19771977}
19781978
19791979
1980- static SLONG get_number ( const SCHAR* string)
1980+ static SLONG get_number (const SCHAR* string) noexcept
19811981{
19821982/* *************************************
19831983 *
@@ -1986,10 +1986,7 @@ static SLONG get_number( const SCHAR* string)
19861986 **************************************
19871987 *
19881988 * Functional description
1989- * Convert a string to binary, complaining bitterly if
1990- * the string is bum.
1991- * CVC: where does it complain? It does return zero, nothing else.
1992- * Worse, this function doesn't check for overflow.
1989+ * Convert a string to binary
19931990 **************************************/
19941991 SCHAR c;
19951992 SLONG value = 0 ;
@@ -2077,7 +2074,7 @@ static gbak_action open_files(const TEXT* file1,
20772074
20782075 if (tdgbl->gbl_sw_keyholder )
20792076 {
2080- unsigned char info[] = {fb_info_crypt_key, fb_info_crypt_plugin};
2077+ constexpr unsigned char info[] = {fb_info_crypt_key, fb_info_crypt_plugin};
20812078 unsigned char buffer[(1 + 2 + MAX_SQL_IDENTIFIER_SIZE) * 2 + 2 ];
20822079 unsigned int len;
20832080
@@ -2616,7 +2613,7 @@ static ULONG get_size(const SCHAR* string, burp_fil* file)
26162613 {
26172614 if (isdigit (c))
26182615 {
2619- int val = c - ' 0' ;
2616+ const int val = c - ' 0' ;
26202617 if (size >= overflow)
26212618 {
26222619 file->fil_size_code = size_e;
@@ -2836,13 +2833,13 @@ void BurpGlobals::print_stats(USHORT number)
28362833
28372834 if (gbl_stat_flags & (1 << TIME_TOTAL))
28382835 {
2839- SINT64 t1 = (t0 - gbl_stats[TIME_TOTAL]) / freq_ms;
2836+ const SINT64 t1 = (t0 - gbl_stats[TIME_TOTAL]) / freq_ms;
28402837 burp_output (false , STAT_FORMATS[TIME_TOTAL].format , (int )(t1 / 1000 ), (int )(t1 % 1000 ));
28412838 }
28422839
28432840 if (gbl_stat_flags & (1 << TIME_DELTA))
28442841 {
2845- SINT64 t2 = (t0 - gbl_stats[TIME_DELTA]) / freq_ms;
2842+ const SINT64 t2 = (t0 - gbl_stats[TIME_DELTA]) / freq_ms;
28462843 burp_output (false , STAT_FORMATS[TIME_DELTA].format , (int )(t2 / 1000 ), (int )(t2 % 1000 ));
28472844
28482845 gbl_stats[TIME_DELTA] = t0;
0 commit comments