public
Description: My 1wire protocol stack and related tools
Homepage: http://bleu.west.spy.net/~dustin/projects/ibutton/
Clone URL: git://github.com/dustin/ibutton.git
Search Repo:
Updates for newer, more strict compilers.


imported from: dustin@spy.net--projects-2006/ibutton--head--1.2--patch-2
dustin (author)
Sun May 28 19:45:13 -0700 2006
commit  67e4511948d7847fd782708cdf7bf67cd2478411
tree    58b8d161c01ab6b9d9859f9c1e5fdd66f7b5cbfb
parent  47c4d27f45248afd40ee975db58985531dcbb9de
...
28
29
30
31
 
 
32
33
34
...
28
29
30
 
31
32
33
34
35
0
@@ -28,7 +28,8 @@ all:
0
 distclean: clean
0
   cd collection && make clean
0
   rm -f Makefile config.cache config.status config.log \
0
- collection/Makefile mlan/Makefile
0
+ collection/Makefile mlan/Makefile commands/Makefile
0
+ rmdir mlan/stringlib mlan/mymalloc
0
 
0
 clean:
0
   rm -f $(PROGS) $(PROGO)
...
2
3
4
5
 
6
...
2
3
4
 
5
6
0
@@ -2,5 +2,5 @@
0
 
0
 # Need mymalloc
0
 ./mymalloc  dustin@spy.net--projects/clib--mymalloc--1.0
0
-./stringlib dustin@spy.net--projects-2004/clib--strings--1.0
0
+./stringlib dustin@spy.net--projects-2006/clib--strings--1.0
0
 
...
212
213
214
215
 
 
216
217
218
...
212
213
214
 
