Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/cad/electric/files/patch-src_graph_graphunixx11.c
16461 views
1
--- src/graph/graphunixx11.c.orig 2004-07-16 01:59:53 UTC
2
+++ src/graph/graphunixx11.c
3
@@ -167,6 +167,8 @@
4
#define TRUESTRLEN strlen
5
6
7
+#include <sys/sysctl.h>
8
+
9
/****** windows ******/
10
11
#define WMLEFTBORDER 8 /* size of left border for windows */
12
@@ -1518,13 +1520,13 @@ BOOLEAN initgraphics(BOOLEAN messages)
13
gra_truetypeon = 1;
14
15
/* Preload T1 fonts here, because T1_LoadFont spoils memory */
16
- for(j=0; j<T1_Get_no_fonts(); j++) T1_LoadFont(j);
17
+ for(j=0; j<T1_GetNoFonts(); j++) T1_LoadFont(j);
18
19
gra_truetypedeffont = 0; /* presume that the first font is good to use */
20
ptr = egetenv(x_("ELECTRIC_TRUETYPE_FONT"));
21
if (ptr != NULL)
22
{
23
- j = T1_Get_no_fonts();
24
+ j = T1_GetNoFonts();
25
for(gra_truetypedeffont=0; gra_truetypedeffont<j; gra_truetypedeffont++)
26
{
27
T1_LoadFont(gra_truetypedeffont);
28
@@ -3088,8 +3090,13 @@ void ewait(INTBIG process)
29
INTBIG enumprocessors(void)
30
{
31
INTBIG numproc;
32
+ size_t proclen;
33
+
34
+ proclen = sizeof(numproc);
35
+ if ((sysctlbyname("hw.ncpu", &numproc, &proclen, NULL, 0) < 0) ||
36
+ (proclen != sizeof(numproc)))
37
+ numproc = 1;
38
39
- numproc = sysconf(_SC_NPROCESSORS_ONLN);
40
return(numproc);
41
}
42
43
@@ -4758,7 +4765,7 @@ INTBIG screengetfacelist(CHAR ***list, B
44
45
if (gra_numfaces == 0)
46
{
47
- total = T1_Get_no_fonts();
48
+ total = T1_GetNoFonts();
49
gra_numfaces = total + 1;
50
gra_facelist = (CHAR **)emalloc(gra_numfaces * (sizeof (CHAR *)), us_tool->cluster);
51
if (gra_facelist == 0) return(0);
52
53