改了 bool BOOL 和int int 那两个错仍然不行,主要报错在这两个地方
src/socks/SocksMgr.cpp:158:15: error: cast from ‘void*’ to ‘int’ loses precision [-fpermissive]
int s = (int)lpParameter;
^
src/socks/SocksMgr.cpp: In member function ‘bool CSocksMgr::Begin(LPCSTR, int, LPCSTR, int)’:
src/socks/SocksMgr.cpp:291:34: error: cast from ‘CSocksMgr*’ to ‘uint32_t {aka unsigned int}’ loses precision [-fpermissive]
proxy->lpParameter = (uint32_t)this;
全部报错是
g++ -c src/Tunnel.cpp -o src/Tunnel.o -I./src -DLINUX
In file included from src/stdafx.h:52:0,
from src/Tunnel.cpp:1:
src/utils/AutoCleanup.h:105:38: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
bool WaitForEnd(DWORD dwTimeoutMS = INFINITE)
^
src/utils/AutoCleanup.h: In constructor ‘Thread::Thread()’:
src/utils/AutoCleanup.h:68:19: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
, m_dwThreadId(0)
^
src/utils/AutoCleanup.h: In destructor ‘Thread::~Thread()’:
src/utils/AutoCleanup.h:74:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL != m_hThread)
^
src/utils/AutoCleanup.h: In member function ‘bool Thread::Start(LPTHREAD_START_ROUTINE, LPVOID)’:
src/utils/AutoCleanup.h:84:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL != m_hThread) return FALSE;
^
src/utils/AutoCleanup.h: In member function ‘bool Thread::WaitForEnd(DWORD)’:
src/utils/AutoCleanup.h:107:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL == m_hThread) return TRUE;
^
src/utils/AutoCleanup.h:118:22: warning: NULL used in arithmetic [-Wpointer-arith]
if (dwTimeoutMS == INFINITE)
^
src/utils/AutoCleanup.h:131:14: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
m_hThread = NULL;
^
src/utils/AutoCleanup.h: In member function ‘void Thread::Terminate()’:
src/utils/AutoCleanup.h:148:13: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
m_hThread = NULL;
^
src/Tunnel.cpp: In member function ‘DWORD CTunnel::TCPTunnelProc(LPVOID)’:
src/Tunnel.cpp:214:16: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
t1.WaitForEnd();
^
src/Tunnel.cpp:215:16: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
t2.WaitForEnd();
^
src/Tunnel.cpp: In member function ‘bool CTunnel::Begin(int, int)’:
src/Tunnel.cpp:247:16: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
t1.WaitForEnd();
^
src/Tunnel.cpp:248:16: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
t2.WaitForEnd();
^
g++ -c src/xsocks.cpp -o src/xsocks.o -I./src -DLINUX
In file included from src/stdafx.h:52:0,
from src/xsocks.cpp:1:
src/utils/AutoCleanup.h:105:38: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
bool WaitForEnd(DWORD dwTimeoutMS = INFINITE)
^
src/utils/AutoCleanup.h: In constructor ‘Thread::Thread()’:
src/utils/AutoCleanup.h:68:19: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
, m_dwThreadId(0)
^
src/utils/AutoCleanup.h: In destructor ‘Thread::~Thread()’:
src/utils/AutoCleanup.h:74:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL != m_hThread)
^
src/utils/AutoCleanup.h: In member function ‘bool Thread::Start(LPTHREAD_START_ROUTINE, LPVOID)’:
src/utils/AutoCleanup.h:84:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL != m_hThread) return FALSE;
^
src/utils/AutoCleanup.h: In member function ‘bool Thread::WaitForEnd(DWORD)’:
src/utils/AutoCleanup.h:107:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL == m_hThread) return TRUE;
^
src/utils/AutoCleanup.h:118:22: warning: NULL used in arithmetic [-Wpointer-arith]
if (dwTimeoutMS == INFINITE)
^
src/utils/AutoCleanup.h:131:14: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
m_hThread = NULL;
^
src/utils/AutoCleanup.h: In member function ‘void Thread::Terminate()’:
src/utils/AutoCleanup.h:148:13: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
m_hThread = NULL;
^
g++ -c src/stdafx.cpp -o src/stdafx.o -I./src -DLINUX
In file included from src/stdafx.h:52:0,
from src/stdafx.cpp:5:
src/utils/AutoCleanup.h:105:38: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
bool WaitForEnd(DWORD dwTimeoutMS = INFINITE)
^
src/utils/AutoCleanup.h: In constructor ‘Thread::Thread()’:
src/utils/AutoCleanup.h:68:19: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
, m_dwThreadId(0)
^
src/utils/AutoCleanup.h: In destructor ‘Thread::~Thread()’:
src/utils/AutoCleanup.h:74:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL != m_hThread)
^
src/utils/AutoCleanup.h: In member function ‘bool Thread::Start(LPTHREAD_START_ROUTINE, LPVOID)’:
src/utils/AutoCleanup.h:84:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL != m_hThread) return FALSE;
^
src/utils/AutoCleanup.h: In member function ‘bool Thread::WaitForEnd(DWORD)’:
src/utils/AutoCleanup.h:107:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL == m_hThread) return TRUE;
^
src/utils/AutoCleanup.h:118:22: warning: NULL used in arithmetic [-Wpointer-arith]
if (dwTimeoutMS == INFINITE)
^
src/utils/AutoCleanup.h:131:14: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
m_hThread = NULL;
^
src/utils/AutoCleanup.h: In member function ‘void Thread::Terminate()’:
src/utils/AutoCleanup.h:148:13: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
m_hThread = NULL;
^
g++ -c src/socks/SocksMgr.cpp -o src/socks/SocksMgr.o -I./src -DLINUX
In file included from ./src/stdafx.h:52:0,
from src/socks/SocksMgr.cpp:1:
./src/utils/AutoCleanup.h:105:38: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
bool WaitForEnd(DWORD dwTimeoutMS = INFINITE)
^
./src/utils/AutoCleanup.h: In constructor ‘Thread::Thread()’:
./src/utils/AutoCleanup.h:68:19: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
, m_dwThreadId(0)
^
./src/utils/AutoCleanup.h: In destructor ‘Thread::~Thread()’:
./src/utils/AutoCleanup.h:74:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL != m_hThread)
^
./src/utils/AutoCleanup.h: In member function ‘bool Thread::Start(LPTHREAD_START_ROUTINE, LPVOID)’:
./src/utils/AutoCleanup.h:84:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL != m_hThread) return FALSE;
^
./src/utils/AutoCleanup.h: In member function ‘bool Thread::WaitForEnd(DWORD)’:
./src/utils/AutoCleanup.h:107:15: warning: NULL used in arithmetic [-Wpointer-arith]
if (NULL == m_hThread) return TRUE;
^
./src/utils/AutoCleanup.h:118:22: warning: NULL used in arithmetic [-Wpointer-arith]
if (dwTimeoutMS == INFINITE)
^
./src/utils/AutoCleanup.h:131:14: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
m_hThread = NULL;
^
./src/utils/AutoCleanup.h: In member function ‘void Thread::Terminate()’:
./src/utils/AutoCleanup.h:148:13: warning: converting to non-pointer type ‘HANDLE {aka long unsigned int}’ from NULL [-Wconversion-null]
m_hThread = NULL;
^
src/socks/SocksMgr.cpp: In member function ‘DWORD CSocksMgr::TCPTunnelProc(LPVOID)’:
src/socks/SocksMgr.cpp:88:16: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
t1.WaitForEnd();
^
src/socks/SocksMgr.cpp:89:16: warning: converting to non-pointer type ‘DWORD {aka long unsigned int}’ from NULL [-Wconversion-null]
t2.WaitForEnd();
^
src/socks/SocksMgr.cpp: In member function ‘DWORD CSocksMgr::ForwardProc(void*)’:
src/socks/SocksMgr.cpp:158:15: error: cast from ‘void*’ to ‘int’ loses precision [-fpermissive]
int s = (int)lpParameter;
^
src/socks/SocksMgr.cpp: In member function ‘bool CSocksMgr::Begin(LPCSTR, int, LPCSTR, int)’:
src/socks/SocksMgr.cpp:291:34: error: cast from ‘CSocksMgr*’ to ‘uint32_t {aka unsigned int}’ loses precision [-fpermissive]
proxy->lpParameter = (uint32_t)this;
^
src/socks/SocksMgr.cpp: In member function ‘bool CSocksMgr::Begin(LPCSTR, int)’:
src/socks/SocksMgr.cpp:336:34: error: cast from ‘CSocksMgr*’ to ‘uint32_t {aka unsigned int}’ loses precision [-fpermissive]
proxy->lpParameter = (uint32_t)this;
^
src/socks/SocksMgr.cpp: In member function ‘bool CSocksMgr::Begin(int)’:
src/socks/SocksMgr.cpp:386:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
t.Start((LPTHREAD_START_ROUTINE)Forward,(void*)rs);
^
make: *** [src/socks/SocksMgr.o] Error 1