mirror of
https://github.com/clangen/musikcube.git
synced 2025-02-11 09:40:26 +00:00
Fixed macOS compile.
This commit is contained in:
parent
844b0d0537
commit
d305e266ce
@ -100,7 +100,7 @@ static std::string contentType(const std::string& fn) {
|
|||||||
return "application/octet-stream";
|
return "application/octet-stream";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* toHex, urlEncode, fromHex, urlDecode are stilen from here:
|
/* toHex, urlEncode, fromHex, urlDecode are stolen from here:
|
||||||
http://dlib.net/dlib/server/server_http.cpp.html */
|
http://dlib.net/dlib/server/server_http.cpp.html */
|
||||||
static inline unsigned char toHex(unsigned char x) {
|
static inline unsigned char toHex(unsigned char x) {
|
||||||
return x + (x > 9 ? ('A' - 10) : '0');
|
return x + (x > 9 ? ('A' - 10) : '0');
|
||||||
@ -127,7 +127,7 @@ std::string urlEncode(const std::string& s) {
|
|||||||
return os.str();
|
return os.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned char from_hex(unsigned char ch) {
|
inline unsigned char fromHex(unsigned char ch) {
|
||||||
if (ch <= '9' && ch >= '0') {
|
if (ch <= '9' && ch >= '0') {
|
||||||
ch -= '0';
|
ch -= '0';
|
||||||
}
|
}
|
||||||
@ -154,8 +154,8 @@ std::string urlDecode(const std::string& str) {
|
|||||||
result += ' ';
|
result += ' ';
|
||||||
}
|
}
|
||||||
else if (str[i] == '%' && str.size() > i + 2) {
|
else if (str[i] == '%' && str.size() > i + 2) {
|
||||||
const unsigned char ch1 = from_hex(str[i + 1]);
|
const unsigned char ch1 = fromHex(str[i + 1]);
|
||||||
const unsigned char ch2 = from_hex(str[i + 2]);
|
const unsigned char ch2 = fromHex(str[i + 2]);
|
||||||
const unsigned char ch = (ch1 << 4) | ch2;
|
const unsigned char ch = (ch1 << 4) | ch2;
|
||||||
result += ch;
|
result += ch;
|
||||||
i += 2;
|
i += 2;
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
static const std::string TAG = "Indexer";
|
static const std::string TAG = "Indexer";
|
||||||
static const int MAX_THREADS = 2;
|
static const int MAX_THREADS = 2;
|
||||||
static const size_t TRANSACTION_INTERVAL = 300;
|
static const size_t TRANSACTION_INTERVAL = 300;
|
||||||
static std::atomic<unsigned long long> nextExternalId = 1;
|
static std::atomic<unsigned long long> nextExternalId;
|
||||||
|
|
||||||
using namespace musik::core;
|
using namespace musik::core;
|
||||||
using namespace musik::core::sdk;
|
using namespace musik::core::sdk;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user