Commit 5acc9a41 authored by captainwong's avatar captainwong

fix gcc warnings

parent b01215da
...@@ -201,7 +201,7 @@ void handle_com_passthrough(ThreadContext* context, Client& client, evbuffer* ou ...@@ -201,7 +201,7 @@ void handle_com_passthrough(ThreadContext* context, Client& client, evbuffer* ou
client.zones[zp.zone] = zplc; client.zones[zp.zone] = zplc;
snprintf(buf, sizeof(buf), getZoneFormatString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)), zp.zone); snprintf(buf, sizeof(buf), getZoneFormatString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)), zp.zone);
printf("\t\tZone:"); printf("\t\tZone:");
printf(buf); printf("%s", buf);
printf(" Prop:0x%02X %s\n", zp.prop, zonePropertyToStringEn(zp.prop)); printf(" Prop:0x%02X %s\n", zp.prop, zonePropertyToStringEn(zp.prop));
} }
XDataPtr xdata; XDataPtr xdata;
...@@ -259,7 +259,7 @@ void handle_com_passthrough(ThreadContext* context, Client& client, evbuffer* ou ...@@ -259,7 +259,7 @@ void handle_com_passthrough(ThreadContext* context, Client& client, evbuffer* ou
client.zones[zone].tamper_enabled = true; client.zones[zone].tamper_enabled = true;
snprintf(buf, sizeof(buf), getZoneFormatString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)), zone); snprintf(buf, sizeof(buf), getZoneFormatString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)), zone);
printf("\t\tZone:"); printf("\t\tZone:");
printf(buf); printf("%s", buf);
printf(" Tamper Enabled: true\n"); printf(" Tamper Enabled: true\n");
} }
XDataPtr xdata; XDataPtr xdata;
...@@ -296,9 +296,9 @@ void handle_com_passthrough(ThreadContext* context, Client& client, evbuffer* ou ...@@ -296,9 +296,9 @@ void handle_com_passthrough(ThreadContext* context, Client& client, evbuffer* ou
client.status2 = b1.data.cmd.status2 == 0 ? MachineStatus::Arm : MachineStatus::Disarm; client.status2 = b1.data.cmd.status2 == 0 ? MachineStatus::Arm : MachineStatus::Disarm;
client.status3 = b1.data.cmd.status3 == 0 ? MachineStatus::Arm : MachineStatus::Disarm; client.status3 = b1.data.cmd.status3 == 0 ? MachineStatus::Arm : MachineStatus::Disarm;
printf("\t\t status1: %d %s\n\t\t status2: %d %s\n\t\t status3: %d %s\n", printf("\t\t status1: %d %s\n\t\t status2: %d %s\n\t\t status3: %d %s\n",
client.status1, machineStatusToString(client.status1), (int)client.status1, machineStatusToString(client.status1),
client.status2, machineStatusToString(client.status2), (int)client.status2, machineStatusToString(client.status2),
client.status3, machineStatusToString(client.status3)); (int)client.status3, machineStatusToString(client.status3));
break; break;
} }
case com::ResponseParser::ResponseType::Invalid_response: case com::ResponseParser::ResponseType::Invalid_response:
...@@ -861,20 +861,20 @@ int main(int argc, char** argv) ...@@ -861,20 +861,20 @@ int main(int argc, char** argv)
client.fd, client.acct.data(), client.ademco_id, client.fd, client.acct.data(), client.ademco_id,
machineTypeToString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type))); machineTypeToString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)));
printf(" status1: %d %s status2: %d %s status3: %d %s\n", printf(" status1: %d %s status2: %d %s status3: %d %s\n",
client.status1, machineStatusToString(client.status1), (int)client.status1, machineStatusToString(client.status1),
client.status2, machineStatusToString(client.status2), (int)client.status2, machineStatusToString(client.status2),
client.status3, machineStatusToString(client.status3)); (int)client.status3, machineStatusToString(client.status3));
} else { } else {
printf(" fd=#%d acct=%s ademco_id=%zd type=%s status=%d %s\n", printf(" fd=#%d acct=%s ademco_id=%zd type=%s status=%d %s\n",
client.fd, client.acct.data(), client.ademco_id, client.fd, client.acct.data(), client.ademco_id,
machineTypeToString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)), machineTypeToString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)),
client.status, machineStatusToString(client.status)); (int)client.status, machineStatusToString(client.status));
} }
for (const auto& zp : client.zones) { for (const auto& zp : client.zones) {
char buf[512]; char buf[512];
snprintf(buf, sizeof(buf), getZoneFormatString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)), zp.first); snprintf(buf, sizeof(buf), getZoneFormatString(machineTypeFromAdemcoEvent((ADEMCO_EVENT)client.type)), zp.first);
printf(" Zone:"); printf(" Zone:");
printf(buf); printf("%s", buf);
printf(" Prop:0x%02X %s \tTamper Enabled:%s\n", printf(" Prop:0x%02X %s \tTamper Enabled:%s\n",
zp.second.prop, zonePropertyToStringEn(zp.second.prop), zp.second.prop, zonePropertyToStringEn(zp.second.prop),
zp.second.tamper_enabled ? "true" : "false"); zp.second.tamper_enabled ? "true" : "false");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment