1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

update to Fedora to version 35

This commit is contained in:
Steffen Vogel 2022-10-21 09:09:39 +00:00
parent bf8a5a160c
commit edf5d45ee2
9 changed files with 38 additions and 26 deletions

View file

@ -16,7 +16,7 @@
#
###################################################################################
FROM fedora:33
FROM fedora:36
LABEL \
org.label-schema.schema-version="1.0" \

View file

@ -209,10 +209,10 @@ public:
findAddressSpace(const std::string &name);
std::list<AddressSpaceId>
findPath(AddressSpaceId fromAddrSpaceId, AddressSpaceId toAddrSpaceId);
findPath(const AddressSpaceId &fromAddrSpaceId, const AddressSpaceId &toAddrSpaceId);
MemoryTranslation
getTranslation(AddressSpaceId fromAddrSpaceId, AddressSpaceId toAddrSpaceId);
getTranslation(const AddressSpaceId &fromAddrSpaceId, const AddressSpaceId &toAddrSpaceId);
// cppcheck-suppress passedByValue
MemoryTranslation getTranslationFromProcess(AddressSpaceId foreignAddrSpaceId)

View file

@ -169,7 +169,7 @@ public:
}
};
template<typename T = Plugin>
template<typename T>
void
Registry::dump()
{

View file

@ -111,7 +111,7 @@ namespace villas {
namespace utils {
std::vector<std::string>
tokenize(std::string s, std::string delimiter);
tokenize(std::string s, const std::string &delimiter);
template<typename T>
void

View file

@ -152,6 +152,8 @@ void Log::parse(json_t *json)
size_t i;
json_t *json_expression;
// cppcheck-suppress unknownMacro
json_array_foreach(json_expressions, i, json_expression)
expressions.emplace_back(json_expression);
}

View file

@ -85,8 +85,8 @@ MemoryManager::findAddressSpace(const std::string &name)
}
std::list<MemoryManager::AddressSpaceId>
MemoryManager::findPath(MemoryManager::AddressSpaceId fromAddrSpaceId,
MemoryManager::AddressSpaceId toAddrSpaceId)
MemoryManager::findPath(const MemoryManager::AddressSpaceId &fromAddrSpaceId,
const MemoryManager::AddressSpaceId &toAddrSpaceId)
{
std::list<AddressSpaceId> path;
@ -112,8 +112,8 @@ MemoryManager::findPath(MemoryManager::AddressSpaceId fromAddrSpaceId,
}
MemoryTranslation
MemoryManager::getTranslation(MemoryManager::AddressSpaceId fromAddrSpaceId,
MemoryManager::AddressSpaceId toAddrSpaceId)
MemoryManager::getTranslation(const MemoryManager::AddressSpaceId &fromAddrSpaceId,
const MemoryManager::AddressSpaceId &toAddrSpaceId)
{
// Find a path through the memory graph
MemoryGraph::Path path;

View file

@ -38,7 +38,7 @@ static pthread_t main_thread;
namespace villas {
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;
@ -318,7 +318,7 @@ int log2i(long long x) {
int sha1sum(FILE *f, unsigned char *sha1)
{
SHA_CTX c;
int ret;
char buf[512];
ssize_t bytes;
long seek;
@ -326,18 +326,24 @@ int sha1sum(FILE *f, unsigned char *sha1)
seek = ftell(f);
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);
while (bytes > 0) {
SHA1_Update(&c, buf, bytes);
EVP_DigestUpdate(c, buf, bytes);
bytes = fread(buf, 1, 512, f);
}
SHA1_Final(sha1, &c);
EVP_DigestFinal(c, sha1, nullptr);
fseek(f, seek, SEEK_SET);
EVP_MD_CTX_free(c);
return 0;
}

View file

@ -5,7 +5,7 @@
* @license Apache License 2.0
*********************************************************************************/
#include <openssl/md5.h>
#include <openssl/evp.h>
#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 ret;
MD5_CTX c;
EVP_MD_CTX *c = EVP_MD_CTX_new();
ret = MD5_Init(&c);
ret = EVP_DigestInit(c, EVP_md5());
if (!ret)
return -1;
/* 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)
return -1;
/* 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)
return -1;
ret = MD5_Final((unsigned char *) out, &c);
ret = EVP_DigestFinal(c, (unsigned char *) out, nullptr);
if (!ret)
return -1;
EVP_MD_CTX_free(c);
return 0;
}
int villas::uuid::generateFromString(uuid_t out, const std::string &data, const uuid_t ns)
{
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)
return -1;
/* Namespace */
ret = MD5_Update(&c, (unsigned char *) ns, 16);
ret = EVP_DigestUpdate(c, (unsigned char *) ns, 16);
if (!ret)
return -1;
/* 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)
return -1;
ret = MD5_Final((unsigned char *) out, &c);
ret = EVP_DigestFinal(c, (unsigned char *) out, nullptr);
if (!ret)
return -1;
EVP_MD_CTX_free(c);
return 0;
}

View file

@ -27,6 +27,6 @@ Test(hist, simple) {
h.put(td);
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);
}