Skip to content

Commit be9624e

Browse files
mojotxbrammool
authored andcommitted
patch 9.0.1471: warnings for function declarations
Problem: Warnings for function declarations. Solution: Add argument types. (Michael Jarvis, closes #12277)
1 parent 1be4b81 commit be9624e

5 files changed

Lines changed: 24 additions & 22 deletions

File tree

src/crypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef struct {
4040
int whole_undofile; // whole undo file is encrypted
4141

4242
// Optional function pointer for a self-test.
43-
int (* self_test_fn)();
43+
int (* self_test_fn)(void);
4444

4545
// Function pointer for initializing encryption/decryption.
4646
int (* init_fn)(cryptstate_T *state, char_u *key,

src/os_macosx.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ - (void) sound:(NSSound *)sound didFinishPlaying:(BOOL)flag
430430
@end
431431

432432
void
433-
process_cfrunloop()
433+
process_cfrunloop(void)
434434
{
435435
if (sounds_list != nil && [sounds_list count] > 0)
436436
{
@@ -493,7 +493,7 @@ - (void) sound:(NSSound *)sound didFinishPlaying:(BOOL)flag
493493
}
494494

495495
void
496-
sound_mch_clear()
496+
sound_mch_clear(void)
497497
{
498498
if (sounds_list != nil)
499499
{
@@ -510,7 +510,7 @@ - (void) sound:(NSSound *)sound didFinishPlaying:(BOOL)flag
510510
}
511511

512512
void
513-
sound_mch_free()
513+
sound_mch_free(void)
514514
{
515515
sound_mch_clear();
516516
}

src/os_unix.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void deathtrap SIGPROTOARG;
198198

199199
static void catch_int_signal(void);
200200
static void set_signals(void);
201-
static void catch_signals(void (*func_deadly)(), void (*func_other)());
201+
static void catch_signals(void (*func_deadly)(int), void (*func_other)(int));
202202
#ifdef HAVE_SIGPROCMASK
203203
# define SIGSET_DECL(set) sigset_t set;
204204
# define BLOCK_SIGNALS(set) block_signals(set)
@@ -668,9 +668,9 @@ mch_delay(long msec, int flags)
668668
// a patch from Sun to fix this. Reported by Gunnar Pedersen.
669669
select(0, NULL, NULL, NULL, &tv);
670670
}
671-
# endif // HAVE_SELECT
672-
# endif // HAVE_NANOSLEEP
673-
#endif // HAVE_USLEEP
671+
# endif
672+
# endif
673+
#endif
674674
#ifdef FEAT_MZSCHEME
675675
}
676676
while (total > 0);
@@ -812,7 +812,7 @@ static struct sigstack sigstk; // for sigstack()
812812
* Get a size of signal stack.
813813
* Preference (if available): sysconf > SIGSTKSZ > guessed size
814814
*/
815-
static long int get_signal_stack_size()
815+
static long int get_signal_stack_size(void)
816816
{
817817
# ifdef HAVE_SYSCONF_SIGSTKSZ
818818
long int size = -1;
@@ -869,7 +869,7 @@ init_signal_stack(void)
869869
sig_winch SIGDEFARG(sigarg)
870870
{
871871
// this is not required on all systems, but it doesn't hurt anybody
872-
signal(SIGWINCH, (void (*)())sig_winch);
872+
signal(SIGWINCH, (void (*)(int))sig_winch);
873873
do_resize = TRUE;
874874
}
875875
#endif
@@ -890,7 +890,7 @@ sig_tstp SIGDEFARG(sigarg)
890890
#if !defined(__ANDROID__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
891891
// This is not required on all systems. On some systems (at least Android,
892892
// OpenBSD, and DragonFlyBSD) this breaks suspending with CTRL-Z.
893-
signal(SIGTSTP, (void (*)())sig_tstp);
893+
signal(SIGTSTP, (void (*)(int))sig_tstp);
894894
#endif
895895
}
896896
#endif
@@ -900,7 +900,7 @@ sig_tstp SIGDEFARG(sigarg)
900900
catch_sigint SIGDEFARG(sigarg)
901901
{
902902
// this is not required on all systems, but it doesn't hurt anybody
903-
signal(SIGINT, (void (*)())catch_sigint);
903+
signal(SIGINT, (void (*)(int))catch_sigint);
904904
got_int = TRUE;
905905
}
906906
#endif
@@ -910,7 +910,7 @@ catch_sigint SIGDEFARG(sigarg)
910910
catch_sigusr1 SIGDEFARG(sigarg)
911911
{
912912
// this is not required on all systems, but it doesn't hurt anybody
913-
signal(SIGUSR1, (void (*)())catch_sigusr1);
913+
signal(SIGUSR1, (void (*)(int))catch_sigusr1);
914914
got_sigusr1 = TRUE;
915915
}
916916
#endif
@@ -1383,7 +1383,7 @@ set_signals(void)
13831383
/*
13841384
* WINDOW CHANGE signal is handled with sig_winch().
13851385
*/
1386-
signal(SIGWINCH, (void (*)())sig_winch);
1386+
signal(SIGWINCH, (void (*)(int))sig_winch);
13871387
#endif
13881388

13891389
#ifdef SIGTSTP
@@ -1395,7 +1395,7 @@ set_signals(void)
13951395
# ifdef FEAT_GUI
13961396
: gui.in_use || gui.starting ? SIG_DFL
13971397
# endif
1398-
: (void (*)())sig_tstp);
1398+
: (void (*)(int))sig_tstp);
13991399
#endif
14001400
#if defined(SIGCONT)
14011401
signal(SIGCONT, sigcont_handler);
@@ -1415,7 +1415,7 @@ set_signals(void)
14151415
/*
14161416
* Call user's handler on SIGUSR1
14171417
*/
1418-
signal(SIGUSR1, (void (*)())catch_sigusr1);
1418+
signal(SIGUSR1, (void (*)(int))catch_sigusr1);
14191419
#endif
14201420

14211421
/*
@@ -1454,7 +1454,7 @@ set_signals(void)
14541454
static void
14551455
catch_int_signal(void)
14561456
{
1457-
signal(SIGINT, (void (*)())catch_sigint);
1457+
signal(SIGINT, (void (*)(int))catch_sigint);
14581458
}
14591459
#endif
14601460

@@ -1470,8 +1470,8 @@ reset_signals(void)
14701470

14711471
static void
14721472
catch_signals(
1473-
void (*func_deadly)(),
1474-
void (*func_other)())
1473+
void (*func_deadly)(int),
1474+
void (*func_other)(int))
14751475
{
14761476
int i;
14771477

src/proto/os_macosx.pro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* os_macosx.m */
2-
void process_cfrunloop();
2+
void process_cfrunloop(void);
33
bool sound_mch_play(const char_u* event, long sound_id, soundcb_T *callback, bool playfile);
44
void sound_mch_stop(long sound_id);
5-
void sound_mch_clear();
6-
void sound_mch_free();
5+
void sound_mch_clear(void);
6+
void sound_mch_free(void);
77
/* vim: set ft=c : */

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
1471,
698700
/**/
699701
1470,
700702
/**/

0 commit comments

Comments
 (0)