Skip to content

Commit

Permalink
Merge with upstream 5475c48
Browse files Browse the repository at this point in the history
# Conflicts:
#	Source/Atomic/Core/ProcessUtils.h
#	Source/CMakeLists.txt
#	Source/Urho3D/CMakeLists.txt
  • Loading branch information
rokups committed Jul 4, 2017
1 parent d91f7ab commit 604d153
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions Source/Atomic/Core/ProcessUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ String GetPlatform()
#elif defined(__linux__)
return "Linux";
#else
return String::EMPTY;
return "(?)";
#endif
}

Expand Down Expand Up @@ -557,7 +557,7 @@ String GetLoginName()
{
#if defined(__linux__) && !defined(__ANDROID__)
struct passwd *p = getpwuid(getuid());
if (p)
if (p != NULL)
return p->pw_name;
#elif defined(_WIN32)
char name[UNLEN + 1];
Expand All @@ -582,7 +582,7 @@ String GetLoginName()
}
}
#endif
return "(?)";
return "(?)";
}

String GetHostName()
Expand All @@ -597,11 +597,11 @@ String GetHostName()
if (GetComputerName(buffer, &len))
return buffer;
#endif
return String::EMPTY;
return "(?)";
}

// Disable Windows OS version functionality when compiling mini version for Web, see https://github.com/urho3d/Urho3D/issues/1998
#if defined(_WIN32) && !defined(MINI_URHO)
#if defined(_WIN32) && defined(HAVE_RTL_OSVERSIONINFOW) && !defined(MINI_URHO)
typedef NTSTATUS (WINAPI *RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);

static void GetOS(RTL_OSVERSIONINFOW *r)
Expand All @@ -622,7 +622,7 @@ String GetOSVersion()
struct utsname u;
if (uname(&u) == 0)
return String(u.sysname) + " " + u.release;
#elif defined(_WIN32) && !defined(MINI_URHO)
#elif defined(_WIN32) && defined(HAVE_RTL_OSVERSIONINFOW) && !defined(MINI_URHO)
RTL_OSVERSIONINFOW r;
GetOS(&r);
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
Expand All @@ -643,7 +643,7 @@ String GetOSVersion()
else if (r.dwMajorVersion == 10 && r.dwMinorVersion == 0)
return "Windows 10/Windows Server 2016";
else
return "Windows Unidentified";
return "Windows Unknown";
#elif defined(__APPLE__)
char kernel_r[256];
size_t size = sizeof(kernel_r);
Expand Down Expand Up @@ -719,7 +719,7 @@ String GetOSVersion()
return version + " (Darwin kernel " + kernel_version[0] + "." + kernel_version[1] + "." + kernel_version[2] + ")";
}
#endif
return String::EMPTY;
return "(?)";
}

}
8 changes: 4 additions & 4 deletions Source/Atomic/Core/ProcessUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ATOMIC_API const Vector<String>& ParseArguments(int argc, char** argv);
ATOMIC_API const Vector<String>& GetArguments();
/// Read input from the console window. Return empty if no input.
ATOMIC_API String GetConsoleInput();
/// Return the runtime platform identifier.
/// Return the runtime platform identifier, or (?) if not identified.
ATOMIC_API String GetPlatform();
/// Return the number of physical CPU cores.
ATOMIC_API unsigned GetNumPhysicalCPUs();
Expand All @@ -69,13 +69,13 @@ ATOMIC_API unsigned GetNumLogicalCPUs();
ATOMIC_API void SetMiniDumpDir(const String& pathName);
/// Return minidump write location.
ATOMIC_API String GetMiniDumpDir();
/// Return the total amount of useable memory.
/// Return the total amount of usable memory in bytes.
ATOMIC_API unsigned long long GetTotalMemory();
/// Return the name of the currently logged in user.
/// Return the name of the currently logged in user, or (?) if not identified.
ATOMIC_API String GetLoginName();
/// Return the name of the running machine.
ATOMIC_API String GetHostName();
/// Return the version of the currently running OS.
/// Return the version of the currently running OS, or (?) if not identified.
ATOMIC_API String GetOSVersion();

// ATOMIC BEGIN
Expand Down
4 changes: 2 additions & 2 deletions Source/Atomic/Graphics/Text3D/Text3DFreeType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ bool Text3DFreeType::Load(const unsigned char* fontData, unsigned fontDataSize,
unsigned rightIndex = deserializer.ReadUShort();
short amount = FixedToFloat(deserializer.ReadShort());

unsigned leftCharCode = leftIndex < numGlyphs ? charCodes[leftIndex] : 0;
unsigned rightCharCode = rightIndex < numGlyphs ? charCodes[rightIndex] : 0;
unsigned leftCharCode = leftIndex < numGlyphs ? charCodes[leftIndex + 1] : 0;
unsigned rightCharCode = rightIndex < numGlyphs ? charCodes[rightIndex + 1] : 0;
if (leftCharCode != 0 && rightCharCode != 0)
{
unsigned value = (leftCharCode << 16) + rightCharCode;
Expand Down

0 comments on commit 604d153

Please sign in to comment.