严格要求代码,排除编译警告

This commit is contained in:
Stone 2016-06-18 07:16:31 +00:00
parent 64eb17e6f4
commit cb18316376
8 changed files with 12 additions and 12 deletions

View File

@ -40,7 +40,7 @@ void WeakStore::Init()
{
assert(Magic, "未指定幻数");
debug_printf("初始化 0x%08X幻数 %s\r\n", Data.GetBuffer(), Magic);
debug_printf("初始化 0x%08X幻数 %s\r\n", (uint)Data.GetBuffer(), Magic);
Data.Clear();
Data.Copy(0, (byte*)Magic, MagicLength);
}

View File

@ -36,7 +36,7 @@ public:
}
// 是否广播地址全0或全1
bool IsBroadcast() { return !v4 && !v2 || v4 == 0xFFFFFFFF && v2 == 0xFFFF; }
bool IsBroadcast() { return (!v4 && !v2) || (v4 == 0xFFFFFFFF && v2 == 0xFFFF); }
MacAddr& operator=(UInt64 v)
{

View File

@ -12,7 +12,7 @@ DataMessage::DataMessage(const Message& msg, Stream* dest, bool isTokenMsg) : _S
// 读取请求、写入响应、错误响应 等包含偏移和长度
byte code = msg.Code & 0x0F;
if(code == 0x05 && !msg.Reply || code == 0x06 && msg.Reply || msg.Error)
if((code == 0x05 && !msg.Reply) || (code == 0x06 && msg.Reply) || msg.Error)
Length = _Src.ReadEncodeInt();
}

View File

@ -75,10 +75,10 @@ String& JoinMessage::ToStr(String& str) const
else
{
str += "#";
str += " Server=" + Server;
str += " Channel=" + Channel;
str += " Speed=" + Speed;
str += " Address=" + Address;
str = str + " Server=" + Server;
str = str + " Channel=" + Channel;
str = str + " Speed=" + Speed;
str = str + " Address=" + Address;
str = str + " Password=" + Password;
str.Format(" TranID=%08X", TranID);
str = str + " HardID=" + HardID;

View File

@ -253,7 +253,7 @@ bool TinyClient::Report(uint offset, const Buffer& bs)
void TinyClient::ReportAsync(uint offset,uint length)
{
if(this == nullptr) return;
//if(this == nullptr) return;
if(offset + length >= Store.Data.Length()) return;
NextReport = offset;

View File

@ -588,7 +588,7 @@ void TinyController::Loop()
Buffer bs(node.Data, node.Length);
if(node.Length <= 0 || node.Length > 32)
{
debug_printf("node=0x%08x Length=%d Seq=0x%02X Times=%d Next=%d EndTime=%d\r\n", &node, node.Length, node.Seq, node.Times, (uint)node.Next, (uint)node.EndTime);
debug_printf("node=0x%08x Length=%d Seq=0x%02X Times=%d Next=%d EndTime=%d\r\n", (uint)&node, node.Length, node.Seq, node.Times, (uint)node.Next, (uint)node.EndTime);
}
if(node.Mac[0])
Port->Write(bs, &node.Mac[1]);

View File

@ -532,9 +532,9 @@ void DevicesManagement::DeviceRequest(DeviceAtions act, const Device* dv)
TS("DevicesManagement::DeviceRequest");
bool PortOk = true;
if (Port == nullptr)PortOk = false;
if (!Port)PortOk = false;
if (Port->Status < 2) PortOk = false;
if(Port == false)debug_printf("Port Not Realy\r\n");
if(!Port)debug_printf("Port Not Realy\r\n");
byte id = dv->Address;
switch (act)

View File

@ -107,7 +107,7 @@ void TokenMessage::Show() const
byte code = Code;
if(Reply) code |= 0x80;
if(!Reply && OneWay || Reply && Error) code |= (1 << 6);
if((!Reply && OneWay) || (Reply && Error)) code |= (1 << 6);
debug_printf("%02X", code);
if(Reply)