eb-console

"A. Craig West" <[email protected]> Mon, 29 Mar 2004 18:25:44 -0500 (EST)
Newsgroups gmane.network.everybuddy.devel
Message-ID <[email protected]>
While I was inthe neighbourhood, I shamelessly stole some of Karine's Makefile
changes from ebnc and put them in eb-console. Then, using the results of the
-Wall flag on the compile, I cleaned up it's compile, too. The results are:
(I'm not positive about the Makefile.Win32 changes, but they should be all
right)

------------------ Patch Begins -------------------
Index: eb-console/GUIcomms.c
===================================================================
--- eb-console/GUIcomms.c	(revision 319)
+++ eb-console/GUIcomms.c	(working copy)
@@ -1,4 +1,6 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #ifdef __MINGW32__
 #include <winsock2.h>
@@ -45,6 +47,8 @@
   return 0;
 }
 
+int read_m(int sock, char * dest, int num);
+
 char ** read_gui_message(int * num_params)
 {
   unsigned char c, c2[2];
@@ -84,7 +88,6 @@
 {
   struct sockaddr_in sa;
   struct hostent     *hp;
-  int a;
 #ifdef __MINGW32__
   WSADATA wsaData;
   WSAStartup(MAKEWORD(2,0),&wsaData);
@@ -116,7 +119,7 @@
 {
   int pos=0;
   int read_result=0;
-  int a;
+  //int a;
 
   while(pos<num)
   {
Index: eb-console/eb-console.c
===================================================================
--- eb-console/eb-console.c	(revision 319)
+++ eb-console/eb-console.c	(working copy)
@@ -240,7 +240,7 @@
 
 void handle_interrupt(int sig);
 
-main(int argc, char * argv[])
+int main(int argc, char * argv[])
 {
   char * host="localhost";
   int port=18234;
@@ -545,6 +545,7 @@
   {
     if(!strcmp(name, c->params[a].name)) { return &(c->params[a]); }
   }
+  return NULL;
 }
 
 void diffpoint(const char * s1, const char * s2, int * minmatch)
Index: eb-console/Makefile
===================================================================
--- eb-console/Makefile	(revision 319)
+++ eb-console/Makefile	(working copy)
@@ -1,7 +1,18 @@
-CFLAGS=-g
+CFLAGS = -g -Wall
 
-eb-console: GUIcomms.o eb-console.o elist.o ebparse.o
-	gcc -g -o eb-console GUIcomms.o eb-console.o elist.o ebparse.o -lreadline -lcurses
+OBJECTS = GUIcomms.o eb-console.o elist.o ebparse.o
 
+eb-console: $(OBJECTS) dep
+	gcc $(CFLAGS) -o eb-console $(OBJECTS) -lreadline -lcurses
+
+dep:
+	@echo > .deps
+	@for i in $(SRC); do gcc -MM $$i >> .deps; done
+
 clean:
 	rm -f eb-console *.o
+
+run:
+	./eb-console -c ~/.everybuddy/authcookie
+
+-include .deps
Index: eb-console/Makefile.win32
===================================================================
--- eb-console/Makefile.win32	(revision 319)
+++ eb-console/Makefile.win32	(working copy)
@@ -1,8 +1,19 @@
-CFLAGS=-g
+CFLAGS = -g -Wall
 LIBS=-L/usr/local/lib -lcurses-static -lws2_32 -lwinmm
 
-eb-console: GUIcomms.o eb-console.o elist.o ebparse.o
-	gcc -g -o eb-console GUIcomms.o eb-console.o elist.o ebparse.o -lreadline -lcurses $(LIBS)
+OBJECTS = GUIcomms.o eb-console.o elist.o ebparse.o
 
+eb-console: $(OBJECTS) dep
+	gcc $(CFLAGS) -o eb-console $(OBJECTS) -lreadline -lcurses $(LIBS)
+
+dep:
+	@echo > .deps
+	@for i in $(SRC); do gcc -MM $$i >> .deps; done
+
 clean:
 	rm -f eb-console *.o
+
+run:
+	./eb-console -c ~/.everybuddy/authcookie
+
+-include .deps
------------------ Patch Ends -------------------

-- 
Craig West         Ph: (416) 666-1645	|  It's not a bug,
[email protected]              	|  It's a feature...