changeset 210:ec0686b3b03f

[gaim-migrate @ 220] Mostly small changes trying to get -Wall not to give any messages. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 01 May 2000 19:39:00 +0000
parents 6e9b375e30e7
children 2042a38da38b
files src/conversation.c src/gaim.h src/proxy.c src/rvous.c src/util.c
diffstat 5 files changed, 41 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Mon May 01 18:49:00 2000 +0000
+++ b/src/conversation.c	Mon May 01 19:39:00 2000 +0000
@@ -26,6 +26,7 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <ctype.h>
 #include <gtk/gtk.h>
 #include "gaim.h"
 #include "gtkhtml.h"
@@ -37,7 +38,7 @@
 #include "pixmaps/normal.xpm"
 #include "pixmaps/big.xpm"
 #include "pixmaps/speaker.xpm"
-#include "pixmaps/aimicon2.xpm"
+/* #include "pixmaps/aimicon2.xpm" */
 #include "pixmaps/wood.xpm"
 #include "pixmaps/palette.xpm"
 #include "pixmaps/link.xpm"
--- a/src/gaim.h	Mon May 01 18:49:00 2000 +0000
+++ b/src/gaim.h	Mon May 01 19:39:00 2000 +0000
@@ -235,34 +235,36 @@
 };
 
 struct file_header {
-	short hdrtype;		/* 0 */
-	char  bcookie[8];	/* 2 */
-	short encrypt;		/* 10 */
-	short compress;		/* 12 */
-	short totfiles;		/* 14 */
-	short filesleft;	/* 16 */
-	short totparts;		/* 18 */
-	short partsleft;	/* 20 */
-	long  totsize;		/* 22 */
-	long  size;		/* 26 */
-	long  modtime;		/* 30 */
-	long  checksum;		/* 34 */
-	long  rfrcsum;		/* 38 */
-	long  rfsize;		/* 42 */
-	long  cretime;		/* 46 */
-	long  rfcsum;		/* 50 */
-	long  nrecvd;		/* 54 */
-	long  recvcsum;		/* 58 */
-	char  idstring[32];	/* 62 */
-	char  flags;		/* 94 */
-	char  lnameoffset;	/* 95 */
-	char  lsizeoffset;	/* 96 */
-	char  dummy[69];	/* 97 */
-	char  macfileinfo[16];	/* 166 */
-	short nencode;		/* 182 */
-	short nlanguage;	/* 184 */
-	char  name[64];		/* 186 */
-				/* 250 */
+	char  magic[4];		/* 0 */
+	short hdrlen;		/* 4 */
+	short hdrtype;		/* 6 */
+	char  bcookie[8];	/* 8 */
+	short encrypt;		/* 16 */
+	short compress;		/* 18 */
+	short totfiles;		/* 20 */
+	short filesleft;	/* 22 */
+	short totparts;		/* 24 */
+	short partsleft;	/* 26 */
+	long  totsize;		/* 28 */
+	long  size;		/* 32 */
+	long  modtime;		/* 36 */
+	long  checksum;		/* 40 */
+	long  rfrcsum;		/* 44 */
+	long  rfsize;		/* 48 */
+	long  cretime;		/* 52 */
+	long  rfcsum;		/* 56 */
+	long  nrecvd;		/* 60 */
+	long  recvcsum;		/* 64 */
+	char  idstring[32];	/* 68 */
+	char  flags;		/* 100 */
+	char  lnameoffset;	/* 101 */
+	char  lsizeoffset;	/* 102 */
+	char  dummy[69];	/* 103 */
+	char  macfileinfo[16];	/* 172 */
+	short nencode;		/* 188 */
+	short nlanguage;	/* 190 */
+	char  name[64];		/* 192 */
+				/* 256 */
 };
 
 struct file_transfer {
@@ -332,7 +334,7 @@
 #define TYPE_SIGNOFF   4
 #define TYPE_KEEPALIVE 5
 
-#define REVISION "gaim:$Revision: 219 $"
+#define REVISION "gaim:$Revision: 220 $"
 #define FLAPON "FLAPON\r\n\r\n"
 
 #define ROAST "Tic/Toc"
--- a/src/proxy.c	Mon May 01 18:49:00 2000 +0000
+++ b/src/proxy.c	Mon May 01 19:39:00 2000 +0000
@@ -35,7 +35,7 @@
 #include "proxy.h"
 
 
-static int proxy_inited=0;
+/* static int proxy_inited=0; */
 int proxy_type = 0;
 char proxy_host[256];
 int proxy_port = 3128;
--- a/src/rvous.c	Mon May 01 18:49:00 2000 +0000
+++ b/src/rvous.c	Mon May 01 19:39:00 2000 +0000
@@ -324,7 +324,6 @@
 	char *file = g_strdup(gtk_file_selection_get_filename(GTK_FILE_SELECTION(ft->window)));
 	char *buf;
 	int read_rv;
-	char bmagic[7];
 	struct file_header *fhdr = g_new0(struct file_header, 1);
 	struct sockaddr_in sin;
 	guint32 rcv;
@@ -379,6 +378,8 @@
 	buf = frombase64(ft->cookie);
 	sprintf(debug_buff, "Building header to send %s (cookie: %s)\n", file, buf);
 	debug_print(debug_buff);
+	fhdr->magic[0] = 'O'; fhdr->magic[1] = 'F'; fhdr->magic[2] = 'T'; fhdr->magic[3] = '2';
+	fhdr->hdrlen = 256;
 	fhdr->hdrtype = 0x1108;
 	snprintf(fhdr->bcookie, 8, "%s", buf);
 	g_free(buf);
@@ -408,17 +409,9 @@
 	fhdr->nencode = 0;
 	fhdr->nlanguage = 0;
 	snprintf(fhdr->name, 64, "listing.txt");
-	snprintf(bmagic, 6, "TFT1\001");
-	read_rv = write(ft->fd, bmagic, 6);
+	read_rv = write(ft->fd, fhdr, 256);
 	if (read_rv <= -1) {
-		sprintf(debug_buff, "Couldn't write opening header \n");
-		debug_print(debug_buff);
-		close(ft->fd);
-		return;
-	}
-	read_rv = write(ft->fd, fhdr, 250);
-	if (read_rv <= -1) {
-		sprintf(debug_buff, "Couldn't write opening header 2\n");
+		sprintf(debug_buff, "Couldn't write opening header\n");
 		debug_print(debug_buff);
 		close(ft->fd);
 		return;
@@ -427,20 +420,13 @@
 	/* 2. receive header */
 	sprintf(debug_buff, "Receiving header\n");
 	debug_print(debug_buff);
-	read_rv = read(ft->fd, bmagic, 6);
+	read_rv = read(ft->fd, fhdr, 256);
 	if (read_rv <= -1) {
 		sprintf(debug_buff, "Couldn't read header\n");
 		debug_print(debug_buff);
 		close(ft->fd);
 		return;
 	}
-	read_rv = read(ft->fd, fhdr, *(short *)&bmagic[4]);
-	if (read_rv <= -1) {
-		sprintf(debug_buff, "Couldn't read header 2\n");
-		debug_print(debug_buff);
-		close(ft->fd);
-		return;
-	}
 
 	/* 3. send listing file */
 	/* mm/dd/yyyy hh:mm sizesize name.ext\r\n */
@@ -474,20 +460,13 @@
 	/* 4. receive header */
 	sprintf(debug_buff, "Receiving closing header\n");
 	debug_print(debug_buff);
-	read_rv = read(ft->fd, bmagic, 6);
+	read_rv = read(ft->fd, fhdr, 256);
 	if (read_rv <= -1) {
 		sprintf(debug_buff, "Couldn't read closing header\n");
 		debug_print(debug_buff);
 		close(ft->fd);
 		return;
 	}
-	read_rv = read(ft->fd, fhdr, *(short *)&bmagic[4]);
-	if (read_rv <= -1) {
-		sprintf(debug_buff, "Couldn't read closing header 2\n");
-		debug_print(debug_buff);
-		close(ft->fd);
-		return;
-	}
 
 	fclose(ft->f);
 	close(ft->fd);
--- a/src/util.c	Mon May 01 18:49:00 2000 +0000
+++ b/src/util.c	Mon May 01 19:39:00 2000 +0000
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <sys/wait.h>
 #include <gtk/gtk.h>
+#include <ctype.h>
 #include <pixmaps/aimicon.xpm>
 #include "gaim.h"
 
@@ -758,7 +759,6 @@
 {
         int start = 0;
         int end = 0;
-        int length = gtk_text_get_length(GTK_TEXT(text));
         static GdkColor * color = NULL;
         int ignore = 0;
         int point = gtk_editable_get_position(GTK_EDITABLE(text));