mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Fix Android warnings
This commit is contained in:
@@ -227,6 +227,7 @@ bool Process::openDocument (const String& fileName, const String& parameters)
|
||||
{
|
||||
const LocalRef<jstring> t (javaString (fileName));
|
||||
android.activity.callVoidMethod (BeastAppActivity.launchURL, t.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
void File::revealToUser() const
|
||||
|
||||
@@ -23,5 +23,5 @@
|
||||
|
||||
void Logger::outputDebugString (const String& text)
|
||||
{
|
||||
__android_log_print (ANDROID_LOG_INFO, "BEAST", text.toUTF8());
|
||||
__android_log_print (ANDROID_LOG_INFO, "BEAST", "%", text.toUTF8().getAddress());
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ static void findIPAddresses (int sock, Array<IPAddress>& result)
|
||||
cfg.ifc_buf += IFNAMSIZ + cfg.ifc_req->ifr_addr.sa_len;
|
||||
}
|
||||
#else
|
||||
for (int i = 0; i < cfg.ifc_len / sizeof (struct ifreq); ++i)
|
||||
for (size_t i = 0; i < cfg.ifc_len / sizeof (struct ifreq); ++i)
|
||||
{
|
||||
const ifreq& item = cfg.ifc_req[i];
|
||||
|
||||
|
||||
@@ -58,10 +58,15 @@ struct CurrentThreadHolder : public SharedObject
|
||||
|
||||
static char currentThreadHolderLock [sizeof (SpinLock)]; // (statically initialised to zeros).
|
||||
|
||||
static SpinLock* castToSpinLockWithoutAliasingWarning (void* s)
|
||||
{
|
||||
return static_cast<SpinLock*> (s);
|
||||
}
|
||||
|
||||
static CurrentThreadHolder::Ptr getCurrentThreadHolder()
|
||||
{
|
||||
static CurrentThreadHolder::Ptr currentThreadHolder;
|
||||
SpinLock::ScopedLockType lock (*reinterpret_cast <SpinLock*> (currentThreadHolderLock));
|
||||
SpinLock::ScopedLockType lock (*castToSpinLockWithoutAliasingWarning (currentThreadHolderLock));
|
||||
|
||||
if (currentThreadHolder == nullptr)
|
||||
currentThreadHolder = new CurrentThreadHolder();
|
||||
|
||||
Reference in New Issue
Block a user