mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 11:02:48 -05:00
Fixes (mostly from Colin Watson, a couple redone by me) to make Unix
PuTTY compile cleanly under gcc 4.6.0 without triggering any of its new warnings. [originally from svn r9169]
This commit is contained in:
@ -3540,15 +3540,29 @@ int pt_main(int argc, char **argv)
|
||||
|
||||
inst->menu = gtk_menu_new();
|
||||
|
||||
#define MKMENUITEM(title, func) do { \
|
||||
menuitem = title ? gtk_menu_item_new_with_label(title) : \
|
||||
gtk_menu_item_new(); \
|
||||
gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
|
||||
gtk_widget_show(menuitem); \
|
||||
if (func != NULL) \
|
||||
gtk_signal_connect(GTK_OBJECT(menuitem), "activate", \
|
||||
GTK_SIGNAL_FUNC(func), inst); \
|
||||
} while (0)
|
||||
#define MKMENUITEM(title, func) do \
|
||||
{ \
|
||||
menuitem = gtk_menu_item_new_with_label(title); \
|
||||
gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
|
||||
gtk_widget_show(menuitem); \
|
||||
gtk_signal_connect(GTK_OBJECT(menuitem), "activate", \
|
||||
GTK_SIGNAL_FUNC(func), inst); \
|
||||
} while (0)
|
||||
|
||||
#define MKSUBMENU(title) do \
|
||||
{ \
|
||||
menuitem = gtk_menu_item_new_with_label(title); \
|
||||
gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
|
||||
gtk_widget_show(menuitem); \
|
||||
} while (0)
|
||||
|
||||
#define MKSEP() do \
|
||||
{ \
|
||||
menuitem = gtk_menu_item_new(); \
|
||||
gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
|
||||
gtk_widget_show(menuitem); \
|
||||
} while (0)
|
||||
|
||||
if (new_session)
|
||||
MKMENUITEM("New Session...", new_session_menuitem);
|
||||
MKMENUITEM("Restart Session", restart_session_menuitem);
|
||||
@ -3563,27 +3577,29 @@ int pt_main(int argc, char **argv)
|
||||
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem),
|
||||
inst->sessionsmenu);
|
||||
}
|
||||
MKMENUITEM(NULL, NULL);
|
||||
MKSEP();
|
||||
MKMENUITEM("Change Settings...", change_settings_menuitem);
|
||||
MKMENUITEM(NULL, NULL);
|
||||
MKSEP();
|
||||
if (use_event_log)
|
||||
MKMENUITEM("Event Log", event_log_menuitem);
|
||||
MKMENUITEM("Special Commands", NULL);
|
||||
MKSUBMENU("Special Commands");
|
||||
inst->specialsmenu = gtk_menu_new();
|
||||
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), inst->specialsmenu);
|
||||
inst->specialsitem1 = menuitem;
|
||||
MKMENUITEM(NULL, NULL);
|
||||
MKSEP();
|
||||
inst->specialsitem2 = menuitem;
|
||||
gtk_widget_hide(inst->specialsitem1);
|
||||
gtk_widget_hide(inst->specialsitem2);
|
||||
MKMENUITEM("Clear Scrollback", clear_scrollback_menuitem);
|
||||
MKMENUITEM("Reset Terminal", reset_terminal_menuitem);
|
||||
MKMENUITEM("Copy All", copy_all_menuitem);
|
||||
MKMENUITEM(NULL, NULL);
|
||||
MKSEP();
|
||||
s = dupcat("About ", appname, NULL);
|
||||
MKMENUITEM(s, about_menuitem);
|
||||
sfree(s);
|
||||
#undef MKMENUITEM
|
||||
#undef MKSUBMENU
|
||||
#undef MKSEP
|
||||
}
|
||||
|
||||
inst->textcursor = make_mouse_ptr(inst, GDK_XTERM);
|
||||
|
@ -588,7 +588,6 @@ int main(int argc, char **argv)
|
||||
int errors;
|
||||
int use_subsystem = 0;
|
||||
int got_host = FALSE;
|
||||
void *ldisc;
|
||||
long now;
|
||||
|
||||
fdlist = NULL;
|
||||
@ -901,7 +900,7 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
back->provide_logctx(backhandle, logctx);
|
||||
ldisc = ldisc_create(&cfg, NULL, back, backhandle, NULL);
|
||||
ldisc_create(&cfg, NULL, back, backhandle, NULL);
|
||||
sfree(realhost);
|
||||
}
|
||||
connopen = 1;
|
||||
|
@ -352,13 +352,11 @@ static void serial_free(void *handle)
|
||||
static void serial_reconfig(void *handle, Config *cfg)
|
||||
{
|
||||
Serial serial = (Serial) handle;
|
||||
const char *err;
|
||||
|
||||
err = serial_configure(serial, cfg);
|
||||
|
||||
/*
|
||||
* FIXME: what should we do if err returns something?
|
||||
* FIXME: what should we do if this returns an error?
|
||||
*/
|
||||
serial_configure(serial, cfg);
|
||||
}
|
||||
|
||||
static int serial_select_result(int fd, int event)
|
||||
|
Reference in New Issue
Block a user