mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
update to Fedora to version 35
This commit is contained in:
parent
7703f9e23a
commit
e6e4818c0b
9 changed files with 38 additions and 26 deletions
|
@ -16,7 +16,7 @@
|
||||||
#
|
#
|
||||||
###################################################################################
|
###################################################################################
|
||||||
|
|
||||||
FROM fedora:33
|
FROM fedora:36
|
||||||
|
|
||||||
LABEL \
|
LABEL \
|
||||||
org.label-schema.schema-version="1.0" \
|
org.label-schema.schema-version="1.0" \
|
||||||
|
|
|
@ -209,10 +209,10 @@ public:
|
||||||
findAddressSpace(const std::string &name);
|
findAddressSpace(const std::string &name);
|
||||||
|
|
||||||
std::list<AddressSpaceId>
|
std::list<AddressSpaceId>
|
||||||
findPath(AddressSpaceId fromAddrSpaceId, AddressSpaceId toAddrSpaceId);
|
findPath(const AddressSpaceId &fromAddrSpaceId, const AddressSpaceId &toAddrSpaceId);
|
||||||
|
|
||||||
MemoryTranslation
|
MemoryTranslation
|
||||||
getTranslation(AddressSpaceId fromAddrSpaceId, AddressSpaceId toAddrSpaceId);
|
getTranslation(const AddressSpaceId &fromAddrSpaceId, const AddressSpaceId &toAddrSpaceId);
|
||||||
|
|
||||||
// cppcheck-suppress passedByValue
|
// cppcheck-suppress passedByValue
|
||||||
MemoryTranslation getTranslationFromProcess(AddressSpaceId foreignAddrSpaceId)
|
MemoryTranslation getTranslationFromProcess(AddressSpaceId foreignAddrSpaceId)
|
||||||
|
|
|
@ -169,7 +169,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T = Plugin>
|
template<typename T>
|
||||||
void
|
void
|
||||||
Registry::dump()
|
Registry::dump()
|
||||||
{
|
{
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace villas {
|
||||||
namespace utils {
|
namespace utils {
|
||||||
|
|
||||||
std::vector<std::string>
|
std::vector<std::string>
|
||||||
tokenize(std::string s, std::string delimiter);
|
tokenize(std::string s, const std::string &delimiter);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void
|
void
|
||||||
|
|
|
@ -152,6 +152,8 @@ void Log::parse(json_t *json)
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
json_t *json_expression;
|
json_t *json_expression;
|
||||||
|
|
||||||
|
// cppcheck-suppress unknownMacro
|
||||||
json_array_foreach(json_expressions, i, json_expression)
|
json_array_foreach(json_expressions, i, json_expression)
|
||||||
expressions.emplace_back(json_expression);
|
expressions.emplace_back(json_expression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,8 +85,8 @@ MemoryManager::findAddressSpace(const std::string &name)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<MemoryManager::AddressSpaceId>
|
std::list<MemoryManager::AddressSpaceId>
|
||||||
MemoryManager::findPath(MemoryManager::AddressSpaceId fromAddrSpaceId,
|
MemoryManager::findPath(const MemoryManager::AddressSpaceId &fromAddrSpaceId,
|
||||||
MemoryManager::AddressSpaceId toAddrSpaceId)
|
const MemoryManager::AddressSpaceId &toAddrSpaceId)
|
||||||
{
|
{
|
||||||
std::list<AddressSpaceId> path;
|
std::list<AddressSpaceId> path;
|
||||||
|
|
||||||
|
@ -112,8 +112,8 @@ MemoryManager::findPath(MemoryManager::AddressSpaceId fromAddrSpaceId,
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryTranslation
|
MemoryTranslation
|
||||||
MemoryManager::getTranslation(MemoryManager::AddressSpaceId fromAddrSpaceId,
|
MemoryManager::getTranslation(const MemoryManager::AddressSpaceId &fromAddrSpaceId,
|
||||||
MemoryManager::AddressSpaceId toAddrSpaceId)
|
const MemoryManager::AddressSpaceId &toAddrSpaceId)
|
||||||
{
|
{
|
||||||
// Find a path through the memory graph
|
// Find a path through the memory graph
|
||||||
MemoryGraph::Path path;
|
MemoryGraph::Path path;
|
||||||
|
|
|
@ -38,7 +38,7 @@ static pthread_t main_thread;
|
||||||
namespace villas {
|
namespace villas {
|
||||||
namespace utils {
|
namespace utils {
|
||||||
|
|
||||||
std::vector<std::string> tokenize(std::string s, std::string delimiter)
|
std::vector<std::string> tokenize(std::string s, const std::string &delimiter)
|
||||||
{
|
{
|
||||||
std::vector<std::string> tokens;
|
std::vector<std::string> tokens;
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ int log2i(long long x) {
|
||||||
|
|
||||||
int sha1sum(FILE *f, unsigned char *sha1)
|
int sha1sum(FILE *f, unsigned char *sha1)
|
||||||
{
|
{
|
||||||
SHA_CTX c;
|
int ret;
|
||||||
char buf[512];
|
char buf[512];
|
||||||
ssize_t bytes;
|
ssize_t bytes;
|
||||||
long seek;
|
long seek;
|
||||||
|
@ -326,18 +326,24 @@ int sha1sum(FILE *f, unsigned char *sha1)
|
||||||
seek = ftell(f);
|
seek = ftell(f);
|
||||||
fseek(f, 0, SEEK_SET);
|
fseek(f, 0, SEEK_SET);
|
||||||
|
|
||||||
SHA1_Init(&c);
|
EVP_MD_CTX *c = EVP_MD_CTX_new();
|
||||||
|
|
||||||
|
ret = EVP_DigestInit(c, EVP_sha1());
|
||||||
|
if (!ret)
|
||||||
|
return -1;
|
||||||
|
|
||||||
bytes = fread(buf, 1, 512, f);
|
bytes = fread(buf, 1, 512, f);
|
||||||
while (bytes > 0) {
|
while (bytes > 0) {
|
||||||
SHA1_Update(&c, buf, bytes);
|
EVP_DigestUpdate(c, buf, bytes);
|
||||||
bytes = fread(buf, 1, 512, f);
|
bytes = fread(buf, 1, 512, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
SHA1_Final(sha1, &c);
|
EVP_DigestFinal(c, sha1, nullptr);
|
||||||
|
|
||||||
fseek(f, seek, SEEK_SET);
|
fseek(f, seek, SEEK_SET);
|
||||||
|
|
||||||
|
EVP_MD_CTX_free(c);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* @license Apache License 2.0
|
* @license Apache License 2.0
|
||||||
*********************************************************************************/
|
*********************************************************************************/
|
||||||
|
|
||||||
#include <openssl/md5.h>
|
#include <openssl/evp.h>
|
||||||
|
|
||||||
#include <villas/uuid.hpp>
|
#include <villas/uuid.hpp>
|
||||||
|
|
||||||
|
@ -14,52 +14,56 @@ using namespace villas::uuid;
|
||||||
int villas::uuid::generateFromString(uuid_t out, const std::string &data, const std::string &ns)
|
int villas::uuid::generateFromString(uuid_t out, const std::string &data, const std::string &ns)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
MD5_CTX c;
|
EVP_MD_CTX *c = EVP_MD_CTX_new();
|
||||||
|
|
||||||
ret = MD5_Init(&c);
|
ret = EVP_DigestInit(c, EVP_md5());
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Namespace */
|
/* Namespace */
|
||||||
ret = MD5_Update(&c, (unsigned char *) ns.c_str(), ns.size());
|
ret = EVP_DigestUpdate(c, (unsigned char *) ns.c_str(), ns.size());
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Data */
|
/* Data */
|
||||||
ret = MD5_Update(&c, (unsigned char *) data.c_str(), data.size());
|
ret = EVP_DigestUpdate(c, (unsigned char *) data.c_str(), data.size());
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ret = MD5_Final((unsigned char *) out, &c);
|
ret = EVP_DigestFinal(c, (unsigned char *) out, nullptr);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
EVP_MD_CTX_free(c);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int villas::uuid::generateFromString(uuid_t out, const std::string &data, const uuid_t ns)
|
int villas::uuid::generateFromString(uuid_t out, const std::string &data, const uuid_t ns)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
MD5_CTX c;
|
EVP_MD_CTX *c = EVP_MD_CTX_new();
|
||||||
|
|
||||||
ret = MD5_Init(&c);
|
ret = EVP_DigestInit(c, EVP_md5());
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Namespace */
|
/* Namespace */
|
||||||
ret = MD5_Update(&c, (unsigned char *) ns, 16);
|
ret = EVP_DigestUpdate(c, (unsigned char *) ns, 16);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Data */
|
/* Data */
|
||||||
ret = MD5_Update(&c, (unsigned char *) data.c_str(), data.size());
|
ret = EVP_DigestUpdate(c, (unsigned char *) data.c_str(), data.size());
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ret = MD5_Final((unsigned char *) out, &c);
|
ret = EVP_DigestFinal(c, (unsigned char *) out, nullptr);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
EVP_MD_CTX_free(c);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,6 @@ Test(hist, simple) {
|
||||||
h.put(td);
|
h.put(td);
|
||||||
|
|
||||||
cr_assert_float_eq(h.getMean(), 5.5, 1e-6, "Mean is %lf", h.getMean());
|
cr_assert_float_eq(h.getMean(), 5.5, 1e-6, "Mean is %lf", h.getMean());
|
||||||
cr_assert_float_eq(h.getVar(), 9.1666, 1e-3,);
|
cr_assert_float_eq(h.getVar(), 9.1666, 1e-3);
|
||||||
cr_assert_float_eq(h.getStddev(), 3.027650, 1e-6);
|
cr_assert_float_eq(h.getStddev(), 3.027650, 1e-6);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue