merge upstream/noglib and update some glib related types

This commit is contained in:
Chris Eagle
2016-12-19 12:32:06 -08:00
11 changed files with 227 additions and 114 deletions

View File

@@ -39,18 +39,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/* typedefs for glib related types that may still be referenced */
typedef void* gpointer;
typedef const void *gconstpointer;
typedef uint32_t guint;
typedef int gint;
typedef unsigned int guint;
typedef char gchar;
typedef int gboolean;
typedef int (*GCompareFunc)(const void *v1, const void *v2);
typedef void (*GFunc)(void* data, void* user_data);
typedef gint (*GCompareFunc)(const void *v1, const void *v2);
typedef void (*GDestroyNotify)(void *data);
uint32_t g_direct_hash(const void *v);
guint g_direct_hash(const void *v);
int g_direct_equal(const void *v1, const void *v2);
uint32_t g_str_hash(const void *v);
guint g_str_hash(const void *v);
int g_str_equal(const void *v1, const void *v2);
uint32_t g_int_hash(const void *v);
guint g_int_hash(const void *v);
int g_int_equal(const void *v1, const void *v2);
typedef struct _GList {
@@ -59,17 +61,14 @@ typedef struct _GList {
struct _GList *prev;
} GList;
typedef void (*list_func)(void* data, void* user_data);
typedef int (*compare_func)(const void *d1, const void *d2);
GList *g_list_first(GList *list);
void g_list_foreach(GList *list, list_func func, void* user_data);
void g_list_foreach(GList *list, GFunc func, void* user_data);
void g_list_free(GList *list);
GList *g_list_insert_sorted(GList *list, void* data, compare_func compare);
GList *g_list_insert_sorted(GList *list, void* data, GCompareFunc compare);
#define g_list_next(list) (list->next)
GList *g_list_prepend(GList *list, void* data);
GList *g_list_remove_link(GList *list, GList *llink);
GList *g_list_sort(GList *list, compare_func compare);
GList *g_list_sort(GList *list, GCompareFunc compare);
typedef struct _GSList {
void *data;
@@ -77,15 +76,15 @@ typedef struct _GSList {
} GSList;
GSList *g_slist_append(GSList *list, void* data);
void g_slist_foreach(GSList *list, list_func func, void* user_data);
void g_slist_foreach(GSList *list, GFunc func, void* user_data);
void g_slist_free(GSList *list);
void g_slist_free_full(GSList *list, GDestroyNotify free_func);
GSList *g_slist_prepend(GSList *list, void* data);
GSList *g_slist_sort(GSList *list, compare_func compare);
GSList *g_slist_find_custom(GSList *list, const void *data, compare_func func);
GSList *g_slist_sort(GSList *list, GCompareFunc compare);
GSList *g_slist_find_custom(GSList *list, const void *data, GCompareFunc func);
GSList *g_slist_remove(GSList *list, const void *data);
typedef uint32_t (*GHashFunc)(const void *key);
typedef guint (*GHashFunc)(const void *key);
typedef int (*GEqualFunc)(const void *a, const void *b);
typedef void (*GHFunc)(void* key, void* value, void* user_data);
typedef int (*GHRFunc)(void* key, void* value, void* user_data);
@@ -104,7 +103,7 @@ void g_hash_table_remove_all(GHashTable *hash_table);
int g_hash_table_remove(GHashTable *hash_table, const void* key);
void g_hash_table_unref(GHashTable *hash_table);
GHashTable *g_hash_table_ref(GHashTable *hash_table);
uint32_t g_hash_table_size(GHashTable *hash_table);
guint g_hash_table_size(GHashTable *hash_table);
/* replacement for g_malloc dependency */
void *g_malloc(size_t size);

View File

@@ -119,7 +119,7 @@ static inline GList *g_list_insert_sorted_merged(GList *list,
return list;
}
static inline int32_t range_compare(gconstpointer a, gconstpointer b)
static inline gint range_compare(gconstpointer a, gconstpointer b)
{
Range *ra = (Range *)a, *rb = (Range *)b;
if (ra->begin == rb->begin && ra->end == rb->end) {