mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-24 07:24:31 +08:00
Avoid some -Wcomma warnings
This commit is contained in:
+12
-4
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user