fix: cleanup

This commit is contained in:
Tobias Reisinger 2019-09-08 23:42:48 +02:00
parent 8679bfe680
commit be84c0e4c2
9 changed files with 5 additions and 20 deletions

View file

@ -1,4 +1,3 @@
#include <netdb.h>
#include <models/controller_dbo.h>
#include <config.h>
#include "api_v1_controllers.h"

View file

@ -9,8 +9,8 @@ helpers::get_server_port(int fd)
return -1;
}
struct sockaddr_in sin{};
socklen_t addrlen = sizeof(sin);
if(getsockname(fd, (struct sockaddr *)&sin, &addrlen) == 0)
socklen_t addr_len = sizeof(sin);
if(getsockname(fd, (struct sockaddr *)&sin, &addr_len) == 0)
{
return ntohs(sin.sin_port);
}

View file

@ -13,7 +13,7 @@ helpers::open_tcp_connection(char *host, char *port)
if ((status = getaddrinfo(host, port, &hints, &res)) != 0)
{
LOG_ERROR << "Error getting addressinfo: " << gai_strerror(status);
LOG_ERROR << "Error getting address info: " << gai_strerror(status);
freeaddrinfo(res);
return 0;
}

View file

@ -1,9 +1,8 @@
#include <netdb.h>
#include <arpa/inet.h>
#include <trantor/utils/Logger.h>
#include "config.h"
#include <helpers.h>
#include <unistd.h>
#include <helpers.h>
int
helpers::send_udp_broadcast(const char *addr, uint16_t port, const char* message)

View file

@ -1,6 +1,5 @@
#include <cstdio>
#include <cstring>
#include <cstring>
#include <trantor/utils/Logger.h>
#include <sys/socket.h>
#include <unistd.h>

View file

@ -1,7 +1,5 @@
#include <cstdio>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include "period.h"
period::period(uint16_t start, uint16_t end)

View file

@ -1,8 +1,5 @@
#include <cstdio>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <drogon/drogon.h>
#include "period_list.h"
period_list::period_list()

View file

@ -1,6 +1,5 @@
#include <cstdio>
#include <cstring>
#include <cstring>
#include <trantor/utils/Logger.h>
#include <helpers.h>
#include "relay_dbo.h"

View file

@ -1,9 +1,3 @@
//
// Created by tobias on 08/07/19.
//
#include <cstdio>
#include <cstring>
#include <cstring>
#include <trantor/utils/Logger.h>
#include <helpers.h>
@ -15,7 +9,7 @@ static bool schedule_db_update_insert(schedule_dbo *schedule, sqlite3_stmt *stmt
{
int rc;
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, 2, schedule->name, -1, SQLITE_STATIC);