Title: [174412] trunk/Source/WTF
Revision
174412
Author
[email protected]
Date
2014-10-07 16:17:04 -0700 (Tue, 07 Oct 2014)

Log Message

[Win] Resolve some MSVC static analyzer warnings
https://bugs.webkit.org/show_bug.cgi?id=137504

Reviewed by Dean Jackson.

* wtf/GregorianDateTime.cpp:
(WTF::GregorianDateTime::setToCurrentLocalTime): Properly handle
possible timezone error case.
* wtf/OSAllocatorWin.cpp:
(WTF::OSAllocator::decommit): Silence a spurious warning about using
MEM_DECOMMIT instead of MEM_RELEASE.
* wtf/ThreadingWin.cpp: Silence a spurious warning about how the
tryLock method is implemented.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (174411 => 174412)


--- trunk/Source/WTF/ChangeLog	2014-10-07 22:28:25 UTC (rev 174411)
+++ trunk/Source/WTF/ChangeLog	2014-10-07 23:17:04 UTC (rev 174412)
@@ -1,3 +1,19 @@
+2014-10-07  Brent Fulgham  <[email protected]>
+
+        [Win] Resolve some MSVC static analyzer warnings
+        https://bugs.webkit.org/show_bug.cgi?id=137504
+
+        Reviewed by Dean Jackson.
+
+        * wtf/GregorianDateTime.cpp:
+        (WTF::GregorianDateTime::setToCurrentLocalTime): Properly handle
+        possible timezone error case.
+        * wtf/OSAllocatorWin.cpp:
+        (WTF::OSAllocator::decommit): Silence a spurious warning about using
+        MEM_DECOMMIT instead of MEM_RELEASE.
+        * wtf/ThreadingWin.cpp: Silence a spurious warning about how the
+        tryLock method is implemented.
+
 2014-10-07  Christophe Dumez  <[email protected]>
 
         [WK2] Use is<>() / downcast<>() for DrawingAreaProxy subclasses

Modified: trunk/Source/WTF/wtf/GregorianDateTime.cpp (174411 => 174412)


--- trunk/Source/WTF/wtf/GregorianDateTime.cpp	2014-10-07 22:28:25 UTC (rev 174411)
+++ trunk/Source/WTF/wtf/GregorianDateTime.cpp	2014-10-07 23:17:04 UTC (rev 174412)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Patrick Gansterer <[email protected]>
+ * Copyright (C) 2012, 2014 Patrick Gansterer <[email protected]>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,13 +43,16 @@
     TIME_ZONE_INFORMATION timeZoneInformation;
     DWORD timeZoneId = GetTimeZoneInformation(&timeZoneInformation);
 
-    LONG bias = timeZoneInformation.Bias;
-    if (timeZoneId == TIME_ZONE_ID_DAYLIGHT)
-        bias += timeZoneInformation.DaylightBias;
-    else if (timeZoneId == TIME_ZONE_ID_STANDARD)
-        bias += timeZoneInformation.StandardBias;
-    else
-        ASSERT(timeZoneId == TIME_ZONE_ID_UNKNOWN);
+    LONG bias = 0;
+    if (timeZoneId != TIME_ZONE_ID_INVALID) {
+        bias = timeZoneInformation.Bias;
+        if (timeZoneId == TIME_ZONE_ID_DAYLIGHT)
+            bias += timeZoneInformation.DaylightBias;
+        else if ((timeZoneId == TIME_ZONE_ID_STANDARD) || (timeZoneId == TIME_ZONE_ID_UNKNOWN))
+            bias += timeZoneInformation.StandardBias;
+        else
+            ASSERT(0);
+    }
 
     m_year = systemTime.wYear;
     m_month = systemTime.wMonth - 1;

Modified: trunk/Source/WTF/wtf/OSAllocatorWin.cpp (174411 => 174412)


--- trunk/Source/WTF/wtf/OSAllocatorWin.cpp	2014-10-07 22:28:25 UTC (rev 174411)
+++ trunk/Source/WTF/wtf/OSAllocatorWin.cpp	2014-10-07 23:17:04 UTC (rev 174412)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -73,6 +73,8 @@
     // See: https://bugs.webkit.org/show_bug.cgi?id=121972.
     if (!bytes)
         return;
+    // Silence warning about using MEM_DECOMMIT instead of MEM_RELEASE:
+#pragma warning(suppress: 6250)
     bool result = VirtualFree(address, bytes, MEM_DECOMMIT);
     if (!result)
         CRASH();

Modified: trunk/Source/WTF/wtf/ThreadingWin.cpp (174411 => 174412)


--- trunk/Source/WTF/wtf/ThreadingWin.cpp	2014-10-07 22:28:25 UTC (rev 174411)
+++ trunk/Source/WTF/wtf/ThreadingWin.cpp	2014-10-07 23:17:04 UTC (rev 174412)
@@ -296,6 +296,7 @@
     ++m_mutex.m_recursionCount;
 }
     
+#pragma warning(suppress: 26115)
 bool Mutex::tryLock()
 {
     // This method is modeled after the behavior of pthread_mutex_trylock,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to