* gmarkup.c: Fix warnings.
* guniprop.c, gunidecomp.c: Make warnings go away by using
GPOINTER_TO_INT() instead of (int).
* gcompletion.[ch]: Add g_completion_set_compare(),
to allow (for example) using case-insensitive completion.
* gobject/gsignal.c: Fix warnings about possible use of uninitialized
variables, and fix logic that would leave 'node' unset in cases
that it might be used in.
* gobject/glib-genmarshal.c: Fix warning about printf format.
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gmarkup.c: Fix warnings.
+
+ * guniprop.c, gunidecomp.c: Make warnings go away by using
+ GPOINTER_TO_INT() instead of (int).
+
+ * gcompletion.[ch]: Add g_completion_set_compare(),
+ to allow (for example) using case-insensitive completion.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
Patches by Hans Breuer:
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gmarkup.c: Fix warnings.
+
+ * guniprop.c, gunidecomp.c: Make warnings go away by using
+ GPOINTER_TO_INT() instead of (int).
+
+ * gcompletion.[ch]: Add g_completion_set_compare(),
+ to allow (for example) using case-insensitive completion.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
Patches by Hans Breuer:
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gmarkup.c: Fix warnings.
+
+ * guniprop.c, gunidecomp.c: Make warnings go away by using
+ GPOINTER_TO_INT() instead of (int).
+
+ * gcompletion.[ch]: Add g_completion_set_compare(),
+ to allow (for example) using case-insensitive completion.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
Patches by Hans Breuer:
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gmarkup.c: Fix warnings.
+
+ * guniprop.c, gunidecomp.c: Make warnings go away by using
+ GPOINTER_TO_INT() instead of (int).
+
+ * gcompletion.[ch]: Add g_completion_set_compare(),
+ to allow (for example) using case-insensitive completion.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
Patches by Hans Breuer:
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gmarkup.c: Fix warnings.
+
+ * guniprop.c, gunidecomp.c: Make warnings go away by using
+ GPOINTER_TO_INT() instead of (int).
+
+ * gcompletion.[ch]: Add g_completion_set_compare(),
+ to allow (for example) using case-insensitive completion.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
Patches by Hans Breuer:
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gmarkup.c: Fix warnings.
+
+ * guniprop.c, gunidecomp.c: Make warnings go away by using
+ GPOINTER_TO_INT() instead of (int).
+
+ * gcompletion.[ch]: Add g_completion_set_compare(),
+ to allow (for example) using case-insensitive completion.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
Patches by Hans Breuer:
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gmarkup.c: Fix warnings.
+
+ * guniprop.c, gunidecomp.c: Make warnings go away by using
+ GPOINTER_TO_INT() instead of (int).
+
+ * gcompletion.[ch]: Add g_completion_set_compare(),
+ to allow (for example) using case-insensitive completion.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
Patches by Hans Breuer:
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gmarkup.c: Fix warnings.
+
+ * guniprop.c, gunidecomp.c: Make warnings go away by using
+ GPOINTER_TO_INT() instead of (int).
+
+ * gcompletion.[ch]: Add g_completion_set_compare(),
+ to allow (for example) using case-insensitive completion.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
Patches by Hans Breuer:
gcomp->cache = NULL;
gcomp->prefix = NULL;
gcomp->func = func;
+ gcomp->strncmp_func = strncmp;
return gcomp;
}
if (cmp->prefix && cmp->cache)
{
plen = strlen (cmp->prefix);
- if (plen <= len && !strncmp (prefix, cmp->prefix, plen))
+ if (plen <= len && ! cmp->strncmp_func (prefix, cmp->prefix, plen))
{
/* use the cache */
list = cmp->cache;
while (list)
{
- if (strncmp (prefix,
+ if (cmp->strncmp_func (prefix,
cmp->func ? cmp->func (list->data) : (gchar*) list->data,
len))
{
list = cmp->items;
while (*prefix && list)
{
- if (!strncmp (prefix,
+ if (!cmp->strncmp_func (prefix,
cmp->func ? cmp->func (list->data) : (gchar*) list->data,
len))
cmp->cache = g_list_prepend (cmp->cache, list->data);
g_free (cmp);
}
+void
+g_completion_set_compare(GCompletion *cmp,
+ GCompletionStrncmpFunc strncmp_func)
+{
+ cmp->strncmp_func = strncmp_func;
+}
+
#ifdef TEST_COMPLETION
#include <stdio.h>
int
#define __G_COMPLETION_H__
#include <glist.h>
+#include <unistd.h>
G_BEGIN_DECLS
/* GCompletion
*/
+typedef int (*GCompletionStrcmpFunc)(const char *s1, const char *s2);
+typedef int (*GCompletionStrncmpFunc)(const char *s1, const char *s2, size_t n);
+
struct _GCompletion
{
GList* items;
gchar* prefix;
GList* cache;
+ GCompletionStrncmpFunc strncmp_func;
};
GCompletion* g_completion_new (GCompletionFunc func);
GList* g_completion_complete (GCompletion* cmp,
gchar* prefix,
gchar** new_prefix);
+void g_completion_set_compare (GCompletion *cmp,
+ GCompletionStrncmpFunc strncmp_func);
void g_completion_free (GCompletion* cmp);
G_END_DECLS
gcomp->cache = NULL;
gcomp->prefix = NULL;
gcomp->func = func;
+ gcomp->strncmp_func = strncmp;
return gcomp;
}
if (cmp->prefix && cmp->cache)
{
plen = strlen (cmp->prefix);
- if (plen <= len && !strncmp (prefix, cmp->prefix, plen))
+ if (plen <= len && ! cmp->strncmp_func (prefix, cmp->prefix, plen))
{
/* use the cache */
list = cmp->cache;
while (list)
{
- if (strncmp (prefix,
+ if (cmp->strncmp_func (prefix,
cmp->func ? cmp->func (list->data) : (gchar*) list->data,
len))
{
list = cmp->items;
while (*prefix && list)
{
- if (!strncmp (prefix,
+ if (!cmp->strncmp_func (prefix,
cmp->func ? cmp->func (list->data) : (gchar*) list->data,
len))
cmp->cache = g_list_prepend (cmp->cache, list->data);
g_free (cmp);
}
+void
+g_completion_set_compare(GCompletion *cmp,
+ GCompletionStrncmpFunc strncmp_func)
+{
+ cmp->strncmp_func = strncmp_func;
+}
+
#ifdef TEST_COMPLETION
#include <stdio.h>
int
#define __G_COMPLETION_H__
#include <glist.h>
+#include <unistd.h>
G_BEGIN_DECLS
/* GCompletion
*/
+typedef int (*GCompletionStrcmpFunc)(const char *s1, const char *s2);
+typedef int (*GCompletionStrncmpFunc)(const char *s1, const char *s2, size_t n);
+
struct _GCompletion
{
GList* items;
gchar* prefix;
GList* cache;
+ GCompletionStrncmpFunc strncmp_func;
};
GCompletion* g_completion_new (GCompletionFunc func);
GList* g_completion_complete (GCompletion* cmp,
gchar* prefix,
gchar** new_prefix);
+void g_completion_set_compare (GCompletion *cmp,
+ GCompletionStrncmpFunc strncmp_func);
void g_completion_free (GCompletion* cmp);
G_END_DECLS
if (context->parser->start_element)
(* context->parser->start_element) (context,
start_name,
- attr_names,
- attr_values,
+ (const gchar *)attr_names,
+ (const gchar *)attr_values,
context->user_data,
&tmp_error);
/* We cheat a bit and cast type values to (char *). We detect these
using the &0xff trick. */
#define CC(Page, Char) \
- (((((int) (combining_class_table[Page])) & 0xff) \
- == ((int) combining_class_table[Page])) \
- ? ((int) combining_class_table[Page]) \
+ ((((GPOINTER_TO_INT(combining_class_table[Page])) & 0xff) \
+ == GPOINTER_TO_INT(combining_class_table[Page])) \
+ ? GPOINTER_TO_INT(combining_class_table[Page]) \
: (combining_class_table[Page][Char]))
#define COMBINING_CLASS(Char) \
/* We cheat a bit and cast type values to (char *). We detect these
using the &0xff trick. */
#define TTYPE(Page, Char) \
- (((((int) type_table[Page]) & 0xff) == ((int) type_table[Page])) \
- ? ((int) (type_table[Page])) \
+ (((GPOINTER_TO_INT(type_table[Page]) & 0xff) == GPOINTER_TO_INT(type_table[Page])) \
+ ? GPOINTER_TO_INT(type_table[Page]) \
: (type_table[Page][Char]))
#define TYPE(Char) (((Char) > (G_UNICODE_LAST_CHAR)) ? G_UNICODE_UNASSIGNED : TTYPE ((Char) >> 8, (Char) & 0xff))
if (context->parser->start_element)
(* context->parser->start_element) (context,
start_name,
- attr_names,
- attr_values,
+ (const gchar *)attr_names,
+ (const gchar *)attr_values,
context->user_data,
&tmp_error);
+2000-11-28 Elliot Lee <sopwith@redhat.com>
+
+ * gsignal.c: Fix warnings about possible use of uninitialized
+ variables, and fix logic that would leave 'node' unset in cases
+ that it might be used in.
+
+ * glib-genmarshal.c: Fix warning about printf format.
+
2000-11-28 Tor Lillqvist <tml@iki.fi>
* gboxed.c: Include <string.h> for memset ().
{
g_free (buffer);
buffer = g_strdup_printf ("%s ", string);
- g_warning ("overfull string (%u bytes) for padspace", strlen (string));
+ g_warning ("overfull string (%lu bytes) for padspace", strlen (string));
return buffer;
}
{
HandlerList *hlist = handler_list_lookup (signal_id, instance);
Handler *handler;
- SignalNode *node;
+ SignalNode *node = NULL;
- if (mask & G_SIGNAL_MATCH_FUNC)
+ if (!(mask & G_SIGNAL_MATCH_FUNC))
{
node = LOOKUP_SIGNAL_NODE (signal_id);
if (!node || !node->c_marshaller)
for (i = 0; i < hlbsa->n_nodes; i++)
{
HandlerList *hlist = g_bsearch_array_get_nth (hlbsa, i);
- SignalNode *node;
+ SignalNode *node = NULL;
Handler *handler;
if (!(mask & G_SIGNAL_MATCH_FUNC))
/* We cheat a bit and cast type values to (char *). We detect these
using the &0xff trick. */
#define CC(Page, Char) \
- (((((int) (combining_class_table[Page])) & 0xff) \
- == ((int) combining_class_table[Page])) \
- ? ((int) combining_class_table[Page]) \
+ ((((GPOINTER_TO_INT(combining_class_table[Page])) & 0xff) \
+ == GPOINTER_TO_INT(combining_class_table[Page])) \
+ ? GPOINTER_TO_INT(combining_class_table[Page]) \
: (combining_class_table[Page][Char]))
#define COMBINING_CLASS(Char) \
/* We cheat a bit and cast type values to (char *). We detect these
using the &0xff trick. */
#define TTYPE(Page, Char) \
- (((((int) type_table[Page]) & 0xff) == ((int) type_table[Page])) \
- ? ((int) (type_table[Page])) \
+ (((GPOINTER_TO_INT(type_table[Page]) & 0xff) == GPOINTER_TO_INT(type_table[Page])) \
+ ? GPOINTER_TO_INT(type_table[Page]) \
: (type_table[Page][Char]))
#define TYPE(Char) (((Char) > (G_UNICODE_LAST_CHAR)) ? G_UNICODE_UNASSIGNED : TTYPE ((Char) >> 8, (Char) & 0xff))
static void
run_tests (void)
{
- GError *err;
gint i;
i = 0;