File: 0002-Fix-some-assertion-errors-from-calls-to-the-logger.patch

package info (click to toggle)
freespace2-launcher-wxlauncher 0.12.0~rc3%2Bdfsg-1.1
  • links: PTS, VCS
  • area: contrib
  • in suites: sid
  • size: 2,620 kB
  • sloc: cpp: 13,683; python: 818; sh: 55; makefile: 14
file content (51 lines) | stat: -rw-r--r-- 2,141 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 4c61d2a68bdefd3b3270afede832caf1310ce577 Mon Sep 17 00:00:00 2001
From: Yuri Pieters <magejohnyjtp@gmail.com>
Date: Tue, 13 Dec 2022 17:57:52 +0000
Subject: Fix some assertion errors from calls to the logger

---
 code/apis/ProfileManager.cpp          | 6 +++---
 code/datastructures/FSOExecutable.cpp | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

--- a/code/apis/ProfileManager.cpp
+++ b/code/apis/ProfileManager.cpp
@@ -135,9 +135,9 @@
 	// fetch all profiles.
 	wxArrayString foundProfiles;
 	wxDir::GetAllFiles(GetProfileStorageFolder(), &foundProfiles, wxT_2("pro?????.ini"));
 
-	wxLogInfo(wxT_2(" Found %d profile(s)."), foundProfiles.Count());
+	wxLogInfo(wxT_2(" Found %u profile(s)."), static_cast<unsigned>(foundProfiles.Count()));
 	for( size_t i = 0; i < foundProfiles.Count(); i++) {
 		wxLogDebug(wxT_2("  Opening %s"), foundProfiles[i].c_str());
 		wxFFileInputStream instream(foundProfiles[i]);
 		wxFileConfig *config = new wxFileConfig(instream);
@@ -1429,10 +1429,10 @@
 	
 	wxLogDebug(_T("contents of dest config after clearing:"));
 	LogConfigContents(*dest);
 	
-	wxLogDebug(_T("after clearing, dest has %d entries and %d groups"),
-		dest->GetNumberOfEntries(true), dest->GetNumberOfGroups(true));
+	wxLogDebug(_T("after clearing, dest has %u entries and %u groups"),
+		static_cast<unsigned>(dest->GetNumberOfEntries(true)), static_cast<unsigned>(dest->GetNumberOfGroups(true)));
 	
 	wxLogDebug(_T("recopying src to dest"));
 	
 	CopyConfig(src, *dest);
--- a/code/datastructures/FSOExecutable.cpp
+++ b/code/datastructures/FSOExecutable.cpp
@@ -177,10 +177,10 @@
 #endif
 	
 	if (!quiet) {
 		wxString execType = globPattern.Lower().Find(_T("fred")) == wxNOT_FOUND ? _T("FS2") : _T("FRED2");
-		wxLogInfo(_T(" Found %d %s Open executables in '%s'"),
-			files.GetCount(), execType.c_str(), path.GetPath().c_str());
+		wxLogInfo(_T(" Found %u %s Open executables in '%s'"),
+			static_cast<unsigned>(files.GetCount()), execType.c_str(), path.GetPath().c_str());
 		
 		for (size_t i = 0, n = files.GetCount(); i < n; ++i) {
 			wxLogDebug(_T("Found executable: %s"), files.Item(i).c_str());
 		}