# HG changeset patch # User Mark Huetsch # Date 1162685512 0 # Node ID fe184dbde619e0baff8bb5e81a8e335e85bd1b91 # Parent 717ea4589f8d7e6760fd956765b540f3d47fc492 [gaim-migrate @ 17668] Eliminate this union, as suggested by elb and nosnilmot. committer: Tailor Script diff -r 717ea4589f8d -r fe184dbde619 libgaim/protocols/qq/file_trans.c --- a/libgaim/protocols/qq/file_trans.c Sat Nov 04 22:00:22 2006 +0000 +++ b/libgaim/protocols/qq/file_trans.c Sun Nov 05 00:11:52 2006 +0000 @@ -218,8 +218,8 @@ static int _qq_xfer_open_file(const gchar *filename, const gchar *method, GaimXfer *xfer) { ft_info *info = xfer->data; - info->u.dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method); - if (info->u.dest_fp == NULL) { + info->dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method); + if (info->dest_fp == NULL) { return -1; } return 0; @@ -229,22 +229,22 @@ { ft_info *info = xfer->data; - fseek(info->u.dest_fp, index * len, SEEK_SET); - return fread(buffer, 1, len, info->u.dest_fp); + fseek(info->dest_fp, index * len, SEEK_SET); + return fread(buffer, 1, len, info->dest_fp); } static gint _qq_xfer_write_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer) { ft_info *info = xfer->data; - fseek(info->u.dest_fp, index * len, SEEK_SET); - return fwrite(buffer, 1, len, info->u.dest_fp); + fseek(info->dest_fp, index * len, SEEK_SET); + return fwrite(buffer, 1, len, info->dest_fp); } void qq_xfer_close_file(GaimXfer *xfer) { ft_info *info = xfer->data; - if (info->u.dest_fp) fclose(info->u.dest_fp); + if (info->dest_fp) fclose(info->dest_fp); } #endif diff -r 717ea4589f8d -r fe184dbde619 libgaim/protocols/qq/send_file.c --- a/libgaim/protocols/qq/send_file.c Sat Nov 04 22:00:22 2006 +0000 +++ b/libgaim/protocols/qq/send_file.c Sun Nov 05 00:11:52 2006 +0000 @@ -204,8 +204,8 @@ info = (ft_info *) xfer->data; qq_xfer_close_file(xfer); - if (info->u.dest_fp != NULL) { - fclose(info->u.dest_fp); + if (info->dest_fp != NULL) { + fclose(info->dest_fp); gaim_debug(GAIM_DEBUG_INFO, "QQ", "file closed\n"); } if (info->major_fd != 0) { @@ -217,8 +217,8 @@ gaim_debug(GAIM_DEBUG_INFO, "QQ", "minor port closed\n"); } /* - if (info->u.buffer != NULL) { - munmap(info->u.buffer, gaim_xfer_get_size(xfer)); + if (info->buffer != NULL) { + munmap(info->buffer, gaim_xfer_get_size(xfer)); gaim_debug(GAIM_DEBUG_INFO, "QQ", "file mapping buffer is freed.\n"); } */ diff -r 717ea4589f8d -r fe184dbde619 libgaim/protocols/qq/send_file.h --- a/libgaim/protocols/qq/send_file.h Sat Nov 04 22:00:22 2006 +0000 +++ b/libgaim/protocols/qq/send_file.h Sun Nov 05 00:11:52 2006 +0000 @@ -37,10 +37,8 @@ int minor_fd; int sender_fd; int recv_fd; - union { - FILE *dest_fp; - guint8 *buffer; - } u; + FILE *dest_fp; + /* guint8 *buffer; */ gboolean use_major; } ft_info;