summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@daimi.au.dk>2010-04-23 11:53:46 -0400
committerSøren Sandmann Pedersen <sandmann@daimi.au.dk>2010-04-23 11:56:14 -0400
commit73922a0af984c0882f1177f4d3958626fb861664 (patch)
tree79ef6929279d5ff415b94b65f9a1e7366a7a1e99
parenta03172b11fad937ba87f502aff1f6e317b8487af (diff)
Eliminate some compiler warnings
-rw-r--r--binfile.c3
-rw-r--r--collector.c4
-rw-r--r--testelf.c1
-rw-r--r--unwind.c17
-rw-r--r--util.h (renamed from barrier.h)7
5 files changed, 20 insertions, 12 deletions
diff --git a/binfile.c b/binfile.c
index be79594..95613db 100644
--- a/binfile.c
+++ b/binfile.c
@@ -37,6 +37,7 @@
#include "binfile.h"
#include "elfparser.h"
+#include "util.h"
struct bin_file_t
{
@@ -439,7 +440,7 @@ bin_file_check_inode (bin_file_t *bin_file,
if (!bin_file->inode_check)
{
- g_print ("warning: Inode mismatch for %s (disk: %lld, memory: %lld)\n",
+ g_print ("warning: Inode mismatch for %s (disk: "FMT64", memory: "FMT64")\n",
bin_file->filename,
(guint64)bin_file->inode, (guint64)inode);
diff --git a/collector.c b/collector.c
index 79ccae4..2bba702 100644
--- a/collector.c
+++ b/collector.c
@@ -36,7 +36,7 @@
#include "tracker.h"
#include "perf_counter.h"
-#include "barrier.h"
+#include "util.h"
#define d_print(...)
@@ -262,7 +262,7 @@ on_read (gpointer data)
if (head < tail)
{
- g_warning ("sysprof fails at ring buffers (head %llu, tail %llu\n", head, tail);
+ g_warning ("sysprof fails at ring buffers (head "FMT64", tail "FMT64"\n", head, tail);
tail = head;
}
diff --git a/testelf.c b/testelf.c
index fac5c92..92d8801 100644
--- a/testelf.c
+++ b/testelf.c
@@ -34,7 +34,6 @@ int
main (int argc, char **argv)
{
ElfParser *elf;
- int i;
const char *build_id;
const char *filename;
diff --git a/unwind.c b/unwind.c
index 2184158..d7c23e1 100644
--- a/unwind.c
+++ b/unwind.c
@@ -1,5 +1,6 @@
#include "elfparser.h"
#include <string.h>
+#include "util.h"
/* Pointer encodings, from dwarf2.h. */
typedef enum
@@ -131,7 +132,7 @@ decode_instruction (const guchar **data)
else if (high2 == 0x02)
{
g_print ("register: %d\n", low6);
- g_print ("offset: %llu\n", decode_uleb128 (data));
+ g_print ("offset: "FMT64"\n", decode_uleb128 (data));
return "DW_CFA_offset";
}
@@ -193,8 +194,8 @@ decode_instruction (const guchar **data)
return "DW_CFA_restore_state";
case 0x0c:
- g_print ("reg: %llu\n", decode_uleb128 (data));
- g_print ("off: %llu\n", decode_uleb128 (data));
+ g_print ("reg: "FMT64"\n", decode_uleb128 (data));
+ g_print ("off: "FMT64"\n", decode_uleb128 (data));
return "DW_CFA_def_cfa";
case 0x0d:
@@ -266,7 +267,7 @@ decode_cie (const guchar **data, const guchar *end)
{
gboolean has_augmentation;
guint64 aug_len;
- char *augmentation;
+ const char *augmentation;
CIE *cie;
int i, field;
@@ -276,11 +277,11 @@ decode_cie (const guchar **data, const guchar *end)
*data += strlen (*data) + 1;
- g_print ("code alignment: %llu\n", decode_uleb128 (data));
+ g_print ("code alignment: "FMT64"\n", decode_uleb128 (data));
g_print ("data alignment: %lld\n", decode_sleb128 (data));
- g_print ("return register: %llu\n", decode_uleb128 (data));
+ g_print ("return register: "FMT64"\n", decode_uleb128 (data));
g_print ("augmentation: %s\n", augmentation);
@@ -288,7 +289,7 @@ decode_cie (const guchar **data, const guchar *end)
{
aug_len = decode_uleb128 (data);
- g_print ("len: %llu\n", aug_len);
+ g_print ("len: "FMT64"\n", aug_len);
for (i = 1; augmentation[i] != 0; ++i)
{
@@ -334,7 +335,7 @@ decode_entry (const guchar **data, gboolean eh_frame)
end = *data + len;
- g_print ("length: %llu\n", len);
+ g_print ("length: "FMT64"\n", len);
/* CIE_id is 0 for eh frames, and 0xffffffff/0xffffffffffffffff for .debug_frame */
diff --git a/barrier.h b/util.h
index 8d468c2..c1fb1df 100644
--- a/barrier.h
+++ b/util.h
@@ -1,3 +1,8 @@
+#ifndef UTIL_H
+#define UTIL_H
+
+#define FMT64 "%"G_GUINT64_FORMAT
+
#if defined(__i386__)
#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
#define cpu_relax() asm volatile("rep; nop" ::: "memory");
@@ -31,3 +36,5 @@
#define rmb() asm volatile("" ::: "memory")
#define cpu_relax() asm volatile("" ::: "memory");
#endif
+
+#endif