summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Scorgie <dscorgie@src.gnome.org>2007-09-03 19:20:46 +0000
committerDon Scorgie <dscorgie@src.gnome.org>2007-09-03 19:20:46 +0000
commitf7769c9e546bb1aa76552cebbab1d82cf7fd6e6e (patch)
treedf809794b2bdfb0585f757b714301dadb299fdac
parent2ffc9f09a867166c836410cac2a141eb073e157c (diff)
downloadyelp-f7769c9e546bb1aa76552cebbab1d82cf7fd6e6e.tar.gz
C89 fixes from Jens Granseuer (bug #472489)
* src/yelp-debug.c: * src/yelp-search-parser.c: C89 fixes from Jens Granseuer (bug #472489) svn path=/trunk/; revision=2925
-rw-r--r--ChangeLog6
-rw-r--r--src/yelp-debug.h6
-rw-r--r--src/yelp-search-parser.c4
3 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 56428067..41437448 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-03 Don Scorgie <dscorgie@svn.gnome.org>
+
+ * src/yelp-debug.c:
+ * src/yelp-search-parser.c:
+ C89 fixes from Jens Granseuer (bug #472489)
+
2007-08-30 Shaun McCance <shaunm@gnome.org>
* src/yelp-window.c:
diff --git a/src/yelp-debug.h b/src/yelp-debug.h
index 846ad750..4706df26 100644
--- a/src/yelp-debug.h
+++ b/src/yelp-debug.h
@@ -58,7 +58,11 @@ typedef enum {
# define debug_print(format, ...) yelp_debug (__FILE__, __LINE__, __func__, format, __VA_ARGS__)
# endif
#else
-# define debug_print(format, ...)
+# if __STDC_VERSION__ < 199901L
+# define debug_print(format, args...)
+# else
+# define debug_print(format, ...)
+# endif
#endif
#ifdef YELP_DEBUG
diff --git a/src/yelp-search-parser.c b/src/yelp-search-parser.c
index 5eca3b33..a3819431 100644
--- a/src/yelp-search-parser.c
+++ b/src/yelp-search-parser.c
@@ -713,13 +713,15 @@ void s_characters(void * data,
gint i = 0;
gchar *s_term = c->search_term[i];
while (s_term && c->score_per_word[i] < 1.0) {
+ gchar *location;
+
if (c->stop_word[i] || c->score_per_word[c->dup_of[i]] == 1.0) {
i++;
s_term = c->search_term[i];
continue;
}
- gchar *location = strstr (tmp, s_term);
+ location = strstr (tmp, s_term);
if (location) {
gchar before = *(location-1);
gchar after = *(location+strlen(s_term));