aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2019-08-09 14:24:20 +0200
committerLukas Larsson <[email protected]>2019-08-09 14:29:46 +0200
commit9bb98a4e50c4c3a13a384baf9e784cae81a592e3 (patch)
treec8fc55907e049061e4dcd05d8cfb858524c7f70f
parent7c9af844d83e300b9a1024dccfb1270b9a338f8f (diff)
downloadotp-9bb98a4e50c4c3a13a384baf9e784cae81a592e3.tar.gz
otp-9bb98a4e50c4c3a13a384baf9e784cae81a592e3.tar.bz2
otp-9bb98a4e50c4c3a13a384baf9e784cae81a592e3.zip
erts: Add typedef for hash_foreach function ptr
-rw-r--r--erts/emulator/beam/hash.c2
-rw-r--r--erts/emulator/beam/hash.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/beam/hash.c b/erts/emulator/beam/hash.c
index 8954dbb06c..cc816ac163 100644
--- a/erts/emulator/beam/hash.c
+++ b/erts/emulator/beam/hash.c
@@ -343,7 +343,7 @@ hash_remove(Hash *h, void *tmpl)
return NULL;
}
-void hash_foreach(Hash* h, void (*func)(void *, void *), void *func_arg2)
+void hash_foreach(Hash* h, HFOREACH_FUN func, void *func_arg2)
{
int i;
diff --git a/erts/emulator/beam/hash.h b/erts/emulator/beam/hash.h
index d319aaca83..38b401548a 100644
--- a/erts/emulator/beam/hash.h
+++ b/erts/emulator/beam/hash.h
@@ -38,6 +38,7 @@ typedef void (*HFREE_FUN)(void*);
typedef void* (*HMALLOC_FUN)(int,size_t);
typedef void (*HMFREE_FUN)(int,void*);
typedef int (*HMPRINT_FUN)(fmtfn_t,void*,char*, ...);
+typedef void (*HFOREACH_FUN)(void *, void *);
/*
** This bucket must be placed in top of
@@ -96,6 +97,6 @@ void* hash_get(Hash*, void*);
void* hash_put(Hash*, void*);
void* hash_erase(Hash*, void*);
void* hash_remove(Hash*, void*);
-void hash_foreach(Hash*, void (*func)(void *, void *), void *);
+void hash_foreach(Hash*, HFOREACH_FUN, void *);
#endif