215
216
217
218
219
0
@@ -212,7 +212,8 @@ mainloop()
0
 {
0
   char msgbuf[256];
0
   struct sockaddr_in addr;
0
- int nbytes=0, addrlen=0;
0
+ int nbytes=0;
0
+ socklen_t addrlen=0;
0
 
0
   /* now just enter a read-print loop */
0
   addrlen = sizeof(addr);
...
444
445
446
447
 
448
449
450
 
451
452
453
...
745
746
747
748
 
749
750
751
...
444
445
446
 
447
448
449
 
450
451
452
453
...
745
746
747
 
748
749
750
751
0
@@ -444,10 +444,10 @@ msend(const char *msg)
0
 
0
 /* Parse the serial number if it looks like a serial number, else return a
0
  * serial number beginning with 0x00 */
0
-char *
0
+uchar *
0
 sdParseSerial(char *in, uchar *out)
0
 {
0
- char *rv=NULL;
0
+ uchar *rv=NULL;
0
 
0
   /* Validate the size */
0
   if(strlen(in) == (MLAN_SERIAL_SIZE*2)) {
0
@@ -745,7 +745,7 @@ mainLoop()
0
       if(FD_ISSET(serverSocket, &rfdset)) {
0
         int client=0;
0
         struct sockaddr_in fsin;
0
- int fromlen=sizeof(fsin);
0
+ socklen_t fromlen=sizeof(fsin);
0
 
0
         client=accept(serverSocket, (struct sockaddr *)&fsin, &fromlen);
0
         if(client < 0) {
...
16
17
18
19
20
21
22
23
24
...
52
53
54
 
 
 
55
56
57
...
59
60
61
62
 
63
64
65
...
16
17
18
 
 
 
19
20
21
...
49
50
51
52
53
54
55
56
57
...
59
60
61
 
62
63
64
65
0
@@ -16,9 +16,6 @@
0
 #define CLIENT_CONTINUE 0
0
 #define CLIENT_DONE 1
0
 
0
-/* Command pointers */
0
-extern struct cmdPointer cmdPointers[];
0
-
0
 /* Possible TCP client states */
0
 enum client_state {
0
   CONNECTED, /* Connected, ready to talk. */
0
@@ -52,6 +49,9 @@ struct cmdPointer {
0
   int (*cmd)(MLan *mlan, struct client *client, int argc, char **argv);
0
 };
0
 
0
+/* Command pointers */
0
+extern struct cmdPointer cmdPointers[];
0
+
0
 /* Prototypes */
0
 void log_error(char *str, ...);
0
 void log_info(char *str, ...);
0
@@ -59,7 +59,7 @@ void handleNewConnection(struct client*, struct sockaddr_in);
0
 int getServerSocket(int port);
0
 int handleRead(MLan *mlan, struct client *client);
0
 void handleWrite(struct client *client);
0
-char *sdParseSerial(char *in, uchar *out);
0
+uchar *sdParseSerial(char *in, uchar *out);
0
 
0
 /* Free a client message */
0
 void freeClientMessage(struct client_msg *msg);
...
416
417
418
419
 
420
421
422
...
416
417
418
 
419
420
421
422
0
@@ -416,7 +416,7 @@ processClientData(MLan *mlan, struct client *client)
0
   char *latest=NULL;
0
 
0
   /* Skip over leading whitespace */
0
- while(*p != NULL && isspace(*p)) {
0
+ while(*p != 0x00 && isspace(*p)) {
0
     p++;
0
   }
0
 
...
2423
2424
2425
2426
 
2427
 
2428
2429
2430
...
4884
4885
4886
4887
 
4888
4889
4890
...
2423
2424
2425
 
2426
2427
2428
2429
2430
2431
...
4885
4886
4887
 
4888
4889
4890
4891
0
@@ -2423,8 +2423,9 @@ fi
0
 
0
 if test "$GCC" = "yes"
0
 then
0
- echo "GCC, setting -Wall"
0
+ echo "GCC, setting -Wall and -Werror"
0
   CPPFLAGS="$CPPFLAGS -Wall"
0
+ CFLAGs="$CFLAGS -Werror"
0
 fi
0
 
0
 if test "$GUILECONF" = ""
0
@@ -4884,7 +4885,7 @@ fi
0
 done
0
 
0
 
0
-CFLAGS="$CFLAGS $CPPFLAGS"
0
+CFLAGS="$CFLAGS $CPPFLAGS $EXTRACFLAGS"
0
 
0
                                         ac_config_files="$ac_config_files Makefile collection/Makefile mlan/Makefile commands/Makefile"
0
 cat >confcache <<\_ACEOF
...
68
69
70
71
 
72
 
73
74
75
...
136
137
138
139
 
140
141
...
68
69
70
 
71
72
73
74
75
76
...
137
138
139
 
140
141
142
0
@@ -68,8 +68,9 @@ fi
0
 
0
 if test "$GCC" = "yes"
0
 then
0
- echo "GCC, setting -Wall"
0
+ echo "GCC, setting -Wall and -Werror"
0
   CPPFLAGS="$CPPFLAGS -Wall"
0
+ CFLAGs="$CFLAGS -Werror"
0
 fi
0
 
0
 dnl If there's guile, build the guile stuff.
0
@@ -136,6 +137,6 @@ AC_TYPE_SIGNAL
0
 AC_CHECK_FUNCS(getopt vsprintf vsnprintf snprintf sprintf strerror utime utimes)
0
 AC_CHECK_FUNCS(vasprintf)
0
 
0
-CFLAGS="$CFLAGS $CPPFLAGS"
0
+CFLAGS="$CFLAGS $CPPFLAGS $EXTRACFLAGS"
0
 
0
 AC_OUTPUT(Makefile collection/Makefile mlan/Makefile commands/Makefile)
...
112
113
114
115
 
116
117
118
...
122
123
124
125
 
126
127
128
...
112
113
114
 
115
116
117
118
...
122
123
124
 
125
126
127
128
0
@@ -112,7 +112,7 @@ h2b(int size, char *buf, uchar *outbuf)
0
 }
0
 
0
 /* External API for parsing serial numbers */
0
-char *
0
+uchar *
0
 parseSerial(char *in, uchar *out)
0
 {
0
   assert(in);
0
@@ -122,7 +122,7 @@ parseSerial(char *in, uchar *out)
0
 }
0
 
0
 /* Parse a serial number */
0
-static char *
0
+static uchar *
0
 _mlan_parseSerial(MLan *mlan, char *in, uchar *out)
0
 {
0
   return(parseSerial(in, out));
...
81
82
83
84
 
85
86
87
...
103
104
105
106
 
107
108
109
...
81
82
83
 
84
85
86
87
...
103
104
105
 
106
107
108
109
0
@@ -81,7 +81,7 @@ struct __mlan {
0
   void (*copySerial)(MLan *mlan, uchar *in);
0
   char *(*serialLookup)(MLan *mlan, int which);
0
   void (*registerSerial)(MLan *mlan, int id, char *value);
0
- char *(*parseSerial)(MLan *mlan, char *serial, uchar *output);
0
+ uchar *(*parseSerial)(MLan *mlan, char *serial, uchar *output);
0
   int (*getBlock)(MLan *mlan, uchar *serial, int page, int pages, uchar *);
0
   int (*writeScratchpad)(MLan *mlan, uchar *serial, int page, int, uchar *);
0
   int (*copyScratchpad)(MLan *mlan, uchar *serial, int page, int size);
0
@@ -103,7 +103,7 @@ char *get_sample(MLan *mlan, uchar *serial);
0
 
0
 void binDumpBlock(uchar *buffer, int size, int start_addr);
0
 void dumpBlock(uchar *buffer, int size);
0
-char *parseSerial(char *in, uchar *out);
0
+uchar *parseSerial(char *in, uchar *out);
0
 
0
 /* Common functions */
0
 int recall(MLan *mlan, uchar *serial);

Comments

    No one has commented yet.