diff --git a/src/browser.c b/src/browser.c
index 2770355a5a07d27b7cf9180a6d69262067a48846..519370ed0e5d29a398fb9ac26ed17d3c42114931 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -304,7 +304,7 @@ char *do_browser(char *path)
 			path = mallocstrcpy(path, filelist[selected]);
 			goto read_directory_contents;
 #ifdef ENABLE_NANORC
-		} else if (func == (void *)implant) {
+		} else if (func == (functionptrtype)implant) {
 			implant(first_sc_for(MBROWSER, func)->expansion);
 #endif
 		} else if (func == do_exit) {
diff --git a/src/help.c b/src/help.c
index a76c3a447e7a5929271badde8309d5fc710dea06..a0da5f97b843767584dbbcea070d63c30073d54a 100644
--- a/src/help.c
+++ b/src/help.c
@@ -217,7 +217,7 @@ void do_help(void)
 		} else if (func == do_findnext) {
 			do_findnext();
 #ifdef ENABLE_NANORC
-		} else if (func == (void *)implant) {
+		} else if (func == (functionptrtype)implant) {
 			implant(first_sc_for(MHELP, func)->expansion);
 #endif
 		} else if (kbinput == KEY_WINCH) {
diff --git a/src/nano.c b/src/nano.c
index 43a08348b14f7acd8db4797ef440ad88689f424c..655bf2c3902da1f8c2cf5fa70245f0399d2bf629 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1622,7 +1622,7 @@ int do_mouse(void)
 #endif /* ENABLE_MOUSE */
 
 /* Return TRUE when the given function is a cursor-moving command. */
-bool wanted_to_move(void *func)
+bool wanted_to_move(void (*func)(void))
 {
 	return func == do_left || func == do_right ||
 			func == do_up || func == do_down ||
@@ -1747,7 +1747,7 @@ int do_input(bool allow_funcs)
 			pletion_line = NULL;
 #endif
 #ifdef ENABLE_NANORC
-		if (shortcut->func == (void *)implant) {
+		if (shortcut->func == (functionptrtype)implant) {
 			implant(shortcut->expansion);
 			return 42;
 		}
diff --git a/src/prompt.c b/src/prompt.c
index e8fbbc0d591ece9776a13acc5e57ddf37161761d..2c612c6e5043daa854e16674760d8a7f1e8aa514 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -153,7 +153,7 @@ int do_statusbar_input(bool *finished)
 								shortcut->func == do_backspace))
 			;
 #ifdef ENABLE_NANORC
-		else if (shortcut->func == (void *)implant)
+		else if (shortcut->func == (functionptrtype)implant)
 			implant(shortcut->expansion);
 #endif
 		else if (shortcut->func == do_verbatim_input)
diff --git a/src/rcfile.c b/src/rcfile.c
index fda3b382c4d8390db4b959d9dc702b4a1898da19..c1e6a87f48bdfc76591a5bd9a4571dd4725bf29a 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -413,7 +413,7 @@ void parse_binding(char *ptr, bool dobind)
 		 * otherwise it is the name of a function. */
 		if (*funcptr == '"') {
 			newsc = nmalloc(sizeof(sc));
-			newsc->func = (void *)implant;
+			newsc->func = (functionptrtype)implant;
 			newsc->expansion = mallocstrcpy(NULL, funcptr + 1);
 #ifndef NANO_TINY
 			newsc->toggle = 0;
@@ -449,7 +449,7 @@ void parse_binding(char *ptr, bool dobind)
 #endif
 #ifdef ENABLE_NANORC
 		/* Handle the special case of a key defined as a string. */
-		if (newsc->func == (void *)implant)
+		if (newsc->func == (functionptrtype)implant)
 			mask = MMOST | MHELP;
 #endif
 		/* Now limit the given menu to those where the function exists. */