Browse Source

Priorize OpenSSL 1.0 in cmake, warning fixes

Eduardo Bart 2 years ago
parent
commit
8b161e1a07

+ 1
- 1
src/client/effect.cpp View File

@@ -24,7 +24,7 @@
24 24
 #include "map.h"
25 25
 #include <framework/core/eventdispatcher.h>
26 26
 
27
-void Effect::draw(const Point& dest, float scaleFactor, bool animate, int offsetX, int offsetY, LightView *lightView)
27
+void Effect::drawEffect(const Point& dest, float scaleFactor, bool animate, int offsetX, int offsetY, LightView *lightView)
28 28
 {
29 29
     if(m_id == 0)
30 30
         return;

+ 1
- 1
src/client/effect.h View File

@@ -35,7 +35,7 @@ class Effect : public Thing
35 35
     };
36 36
 
37 37
 public:
38
-    void draw(const Point& dest, float scaleFactor, bool animate, int offsetX = 0, int offsetY = 0, LightView *lightView = nullptr);
38
+    void drawEffect(const Point& dest, float scaleFactor, bool animate, int offsetX = 0, int offsetY = 0, LightView *lightView = nullptr);
39 39
 
40 40
     void setId(uint32 id);
41 41
     uint32 getId() { return m_id; }

+ 2
- 1
src/client/protocolgameparse.cpp View File

@@ -1351,7 +1351,7 @@ void ProtocolGame::parsePlayerStats(const InputMessagePtr& msg)
1351 1351
     double level = msg->getU16();
1352 1352
     double levelPercent = msg->getU8();
1353 1353
 
1354
-    if(g_game.getFeature(Otc::GameExperienceBonus))
1354
+    if(g_game.getFeature(Otc::GameExperienceBonus)) {
1355 1355
         if(g_game.getClientVersion() <= 1096) {
1356 1356
             double experienceBonus = msg->getDouble();
1357 1357
         } else {
@@ -1361,6 +1361,7 @@ void ProtocolGame::parsePlayerStats(const InputMessagePtr& msg)
1361 1361
             int storeBoostAddend = msg->getU16();
1362 1362
             int huntingBoostFactor = msg->getU16();
1363 1363
         }
1364
+    }
1364 1365
 
1365 1366
     double mana;
1366 1367
     double maxMana;

+ 1
- 1
src/client/tile.cpp View File

@@ -155,7 +155,7 @@ void Tile::draw(const Point& dest, float scaleFactor, int drawFlags, LightView *
155 155
     // effects
156 156
     if(drawFlags & Otc::DrawEffects)
157 157
         for(const EffectPtr& effect : m_effects)
158
-            effect->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, m_position.x - g_map.getCentralPosition().x, m_position.y - g_map.getCentralPosition().y, lightView);
158
+            effect->drawEffect(dest - m_drawElevation*scaleFactor, scaleFactor, animate, m_position.x - g_map.getCentralPosition().x, m_position.y - g_map.getCentralPosition().y, lightView);
159 159
 
160 160
     // top items
161 161
     if(drawFlags & Otc::DrawOnTop)

+ 2
- 2
src/framework/CMakeLists.txt View File

@@ -160,7 +160,7 @@ endif()
160 160
 include(FindCXX11)
161 161
 
162 162
 # gcc compile flags
163
-set(WARNS_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-unused-result")
163
+set(WARNS_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter")
164 164
 set(CMAKE_CXX_FLAGS                   "${CMAKE_CXX_FLAGS} ${WARNS_FLAGS} ${ARCH_FLAGS} ${CPP2011_FLAGS} -pipe")
165 165
 set(CMAKE_CXX_FLAGS_COMPILESPEED      "-O0")
166 166
 set(CMAKE_CXX_FLAGS_DEBUG             "-O0 -g")
@@ -234,7 +234,7 @@ set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS}
234 234
     ${Boost_INCLUDE_DIRS}
235 235
     ${LUA_INCLUDE_DIR}
236 236
     ${PHYSFS_INCLUDE_DIR}
237
-    ${OpenSSL_INCLUDE_DIR}
237
+    ${OPENSSL_INCLUDE_DIR}
238 238
     ${framework_INCLUDE_DIRS}
239 239
 )
240 240
 

+ 5
- 5
src/framework/cmake/FindOpenSSL.cmake View File

@@ -3,17 +3,17 @@
3 3
 #  OPENSSL_INCLUDE_DIR - the OpenSSL include directory
4 4
 #  OPENSSL_LIBRARY - the OpenSSL library
5 5
 
6
-FIND_PATH(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h)
6
+FIND_PATH(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h PATH_SUFFIXES openssl-1.0)
7 7
 SET(_OPENSSL_STATIC_LIBS libssl.a)
8 8
 SET(_OPENSSL_SHARED_LIBS libssl.dll.a ssl)
9 9
 SET(_OPENSSL_CRYPTO_STATIC_LIBS libcrypto.a)
