mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-02-16 10:18:42 +00:00
fix linting
This commit is contained in:
parent
b0d10c5eaa
commit
a82e0383cb
|
|
@ -17,8 +17,10 @@
|
||||||
#include "../DatabaseType.h"
|
#include "../DatabaseType.h"
|
||||||
#include "../DatabaseStatus.h"
|
#include "../DatabaseStatus.h"
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
struct ConnectionAbstract {
|
struct ConnectionAbstract {
|
||||||
void* con = NULL;
|
void* con = NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,10 @@
|
||||||
#include "PostgresqlConnection.h"
|
#include "PostgresqlConnection.h"
|
||||||
#include "SQLiteConnection.h"
|
#include "SQLiteConnection.h"
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
ConnectionAbstract *create_connection(DbConnectionConfig dbdata)
|
ConnectionAbstract *create_connection(DbConnectionConfig dbdata)
|
||||||
{
|
{
|
||||||
switch (dbdata.db) {
|
switch (dbdata.db) {
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,10 @@
|
||||||
|
|
||||||
#include "../DatabaseType.h"
|
#include "../DatabaseType.h"
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
typedef struct {
|
typedef struct {
|
||||||
DatabaseType db = DatabaseType::UNDEFINED;
|
DatabaseType db = DatabaseType::UNDEFINED;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,10 @@
|
||||||
#include "../DatabaseType.h"
|
#include "../DatabaseType.h"
|
||||||
#include "../DatabaseStatus.h"
|
#include "../DatabaseStatus.h"
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
struct MysqlConnection : ConnectionAbstract {
|
struct MysqlConnection : ConnectionAbstract {
|
||||||
MysqlConnection(DbConnectionConfig dbdata)
|
MysqlConnection(DbConnectionConfig dbdata)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,10 @@
|
||||||
#include "../DatabaseType.h"
|
#include "../DatabaseType.h"
|
||||||
#include "../DatabaseStatus.h"
|
#include "../DatabaseStatus.h"
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
struct PostgresqlConnection : ConnectionAbstract {
|
struct PostgresqlConnection : ConnectionAbstract {
|
||||||
PostgresqlConnection(DbConnectionConfig dbdata)
|
PostgresqlConnection(DbConnectionConfig dbdata)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,10 @@
|
||||||
#include "../DatabaseType.h"
|
#include "../DatabaseType.h"
|
||||||
#include "../DatabaseStatus.h"
|
#include "../DatabaseStatus.h"
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
struct SQLiteConnection : ConnectionAbstract {
|
struct SQLiteConnection : ConnectionAbstract {
|
||||||
SQLiteConnection(DbConnectionConfig dbdata)
|
SQLiteConnection(DbConnectionConfig dbdata)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,10 @@
|
||||||
#ifndef DATASTORAGE_DATABASE_STATUS_H
|
#ifndef DATASTORAGE_DATABASE_STATUS_H
|
||||||
#define DATASTORAGE_DATABASE_STATUS_H
|
#define DATASTORAGE_DATABASE_STATUS_H
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OK = 0,
|
OK = 0,
|
||||||
MISSING_DATABASE = 1,
|
MISSING_DATABASE = 1,
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,10 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
typedef enum {
|
typedef enum {
|
||||||
MYSQL = 1,
|
MYSQL = 1,
|
||||||
SQLITE = 2,
|
SQLITE = 2,
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,10 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char *name;
|
||||||
char *type;
|
char *type;
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,10 @@
|
||||||
|
|
||||||
#include "DbField.h"
|
#include "DbField.h"
|
||||||
|
|
||||||
namespace DataStorage {
|
namespace DataStorage
|
||||||
namespace Database {
|
{
|
||||||
|
namespace Database
|
||||||
|
{
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char *name;
|
||||||
DbField *fields;
|
DbField *fields;
|
||||||
|
|
|
||||||
|
|
@ -199,8 +199,10 @@
|
||||||
pxor(r2, r3)
|
pxor(r2, r3)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Hash {
|
namespace Hash
|
||||||
namespace Meow {
|
{
|
||||||
|
namespace Meow
|
||||||
|
{
|
||||||
#if MEOW_DUMP
|
#if MEOW_DUMP
|
||||||
struct meow_dump
|
struct meow_dump
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,10 @@
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace Image {
|
namespace Image
|
||||||
namespace BillDetection {
|
{
|
||||||
|
namespace BillDetection
|
||||||
|
{
|
||||||
cv::Mat highlightBill(cv::Mat in)
|
cv::Mat highlightBill(cv::Mat in)
|
||||||
{
|
{
|
||||||
cv::Mat gray;
|
cv::Mat gray;
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,10 @@
|
||||||
|
|
||||||
#include "../Utils/MathUtils.h"
|
#include "../Utils/MathUtils.h"
|
||||||
|
|
||||||
namespace Image {
|
namespace Image
|
||||||
namespace ImageUtils {
|
{
|
||||||
|
namespace ImageUtils
|
||||||
|
{
|
||||||
cv::Mat find_diff (cv::Mat in1, cv::Mat in2)
|
cv::Mat find_diff (cv::Mat in1, cv::Mat in2)
|
||||||
{
|
{
|
||||||
cv::Mat diff;
|
cv::Mat diff;
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,10 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
namespace Image {
|
namespace Image
|
||||||
namespace ImageUtils {
|
{
|
||||||
|
namespace ImageUtils
|
||||||
|
{
|
||||||
inline
|
inline
|
||||||
float lightnessFromRgb(int r, int g, int b)
|
float lightnessFromRgb(int r, int g, int b)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@
|
||||||
#include "ImageUtils.h"
|
#include "ImageUtils.h"
|
||||||
#include "../Utils/MathUtils.h"
|
#include "../Utils/MathUtils.h"
|
||||||
|
|
||||||
namespace Image {
|
namespace Image
|
||||||
|
{
|
||||||
const float KERNEL_RIDGE_1[3][3] = {
|
const float KERNEL_RIDGE_1[3][3] = {
|
||||||
{0.0, -1.0, 0.0},
|
{0.0, -1.0, 0.0},
|
||||||
{-1.0, 4.0, -1.0},
|
{-1.0, 4.0, -1.0},
|
||||||
|
|
@ -61,7 +62,8 @@ namespace Image {
|
||||||
{-1.0 / 256.0, -4.0 / 256.0, -6.0 / 256.0, -4.0 / 256.0, -1.0 / 256.0},
|
{-1.0 / 256.0, -4.0 / 256.0, -6.0 / 256.0, -4.0 / 256.0, -1.0 / 256.0},
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel
|
||||||
|
{
|
||||||
inline
|
inline
|
||||||
cv::Mat convolve(cv::Mat in, const float kernel[][3])
|
cv::Mat convolve(cv::Mat in, const float kernel[][3])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
#include "../Utils/MathUtils.h"
|
#include "../Utils/MathUtils.h"
|
||||||
|
|
||||||
namespace Image {
|
namespace Image
|
||||||
namespace Skew {
|
{
|
||||||
|
namespace Skew
|
||||||
|
{
|
||||||
cv::Mat deskewHoughLines(cv::Mat in, int maxDegree = 45)
|
cv::Mat deskewHoughLines(cv::Mat in, int maxDegree = 45)
|
||||||
{
|
{
|
||||||
cv::Size dim = in.size();
|
cv::Size dim = in.size();
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,10 @@
|
||||||
#include "ImageUtils.h"
|
#include "ImageUtils.h"
|
||||||
#include "../Utils/MathUtils.h"
|
#include "../Utils/MathUtils.h"
|
||||||
|
|
||||||
namespace Image {
|
namespace Image
|
||||||
namespace Thresholding {
|
{
|
||||||
|
namespace Thresholding
|
||||||
|
{
|
||||||
cv::Mat integralThresholding(cv::Mat in)
|
cv::Mat integralThresholding(cv::Mat in)
|
||||||
{
|
{
|
||||||
cv::Size dim = in.size();
|
cv::Size dim = in.size();
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Threads {
|
namespace Threads
|
||||||
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
typedef DWORD WINAPI(*JobFunc)(void *);
|
typedef DWORD WINAPI(*JobFunc)(void *);
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@
|
||||||
#include "Job.h"
|
#include "Job.h"
|
||||||
#include "ThreadPool.h"
|
#include "ThreadPool.h"
|
||||||
|
|
||||||
namespace Threads {
|
namespace Threads
|
||||||
|
{
|
||||||
Job *pool_work_create(JobFunc func, void *arg)
|
Job *pool_work_create(JobFunc func, void *arg)
|
||||||
{
|
{
|
||||||
Job *work;
|
Job *work;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@
|
||||||
#include "OSWrapper.h"
|
#include "OSWrapper.h"
|
||||||
#include "Job.h"
|
#include "Job.h"
|
||||||
|
|
||||||
namespace Threads {
|
namespace Threads
|
||||||
|
{
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Job *work_first;
|
Job *work_first;
|
||||||
Job *work_last;
|
Job *work_last;
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
#include "OSWrapper.h"
|
#include "OSWrapper.h"
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils
|
||||||
namespace ApplicationUtils {
|
{
|
||||||
|
namespace ApplicationUtils
|
||||||
|
{
|
||||||
inline
|
inline
|
||||||
char *cwd()
|
char *cwd()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils
|
||||||
namespace ArrayUtils {
|
{
|
||||||
|
namespace ArrayUtils
|
||||||
|
{
|
||||||
inline
|
inline
|
||||||
char* get_arg(const char *id, char **argv, int length)
|
char* get_arg(const char *id, char **argv, int length)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,10 @@
|
||||||
|
|
||||||
#include "OSWrapper.h"
|
#include "OSWrapper.h"
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils
|
||||||
namespace FileUtils {
|
{
|
||||||
|
namespace FileUtils
|
||||||
|
{
|
||||||
inline
|
inline
|
||||||
bool file_exists (const char *filename)
|
bool file_exists (const char *filename)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2793,7 +2793,8 @@ JSON_HEDLEY_DIAGNOSTIC_POP
|
||||||
// it allows using the detected idiom to retrieve the return type
|
// it allows using the detected idiom to retrieve the return type
|
||||||
// of such an expression
|
// of such an expression
|
||||||
#define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \
|
#define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \
|
||||||
namespace detail { \
|
namespace detail
|
||||||
|
{ \
|
||||||
using std::std_name; \
|
using std::std_name; \
|
||||||
\
|
\
|
||||||
template<typename... T> \
|
template<typename... T> \
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,12 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils
|
||||||
namespace Rng {
|
{
|
||||||
namespace StringUtils {
|
namespace Rng
|
||||||
|
{
|
||||||
|
namespace StringUtils
|
||||||
|
{
|
||||||
inline
|
inline
|
||||||
char* generate_string(
|
char* generate_string(
|
||||||
size_t min = 10, size_t max = 10,
|
size_t min = 10, size_t max = 10,
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,10 @@
|
||||||
#include "MathUtils.h"
|
#include "MathUtils.h"
|
||||||
#include "ArraySort.h"
|
#include "ArraySort.h"
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils
|
||||||
namespace StringUtils {
|
{
|
||||||
|
namespace StringUtils
|
||||||
|
{
|
||||||
inline
|
inline
|
||||||
char *search_replace(const char *haystack, const char *needle, const char *replace)
|
char *search_replace(const char *haystack, const char *needle, const char *replace)
|
||||||
{
|
{
|
||||||
|
|
@ -251,7 +253,7 @@ namespace Utils {
|
||||||
}
|
}
|
||||||
diffValues = diffValuesT;
|
diffValues = diffValuesT;
|
||||||
|
|
||||||
int *diffMasksT = (int *) realloc(diffMasks, diffIndex * sizeof(int));
|
int *diffMasksT = (int *) realloc(diffMasks, diffIndex * sizeof(int));
|
||||||
if (!diffMasksT) {
|
if (!diffMasksT) {
|
||||||
free(diffMasks);
|
free(diffMasks);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,10 @@
|
||||||
|
|
||||||
#include "FileUtils.h"
|
#include "FileUtils.h"
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils
|
||||||
namespace WebUtils {
|
{
|
||||||
|
namespace WebUtils
|
||||||
|
{
|
||||||
static bool CURL_SETUP = false;
|
static bool CURL_SETUP = false;
|
||||||
|
|
||||||
inline
|
inline
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user