forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aqsis-1.8.2-gcc6.patch
23 lines (20 loc) · 1.01 KB
/
aqsis-1.8.2-gcc6.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From d450f4aac8c107f82b18df7789afb52b502eaba0 Mon Sep 17 00:00:00 2001
From: Hodorgasm <[email protected]>
Date: Mon, 19 Sep 2016 22:58:44 -0400
Subject: [PATCH] Use "!file.fail()" instead of "file != NULL"
Pre-C++11 defined an implicit cast from ifstream to "void *" and post C++11 replaced it with an explicit cast of ifstream to "bool". Testing an ifstream with "!ifstream.fail()" should work regardless of the C++ dialect.
---
libs/core/texturing_old/shadowmap_old.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/core/texturing_old/shadowmap_old.cpp b/libs/core/texturing_old/shadowmap_old.cpp
index 1a22491..fbcac59 100644
--- a/libs/core/texturing_old/shadowmap_old.cpp
+++ b/libs/core/texturing_old/shadowmap_old.cpp
@@ -176,7 +176,7 @@ void CqShadowMapOld::LoadZFile()
{
std::ifstream file( m_strName.c_str(), std::ios::in | std::ios::binary );
- if ( file != NULL )
+ if ( !file.fail() )
{
// Save a file type and version marker
TqPchar origHeader = tokenCast(ZFILE_HEADER);