summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-05-30 12:38:16 +0300
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2018-06-04 10:35:16 +0200
commitea4ea50f064c5468142b24627acad09a41f060cb (patch)
treeedd308866e93219b4b0973553d9764cc1dfe8c30
parenta19d2449c7801a22d6c8370a965dab3d16c77925 (diff)
downloadillumos-joyent-ea4ea50f064c5468142b24627acad09a41f060cb.tar.gz
9565 ctf: cast between incompatible function types
Reviewed by: Yuri Pankov <yuripv@yuripv.net> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: John Levon <john.levon@joyent.com> Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-rw-r--r--usr/src/tools/ctf/cvt/ctfmerge.c9
-rw-r--r--usr/src/tools/ctf/cvt/ctftools.h13
-rw-r--r--usr/src/tools/ctf/cvt/iidesc.c23
-rw-r--r--usr/src/tools/ctf/cvt/st_parse.c2
-rw-r--r--usr/src/tools/ctf/cvt/stabs.c6
-rw-r--r--usr/src/tools/ctf/cvt/tdata.c14
6 files changed, 36 insertions, 31 deletions
diff --git a/usr/src/tools/ctf/cvt/ctfmerge.c b/usr/src/tools/ctf/cvt/ctfmerge.c
index 5706cceb17..1d6d751d99 100644
--- a/usr/src/tools/ctf/cvt/ctfmerge.c
+++ b/usr/src/tools/ctf/cvt/ctfmerge.c
@@ -504,9 +504,11 @@ worker_runphase2(workqueue_t *wq)
/*
* Main loop for worker threads.
*/
-static void
-worker_thread(workqueue_t *wq)
+static void *
+worker_thread(void *ptr)
{
+ workqueue_t *wq = ptr;
+
worker_runphase1(wq);
debug(2, "%d: entering first barrier\n", pthread_self());
@@ -530,6 +532,7 @@ worker_thread(workqueue_t *wq)
debug(2, "%d: phase 1 complete\n", pthread_self());
worker_runphase2(wq);
+ return (NULL);
}
/*
@@ -692,7 +695,7 @@ start_threads(workqueue_t *wq)
for (i = 0; i < wq->wq_nthreads; i++) {
pthread_create(&wq->wq_thread[i], NULL,
- (void *(*)(void *))worker_thread, wq);
+ worker_thread, wq);
}
sigset(SIGINT, handle_sig);
diff --git a/usr/src/tools/ctf/cvt/ctftools.h b/usr/src/tools/ctf/cvt/ctftools.h
index 708dfd82ef..79746cba52 100644
--- a/usr/src/tools/ctf/cvt/ctftools.h
+++ b/usr/src/tools/ctf/cvt/ctftools.h
@@ -58,11 +58,11 @@ extern "C" {
#endif
#ifndef MAX
-#define MAX(a, b) ((a) < (b) ? (b) : (a))
+#define MAX(a, b) ((a) < (b) ? (b) : (a))
#endif
#ifndef MIN
-#define MIN(a, b) ((a) > (b) ? (b) : (a))
+#define MIN(a, b) ((a) > (b) ? (b) : (a))
#endif
#define TRUE 1
@@ -271,13 +271,13 @@ typedef enum iitype {
typedef struct iidesc {
iitype_t ii_type;
char *ii_name;
- tdesc_t *ii_dtype;
+ tdesc_t *ii_dtype;
char *ii_owner; /* File that defined this node */
int ii_flags;
/* Function arguments (if any) */
int ii_nargs;
- tdesc_t **ii_args;
+ tdesc_t **ii_args;
int ii_vargs; /* Function uses varargs */
} iidesc_t;
@@ -358,14 +358,15 @@ void iter_iidescs_by_name(tdata_t *, const char *,
iidesc_t *iidesc_dup(iidesc_t *);
iidesc_t *iidesc_dup_rename(iidesc_t *, char const *, char const *);
void iidesc_add(hash_t *, iidesc_t *);
-void iidesc_free(iidesc_t *, void *);
+void iidesc_free(iidesc_t *);
+void iidesc_free_cb(void *, void *);
int iidesc_count_type(void *, void *);
void iidesc_stats(hash_t *);
int iidesc_dump(iidesc_t *);
/* input.c */
typedef enum source_types {
- SOURCE_NONE = 0,
+ SOURCE_NONE = 0,
SOURCE_UNKNOWN = 1,
SOURCE_C = 2,
SOURCE_S = 4
diff --git a/usr/src/tools/ctf/cvt/iidesc.c b/usr/src/tools/ctf/cvt/iidesc.c
index b6b9a0c7f2..0d75e3f852 100644
--- a/usr/src/tools/ctf/cvt/iidesc.c
+++ b/usr/src/tools/ctf/cvt/iidesc.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Routines for manipulating iidesc_t structures
*/
@@ -99,7 +97,7 @@ iidesc_add(hash_t *hash, iidesc_t *new)
bcopy(new, old, sizeof (*old));
bcopy(&tmp, new, sizeof (*new));
- iidesc_free(new, NULL);
+ iidesc_free(new);
return;
}
@@ -151,17 +149,22 @@ iidesc_dup_rename(iidesc_t *src, char const *name, char const *owner)
/*ARGSUSED*/
void
-iidesc_free(iidesc_t *idp, void *private)
+iidesc_free_cb(void *ptr, void *private)
{
- if (idp->ii_name)
- free(idp->ii_name);
- if (idp->ii_nargs)
- free(idp->ii_args);
- if (idp->ii_owner)
- free(idp->ii_owner);
+ iidesc_t *idp = ptr;
+
+ free(idp->ii_name);
+ free(idp->ii_args);
+ free(idp->ii_owner);
free(idp);
}
+void
+iidesc_free(iidesc_t *idp)
+{
+ iidesc_free_cb(idp, NULL);
+}
+
int
iidesc_dump(iidesc_t *ii)
{
diff --git a/usr/src/tools/ctf/cvt/st_parse.c b/usr/src/tools/ctf/cvt/st_parse.c
index 1530734a48..03facfd5cb 100644
--- a/usr/src/tools/ctf/cvt/st_parse.c
+++ b/usr/src/tools/ctf/cvt/st_parse.c
@@ -448,7 +448,7 @@ parse_stab(stab_t *stab, char *cp, iidesc_t **iidescp)
bzero(&resetbuf, sizeof (resetbuf));
if (rc < 0 || ii->ii_type == II_NOT) {
- iidesc_free(ii, NULL);
+ iidesc_free(ii);
return (rc);
}
diff --git a/usr/src/tools/ctf/cvt/stabs.c b/usr/src/tools/ctf/cvt/stabs.c
index f7b3034c64..53b4565859 100644
--- a/usr/src/tools/ctf/cvt/stabs.c
+++ b/usr/src/tools/ctf/cvt/stabs.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Routines used to read stabs data from a file, and to build a tdata structure
* based on the interesting parts of that data.
@@ -331,7 +329,7 @@ stabs_read(tdata_t *td, Elf *elf, const char *file)
*/
if (scope && stab->n_type != N_PSYM) {
if (iidescp)
- iidesc_free(iidescp, NULL);
+ iidesc_free(iidescp);
goto parse_loop_end;
}
@@ -356,7 +354,7 @@ stabs_read(tdata_t *td, Elf *elf, const char *file)
case II_PSYM:
fnarg_add(curfun, iidescp);
- iidesc_free(iidescp, NULL);
+ iidesc_free(iidescp);
break;
default:
aborterr("invalid ii_type %d for stab type %d",
diff --git a/usr/src/tools/ctf/cvt/tdata.c b/usr/src/tools/ctf/cvt/tdata.c
index 295928586e..ca71168bcf 100644
--- a/usr/src/tools/ctf/cvt/tdata.c
+++ b/usr/src/tools/ctf/cvt/tdata.c
@@ -246,22 +246,22 @@ static void (*free_cbs[])(tdesc_t *) = {
};
/*ARGSUSED1*/
-static int
-tdesc_free_cb(tdesc_t *tdp, void *private)
+static void
+tdesc_free_cb(void *ptr, void *private)
{
+ tdesc_t *tdp = ptr;
+
if (tdp->t_name)
free(tdp->t_name);
if (free_cbs[tdp->t_type])
free_cbs[tdp->t_type](tdp);
free(tdp);
-
- return (1);
}
void
tdesc_free(tdesc_t *tdp)
{
- (void) tdesc_free_cb(tdp, NULL);
+ tdesc_free_cb(tdp, NULL);
}
static int
@@ -390,8 +390,8 @@ tdata_new(void)
void
tdata_free(tdata_t *td)
{
- hash_free(td->td_iihash, (void (*)())iidesc_free, NULL);
- hash_free(td->td_layouthash, (void (*)())tdesc_free_cb, NULL);
+ hash_free(td->td_iihash, iidesc_free_cb, NULL);
+ hash_free(td->td_layouthash, tdesc_free_cb, NULL);
hash_free(td->td_idhash, NULL, NULL);
list_free(td->td_fwdlist, NULL, NULL);