From: Timm Bäder
Make advance_pc() a static function so we can get rid of another nested
function. Rename it to run_advance_pc() and use a local advance_pc()
macro to pass all the local variables. This is similar to what the
equivalent code in libdw/dwarf_getsrclines.c is doing.
Signed-off-by: T
Giving this another shot since pulling all the parsing code into
libdwP.h seems a bit overkill (and potentially buggy of course). The
downside is that run_advance_pc() takes 6 arguments instead of the 4
that it takes in libdwarf_getsrclines.c
On 04/03/2021 14:59, Mark Wielaard wrote:
Hi Timm,
On Thu, 2021-03-04 at 14:44 +0100, Timm Bäder wrote:
any update on this? I see that SHT_LLVM_ADDRSIG is still not in upstream
glibc. Are you working on that, Navin?
As for the checks, I'm not sure we can do anything here since elfutils
can't k
On 18/11/2020 06:34, Navin P via Elfutils-devel wrote:
diff --git a/src/elflint.c b/src/elflint.c
index ef3e3732..62663800 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -3905,6 +3905,7 @@ section [%2zu] '%s': size not multiple of entry
size\n"),
&& shdr->sh_type != SHT_GNU_ATTRIBUTES
From: Timm Bäder
CURLINFO_CURLINFO_CONTENT_LENGTH_DOWNLOAD_T is one CURLINFO_ too much.
Signed-off-by: Timm Bäder
---
debuginfod/debuginfod-client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index df238e0
I just looked at this for too long and became confused by the naming.
It seems like there's one CURLINFO_ too much in there. Googling seems to
confirm.
- Timm
From: Timm Bäder
clang warns about this:
../../debuginfod/debuginfod-client.c:899:28: error: implicit conversion from
'long' to 'double' changes value from 9223372036854775807 to
9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
pa = (dl > LONG_MAX ? LONG_MAX : (lon
From: Timm Bäder
When comparing a long to a double, clang prints the following warning:
../../debuginfod/debuginfod-client.c:917:28: error: implicit conversion from
'long' to 'double' changes value from 9223372036854775807 to
9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
If I understand the code correctly, these comparisons exist only for the
curl_off_t cases, in which case dl and cl might be greater than
LONG_MAX. However, in case they are declares as double values, this
cannot be the case and the comparisons are unnecessary.
- Timm
From: Timm Bäder
This unifies the error handling with the rest of the code base and gets
rid of a nested function.
Signed-off-by: Timm Bäder
---
src/ChangeLog | 6 ++
src/elfcompress.c | 215 +++---
2 files changed, 112 insertions(+), 109 deletions
On 24/02/2021 14:16, Mark Wielaard wrote:>>> -#define NO_RESIZING 0u
-#define ALLOCATING_MEMORY 1u
-#define MOVING_DATA 3u
-#define CLEANING 2u
+#define NO_RESIZING 0x0
+#define ALLOCATING_MEMORY 0x1
+#define MOVING_DATA 0x3
+#define CLEANING 0x2
Nope, same result. :(
Hmm
On 24/02/2021 14:16, Mark Wielaard wrote:> Hmmm. I am not sure why that
doesn't work. What if you make them
explicitly unsinged (adding u at the end). Or does it simply ignore
the values and just warn because it sees the macro name and not an
explicit number?
Another viable workaround is to jus
On 24/02/2021 14:46, Timm Bäder wrote:
On 24/02/2021 14:16, Mark Wielaard wrote:
Hmmm. I am not sure why that doesn't work. What if you make them
explicitly unsinged (adding u at the end). Or does it simply ignore
the values and just warn because it sees the macro name and not an
explicit number
On 24/02/2021 14:16, Mark Wielaard wrote:
Hmmm. I am not sure why that doesn't work. What if you make them
explicitly unsinged (adding u at the end). Or does it simply ignore
the values and just warn because it sees the macro name and not an
explicit number?
I think I don't really understand any
On 17/02/2021 17:49, Mark Wielaard wrote:
I think both the comment and the warning message are a little
misleading.
The comment should really read "Change state from CLEANING to
NO_RESIZING". You are right that NO_RESIZING is just zero, but still
removing it seems to make the code less clear.
From: Timm Bäder
Clang complains about this because it has -Wxor-used-as-pow:
../../lib/dynamicsizehash_concurrent.c:288:61: error: result of 'CLEANING ^
NO_RESIZING' is 2; did you mean '1 << NO_RESIZING' (1)?
[-Werror,-Wxor-used-as-pow]
atomic_fetch_xor_explicit(&htab->resizing_state, CLEAN
Hi,
I'm mainly leaving this patch here to discuss what to do about it.
Clang complains because of -Wxor-used-as-pow. So of course one
possibility is to use -Wno-xor-used-as-pow. It also prints
'0x2 ^ NO_RESIZING' as an alternative to silence the warning. Given the
comment just above the changed li
From: Timm Bäder
Clang does not support -Wtrampolines, so check if the compiler supports
it before using it.
Signed-off-by: Timm Bäder
---
config/eu.am | 10 --
configure.ac | 9 +
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/config/eu.am b/config/eu.am
inde
From: Timm Bäder
GCC accepts the =5, which means it doesn't try to parse any comments
and only accepts the fallthrough attribute in code. Clang does not ever
parse any comments and always wants the fallthrough attribute anyway.
Clang also doesn't accept the =n parameter for -Wimplicit-fallthrough
From: Timm Bäder
Clang does not support this warning, so check for compiler support
before using it.
Signed-off-by: Timm Bäder
---
config/eu.am | 10 --
configure.ac | 9 +
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/config/eu.am b/config/eu.am
index 025125
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
tests/elfstrmerge.c | 32 +---
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
index 00f025ec..197c6a5d 100644
--- a/tests
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
tests/elfstrmerge.c | 76 +
1 file changed, 42 insertions(+), 34 deletions(-)
diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
index abbdf3fd..00f025ec 10064
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/elfcompress.c | 218 +++---
1 file changed, 109 insertions(+), 109 deletions(-)
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 65e28f0e..ba08e73f 100644
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/elfcompress.c | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 2dc74a0c..65e28f0e 100644
--- a/src/elfcompress.c
+++
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/elfcompress.c | 16 +---
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 1b5b1e36..65a922a7 100644
--- a/src/elfcompress.c
+++ b/src/e
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/elfcompress.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 65a922a7..2dc74a0c 100644
--- a/src/elfcompress.c
+++ b/src/elfc
From: Timm Bäder
This is a simple one-liner, so inline this into the few callers.
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/unstrip.c | 14 ++
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/unstrip.c b/src/unstrip.c
index 3822a19b..
From: Timm Bäder
Get rid of an unnecessary nested function this way.
Signed-off-by: Timm Bäder
---
src/unstrip.c | 47 +--
1 file changed, 21 insertions(+), 26 deletions(-)
diff --git a/src/unstrip.c b/src/unstrip.c
index 72fabac8..90e02831 100644
-
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/unstrip.c | 35 ---
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/src/unstrip.c b/src/unstrip.c
index 90e02831..3822a19b 100644
--- a/src/unstrip.c
+++ b/
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/unstrip.c | 28
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/src/unstrip.c b/src/unstrip.c
index 6e874c3a..72fabac8 100644
--- a/src/unstrip.c
+++ b/src/uns
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/unstrip.c | 28 +++-
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/unstrip.c b/src/unstrip.c
index 85803295..6e874c3a 100644
--- a/src/unstrip.c
+++ b/src/uns
From: Timm Bäder
And rename it to buffer_left() to be a bit more descriptive
Signed-off-by: Timm Bäder
---
src/elflint.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/elflint.c b/src/elflint.c
index 4df6f6e5..85cc7833 100644
--- a/src/elflint.c
+++ b
From: Timm Bäder
Rename it to buffer_pos() to be a bit more descriptive and get rid of a
nested function this way.
Signed-off-by: Timm Bäder
---
src/elflint.c | 39 ---
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/src/elflint.c b/src/elfli
There is quite a bit of code duplication between src/readelf.c and
libdw/dwarf_getsrclines.c when parsing header_length, unit_length, etc.
Pull the code out into libdwP.h and use it in both of those files.
It doesn't save a much code as I'd hoped and I'm not sure about the
naming, but here's the
From: Timm Bäder
src/readelf.c and libdw/dwarf_getsrclines.c contain the same code to
read header_length, unit_length, minimum_instr_len, etc.
Pull this code out into libdwP.h and into a header_state struct that
goes with the line_state struct in dwarf_getsrclines.c.
Signed-off-by: Timm Bäder
-
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/ar.c | 34 +-
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/ar.c b/src/ar.c
index 2a17d0d3..66b2c4fd 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -436,6 +4
On 29/01/2021 21:48, Mark Wielaard wrote:
Hi Timm,
On Fri, 2021-01-08 at 09:13 +0100, Timm Bäder via Elfutils-devel wrote:
Get rid of a nested function this way.
Skipping this one for now since I don't believe I understand this code.
Could you explain what the code does what it does an
From: Timm Bäder
advance_pc() uses show_op_index to save whether the current op_index is
> 0 OR the new op_index is > 0.
The new op index is calculated via
new_op_index = (op_index + op_advance) % max_ops_per_instr;
since all of the variables involved are unsigned,
new_op_index >= op_index is
On 01/02/2021 15:21, Mark Wielaard wrote:
On Fri, 2021-01-08 at 09:16 +0100, Timm Bäder via Elfutils-devel wrote:
here another round for src/readelf.c. I think they are simple, but I'm
not happy with the advance_pc() commit. I'm open for suggestions here
but I can't come up
From: Timm Bäder
Get rid of a nested function this way
Signed-off-by: Timm Bäder
---
src/readelf.c | 39 +++
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/readelf.c b/src/readelf.c
index e0163891..9758d338 100644
--- a/src/readelf.c
+++
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/readelf.c | 42 --
1 file changed, 24 insertions(+), 18 deletions(-)
diff --git a/src/readelf.c b/src/readelf.c
index 99e90c34..e0163891 100644
--- a/src/readelf.c
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/readelf.c | 16 +---
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/readelf.c b/src/readelf.c
index 0157f8a2..99e90c34 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -357
From: Timm Bäder
Get rid of a nested function this way
Signed-off-by: Timm Bäder
---
src/readelf.c | 24 ++--
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/readelf.c b/src/readelf.c
index a95fc0aa..0157f8a2 100644
--- a/src/readelf.c
+++ b/src/readelf.
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/readelf.c | 34 ++
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/readelf.c b/src/readelf.c
index 829a418d..a95fc0aa 100644
--- a/src/readelf.c
+++ b/s
Hi,
here another round for src/readelf.c. I think they are simple, but I'm
not happy with the advance_pc() commit. I'm open for suggestions here
but I can't come up with something better right now. I'll keep looking
in to that in the meantime.
- Timm
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/arlib-argp.c | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/arlib-argp.c b/src/arlib-argp.c
index c07d9299..a3c12e4d 100644
--- a/src/arlib-argp.c
+++ b/sr
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/ar.c | 34 +-
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/ar.c b/src/ar.c
index 2a17d0d3..7d0298dd 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -436,6 +4
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
tests/zstrptr.c | 43 ++-
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/tests/zstrptr.c b/tests/zstrptr.c
index 6d8e19f7..9fb42e28 100644
--- a/tests/
From: Timm Bäder
Get rid of the nested functions
Signed-off-by: Timm Bäder
---
src/addr2line.c | 47 ++-
1 file changed, 26 insertions(+), 21 deletions(-)
diff --git a/src/addr2line.c b/src/addr2line.c
index ea01c1be..34945046 100644
--- a/src/addr2
Hi,
here a few patches to remove single nested functions from
- addr2line.c
- tests/zstrptr.c
- ar.c
- arlib-argp.c
I think they are pretty straight-forward again.
- Timm
From: Timm Bäder
Try to unify the 32/64 bit code paths and get rid of the nested
handle_segment() this way.
Signed-off-by: Timm Bäder
---
libdwfl/elf-from-memory.c | 115 +-
1 file changed, 50 insertions(+), 65 deletions(-)
diff --git a/libdwfl/elf-from-mem
From: Timm Bäder
Use one loop for both 32 and 64 bit case. This allows for only one call
site of the old handle_segment(), which we can then inline into the for
loop.
Signed-off-by: Timm Bäder
---
libdwfl/elf-from-memory.c | 81 ---
1 file changed, 34 inser
Hey,
these are relatively straight-forward I think. Let me know if that's not
the case. :)
- Timm
From: Timm Bäder
The no_symtab_updates() function was being called at the beginning of
all case labels in this switch, so we can just call it once before the
switch. Then it only has one call-site, so inline this short function
there.
Signed-off-by: Timm Bäder
---
src/strip.c | 152 +++
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
src/strip.c | 51 ---
1 file changed, 28 insertions(+), 23 deletions(-)
diff --git a/src/strip.c b/src/strip.c
index 71913fac..e608dc5e 100644
--- a/src/strip.
From: Timm Bäder
Pull relocate() info file scope and get rid of a nested function this
way. Refactor remove_debug_relocations() to minimize the parameters we
need to pass to relocate().
Signed-off-by: Timm Bäder
---
src/strip.c | 347
1 file
From: Timm Bäder
Signed-off-by: Timm Bäder
---
src/strip.c | 37 +
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/src/strip.c b/src/strip.c
index 7ce14ab8..c971b6c2 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -1535,25 +1535,30 @@ handle_elf
Hi,
here a couple of patches to remove the nested functions from
src/strip.c. I tried to keep the resulting code clean but had to do some
refactorings to get that done. I hope the result is worth considering.
Otherwise, I'm open for suggestions.
- Timm
From: Timm Bäder
Get rid of a nested function this way.
Signed-off-by: Timm Bäder
---
libdwfl/ChangeLog | 5 +++
libdwfl/link_map.c | 104 +
2 files changed, 62 insertions(+), 47 deletions(-)
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
ind
From: Timm Bäder
Get rid of a nested function this way. Add a memory_closure struct to
keep the functions clean.
Signed-off-by: Timm Bäder
---
libdwfl/ChangeLog | 5 +
libdwfl/link_map.c | 48 ++
2 files changed, 37 insertions(+), 16 deletions(
Same as the old thread. I used a memory_closure struct this time.
I quickly looked over the patches and I think we could even save
buffer and buffer_available in there to reduce the parameter count
further but then we should rename the struct (but read_data isn't the
best name either).
Hope the ch
From: Timm Bäder
This gets rid of the tested function and is shorter.
---
libdwfl/link_map.c | 66 ++
1 file changed, 26 insertions(+), 40 deletions(-)
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index 64baaec4..8a19f358 100644
--- a/libdwfl/
From: Timm Bäder
Get rid of another nested function this way
---
libdwfl/link_map.c | 114 ++---
1 file changed, 66 insertions(+), 48 deletions(-)
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index 5c39c631..64baaec4 100644
--- a/libdwfl/link_map.
From: Timm Bäder
Get rid of another nested function
---
libdwfl/link_map.c | 47 +++---
1 file changed, 32 insertions(+), 15 deletions(-)
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index 29307c74..5c39c631 100644
--- a/libdwfl/link_map.c
+++ b/l
Hi,
the attached patches get rid of nested functions in libdwfl/link_map.c.
I wrote these a while back and just looked at them again and we could
use the same read_state struct here as well. I just quickly checked,
but it seems a bit more involved due to the integrated_memory_callback
handling. I
From: Timm Bäder
Get rid of a nested function this way.
---
libdwfl/dwfl_segment_report_module.c | 162 +--
1 file changed, 80 insertions(+), 82 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index a082886a..c48d9ab
From: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 65 +++-
1 file changed, 35 insertions(+), 30 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 391fd761..a082886a 100644
--- a/libdwfl/dwfl_segment_rep
From: Timm Bäder
Use a read_state struct here to minimize the amount of parameters we
pass.
---
libdwfl/dwfl_segment_report_module.c | 38
1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_rep
Here are the three patches to remove the three remaining nested
functions from libdwfl/dwfl_segment_report_module.c.
On 25/11/2020 17:33, Mark Wielaard wrote:
Hi Timm,
On Mon, 2020-11-23 at 13:27 +0100, Timm Bäder via Elfutils-devel wrote:
version 2 of this patch set. I removed segmend_read() entirely now,
which meant modifying a bunch of later patches. Other than that, they
are the same.
Hope the --from to
From: Timm Bäder
Do one loop check for 32/64 bit inside the loop, instead of outside.
This way we have only one call site for the function called in the loop
body.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 52 +++-
1 file changed, 27 insertion
From: Timm Bäder
Just like we did before, use only one loop here and check for 32/64 bit
in the loop body. This way we only have one call site for consider_dyn
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 28 ++--
1 file changed, 14 insertions(+)
From: Timm Bäder
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 40 +---
1 file changed, 12 insertions(+), 28 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 8613ce21..046d5381 100644
---
From: Timm Bäder
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 24 ++--
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 848c3bec..c55168ed 100644
--- a/l
From: Timm Bäder
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 77 +---
1 file changed, 47 insertions(+), 30 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index c55168ed..01adfe9e 100644
---
From: Timm Bäder
Get rid of the nested function this way
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 142 +--
1 file changed, 66 insertions(+), 76 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_mod
From: Timm Bäder
There is now only one caller for this nested function, so get rid of it
by just inlining it there.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 24 +---
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/libdwfl/dwfl_segm
From: Timm Bäder
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 25 ++---
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 6c6f9f37..a69ead8f 100644
--- a/
From: Timm Bäder
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 187 +++
1 file changed, 101 insertions(+), 86 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 6abbf992..6c6f9f37 100644
--
From: Timm Bäder
Keep the three build id fields in a struct. This will be an important
clean up later.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 54
1 file changed, 31 insertions(+), 23 deletions(-)
diff --git a/libdwfl/dwfl_segment_repo
From: Timm Bäder
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 16 ++--
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index c587efd7..848c3bec 100644
--- a/libdwfl/dw
From: Timm Bäder
Just inline the memory_callback call everywhere segmenty_read was used.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 24 +---
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libd
Hi again,
version 2 of this patch set. I removed segmend_read() entirely now,
which meant modifying a bunch of later patches. Other than that, they
are the same.
Hope the --from to git send-email worked out, too.
Thanks,
Timm
On 13/11/2020 13:38, Mark Wielaard wrote:
OK. The mail subject is a little misleading, this is far from turning
the code base into ISO C99. gnu99 is much more than those two features:
https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
Right, I wasn't trying to get rid of all the gnu99 feature
On 12/11/2020 17:52, Navin P wrote:
Hi,
I already have a patch that makes elfutils compile with clang. Since
you are working
this will be of use to you. I've attached the patch since it is big.
Here are some of the changes
1. All functions at file scope have static qualifier so that no
col
There is now only one caller for this nested function, so get rid of it
by just inlining it there.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 25 +
1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.
This works just as well with a goto-out style label.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 50 +---
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
This prevents a jump which is needed in a later patch.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 36 ++--
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.
Do one loop check for 32/64 bit inside the loop, instead of outside.
This way we have only one call site for the function called in the loop
body.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 52 +++-
1 file changed, 27 insertions(+), 25 deletions(
Hi,
I'm looking into removing both the nested functions as well as
variable-length arrays in the elfutils source code, so it can be built
using clang. This is a continuation of
https://sourceware.org/bugzilla/show_bug.cgi?id=24964 basically.
I did try to incorporate some cleanup commits as well s
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 26 +++---
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 76686a72..80f97cfd 100644
--- a/libdwfl/dwfl_segme
Just like we did before, use only one loop here and check for 32/64 bit
in the loop body. This way we only have one call site for consider_dyn
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 28 ++--
1 file changed, 14 insertions(+), 14 deletions(-)
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 187 +++
1 file changed, 101 insertions(+), 86 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 44743fab..76686a72 100644
--- a/libdwfl/dwfl_se
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 16 ++--
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index d06d0ba0..ba11b60a 100644
--- a/libdwfl/dwfl_segment_report_m
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 40 +---
1 file changed, 12 insertions(+), 28 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 7c97784f..0679453e 100644
--- a/libdwfl/dwfl_seg
Keep the three build id fields in a struct. This will be an important
clean up later.
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 54
1 file changed, 31 insertions(+), 23 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libd
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 27 ---
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index ba11b60a..751a96f1 100644
--- a/libdwfl/dwfl_segm
Get rid of the nested function this way
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 142 +--
1 file changed, 66 insertions(+), 76 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 0679453
In preparation of getting rid of nested functions
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 30 +---
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
ind
Signed-off-by: Timm Bäder
---
libdwfl/dwfl_segment_report_module.c | 79 +---
1 file changed, 48 insertions(+), 31 deletions(-)
diff --git a/libdwfl/dwfl_segment_report_module.c
b/libdwfl/dwfl_segment_report_module.c
index 751a96f1..00455aa4 100644
--- a/libdwfl/dwfl_seg
100 matches
Mail list logo