[ispykee] r4 committed - Get rid of compile warnings by fixing bugs in the source.

9 views
Skip to first unread message

isp...@googlecode.com

unread,
Sep 6, 2010, 8:38:27 AM9/6/10
to isp...@googlegroups.com
Revision: 4
Author: pe...@hungry.com
Date: Mon Sep 6 05:38:04 2010
Log: Get rid of compile warnings by fixing bugs in the source.
http://code.google.com/p/ispykee/source/detail?r=4

Modified:
/trunk/Makefile
/trunk/lowres.c
/trunk/motion.c
/trunk/spykee.c

=======================================
--- /trunk/Makefile Mon Sep 6 05:29:57 2010
+++ /trunk/Makefile Mon Sep 6 05:38:04 2010
@@ -8,8 +8,8 @@
LDFLAGS=-lm
#comment out the above if you don't have libjpeg

-# had to add this for OS X 10.4 gcc/libc for gettimeofday()
-#CFLAGS+=-DTZP
+# had to add this for OS X 10.4 and Linux gcc/libc for gettimeofday()
+CFLAGS+=-DTZP

# Turn on AUDIO capture
CFLAGS+=-DGETAUDIO
=======================================
--- /trunk/lowres.c Wed Sep 1 14:49:09 2010
+++ /trunk/lowres.c Mon Sep 6 05:38:04 2010
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>

#include "jpeglib.h"

=======================================
--- /trunk/motion.c Wed Sep 1 14:49:09 2010
+++ /trunk/motion.c Mon Sep 6 05:38:04 2010
@@ -83,7 +83,8 @@
int row_stride1, row_stride2;
JSAMPARRAY buffer1, buffer2;
double ySumSqDiff, crSumSqDiff, cbSumSqDiff;
- int col, retval;
+ unsigned int col;
+ int retval;
FILE *file1, *file2;
unsigned char *p1, *p2;

=======================================
--- /trunk/spykee.c Wed Sep 1 14:49:09 2010
+++ /trunk/spykee.c Mon Sep 6 05:38:04 2010
@@ -19,6 +19,10 @@
#include <fcntl.h>
#include <sys/param.h>
#include <sys/file.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <time.h>
+#include <sys/time.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
@@ -33,6 +37,10 @@
#define INADDR_NONE 0xffffffff /* should be in <netinet/in.h> */
#endif

+void main_loop(void);
+int connect_spykee(char *ip, int port, char *uname, char*pw);
+int process_packet(int n);
+
extern char *optarg;
extern int optind;
extern int optopt;
@@ -79,7 +87,7 @@
static char *version = VERSION;

#ifdef HARDSTOP
-hardstop()
+void hardstop(int)
{

siginterrupt(SIGALRM, 1);
@@ -108,7 +116,7 @@
return(0);
}

-adios()
+void adios(void)
{
fprintf(stderr, "Bye\n");
exit(0);
@@ -136,7 +144,7 @@
}
}

-void motor_left()
+void motor_left(void)
{
struct timeval tm;

@@ -167,7 +175,7 @@
}
}

-void motor_right()
+void motor_right(void)
{
struct timeval tm;

@@ -198,7 +206,7 @@
}
}

-void motor_forward()
+void motor_forward(void)
{
Opk[0] = 'P';
Opk[1] = 'K';
@@ -215,7 +223,7 @@
#endif
}

-void motor_back()
+void motor_back(void)
{
Opk[0] = 'P';
Opk[1] = 'K';
@@ -232,7 +240,7 @@
#endif
}

-void motor_stop()
+void motor_stop(void)
{
Opk[0] = 'P';
Opk[1] = 'K';
@@ -267,7 +275,7 @@
}


-void dock()
+void dock(void)
{

Opk[0] = 'P';
@@ -285,7 +293,7 @@

}

-void canceldock()
+void canceldock(void)
{

Opk[0] = 'P';
@@ -303,7 +311,7 @@

}

-void undock()
+void undock(void)
{

Opk[0] = 'P';
@@ -321,7 +329,7 @@

}

-void start_video()
+void start_video(void)
{

// Set The Sound Power of Spykee
@@ -361,7 +369,7 @@
}

#ifdef GETAUDIO
-void start_audio() {
+void start_audio(void) {
/* NOTE: capture of audio is disabled, but this is how you enable it */
// Activate The audio?
// 'PK'+chr(15)+chr(0)+chr(2)+chr(2)+chr(1)
@@ -380,7 +388,7 @@
#endif
}

-void stop_audio() {
+void stop_audio(void) {
/* NOTE: capture of audio is disabled, but this is how you enable it */
// Activate The audio?
// 'PK'+chr(15)+chr(0)+chr(2)+chr(2)+chr(1)
@@ -411,7 +419,7 @@
* such as MP3 etc. if desired
*/

-void save_audio() {
+void save_audio(void) {
char fname[256];
int fd, fd2;
au_filehdr_t hdr;
@@ -473,7 +481,7 @@
}
#endif

-void report_batt()
+void report_batt(void)
{
fprintf(stderr, "report_batt: %d\n", battlvl);
sprintf((char *)Osvr, "%d\r\n", battlvl);
@@ -663,7 +671,7 @@
#endif
}

-int single_step()
+int single_step(void)
{
fd_set all_fds;
int width;
@@ -1323,7 +1331,7 @@
fprintf(stderr, "Cannot conect to server at %s\n", ip);
}

-main_loop()
+void main_loop(void)
{
int n;

Reply all
Reply to author
Forward
0 new messages