summaryrefslogtreecommitdiffstats
path: root/runtime/transport/symbols.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-11-28 11:26:52 -0500
committerFrank Ch. Eigler <fche@elastic.org>2008-11-28 11:26:52 -0500
commit29bdbdb17f088a997b772415d57c37258576f0f5 (patch)
tree33e666ae8cef67e323c62376f95e4393f2a9dd13 /runtime/transport/symbols.c
parent70514d65f670ac2160af4c282ebad1e7eb852341 (diff)
downloadsystemtap-steved-29bdbdb17f088a997b772415d57c37258576f0f5.tar.gz
systemtap-steved-29bdbdb17f088a997b772415d57c37258576f0f5.tar.xz
systemtap-steved-29bdbdb17f088a997b772415d57c37258576f0f5.zip
PR5947: make runtime code -Wpointer-arith-clean
Diffstat (limited to 'runtime/transport/symbols.c')
-rw-r--r--runtime/transport/symbols.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c
index 1cd78724..6e3bef1b 100644
--- a/runtime/transport/symbols.c
+++ b/runtime/transport/symbols.c
@@ -78,10 +78,12 @@ static void u32_swap(void *a, void *b, int size)
static void generic_swap(void *a, void *b, int size)
{
+ char *aa = a;
+ char *bb = b;
do {
- char t = *(char *)a;
- *(char *)a++ = *(char *)b;
- *(char *)b++ = t;
+ char t = *aa;
+ *aa++ = *bb;
+ *bb++ = t;
} while (--size > 0);
}
@@ -101,9 +103,10 @@ static void generic_swap(void *a, void *b, int size)
* O(n*n) worst-case behavior and extra memory requirements that make
* it less suitable for kernel use.
*/
-void _stp_sort(void *base, size_t num, size_t size,
+void _stp_sort(void *_base, size_t num, size_t size,
int (*cmp) (const void *, const void *), void (*swap) (void *, void *, int size))
{
+ char *base = (char*) _base;
/* pre-scale counters for performance */
int i = (num / 2 - 1) * size, n = num * size, c, r;