bugfix macos and android

This commit is contained in:
AlexandreRouma 2023-02-25 19:30:58 +01:00
parent df83d65271
commit ac875aee3b
3 changed files with 22 additions and 23 deletions

View File

@ -9,7 +9,7 @@
#endif
#ifdef __ANDROID__
#include <log.h>
#include <android/log.h>
#ifndef FLOG_ANDROID_TAG
#define FLOG_ANDROID_TAG "flog"
#endif
@ -193,42 +193,42 @@ namespace flog {
return buf;
}
std::string __toString__(uint8_t value) {
char buf[8];
sprintf(buf, "%" PRIu8, value);
return buf;
}
std::string __toString__(int16_t value) {
char buf[16];
sprintf(buf, "%" PRId16, value);
return buf;
}
std::string __toString__(uint16_t value) {
char buf[16];
sprintf(buf, "%" PRIu16, value);
return buf;
}
std::string __toString__(int32_t value) {
char buf[32];
sprintf(buf, "%" PRId32, value);
return buf;
}
std::string __toString__(uint32_t value) {
char buf[32];
sprintf(buf, "%" PRIu32, value);
return buf;
}
std::string __toString__(int64_t value) {
char buf[64];
sprintf(buf, "%" PRId64, value);
return buf;
}
std::string __toString__(uint8_t value) {
char buf[8];
sprintf(buf, "%" PRIu8, value);
return buf;
}
std::string __toString__(uint16_t value) {
char buf[16];
sprintf(buf, "%" PRIu16, value);
return buf;
}
std::string __toString__(uint32_t value) {
char buf[32];
sprintf(buf, "%" PRIu32, value);
return buf;
}
std::string __toString__(uint64_t value) {
char buf[64];
sprintf(buf, "%" PRIu64, value);

View File

@ -19,12 +19,12 @@ namespace flog {
std::string __toString__(bool value);
std::string __toString__(char value);
std::string __toString__(int8_t value);
std::string __toString__(uint8_t value);
std::string __toString__(int16_t value);
std::string __toString__(uint16_t value);
std::string __toString__(int32_t value);
std::string __toString__(uint32_t value);
std::string __toString__(int64_t value);
std::string __toString__(uint8_t value);
std::string __toString__(uint16_t value);
std::string __toString__(uint32_t value);
std::string __toString__(uint64_t value);
std::string __toString__(float value);
std::string __toString__(double value);

View File

@ -175,7 +175,6 @@ private:
std::regex expr("[0-9]+Hz");
std::smatch matches;
std::regex_search(filename, matches, expr);
flog::warn("{0} {1}", filename, matches.size());
if (matches.empty()) { return 0; }
std::string freqStr = matches[0].str();
return std::atof(freqStr.substr(0, freqStr.size() - 2).c_str());