10 10
 SET(_OPENSSL_CRYPTO_SHARED_LIBS libcrypto.dll.a crypto)
11 11
 IF(USE_STATIC_LIBS)
12
-    FIND_LIBRARY(OPENSSL_LIBRARY NAMES ${_OPENSSL_STATIC_LIBS} ${_OPENSSL_SHARED_LIBS})
13
-    FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY NAMES ${_OPENSSL_CRYPTO_STATIC_LIBS} ${_OPENSSL_CRYPTO_SHARED_LIBS})
12
+    FIND_LIBRARY(OPENSSL_LIBRARY NAMES ${_OPENSSL_STATIC_LIBS} ${_OPENSSL_SHARED_LIBS} PATH_SUFFIXES openssl-1.0)
13
+    FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY NAMES ${_OPENSSL_CRYPTO_STATIC_LIBS} ${_OPENSSL_CRYPTO_SHARED_LIBS} PATH_SUFFIXES openssl-1.0)
14 14
 ELSE()
15
-    FIND_LIBRARY(OPENSSL_LIBRARY NAMES ${_OPENSSL_SHARED_LIBS} ${_OPENSSL_STATIC_LIBS})
16
-    FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY NAMES ${_OPENSSL_CRYPTO_SHARED_LIBS} ${_OPENSSL_CRYPTO_STATIC_LIBS})
15
+    FIND_LIBRARY(OPENSSL_LIBRARY NAMES ${_OPENSSL_SHARED_LIBS} ${_OPENSSL_STATIC_LIBS} PATH_SUFFIXES openssl-1.0)
16
+    FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY NAMES ${_OPENSSL_CRYPTO_SHARED_LIBS} ${_OPENSSL_CRYPTO_STATIC_LIBS} PATH_SUFFIXES openssl-1.0)
17 17
 ENDIF()
18 18
 SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
19 19
 INCLUDE(FindPackageHandleStandardArgs)

+ 1
- 1
src/framework/stdext/math.cpp View File

@@ -30,7 +30,7 @@
30 30
 namespace stdext {
31 31
 
32 32
 uint32_t adler32(const uint8_t *buffer, size_t size) {
33
-    register size_t a = 1, b = 0, tlen;
33
+    size_t a = 1, b = 0, tlen;
34 34
     while(size > 0) {
35 35
         tlen = size > 5552 ? 5552 : size;
36 36
         size -= tlen;

+ 4
- 1
src/framework/util/crypt.cpp View File

@@ -143,7 +143,7 @@ std::string Crypt::xorCrypt(const std::string& buffer, const std::string& key)
143 143
 {
144 144
     std::string out;
145 145
     out.resize(buffer.size());
146
-    register size_t i, j=0;
146
+    size_t i, j=0;
147 147
     for(i=0;i<buffer.size();++i) {
148 148
         out[i] = buffer[i] ^ key[j++];
149 149
         if(j >= key.size())
@@ -307,6 +307,8 @@ std::string Crypt::sha512Encode(const std::string& decoded_string, bool upperCas
307 307
 
308 308
 void Crypt::rsaGenerateKey(int bits, int e)
309 309
 {
310
+    // disabled because new OpenSSL changes broke
311
+    /*
310 312
     RSA *rsa = RSA_new();
311 313
     BIGNUM *ebn = BN_new();
312 314
     BN_set_word(ebn, e);
@@ -319,6 +321,7 @@ void Crypt::rsaGenerateKey(int bits, int e)
319 321
     g_logger.info(std::string("e = ") + BN_bn2dec(m_rsa->e));
320 322
     BN_clear_free(ebn);
321 323
     RSA_free(rsa);
324
+    */
322 325
 }
323 326
 
324 327
 void Crypt::rsaSetPublicKey(const std::string& n, const std::string& e)

+ 4
- 0
src/framework/xml/tinyxmlparser.cpp View File

@@ -107,18 +107,22 @@ void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* leng
107 107
     // Scary scary fall throughs.
108 108
     switch (*length)
109 109
     {
110
+        /* FALLTHROUGH */
110 111
         case 4:
111 112
             --output;
112 113
             *output = (char)((input | BYTE_MARK) & BYTE_MASK);
113 114
             input >>= 6;
115
+        /* FALLTHROUGH */
114 116
         case 3:
115 117
             --output;
116 118
             *output = (char)((input | BYTE_MARK) & BYTE_MASK);
117 119
             input >>= 6;
120
+        /* FALLTHROUGH */
118 121
         case 2:
119 122
             --output;
120 123
             *output = (char)((input | BYTE_MARK) & BYTE_MASK);
121 124
             input >>= 6;
125
+        /* FALLTHROUGH */
122 126
         case 1:
123 127
             --output;
124 128
             *output = (char)(input | FIRST_BYTE_MARK[*length]);

Loading…
Cancel
Save