Merge remote-tracking branch 'upstream/master'
Conflicts: src/console_gui.cpp src/genworld_gui.cpp src/group_gui.cpp src/misc_gui.cpp src/settings_gui.cpp src/widgets/settings_widget.h
This commit is contained in:
+15
-3
@@ -15,6 +15,7 @@
|
||||
#include "../../crashlog.h"
|
||||
#include "../../core/random_func.hpp"
|
||||
#include "../../debug.h"
|
||||
#include "../../string_func.h"
|
||||
|
||||
|
||||
#include <dirent.h>
|
||||
@@ -63,6 +64,8 @@ ULONG __stack = (1024*1024)*2; // maybe not that much is needed actually ;)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "../../safeguards.h"
|
||||
|
||||
bool FiosIsRoot(const char *path)
|
||||
{
|
||||
#if !defined(__MORPHOS__) && !defined(__AMIGAOS__)
|
||||
@@ -105,13 +108,13 @@ bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb
|
||||
#if defined(__MORPHOS__) || defined(__AMIGAOS__)
|
||||
/* On MorphOS or AmigaOS paths look like: "Volume:directory/subdirectory" */
|
||||
if (FiosIsRoot(path)) {
|
||||
res = snprintf(filename, lengthof(filename), "%s:%s", path, ent->d_name);
|
||||
res = seprintf(filename, lastof(filename), "%s:%s", path, ent->d_name);
|
||||
} else // XXX - only next line!
|
||||
#else
|
||||
assert(path[strlen(path) - 1] == PATHSEPCHAR);
|
||||
if (strlen(path) > 2) assert(path[strlen(path) - 2] != PATHSEPCHAR);
|
||||
#endif
|
||||
res = snprintf(filename, lengthof(filename), "%s%s", path, ent->d_name);
|
||||
res = seprintf(filename, lastof(filename), "%s%s", path, ent->d_name);
|
||||
|
||||
/* Could we fully concatenate the path and filename? */
|
||||
if (res >= (int)lengthof(filename) || res < 0) return false;
|
||||
@@ -287,7 +290,7 @@ int CDECL main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#ifndef WITH_COCOA
|
||||
bool GetClipboardContents(char *buffer, size_t buff_len)
|
||||
bool GetClipboardContents(char *buffer, const char *last)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -342,9 +345,18 @@ uint GetCPUCoreCount()
|
||||
int ncpu = 0;
|
||||
size_t len = sizeof(ncpu);
|
||||
|
||||
#ifdef OPENBSD
|
||||
int name[2];
|
||||
name[0] = CTL_HW;
|
||||
name[1] = HW_NCPU;
|
||||
if (sysctl(name, 2, &ncpu, &len, NULL, 0) < 0) {
|
||||
ncpu = 0;
|
||||
}
|
||||
#else
|
||||
if (sysctlbyname("hw.availcpu", &ncpu, &len, NULL, 0) < 0) {
|
||||
sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0);
|
||||
}
|
||||
#endif /* #ifdef OPENBSD */
|
||||
|
||||
if (ncpu > 0) count = ncpu;
|
||||
#elif defined(_SC_NPROCESSORS_ONLN)
|
||||
|
||||
Reference in New Issue
Block a user