File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,21 @@ skip_commits:
1919# ---------------------------------#
2020environment :
2121 matrix :
22- # Qt6.5 / VisualStudio 2019 64bit
22+ # Qt6.7 / VisualStudio 2019 64bit
2323 - APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2019
2424 INIT_BAT : C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat
25- QT_PATH : C:\Qt\6.5 \msvc2019_64
25+ QT_PATH : C:\Qt\6.7 \msvc2019_64
2626
2727 # Qt6.7 / VisualStudio 2022 64bit
2828 - APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2022
2929 INIT_BAT : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat
3030 QT_PATH : C:\Qt\6.7\msvc2019_64
3131
32+ # Qt6.5 / VisualStudio 2022 64bit
33+ - APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2022
34+ INIT_BAT : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat
35+ QT_PATH : C:\Qt\6.5\msvc2019_64
36+
3237# scripts that are called at very beginning, before repo cloning
3338init :
3439 - git config --global core.autocrlf false
Original file line number Diff line number Diff line change @@ -357,34 +357,37 @@ std::string simple_format(const std::string &format, Args&&... args)
357357{
358358 QByteArray res;
359359 const size_t len = format.size ();
360+ constexpr int cnt = sizeof ...(args);
360361 QVariantList vars = { QVariant (args)... };
362+
361363 size_t pos = 0 ;
362364 int argidx = 0 ;
363365 res.reserve (len * 2 );
364366
365367 while (pos < len) {
366368 if (format[pos] == ' {' ) {
367369 if (pos + 1 < len && format[pos + 1 ] == ' }' ) {
368- if (argidx < vars. count () ) {
369- res += vars. value ( argidx) .toByteArray ();
370+ if (argidx < cnt ) {
371+ res += vars[ argidx] .toByteArray ();
370372 argidx++;
371373 pos += 2 ; // Skip 2 characters, '{}'
372374 continue ;
373375 }
374376 } else {
375377 auto e = format.find (' }' , pos + 2 );
376- if (e != std::string::npos) {
378+ if (e != std::string::npos && argidx < cnt ) {
377379 auto sz = e - pos - 1 ;
378380 auto subs = format.substr (pos + 1 , sz);
379381 if (subs == " :x" ) {
380- auto num = vars. value ( argidx) .toULongLong ();
382+ auto num = vars[ argidx] .toULongLong ();
381383 res += QString::number (num, 16 ).toLatin1 ();
382384 } else if (subs == " :#x" ) {
383- auto num = vars. value ( argidx) .toULongLong ();
385+ auto num = vars[ argidx] .toULongLong ();
384386 res += " 0x" ;
385387 res += QString::number (num, 16 ).toLatin1 ();
386388 } else {
387389 // other format
390+ res += vars[argidx].toByteArray ();
388391 }
389392 argidx++;
390393 pos += sz + 2 ;
You can’t perform that action at this time.
0 commit comments