From 651e7f664ddabc11cafd8d563d3ded8d12b8cdd0 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 15 Dec 2020 20:48:58 +0000 Subject: [PATCH] Fix type-cast in page_layout_reader.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wksFile.Read() call returns a size_t which is then compared with a int. Make the filelen variable a size_t to make sure it is of the correct width. Fixes the following warning: kicad/common/page_layout/page_layout_reader.cpp: In member function ‘void WS_DATA_MODEL::SetPageLayout(const wxString&, bool)’: kicad/common/page_layout/page_layout_reader.cpp:853:41: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 853 | if( wksFile.Read( buffer, filelen ) != filelen ) --- common/page_layout/page_layout_reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/page_layout/page_layout_reader.cpp b/common/page_layout/page_layout_reader.cpp index c6f52b1edb..472b27d900 100644 --- a/common/page_layout/page_layout_reader.cpp +++ b/common/page_layout/page_layout_reader.cpp @@ -847,7 +847,7 @@ void WS_DATA_MODEL::SetPageLayout( const wxString& aFullFileName, bool Append ) return; } - int filelen = wksFile.Length(); + size_t filelen = wksFile.Length(); char * buffer = new char[filelen+10]; if( wksFile.Read( buffer, filelen ) != filelen )