GCC4 and building gnome-vfs
- From: Kjartan Maraas <kmaraas broadpark no>
- To: gnome-vfs-list gnome org
- Subject: GCC4 and building gnome-vfs
- Date: Tue, 29 Mar 2005 14:44:11 +0200
Hi.
I'm running into problems building gnome-vfs with the new GCC in Fedora
Core 4 test releases. I've cooked up a patch to "fix" some of them, but
I need more help with the stuff in gnome-vfs-handle.c
Attaching a patch for the stuff I have now.
The error I'm seeing that I don't see how to fix immediately is this
one:
gnome-vfs-handle.c: In function '_gnome_vfs_handle_do_tell':
gnome-vfs-handle.c:174: warning: pointer targets in passing argument 3
of 'handle->uri->method->tell' differ in signedness
I see from the fedora package that someone has added some cases of
#undef error
for some similar issues with other methods, but I'm not well enough
versed in the preprocessing magic to know how this should be done in
this case. Anyone?
There are some sparse warning fixes and changes to make code static in
the patch so please comment on those too if possible.
Cheers
Kjartan
Index: libgnomevfs/gnome-vfs-daemon-method.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-daemon-method.c,v
retrieving revision 1.4
diff -u -p -r1.4 gnome-vfs-daemon-method.c
--- libgnomevfs/gnome-vfs-daemon-method.c 15 Dec 2003 10:28:09 -0000 1.4
+++ libgnomevfs/gnome-vfs-daemon-method.c 29 Mar 2005 12:42:08 -0000
@@ -360,7 +360,7 @@ do_write (GnomeVFSMethod *method,
CORBA_exception_init (&ev);
buf._maximum = buf._length = num_bytes;
- buf._buffer = (char *)buffer;
+ buf._buffer = (unsigned char *)buffer;
buf._release = 0;
res = GNOME_VFS_DaemonHandle_Write ((GNOME_VFS_DaemonHandle) method_handle,
Index: libgnomevfs/gnome-vfs-dns-sd.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-dns-sd.c,v
retrieving revision 1.10
diff -u -p -r1.10 gnome-vfs-dns-sd.c
--- libgnomevfs/gnome-vfs-dns-sd.c 10 Jan 2005 17:57:12 -0000 1.10
+++ libgnomevfs/gnome-vfs-dns-sd.c 29 Mar 2005 12:42:08 -0000
@@ -101,14 +101,14 @@ gnome_vfs_dns_sd_service_status_get_type
}
static GHashTable *
-decode_txt_record (unsigned char *raw_txt,
+decode_txt_record (char *raw_txt,
int raw_txt_len)
{
GHashTable *hash;
int i;
int len;
- unsigned char *key, *value, *end;
- unsigned char *key_dup, *value_dup;
+ char *key, *value, *end;
+ char *key_dup, *value_dup;
if (raw_txt == NULL)
return NULL;
@@ -237,7 +237,7 @@ is_valid_dns_sd_type (const char *type)
}
static int
-parse_header (char *reply, int reply_len,
+parse_header (unsigned char *reply, int reply_len,
unsigned char *p,
dns_message_header *header)
{
@@ -256,7 +256,7 @@ parse_header (char *reply, int reply_len
static int
-parse_qs (char *reply, int reply_len,
+parse_qs (unsigned char *reply, int reply_len,
unsigned char *p,
char *name, int name_size,
int *qtype, int *qclass)
@@ -285,7 +285,7 @@ parse_qs (char *reply, int reply_len,
}
static int
-parse_rr (char *reply, int reply_len,
+parse_rr (unsigned char *reply, int reply_len,
unsigned char *p,
dns_message_rr *rr)
{
@@ -508,7 +508,7 @@ unicast_browse_sync (const char *domain,
if (len < 0)
goto error;
- split_service_instance (name, ptr_service, ptr_type, ptr_domain);
+ split_service_instance ((unsigned char *)name, (unsigned char *)ptr_service, (unsigned char *)ptr_type, (unsigned char *)ptr_domain);
if (is_valid_dns_sd_type (ptr_type)) {
service.name = g_strdup (ptr_service);
Index: libgnomevfs/xdgmimealias.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/xdgmimealias.c,v
retrieving revision 1.2
diff -u -p -r1.2 xdgmimealias.c
--- libgnomevfs/xdgmimealias.c 9 Dec 2004 15:43:48 -0000 1.2
+++ libgnomevfs/xdgmimealias.c 29 Mar 2005 12:42:08 -0000
@@ -105,7 +105,7 @@ _xdg_mime_alias_list_lookup (XdgAliasLis
if (list->n_aliases > 0)
{
key.alias = (char *)alias;
- key.mime_type = 0;
+ key.mime_type = NULL;
entry = bsearch (&key, list->aliases, list->n_aliases,
sizeof (XdgAlias), alias_entry_cmp);
Index: modules/sftp-method.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/modules/sftp-method.c,v
retrieving revision 1.31
diff -u -p -r1.31 sftp-method.c
--- modules/sftp-method.c 11 Feb 2005 22:18:08 -0000 1.31
+++ modules/sftp-method.c 29 Mar 2005 12:42:08 -0000
@@ -70,8 +70,8 @@
#include "sftp.h"
#include "pty-open.h"
-size_t default_req_len = 32768;
-guint max_req = 16;
+static size_t default_req_len = 32768;
+static guint max_req = 16;
#ifdef HAVE_GRANTPT
/* We only use this on systems with unix98 ptys */
Index: modules/smb-method.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/modules/smb-method.c,v
retrieving revision 1.25
diff -u -p -r1.25 smb-method.c
--- modules/smb-method.c 2 Mar 2005 23:44:11 -0000 1.25
+++ modules/smb-method.c 29 Mar 2005 12:42:09 -0000
@@ -1445,10 +1445,10 @@ do_read (GnomeVFSMethod *method,
GnomeVFSFileSize *bytes_read,
GnomeVFSContext *context)
{
- FileHandle *handle = (FileHandle *)method_handle;
- GnomeVFSResult res = GNOME_VFS_OK;;
SmbAuthContext actx;
ssize_t n = 0;
+ FileHandle *handle = (FileHandle *)method_handle;
+ GnomeVFSResult res = GNOME_VFS_OK;;
DEBUG_SMB(("do_read() %Lu bytes\n", num_bytes));
Index: programs/gnomevfs-ls.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/programs/gnomevfs-ls.c,v
retrieving revision 1.5
diff -u -p -r1.5 gnomevfs-ls.c
--- programs/gnomevfs-ls.c 16 Jul 2004 12:48:26 -0000 1.5
+++ programs/gnomevfs-ls.c 29 Mar 2005 12:42:09 -0000
@@ -23,7 +23,7 @@
#include <locale.h>
#include <libgnomevfs/gnome-vfs.h>
-char *directory;
+static char *directory;
static void show_data (gpointer item, gpointer no_item);
static void list (void);
Index: test/test-async-cancel.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/test/test-async-cancel.c,v
retrieving revision 1.23
diff -u -p -r1.23 test-async-cancel.c
--- test/test-async-cancel.c 24 Jul 2002 08:06:37 -0000 1.23
+++ test/test-async-cancel.c 29 Mar 2005 12:42:09 -0000
@@ -308,7 +308,7 @@ file_close_callback (GnomeVFSAsyncHandle
}
static gboolean file_read_flag;
-char read_buffer[1];
+static char read_buffer[1];
static void
file_read_callback (GnomeVFSAsyncHandle *handle,
Index: test/test-async-directory.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/test/test-async-directory.c,v
retrieving revision 1.25
diff -u -p -r1.25 test-async-directory.c
--- test/test-async-directory.c 18 Sep 2003 14:29:01 -0000 1.25
+++ test/test-async-directory.c 29 Mar 2005 12:42:09 -0000
@@ -154,7 +154,7 @@ test_read_file_read_callback (GnomeVFSAs
test_read_file_succeeded (handle);
}
-char buffer[256];
+static char buffer[256];
/* Start reading a chunk. */
static void
@@ -202,7 +202,7 @@ typedef struct {
int num_entries_read;
} CallbackData;
-volatile int async_task_counter;
+static volatile int async_task_counter;
static void
directory_load_callback (GnomeVFSAsyncHandle *handle,
Index: test/test-directory.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/test/test-directory.c,v
retrieving revision 1.23
diff -u -p -r1.23 test-directory.c
--- test/test-directory.c 2 May 2002 21:07:28 -0000 1.23
+++ test/test-directory.c 29 Mar 2005 12:42:09 -0000
@@ -33,7 +33,7 @@
static int measure_speed = 0;
-struct poptOption options[] = {
+static struct poptOption options[] = {
{
"measure-speed",
'm',
Index: test/test-shell.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/test/test-shell.c,v
retrieving revision 1.33
diff -u -p -r1.33 test-shell.c
--- test/test-shell.c 9 Dec 2003 08:09:53 -0000 1.33
+++ test/test-shell.c 29 Mar 2005 12:42:09 -0000
@@ -56,7 +56,7 @@ static char *cur_dir = NULL;
static GHashTable *files = NULL;
-FILE *vfserr = NULL;
+static FILE *vfserr = NULL;
static gboolean
@@ -930,10 +930,10 @@ do_handleinfo (void)
* ---------------------------------------------------------------------
*/
-GMainLoop *main_loop = NULL;
+static GMainLoop *main_loop = NULL;
-int interactive = 0;
-const struct poptOption options [] = {
+static int interactive = 0;
+static const struct poptOption options [] = {
{ "interactive", 'i', POPT_ARG_NONE, &interactive, 0,
"Allow interactive input", NULL },
{ NULL, '\0', 0, NULL, 0 }
Index: test/test-symlinks.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/test/test-symlinks.c,v
retrieving revision 1.10
diff -u -p -r1.10 test-symlinks.c
--- test/test-symlinks.c 25 Aug 2004 17:22:18 -0000 1.10
+++ test/test-symlinks.c 29 Mar 2005 12:42:09 -0000
@@ -42,7 +42,7 @@ static int measure_speed = 0;
static int sort = 0;
static int items_per_notification = 1;
-struct poptOption options[] = {
+static struct poptOption options[] = {
{
"chunk-size",
'c',
Index: test/test-uri.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/test/test-uri.c,v
retrieving revision 1.43
diff -u -p -r1.43 test-uri.c
--- test/test-uri.c 11 Feb 2005 13:29:24 -0000 1.43
+++ test/test-uri.c 29 Mar 2005 12:42:09 -0000
@@ -92,7 +92,7 @@ test_make_canonical_path (const char *in
g_free (output);
}
-const char* test_uris[][2] =
+static const char* test_uris[][2] =
{
{ "http://www.gnome.org/", "index.html" },
{ "http://www.gnome.org/", "/index.html"},
Index: test/test-xfer.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/test/test-xfer.c,v
retrieving revision 1.10
diff -u -p -r1.10 test-xfer.c
--- test/test-xfer.c 29 Oct 2002 10:37:23 -0000 1.10
+++ test/test-xfer.c 29 Mar 2005 12:42:09 -0000
@@ -35,7 +35,7 @@ static int remove_source = 0;
static int follow_symlinks = 0;
static int follow_symlinks_recursive = 0;
-const struct poptOption options[] = {
+static const struct poptOption options[] = {
POPT_AUTOHELP
{
"recursive",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]