Bug 1205148 - Fix and disallow warnings in rdf/datasource/. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 29 Sep 2015 17:03:07 -0700
changeset 265084 b308d1901a371aebb1ed2183d62b921f6b0d8ac1
parent 265083 5f2acd473d59258a30d0116cec2144e378832d83
child 265085 ce3c0f04de503847d4e6f144fbb474a020177b44
push id65836
push usernnethercote@mozilla.com
push dateWed, 30 Sep 2015 00:04:02 +0000
treeherdermozilla-inbound@b308d1901a37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1205148
milestone44.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 1205148 - Fix and disallow warnings in rdf/datasource/. r=froydnj.
rdf/datasource/moz.build
rdf/datasource/nsFileSystemDataSource.cpp
--- a/rdf/datasource/moz.build
+++ b/rdf/datasource/moz.build
@@ -18,10 +18,8 @@ FINAL_LIBRARY = 'xul'
 # "This is a dependency on rdfutil.h: it'll go away once that becomes
 # a first-class XPCOM interface."
 LOCAL_INCLUDES += [
     '/rdf/base',
 ]
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wshadow']
-else:
-    ALLOW_COMPILER_WARNINGS = True
--- a/rdf/datasource/nsFileSystemDataSource.cpp
+++ b/rdf/datasource/nsFileSystemDataSource.cpp
@@ -846,17 +846,17 @@ FileSystemDataSource::GetVolumeList(nsIS
 #ifdef XP_WIN
 
     int32_t         driveType;
     wchar_t         drive[32];
     int32_t         volNum;
 
     for (volNum = 0; volNum < 26; volNum++)
     {
-        swprintf( drive, L"%c:\\", volNum + (char16_t)'A');
+        swprintf_s(drive, 32, L"%c:\\", volNum + (char16_t)'A');
 
         driveType = GetDriveTypeW(drive);
         if (driveType != DRIVE_UNKNOWN && driveType != DRIVE_NO_ROOT_DIR)
         {
           nsAutoCString url;
           url.AppendPrintf("file:///%c|/", volNum + 'A');
           nsresult rv = mRDFService->GetResource(url, getter_AddRefs(vol));
           if (NS_FAILED(rv))