[Tracker] Fixes for recent-CVS build warnings
- From: <tpgww onepost net>
- To: tracker-list gnome org
- Subject: [Tracker] Fixes for recent-CVS build warnings
- Date: Sat, 4 Nov 2006 21:01:06 -0500
I recently compiled CVS-tracker (as of 02Nov06) and got a number of warnings, some more serious than others.
I investigated most of them (except the ones generated by imported sqlite3 code) and fixed most of them.
Might as well pass the results on to the devs.
I don't yet know if attachments can be posted to this list. So I just dumped things below. Makes it too long,
sorry.
Regards
Tom
==================================
./configure: line 24094: GNOME_COMMON_INIT: command not found
CVS autogen.sh includes this
which gnome-autogen.sh || {
echo "You need to install gnome-common from the GNOME CVS"
exit 1
}
. gnome-autogen.sh
which seems to be unnecessary. Notwithstanding your interest in getting into gnome 2.18, tracker's
DE-independence is a plus (especially with the clouds recently looming over mono and thence beagle) worth
preserving (apart from the GUI, of course)
I substitute 'autoreconf -vfi'. Probably, some auto* wizard can advise on a better way.
In any event, the package builds quite happily without whatever GNOME_COMMON_INIT is assigned to.
./configure: line 25884: ./po/POTFILES.in: No such file or directory
Will there ever be any ?
These imported sqlite warnings have not been investigated:
btree.c: In function 'sqlite3BtreeDelete':
btree.c:5394: warning: 'szNext' may be used uninitialized in this function
select.c: In function 'generateSortTail':
select.c:696: warning: 'pseudoTab' may be used uninitialized in this function
tokenize.c: In function 'sqlite3RunParser':
tokenize.c:397: warning: nested extern declaration of 'sqlite3ParserAlloc'
tokenize.c:398: warning: nested extern declaration of 'sqlite3ParserFree'
tokenize.c:399: warning: nested extern declaration of 'sqlite3Parser'
vdbe.c:4680: warning: 'res' may be used uninitialized in this function
A bunch of signed-unsigned comparison warnings related to sqlite have not been investigated
chckfile.c: In function 'filexist':
chckfile.c:25: warning: unused variable 'overwrite'
chckfile.c:24: warning: unused variable 'fileptr'
filexist (char *string) has no meaningful content
replace by return (access () ....)
--- chckfile.c-original 2006-10-27 14:52:26.000000000 -0400
+++ chckfile.c 2006-11-04 18:57:37.000000000 -0500
@@ -17,4 +17,5 @@
*/
#include "htmless.h"
+#include <unistd.h>
/* Function to verify if a file already exists. Returns true if it doesn't exist */
@@ -22,4 +23,5 @@
int filexist (char *string) /* Function takes filename */
{
+#if 0
FILE *fileptr; /* Pointer to filename */
char overwrite; /* Yes or no for overwrite */
@@ -25,6 +27,8 @@
char overwrite; /* Yes or no for overwrite */
-
return TRUE; /* File doesn't exist */
+#endif
+ /* assume that supplied string is localised */
+ return (access (string, F_OK) || !access (string, W_OK));
}
@@ -36,4 +40,5 @@
* The function return the number of characters read. Neat-o!
*/
+#if 0
int getfname (char *string)
{
@@ -56,5 +61,5 @@
return strlen(string);
}
-
+#endif //0
int checkfile (char *string) /* Function checks validity of filename */
{
tracker-inotify.c: In function 'process_inotify_events':
tracker-inotify.c:433: warning: 'monitor_name' may be used uninitialized in this function
Fixed by diverting restarting loop when db command fails
tracker-inotify.c:434: warning: 'dir_utf8_uri' may be used uninitialized in this function
Fixed by setting value NULL
--- tracker-inotify.c-original 2006-10-27 15:39:10.000000000 -0400
+++ tracker-inotify.c 2006-10-27 15:58:26.000000000 -0400
@@ -481,4 +481,8 @@
tracker_db_free_result (res);
}
+ else {
+ g_free (event);
+ continue;
+ }
if (action_type == TRACKER_ACTION_IGNORE) {
@@ -504,4 +508,5 @@
if (file_utf8_uri[0] == G_DIR_SEPARATOR) {
str = g_strdup (file_utf8_uri);
+ dir_utf8_uri = NULL;
} else {
tracker-dbus-files.c: In function 'tracker_dbus_method_files_exists':
tracker-dbus-files.c:38: warning: 'fsize' may be used uninitialized in this function
Fix by shifting the place where file_valid flag is set
tracker-dbus-files.c: In function 'tracker_dbus_method_files_get_text_contents':
tracker-dbus-files.c:442: warning: 'res' is used uninitialized in this function
Fix by uncommenting res = line
--- tracker-dbus-files.c-original 2006-10-27 16:01:34.000000000 -0400
+++ tracker-dbus-files.c 2006-10-27 16:14:10.000000000 -0400
@@ -80,5 +80,4 @@
FileInfo *info;
- file_valid = TRUE;
name = g_path_get_basename (uri);
path = g_path_get_dirname (uri);
@@ -89,4 +88,5 @@
if (info) {
+ file_valid = TRUE;
str_size = tracker_uint_to_str (info->file_size);
fsize = info->file_size;
@@ -95,4 +95,6 @@
tracker_free_file_info (info);
}
+ else
+ file_valid = FALSE;
}
@@ -402,5 +404,5 @@
str_max_length = tracker_int_to_str (max_length);
- //char ***res = tracker_exec_proc (db_con, "GetFileContents", 4, path, name, str_offset,
str_max_length);
+ res = tracker_exec_proc (db_con, "GetFileContents", 4, path, name, str_offset,
str_max_length);
g_free (str_offset);
tracker-mbox-thunderbird.c: In function 'watch_emails_of_thunderbird':
tracker-mbox-thunderbird.c:69: warning: 'prefs' may be used uninitialized in this function
Fix by removing irrelevant test at start of function
--- tracker-mbox-thunderbird.c-original 2006-10-27 16:17:20.000000000 -0400
+++ tracker-mbox-thunderbird.c 2006-10-27 16:19:55.000000000 -0400
@@ -72,5 +72,5 @@
size_t len_prefix;
- if (!filename || !prefs) {
+ if (!filename) {
return NULL;
}
tracker-utils.c:1401: warning: 'has_prefix' defined but not used
Redundant function commented out
--- tracker-utils.c-original 2006-10-27 16:22:29.000000000 -0400
+++ tracker-utils.c 2006-10-31 20:58:43.000000000 -0500
@@ -1396,5 +1396,5 @@
-
+/* unused function
static int
has_prefix (const char *str1, const char *str2)
@@ -1414,5 +1414,5 @@
}
}
-
+*/
GSList *
tracker-ioprio.c: In function 'ioprio_set':
tracker-ioprio.c:50: warning: implicit declaration of function 'syscall'
tracker-ioprio.c:50: warning: nested extern declaration of 'syscall'
Some missing #include, not sure which (I have glibc 2.4)
tracker.c:185: warning: 'tracker_boolean_reply' defined but not used
Redundant function commented out
--- tracker.c-original 2006-10-27 16:25:43.000000000 -0400
+++ tracker.c 2006-10-27 16:26:22.000000000 -0400
@@ -180,5 +180,5 @@
g_free (callback_struct);
}
-
+/* unused function
static void
tracker_boolean_reply (DBusGProxy *proxy, gboolean OUT_result, GError *error, gpointer user_data)
@@ -193,5 +193,5 @@
g_free (callback_struct);
}
-
+*/
tracker-search.c: In function 'main':
tracker-search.c:73: warning: 'result' may be used uninitialized in this function
Fix by smarter exit test
--- tracker-search.c-original 2006-10-27 16:28:01.000000000 -0400
+++ tracker-search.c 2006-10-27 17:02:51.000000000 -0400
@@ -126,4 +126,5 @@
} else {
out_array = tracker_search_text_detailed (client, -1, type, search, 0, limit, &error);
+ result = NULL; //compiler-warning prevention only
}
@@ -137,6 +138,7 @@
}
- if (!result) {
+ if ((!detailed && !result) || (detailed && !out_array)) {
g_printerr ("no results found\n");
+ tracker_disconnect (client);
return 0;
}
tracker-extract.c:118: warning: 'get_metadata_type' defined but not used
Redundant function and related array commented out
--- tracker-extract.c-original 2006-10-27 16:39:39.000000000 -0400
+++ tracker-extract.c 2006-10-27 16:41:21.000000000 -0400
@@ -38,9 +38,10 @@
/* document mime type specific metadata groups - NB mime types below are prefixes */
+/* unused array
static char *doc_mime_types[] = {"application/msword","application/pdf",
"application/postscript","application/x-dvi",
"application/vnd.ms-excel", "vnd.ms-powerpoint", "application/vnd.oasis",
"application/vnd.sun.xml", "application/vnd.stardivision",
"application/x-abiword",
"text/html","text/sgml", "text/xml" };
-
+*/
@@ -113,5 +114,5 @@
{ "", NULL }
};
-
+/* unused function
static MetadataFileType
get_metadata_type (const char *mime)
@@ -144,5 +145,5 @@
return NO_METADATA;
}
-
+*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]