summaryrefslogtreecommitdiff
path: root/package/digitemp/patches/patch-src_digitemp_c
blob: 92b5bcca0dd3f7f126537d6cb907d3c6e7720ee3 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
--- digitemp-3.6.0.orig/src/digitemp.c	2008-08-28 06:42:48.000000000 +0200
+++ digitemp-3.6.0/src/digitemp.c	2009-06-12 21:29:17.000000000 +0200
@@ -62,9 +62,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <unistd.h>
-#if !defined(AIX) && !defined(SOLARIS) && !defined(FREEBSD) && !defined(DARWIN)
 #include <getopt.h>
-#endif /* !AIX and !SOLARIS and !FREEBSD and !DARWIN */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -75,24 +73,11 @@
 #include <stdint.h>
 #include "ad26.h"
 
-// Include endian.h
-#if DARWIN
-#include <machine/endian.h>
-#endif
-#if FREEBSD
-#include <sys/endian.h>
-#endif
-#if !defined(DARWIN) && !defined(FREEBSD)
-#include <endian.h>
-#endif
-
-#ifdef LINUX
 #ifndef OWUSB
 #ifdef LOCKDEV
 #include <lockdev.h>
 #endif
 #endif
-#endif
 
 #include "digitemp.h"
 #include "device_name.h"
@@ -101,51 +86,8 @@
 
 
 /* Setup the correct getopt starting point */
-#ifdef LINUX
 #define GETOPTEOF -1
 #define OPTINDSTART 0
-#endif
-
-#ifdef CYGWIN
-#define GETOPTEOF -1
-#define OPTINDSTART 0
-#endif
-
-#ifdef AIX
-#define OPTINDSTART 0
-#define GETOPTEOF 255
-#endif
- 
-#ifdef SOLARIS
-#define GETOPTEOF EOF
-#define OPTINDSTART 1
-#endif
-
-#ifdef FREEBSD
-#define GETOPTEOF EOF
-#define OPTINDSTART 1
-#endif
-
-#ifdef OPENBSD
-#define GETOPTEOF EOF
-#define OPTINDSTART 1
-#endif
-
-#ifdef NETBSD
-#define GETOPTEOF EOF
-#define OPTINDSTART 1
-#endif
-
-#ifdef DARWIN
-#define GETOPTEOF EOF
-#define OPTINDSTART 1
-#endif
- 
-#ifdef OTHER
-#define GETOPTEOF EOF
-#define OPTINDSTART 1
-#endif 
-
 
 /* For tracking down strange errors */
 #undef BCL_DEBUG
@@ -153,10 +95,6 @@
 extern char 	*optarg;              
 extern int	optind, opterr, optopt;
 
-#if defined(FREEBSD) || defined(DARWIN)
-extern int optreset;
-#endif /* FREEBSD or DARWIN */
-
 extern const char dtlib[];			/* Library Used            */
  
 char serial_port[40],                        /* Path to the serial port */
@@ -1928,7 +1866,7 @@ int Walk1Wire()
   struct _roms  coupler_list;           /* Attached Roms                */
   int   x;
 
-  bzero( &coupler_list, sizeof( struct _roms ) );
+  memset( &coupler_list, 0, sizeof( struct _roms ) );
     
   /* Find any DS2409 Couplers and turn them all off.
      This WILL NOT WORK if there is a coupler attached to the
@@ -2427,7 +2365,7 @@ int main( int argc, char *argv[] )
 
 
   /* Make sure the structure is erased */
-  bzero( &sensor_list, sizeof( struct _roms ) );
+  memset( &sensor_list, 0, sizeof( struct _roms ) );
  
 
   if( argc <= 1 )