1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-16 10:37:38 -05:00

Move all extern declarations into header files.

This is another cleanup I felt a need for while I was doing
boolification. If you define a function or variable in one .c file and
declare it extern in another, then nothing will check you haven't got
the types of the two declarations mismatched - so when you're
_changing_ the type, it's a pain to make sure you've caught all the
copies of it.

It's better to put all those extern declarations in header files, so
that the declaration in the header is also in scope for the
definition. Then the compiler will complain if they don't match, which
is what I want.
This commit is contained in:
Simon Tatham
2018-11-03 10:06:33 +00:00
parent 91d16881ab
commit c5895ec292
31 changed files with 136 additions and 119 deletions

View File

@ -107,8 +107,6 @@ void session_window_closed(void) {}
void window_setup_error(const char *errmsg) {}
#else /* GTK_CHECK_VERSION(3,0,0) */
extern const bool use_event_log;
static void startup(GApplication *app, gpointer user_data)
{
GMenu *menubar, *menu, *section;
@ -216,7 +214,6 @@ GtkWidget *make_gtk_toplevel_window(GtkFrontend *frontend)
void launch_duplicate_session(Conf *conf)
{
extern const bool dup_check_launchable;
assert(!dup_check_launchable || conf_launchable(conf));
g_application_hold(G_APPLICATION(app));
new_session_window(conf_copy(conf), NULL);
@ -315,15 +312,11 @@ int main(int argc, char **argv)
{
int status;
{
/* Call the function in ux{putty,pterm}.c to do app-type
* specific setup */
extern void setup(bool);
setup(false); /* false means we are not a one-session process */
}
/* Call the function in ux{putty,pterm}.c to do app-type
* specific setup */
setup(false); /* false means we are not a one-session process */
if (argc > 1) {
extern char *pty_osx_envrestore_prefix;
pty_osx_envrestore_prefix = argv[--argc];
}