File: 0002-Fix-compiler-warnings.patch

package info (click to toggle)
libosl 0.8.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,328 kB
  • sloc: cpp: 114,345; ruby: 1,290; ansic: 915; makefile: 431; perl: 309; sh: 35
file content (82 lines) | stat: -rw-r--r-- 2,700 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
From d4626f1d75781b6f48e1fc49ed9f3d8acdc7c1c0 Mon Sep 17 00:00:00 2001
From: Daigo Moriwaki <daigo@debian.org>
Date: Sun, 4 Dec 2016 11:15:38 +0900
Subject: [PATCH 02/11] Fix compiler warnings

---
 core/osl/basic_type.h        |  2 +-
 core/osl/bits/ptypeTraits.h  |  2 +-
 full/osl/search/usiProxy.cc  |  5 +++--
 std/osl/hash/hashKeyStack.cc | 14 ++++++++++----
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/core/osl/basic_type.h b/core/osl/basic_type.h
index c55f4a695..4e8bd697c 100644
--- a/core/osl/basic_type.h
+++ b/core/osl/basic_type.h
@@ -1059,7 +1059,7 @@ namespace osl
     }
     enum { 
       INVALID_VALUE = (1<<8), DECLARE_WIN = (2<<8),
-      BLACK_PASS = 0, WHITE_PASS = (-1)<<28, 
+      BLACK_PASS = 0, WHITE_PASS = ((unsigned) -1)<<28, 
     };
   public:
     int intValue() const { return move; }
diff --git a/core/osl/bits/ptypeTraits.h b/core/osl/bits/ptypeTraits.h
index 513f0d978..37f1c7411 100644
--- a/core/osl/bits/ptypeTraits.h
+++ b/core/osl/bits/ptypeTraits.h
@@ -292,7 +292,7 @@ namespace osl
   template<Ptype T>
   struct PtypeFunsSub<T,true>
   {
-    static const uint64_t indexMask=(-1LL<<(PtypeTraits<T>::indexMin))^(-1LL<<(PtypeTraits<T>::indexLimit));
+    static const uint64_t indexMask=(((unsigned long long) -1)<<(PtypeTraits<T>::indexMin))^(((unsigned long long) -1)<<(PtypeTraits<T>::indexLimit));
     static const Ptype promotePtype=static_cast<Ptype>(static_cast<int>(T)-8);
     static const Ptype basicType = T;
   };
diff --git a/full/osl/search/usiProxy.cc b/full/osl/search/usiProxy.cc
index 7a5c8bdf1..e21ae2f70 100644
--- a/full/osl/search/usiProxy.cc
+++ b/full/osl/search/usiProxy.cc
@@ -43,8 +43,9 @@ struct osl::search::UsiProxy::Proxy
   Proxy(const std::string& name) : program(name), current(nullptr),
 				   quit(false) {
 #ifndef _WIN32
-    ::pipe(pipe_in);
-    ::pipe(pipe_out);
+    if ( ::pipe(pipe_in) != 0 || ::pipe(pipe_out) != 0 ) {
+	throw std::runtime_error("error upon creating pipes");
+    }
     std::cerr << "new proxy " << program << std::endl;
     if ( (pid = fork()) == 0 ) {
       // child
diff --git a/std/osl/hash/hashKeyStack.cc b/std/osl/hash/hashKeyStack.cc
index 278b652c2..1b82e1d4e 100644
--- a/std/osl/hash/hashKeyStack.cc
+++ b/std/osl/hash/hashKeyStack.cc
@@ -30,10 +30,16 @@ HashKeyStack::dump() const
 #endif
 }
 
-bool osl::hash::operator==(const HashKeyStack& l, const HashKeyStack& r)
-{
-  return l.data == r.data;
-}
+namespace osl {
+  namespace hash {
+
+    bool operator==(const HashKeyStack& l, const HashKeyStack& r)
+    {
+      return l.data == r.data;
+    }
+
+  } // namespace hash
+} // namespace osl
 
 // ;;; Local Variables:
 // ;;; mode:c++
-- 
2.33.0