summaryrefslogtreecommitdiff
path: root/ham/dpbox/patches/patch-ak
blob: 841caddee704b89b38ba2de849eb639f94cdfaec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
$NetBSD: patch-ak,v 1.2 2006/04/21 02:07:54 wulf Exp $

--- pastrix.c.orig	2000-04-27 22:18:55.000000000 +0930
+++ pastrix.c	2006-04-14 11:56:19.000000000 +0930
@@ -19,7 +19,7 @@
 #include "boxlocal.h"
 #include "tools.h"
 
-#if defined(__linux__) || defined(__NetBSD__)
+#if defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__)
 #include <ctype.h>
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -80,7 +80,7 @@
 #endif
 }
 
-#if defined(__linux__) || defined(__NetBSD__)
+#if defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__)
 
 long get_cpuusage(void)
 {
@@ -557,7 +557,7 @@
     return 129;
 
   default:
-    return tolower(ch);
+    return tolower((u_char) ch);
   }
 }
 
@@ -576,7 +576,7 @@
     return 154;
  
   default:
-    return toupper(ch);
+    return toupper((u_char) ch);
   }
 }
 
@@ -615,7 +615,7 @@
     if (*s == '\0') return false;
   }
   while (*s != '\0') {
-    if (!isdigit(*s++)) {
+    if (!isdigit((u_char) *s++)) {
       return false;
     }
   }
@@ -633,7 +633,7 @@
     if (s[1] == '\0')
       return false;
     while (*s != '\0') {
-      if (!((*s >= 'a' && *s <= 'f') || (*s >= 'A' && *s <= 'F') || isdigit(*s)))
+      if (!((*s >= 'a' && *s <= 'f') || (*s >= 'A' && *s <= 'F') || isdigit((u_char) *s)))
 	return false;
       s++;
     }
@@ -669,9 +669,9 @@
 
   digit = false;
   while (*s != '\0') {
-    if (!(*s == 'e' || *s == 'E' || *s == '+' || *s == '-' || *s == '.' || isdigit(*s)))
+    if (!(*s == 'e' || *s == 'E' || *s == '+' || *s == '-' || *s == '.' || isdigit((u_char) *s)))
       return false;
-    else if (isdigit(*s))
+    else if (isdigit((u_char) *s))
       digit = true;
   }
 
@@ -702,7 +702,7 @@
     return c - 87;
 
   default:
-    if (isdigit(c))
+    if (isdigit((u_char) c))
       return c - '0';
     else
       return 0;