Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Krautz <mikkel@krautz.dk>2017-01-22 18:37:32 +0300
committerGitHub <noreply@github.com>2017-01-22 18:37:32 +0300
commit98349a1b332f22337ff8b02e68e344db15b4f6e1 (patch)
treed2e12b3f6ff3436a4b976b3e3e72273d7669e828 /plugins
parent12b9c9b9845058f0f6caf7ac603b1d82d67c41cb (diff)
parent6096b74a1c42cfeaca9cde5df76a21fc3174f167 (diff)
Merge PR #2755: plugins: Fix visibility, warnings and errors when compiled with MinGW
Diffstat (limited to 'plugins')
-rw-r--r--plugins/aoc/aoc.cpp2
-rw-r--r--plugins/arma2/arma2.cpp2
-rw-r--r--plugins/bf1942/bf1942.cpp2
-rw-r--r--plugins/bf2/bf2.cpp2
-rw-r--r--plugins/bf2142/bf2142.cpp2
-rw-r--r--plugins/bf3/bf3.cpp2
-rw-r--r--plugins/bfheroes/bfheroes.cpp2
-rw-r--r--plugins/blacklight/blacklight.cpp2
-rw-r--r--plugins/borderlands/borderlands.cpp2
-rw-r--r--plugins/breach/breach.cpp2
-rw-r--r--plugins/dys/dys.cpp2
-rw-r--r--plugins/etqw/etqw.cpp2
-rw-r--r--plugins/gmod/gmod.cpp2
-rw-r--r--plugins/gw/gw.cpp2
-rw-r--r--plugins/insurgency/insurgency.cpp2
-rw-r--r--plugins/lol/lol.cpp2
-rw-r--r--plugins/mumble_plugin.h6
-rw-r--r--plugins/mumble_plugin_win32_ptr_type.h8
-rw-r--r--plugins/ql/ql.cpp2
-rw-r--r--plugins/sto/sto.cpp5
-rw-r--r--plugins/ut2004/ut2004.cpp2
-rw-r--r--plugins/ut3/ut3.cpp2
22 files changed, 31 insertions, 26 deletions
diff --git a/plugins/aoc/aoc.cpp b/plugins/aoc/aoc.cpp
index 4162ab847..9b8ec695e 100644
--- a/plugins/aoc/aoc.cpp
+++ b/plugins/aoc/aoc.cpp
@@ -92,7 +92,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = rotptr = NULL;
+ posptr = rotptr = 0;
if (! initialize(pids, L"hl2.exe", L"client.dll"))
return false;
diff --git a/plugins/arma2/arma2.cpp b/plugins/arma2/arma2.cpp
index 4432e829f..87c6e4f55 100644
--- a/plugins/arma2/arma2.cpp
+++ b/plugins/arma2/arma2.cpp
@@ -74,7 +74,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = NULL;
+ posptr = 0;
if (! initialize(pids, L"arma2.exe"))
return false;
diff --git a/plugins/bf1942/bf1942.cpp b/plugins/bf1942/bf1942.cpp
index 7b301e8c7..db43e033e 100644
--- a/plugins/bf1942/bf1942.cpp
+++ b/plugins/bf1942/bf1942.cpp
@@ -51,7 +51,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- faceptr = topptr = NULL;
+ faceptr = topptr = 0;
if (! initialize(pids, L"BF1942.exe"))
return false;
diff --git a/plugins/bf2/bf2.cpp b/plugins/bf2/bf2.cpp
index 352a3753b..118efdee8 100644
--- a/plugins/bf2/bf2.cpp
+++ b/plugins/bf2/bf2.cpp
@@ -26,7 +26,7 @@ procptr32_t const ipport_ptr = 0x009A80B8;
procptr32_t commander_ptr, squad_leader_ptr, squad_state_ptr, team_state_ptr;
inline bool resolve_ptrs() {
- pos_ptr = face_ptr = top_ptr = commander_ptr = squad_leader_ptr = squad_state_ptr = team_state_ptr = NULL;
+ pos_ptr = face_ptr = top_ptr = commander_ptr = squad_leader_ptr = squad_state_ptr = team_state_ptr = 0;
//
// Resolve all pointer chains to the values we want to fetch
//
diff --git a/plugins/bf2142/bf2142.cpp b/plugins/bf2142/bf2142.cpp
index 9574f2265..d99c07142 100644
--- a/plugins/bf2142/bf2142.cpp
+++ b/plugins/bf2142/bf2142.cpp
@@ -61,7 +61,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = faceptr = topptr = NULL;
+ posptr = faceptr = topptr = 0;
if (! initialize(pids, L"BF2142.exe", L"BF2142Audio.dll"))
return false;
diff --git a/plugins/bf3/bf3.cpp b/plugins/bf3/bf3.cpp
index 251117b74..46ecb2cd5 100644
--- a/plugins/bf3/bf3.cpp
+++ b/plugins/bf3/bf3.cpp
@@ -71,7 +71,7 @@ enum state_values {
};
inline bool resolve_ptrs() {
- team_state_ptr = squad_state_ptr = squad_lead_state_ptr = NULL;
+ team_state_ptr = squad_state_ptr = squad_lead_state_ptr = 0;
/*
Analysis for future patches:
diff --git a/plugins/bfheroes/bfheroes.cpp b/plugins/bfheroes/bfheroes.cpp
index bda3be927..2903dceb9 100644
--- a/plugins/bfheroes/bfheroes.cpp
+++ b/plugins/bfheroes/bfheroes.cpp
@@ -46,7 +46,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = faceptr = topptr = NULL;
+ posptr = faceptr = topptr = 0;
if (! initialize(pids, L"BFHeroes.exe", L"BFAudio.dll"))
return false;
diff --git a/plugins/blacklight/blacklight.cpp b/plugins/blacklight/blacklight.cpp
index 632ecc597..5dcc777a7 100644
--- a/plugins/blacklight/blacklight.cpp
+++ b/plugins/blacklight/blacklight.cpp
@@ -75,7 +75,7 @@ static bool calcout(float *cam, float *camfront, float *camtop, float *ocam, flo
}
static bool refreshPointers(void) {
- hostipportptr = NULL;
+ hostipportptr = 0;
hostipportptr = pModule + 0xB8C57;
diff --git a/plugins/borderlands/borderlands.cpp b/plugins/borderlands/borderlands.cpp
index ab551ab7a..df7ebe298 100644
--- a/plugins/borderlands/borderlands.cpp
+++ b/plugins/borderlands/borderlands.cpp
@@ -127,7 +127,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = frontptr = topptr = contextptraddress = stateaddress = loginaddress = NULL;
+ posptr = frontptr = topptr = contextptraddress = stateaddress = loginaddress = 0;
if (!initialize(pids, L"Borderlands.exe"))
return false;
diff --git a/plugins/breach/breach.cpp b/plugins/breach/breach.cpp
index 3ca0c8e78..b06846ebb 100644
--- a/plugins/breach/breach.cpp
+++ b/plugins/breach/breach.cpp
@@ -75,7 +75,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = frontptr = topptr = NULL;
+ posptr = frontptr = topptr = 0;
if (! initialize(pids, L"Breach.exe", L"fmodex.dll"))
return false;
diff --git a/plugins/dys/dys.cpp b/plugins/dys/dys.cpp
index 2e790bbff..6d913a819 100644
--- a/plugins/dys/dys.cpp
+++ b/plugins/dys/dys.cpp
@@ -92,7 +92,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = rotptr = NULL;
+ posptr = rotptr = 0;
if (! initialize(pids, L"hl2.exe", L"client.dll"))
return false;
diff --git a/plugins/etqw/etqw.cpp b/plugins/etqw/etqw.cpp
index 039715015..0b902e2fd 100644
--- a/plugins/etqw/etqw.cpp
+++ b/plugins/etqw/etqw.cpp
@@ -95,7 +95,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- pos1ptr = pos2ptr = pos3ptr = rot1ptr = rot2ptr = NULL;
+ pos1ptr = pos2ptr = pos3ptr = rot1ptr = rot2ptr = 0;
if (! initialize(pids, L"etqw.exe", L"gamex86.dll"))
return false;
diff --git a/plugins/gmod/gmod.cpp b/plugins/gmod/gmod.cpp
index df64389cb..ae803f08c 100644
--- a/plugins/gmod/gmod.cpp
+++ b/plugins/gmod/gmod.cpp
@@ -86,7 +86,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = rotptr = NULL;
+ posptr = rotptr = 0;
if (! initialize(pids, L"hl2.exe", L"client.dll"))
return false;
diff --git a/plugins/gw/gw.cpp b/plugins/gw/gw.cpp
index fa6e46dfd..add9ea94a 100644
--- a/plugins/gw/gw.cpp
+++ b/plugins/gw/gw.cpp
@@ -112,7 +112,7 @@ static bool calcout(float *pos, float *front, float *cam, float *camfront, float
static bool refreshPointers(void)
{
- frontptr = NULL;
+ frontptr = 0;
frontptr = peekProc<procptr32_t>(frontptr_);
if (!frontptr)
diff --git a/plugins/insurgency/insurgency.cpp b/plugins/insurgency/insurgency.cpp
index fbb1e081d..2fb18f68f 100644
--- a/plugins/insurgency/insurgency.cpp
+++ b/plugins/insurgency/insurgency.cpp
@@ -92,7 +92,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- posptr = rotptr = NULL;
+ posptr = rotptr = 0;
if (! initialize(pids, L"hl2.exe", L"client.dll"))
return false;
diff --git a/plugins/lol/lol.cpp b/plugins/lol/lol.cpp
index 5bea2920d..19dc69eb6 100644
--- a/plugins/lol/lol.cpp
+++ b/plugins/lol/lol.cpp
@@ -81,7 +81,7 @@ static bool calcout(float *pos, float *cam, float *opos, float *ocam) {
}
static bool refreshPointers(void) {
- posptr = afrontptr = tmpptr = NULL;
+ posptr = afrontptr = tmpptr = 0;
// Avatar front vector pointer
tmpptr = peekProc<procptr32_t>(gameptr);
diff --git a/plugins/mumble_plugin.h b/plugins/mumble_plugin.h
index b92ae9eb8..0e2c72f00 100644
--- a/plugins/mumble_plugin.h
+++ b/plugins/mumble_plugin.h
@@ -11,14 +11,18 @@
#if defined(_MSC_VER)
# define MUMBLE_PLUGIN_CALLING_CONVENTION __cdecl
+#elif defined(__MINGW32__)
+# define MUMBLE_PLUGIN_CALLING_CONVENTION __attribute__((cdecl))
#else
# define MUMBLE_PLUGIN_CALLING_CONVENTION
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__) && !defined(__MINGW32__) // GCC on Unix-like systems
# define MUMBLE_PLUGIN_EXPORT __attribute__((visibility("default")))
#elif defined(_MSC_VER)
# define MUMBLE_PLUGIN_EXPORT __declspec(dllexport)
+#elif defined(__MINGW32__)
+# define MUMBLE_PLUGIN_EXPORT __attribute__((dllexport))
#else
# error No MUMBLE_PLUGIN_EXPORT definition available
#endif
diff --git a/plugins/mumble_plugin_win32_ptr_type.h b/plugins/mumble_plugin_win32_ptr_type.h
index da3d3c3fd..4a1384b0d 100644
--- a/plugins/mumble_plugin_win32_ptr_type.h
+++ b/plugins/mumble_plugin_win32_ptr_type.h
@@ -50,7 +50,7 @@ static inline DWORD getProcess(const wchar_t *exename) {
static inline PTR_TYPE_CONCRETE getModuleAddr(DWORD pid, const wchar_t *modname) {
MODULEENTRY32 me;
- PTR_TYPE_CONCRETE ret = NULL;
+ PTR_TYPE_CONCRETE ret = 0;
me.dwSize = sizeof(me);
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE|TH32CS_SNAPMODULE32, pid);
if (hSnap != INVALID_HANDLE_VALUE) {
@@ -97,7 +97,7 @@ T peekProc(PTR_TYPE base) {
static bool inline initialize(const std::multimap<std::wstring, unsigned long long int> &pids, const wchar_t *procname, const wchar_t *modname = NULL) {
hProcess = NULL;
- pModule = NULL;
+ pModule = 0;
if (! pids.empty()) {
std::multimap<std::wstring, unsigned long long int>::const_iterator iter = pids.find(std::wstring(procname));
@@ -122,7 +122,7 @@ static bool inline initialize(const std::multimap<std::wstring, unsigned long lo
hProcess=OpenProcess(PROCESS_VM_READ, false, dwPid);
if (!hProcess) {
dwPid = 0;
- pModule = NULL;
+ pModule = 0;
return false;
}
@@ -133,7 +133,7 @@ static void generic_unlock() {
if (hProcess) {
CloseHandle(hProcess);
hProcess = NULL;
- pModule = NULL;
+ pModule = 0;
dwPid = 0;
}
}
diff --git a/plugins/ql/ql.cpp b/plugins/ql/ql.cpp
index 207760613..cc6a71d59 100644
--- a/plugins/ql/ql.cpp
+++ b/plugins/ql/ql.cpp
@@ -84,7 +84,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
// Team
- if (team >= 0 && team <= 3) {
+ if (team <= 3) {
if (team == 0)
oidentity << std::endl << "\"Team\": \"FFA\""; // If team value is 0, set "FFA" as team in identity.
if (team == 1)
diff --git a/plugins/sto/sto.cpp b/plugins/sto/sto.cpp
index a6beff2b7..76e2c5421 100644
--- a/plugins/sto/sto.cpp
+++ b/plugins/sto/sto.cpp
@@ -3,7 +3,8 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_win32_32bit.h"
+#include "../mumble_plugin_win32_32bit.h" // Include standard plugin header.
+#include <limits> // Include limits header for the "u8" function.
static procptr32_t identptr, contextptr, posptr;
@@ -70,7 +71,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- identptr = contextptr = posptr = NULL;
+ identptr = contextptr = posptr = 0;
if (! initialize(pids, L"GameClient.exe"))
return false;
diff --git a/plugins/ut2004/ut2004.cpp b/plugins/ut2004/ut2004.cpp
index cef5a05a0..cb3812742 100644
--- a/plugins/ut2004/ut2004.cpp
+++ b/plugins/ut2004/ut2004.cpp
@@ -62,7 +62,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- pos0ptr = pos1ptr = pos2ptr = faceptr = topptr = NULL;
+ pos0ptr = pos1ptr = pos2ptr = faceptr = topptr = 0;
if (! initialize(pids, L"UT2004.exe", L"Engine.dll"))
return false;
diff --git a/plugins/ut3/ut3.cpp b/plugins/ut3/ut3.cpp
index 7974c9a89..249a48786 100644
--- a/plugins/ut3/ut3.cpp
+++ b/plugins/ut3/ut3.cpp
@@ -85,7 +85,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
- pos0ptr = pos1ptr = pos2ptr = faceptr = NULL;
+ pos0ptr = pos1ptr = pos2ptr = faceptr = 0;
if (! initialize(pids, L"UT3.exe", L"wrap_oal.dll"))
return false;