Bug 1124029 - Suppress different __unaligned qualifiers warnings. r=froydnj
authorXidorn Quan <quanxunzhen@gmail.com>
Tue, 27 Jan 2015 08:37:38 +1100
changeset 225895 47834f1829b9e662995afaf331cc79a3cb6c6cda
parent 225894 adbc9eec0490b4739179f3888d5debe1d221e678
child 225896 c1cb74f492e16bf002bda6196b70fc334d087d8e
push id28179
push usercbook@mozilla.com
push dateTue, 27 Jan 2015 14:24:11 +0000
treeherdermozilla-central@232401a6d1cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1124029
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1124029 - Suppress different __unaligned qualifiers warnings. r=froydnj
xpcom/io/nsLocalFileWin.cpp
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -149,17 +149,18 @@ private:
     DWORD attributes = GetFileAttributesW(mResolvedPath.get());
     if (INVALID_FILE_ATTRIBUTES == attributes) {
       return NS_ERROR_FILE_INVALID_PATH;
     }
 
     HRESULT hr;
     if (attributes & FILE_ATTRIBUTE_DIRECTORY) {
       // We have a directory so we should open the directory itself.
-      ITEMIDLIST* dir = ILCreateFromPathW(mResolvedPath.get());
+      ITEMIDLIST* dir =
+        static_cast<ITEMIDLIST*>(ILCreateFromPathW(mResolvedPath.get()));
       if (!dir) {
         return NS_ERROR_FAILURE;
       }
 
       const ITEMIDLIST* selection[] = { dir };
       UINT count = ArrayLength(selection);
 
       //Perform the open of the directory.
@@ -172,23 +173,25 @@ private:
       if (len > MAX_PATH) {
         return NS_ERROR_FILE_INVALID_PATH;
       }
       WCHAR parentDirectoryPath[MAX_PATH + 1] = { 0 };
       wcsncpy(parentDirectoryPath, mResolvedPath.get(), MAX_PATH);
       PathRemoveFileSpecW(parentDirectoryPath);
 
       // We have a file so we should open the parent directory.
-      ITEMIDLIST* dir = ILCreateFromPathW(parentDirectoryPath);
+      ITEMIDLIST* dir =
+        static_cast<ITEMIDLIST*>(ILCreateFromPathW(parentDirectoryPath));
       if (!dir) {
         return NS_ERROR_FAILURE;
       }
 
       // Set the item in the directory to select to the file we want to reveal.
-      ITEMIDLIST* item = ILCreateFromPathW(mResolvedPath.get());
+      ITEMIDLIST* item =
+        static_cast<ITEMIDLIST*>(ILCreateFromPathW(mResolvedPath.get()));
       if (!item) {
         CoTaskMemFree(dir);
         return NS_ERROR_FAILURE;
       }
 
       const ITEMIDLIST* selection[] = { item };
       UINT count = ArrayLength(selection);