Avoid some -Wcomma warnings

This commit is contained in:
Paul Cornett
2026-06-15 22:20:39 -07:00
parent e69213eca1
commit be1274d517
4 changed files with 21 additions and 12 deletions
+12 -4
View File
@@ -157,16 +157,24 @@ int wxGetTimeZone()
// We must initialize the time zone information before using it. It's not a
// problem if we do it twice due to a race condition, as it's idempotent
// anyhow, so don't bother with any locks here.
static bool s_tzSet = (_tzset(), true);
wxUnusedVar(s_tzSet);
static bool s_tzSet;
if (!s_tzSet)
{
_tzset();
s_tzSet = true;
}
long t;
_get_timezone(&t);
return t;
#else // Use some kind of time zone variable.
// In any case we must initialize the time zone before using it.
static bool s_tzSet = (tzset(), true);
wxUnusedVar(s_tzSet);
static bool s_tzSet;
if (!s_tzSet)
{
tzset();
s_tzSet = true;
}
#if defined(WX_TIMEZONE) // If WX_TIMEZONE was defined by configure, use it.
return WX_TIMEZONE;
+2 -1
View File
@@ -771,7 +771,8 @@ void ArchiveTestCase<ClassFactoryT>::ExtractArchive(wxInputStream& in)
if ((m_options & PipeIn) == 0)
OnArchiveExtracted(*arc, expectedTotal);
while (entry = EntryPtr(arc->GetNextEntry()), entry.get() != nullptr) {
while ((entry = EntryPtr(arc->GetNextEntry())).get())
{
wxString name = entry->GetName(wxPATH_UNIX);
// provide some context for the error message so that we know which
+1 -1
View File
@@ -2199,7 +2199,7 @@ TEST_CASE_METHOD(GridTestCase,
int row, col, rows, cols;
// Check main cell.
row = multi.row,
row = multi.row;
col = multi.col;
wxGrid::CellSpan span = m_grid->GetCellSize(row, col, &rows, &cols);
+6 -6
View File
@@ -463,13 +463,13 @@ static bool DoCheckConnection()
wxSocketClient sock;
sock.SetTimeout(10); // 10 secs
bool online = sock.Connect(addr) &&
(sock.Write(HTTP_GET, strlen(HTTP_GET)), sock.WaitForRead(1));
return online;
#else
return false;
if (sock.Connect(addr))
{
sock.Write(HTTP_GET, strlen(HTTP_GET));
return sock.WaitForRead(1);
}
#endif
return false;
}
extern bool IsNetworkAvailable()