From f64fedd7b7245ff20c63b20bac861e5165c15cc0 Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 12 Nov 2007 04:29:55 +0000 Subject: [PATCH] 64 bits warnings fix git-svn-id: http://ltt.polymtl.ca/svn@2737 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/marker.c | 6 +++--- ltt/branches/poly/ltt/marker.h | 6 +++--- ltt/branches/poly/ltt/tracefile.c | 14 ++++++++------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ltt/branches/poly/ltt/marker.c b/ltt/branches/poly/ltt/marker.c index 9da520eb..ce1fc868 100644 --- a/ltt/branches/poly/ltt/marker.c +++ b/ltt/branches/poly/ltt/marker.c @@ -418,7 +418,7 @@ int marker_format_event(LttTrace *trace, GQuark name, const char *format) } fcopy = g_new(char, strlen(format)+1); strcpy(fcopy, format); - g_hash_table_insert(trace->markers_format_hash, (gpointer)name, + g_hash_table_insert(trace->markers_format_hash, (gpointer)(gulong)name, (gpointer)fcopy); info = marker_get_info_from_name(trace, name); @@ -456,7 +456,7 @@ int marker_id_event(LttTrace *trace, GQuark name, guint16 id, info->format, g_quark_to_string(name)); head = marker_get_info_from_name(trace, name); if (!head) - g_hash_table_insert(trace->markers_hash, (gpointer)name, + g_hash_table_insert(trace->markers_hash, (gpointer)(gulong)name, (gpointer)(gulong)id); else { struct marker_info *iter; @@ -464,7 +464,7 @@ int marker_id_event(LttTrace *trace, GQuark name, guint16 id, if (iter->name == name) found = 1; if (!found) { - g_hash_table_replace(trace->markers_hash, (gpointer)name, + g_hash_table_replace(trace->markers_hash, (gpointer)(gulong)name, (gpointer)(gulong)id); info->next = head; } diff --git a/ltt/branches/poly/ltt/marker.h b/ltt/branches/poly/ltt/marker.h index 93f6ff61..3d04db88 100644 --- a/ltt/branches/poly/ltt/marker.h +++ b/ltt/branches/poly/ltt/marker.h @@ -66,8 +66,8 @@ static inline struct marker_info *marker_get_info_from_name(LttTrace *trace, gpointer orig_key, value; int res; - res = g_hash_table_lookup_extended(trace->markers_hash, (gconstpointer)name, - &orig_key, &value); + res = g_hash_table_lookup_extended(trace->markers_hash, + (gconstpointer)(gulong)name, &orig_key, &value); if (!res) return NULL; return marker_get_info_from_id(trace, (guint16)(gulong)value); @@ -80,7 +80,7 @@ static inline char *marker_get_format_from_name(LttTrace *trace, int res; res = g_hash_table_lookup_extended(trace->markers_format_hash, - (gconstpointer)name, &orig_key, &value); + (gconstpointer)(gulong)name, &orig_key, &value); if (!res) return NULL; return (char *)value; diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index ec3bc4da..d026cf91 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -368,7 +368,7 @@ gint ltt_tracefile_open(LttTrace *t, gchar * fileName, LttTracefile *tf) perror("Error in allocating memory for buffer of tracefile"); goto close_file; } - g_assert( ( (guint)tf->buffer.head&(8-1) ) == 0); // make sure it's aligned. + g_assert( ( (gulong)tf->buffer.head&(8-1) ) == 0); // make sure it's aligned. header = (struct ltt_block_start_header*)tf->buffer.head; @@ -669,8 +669,8 @@ void get_absolute_pathname(const gchar *pathname, gchar * abs_pathname) int get_tracefile_name_number(gchar *raw_name, GQuark *name, guint *num, - guint *tid, - guint *pgid, + gulong *tid, + gulong *pgid, guint64 *creation) { guint raw_name_len = strlen(raw_name); @@ -881,10 +881,12 @@ int open_tracefiles(LttTrace *trace, gchar *root_path, gchar *relative_path) if(ret < 0) continue; } else if(S_ISREG(stat_buf.st_mode)) { GQuark name; - guint num, tid, pgid; + guint num; + gulong tid, pgid; guint64 creation; GArray *group; - num = tid = pgid = 0; + num = 0; + tid = pgid = 0; creation = 0; if(get_tracefile_name_number(rel_path, &name, &num, &tid, &pgid, &creation)) continue; /* invalid name */ @@ -1933,7 +1935,7 @@ gint map_block(LttTracefile * tf, guint block_num) g_assert(0); goto map_error; } - g_assert( ( (guint)tf->buffer.head&(8-1) ) == 0); // make sure it's aligned. + g_assert( ( (gulong)tf->buffer.head&(8-1) ) == 0); // make sure it's aligned. tf->buffer.index = block_num; -- 2.34.1