fix: cleanup
This commit is contained in:
parent
8679bfe680
commit
be84c0e4c2
9 changed files with 5 additions and 20 deletions
|
@ -1,4 +1,3 @@
|
||||||
#include <netdb.h>
|
|
||||||
#include <models/controller_dbo.h>
|
#include <models/controller_dbo.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "api_v1_controllers.h"
|
#include "api_v1_controllers.h"
|
||||||
|
|
|
@ -9,8 +9,8 @@ helpers::get_server_port(int fd)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
struct sockaddr_in sin{};
|
struct sockaddr_in sin{};
|
||||||
socklen_t addrlen = sizeof(sin);
|
socklen_t addr_len = sizeof(sin);
|
||||||
if(getsockname(fd, (struct sockaddr *)&sin, &addrlen) == 0)
|
if(getsockname(fd, (struct sockaddr *)&sin, &addr_len) == 0)
|
||||||
{
|
{
|
||||||
return ntohs(sin.sin_port);
|
return ntohs(sin.sin_port);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <trantor/utils/Logger.h>
|
#include <trantor/utils/Logger.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <helpers.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <helpers.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
helpers::send_udp_broadcast(const char *addr, uint16_t port, const char* message)
|
helpers::send_udp_broadcast(const char *addr, uint16_t port, const char* message)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstring>
|
|
||||||
#include <trantor/utils/Logger.h>
|
#include <trantor/utils/Logger.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cmath>
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
|
||||||
#include "period.h"
|
#include "period.h"
|
||||||
|
|
||||||
period::period(uint16_t start, uint16_t end)
|
period::period(uint16_t start, uint16_t end)
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#include <cstdio>
|
|
||||||
#include <cmath>
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <drogon/drogon.h>
|
|
||||||
#include "period_list.h"
|
#include "period_list.h"
|
||||||
|
|
||||||
period_list::period_list()
|
period_list::period_list()
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstring>
|
|
||||||
#include <trantor/utils/Logger.h>
|
#include <trantor/utils/Logger.h>
|
||||||
#include <helpers.h>
|
#include <helpers.h>
|
||||||
#include "relay_dbo.h"
|
#include "relay_dbo.h"
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
//
|
|
||||||
// Created by tobias on 08/07/19.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstring>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <trantor/utils/Logger.h>
|
#include <trantor/utils/Logger.h>
|
||||||
#include <helpers.h>
|
#include <helpers.h>
|
||||||
|
@ -15,7 +9,7 @@ static bool schedule_db_update_insert(schedule_dbo *schedule, sqlite3_stmt *stmt
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
uint16_t *periods_blob = schedule->periods->to_db_blob();
|
uint16_t *periods_blob = schedule->periods->to_db_blob();
|
||||||
int blob_size = sizeof(uint16_t) * ((periods_blob[0] * 2) + 1);
|
int blob_size = (int)sizeof(uint16_t) * ((periods_blob[0] * 2) + 1);
|
||||||
|
|
||||||
sqlite3_bind_text(stmt, 1, schedule->id, -1, SQLITE_STATIC);
|
sqlite3_bind_text(stmt, 1, schedule->id, -1, SQLITE_STATIC);
|
||||||
sqlite3_bind_text(stmt, 2, schedule->name, -1, SQLITE_STATIC);
|
sqlite3_bind_text(stmt, 2, schedule->name, -1, SQLITE_STATIC);
|
||||||
|
|
Loading…
Reference in a new issue