bug fixes

This commit is contained in:
Dennis Eichhorn 2022-11-04 22:57:12 +01:00
parent 9a2c89e12b
commit eb4aa2441c
4 changed files with 100 additions and 97 deletions

View File

@ -13,7 +13,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <mysql.h> #include <mysql/mysql.h>
#include "ConnectionAbstract.h" #include "ConnectionAbstract.h"
#include "DbConnectionConfig.h" #include "DbConnectionConfig.h"
@ -33,7 +33,7 @@ namespace DataStorage {
{ {
this->dbdata = dbdata == NULL ? this->dbdata : *dbdata; this->dbdata = dbdata == NULL ? this->dbdata : *dbdata;
if (this->dbdata.db == NULL if (this->dbdata.db == DatabaseType::UNDEFINED
|| this->dbdata.host == NULL || this->dbdata.host == NULL
|| this->dbdata.port == 0 || this->dbdata.port == 0
|| this->dbdata.database == NULL || this->dbdata.database == NULL

View File

@ -33,7 +33,7 @@ namespace DataStorage {
{ {
this->dbdata = dbdata == NULL ? this->dbdata : *dbdata; this->dbdata = dbdata == NULL ? this->dbdata : *dbdata;
if (this->dbdata.db == NULL if (this->dbdata.db == DatabaseType::UNDEFINED
|| this->dbdata.host == NULL || this->dbdata.host == NULL
|| this->dbdata.port == 0 || this->dbdata.port == 0
|| this->dbdata.database == NULL || this->dbdata.database == NULL

View File

@ -33,7 +33,7 @@ namespace DataStorage {
{ {
this->dbdata = dbdata == NULL ? this->dbdata : *dbdata; this->dbdata = dbdata == NULL ? this->dbdata : *dbdata;
if (this->dbdata.db == NULL if (this->dbdata.db == DatabaseType::UNDEFINED
|| this->dbdata.database == NULL || this->dbdata.database == NULL
) { ) {
this->status = DatabaseStatus::FAILURE; this->status = DatabaseStatus::FAILURE;

View File

@ -115,12 +115,12 @@
#ifndef HASH_MEOW_H #ifndef HASH_MEOW_H
#define HASH_MEOW_H #define HASH_MEOW_H
namespace Hash { // #include <immintrin.h>
namespace Meow {
#if !defined(meow_u8)
#define MEOW_HASH_VERSION 5 #define MEOW_HASH_VERSION 5
#define MEOW_HASH_VERSION_NAME "0.5/calico" #define MEOW_HASH_VERSION_NAME "0.5/calico"
#if !defined(meow_u8)
#if _MSC_VER #if _MSC_VER
#if !defined(__clang__) #if !defined(__clang__)
#define INSTRUCTION_REORDER_BARRIER _ReadWriteBarrier() #define INSTRUCTION_REORDER_BARRIER _ReadWriteBarrier()
@ -164,7 +164,6 @@ namespace Hash {
#if !defined MEOW_PREFETCH_LIMIT #if !defined MEOW_PREFETCH_LIMIT
#define MEOW_PREFETCH_LIMIT 0x3ff #define MEOW_PREFETCH_LIMIT 0x3ff
#endif #endif
#endif
#define prefetcht0(A) _mm_prefetch((char *)(A), _MM_HINT_T0) #define prefetcht0(A) _mm_prefetch((char *)(A), _MM_HINT_T0)
#define movdqu(A, B) A = _mm_loadu_si128((__m128i *)(B)) #define movdqu(A, B) A = _mm_loadu_si128((__m128i *)(B))
@ -198,7 +197,10 @@ namespace Hash {
aesdec(r4, r2); \ aesdec(r4, r2); \
paddq(r5, r6); \ paddq(r5, r6); \
pxor(r2, r3) pxor(r2, r3)
#endif
namespace Hash {
namespace Meow {
#if MEOW_DUMP #if MEOW_DUMP
struct meow_dump struct meow_dump
{ {
@ -700,23 +702,6 @@ namespace Hash {
return(xmm0); return(xmm0);
} }
#undef INSTRUCTION_REORDER_BARRIER
#undef prefetcht0
#undef movdqu
#undef movdqu_mem
#undef movq
#undef aesdec
#undef pshufb
#undef pxor
#undef paddq
#undef pand
#undef palignr
#undef pxor_clear
#undef MEOW_MIX
#undef MEOW_MIX_REG
#undef MEOW_SHUFFLE
#undef MEOW_DUMP_STATE
// //
// NOTE(casey): If you need to create your own seed from non-random data, you can use MeowExpandSeed // NOTE(casey): If you need to create your own seed from non-random data, you can use MeowExpandSeed
// to create a seed which you then store for repeated use. It is _expensive_ to generate the seed, // to create a seed which you then store for repeated use. It is _expensive_ to generate the seed,
@ -741,4 +726,22 @@ namespace Hash {
} }
} }
} }
#undef INSTRUCTION_REORDER_BARRIER
#undef prefetcht0
#undef movdqu
#undef movdqu_mem
#undef movq
#undef aesdec
#undef pshufb
#undef pxor
#undef paddq
#undef pand
#undef palignr
#undef pxor_clear
#undef MEOW_MIX
#undef MEOW_MIX_REG
#undef MEOW_SHUFFLE
#undef MEOW_DUMP_STATE
#endif #endif