diff options
author | Petr Machata <pmachata@redhat.com> | 2011-04-07 16:36:51 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2011-04-07 16:36:51 +0200 |
commit | 088e13dd387acef46f43f3c9fa7d478c8afadc23 (patch) | |
tree | dc72fa52e87bfbbfa8ea789ca352ef4c43fc8351 | |
parent | 9e39d260db9b566e19dd5f2df8cc62a8151bc211 (diff) | |
download | elfutils-088e13dd387acef46f43f3c9fa7d478c8afadc23.tar.gz |
dwarflint: Convert WHERE to a function
-rw-r--r-- | dwarflint/where.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/dwarflint/where.h b/dwarflint/where.h index c5e22761..fb1dd47a 100644 --- a/dwarflint/where.h +++ b/dwarflint/where.h @@ -1,5 +1,5 @@ /* Pedantic checking of DWARF files - Copyright (C) 2009,2010 Red Hat, Inc. + Copyright (C) 2009,2010,2011 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -55,12 +55,6 @@ extern "C" struct where const *next; // For forming "caused-by" chains. }; -# define WHERE(SECTION, NEXT) \ - ((struct where) \ - {(SECTION), wf_plain, \ - (uint64_t)-1, (uint64_t)-1, (uint64_t)-1, \ - NULL, NEXT}) - extern const char *where_fmt (const struct where *wh, char *ptr); extern void where_fmt_chain (const struct where *wh, const char *severity); extern void where_reset_1 (struct where *wh, uint64_t addr); @@ -72,6 +66,18 @@ extern "C" #include <iostream> +inline where +WHERE (section_id sec, where const *next = NULL) +{ + where ret = {sec, wf_plain, + (uint64_t)-1, + (uint64_t)-1, + (uint64_t)-1, + NULL, next}; + return ret; +} + + inline std::ostream & operator << (std::ostream &os, where const &wh) { |