Widget #include cleanup

Roland Illig roland.illig at gmx.de
Mon Jul 11 07:10:32 UTC 2005


Leonard den Ottolander wrote:
> Hi,
> 
> As wtools.h requires Dlg_head and WListbox defined in widget.h it's much
> easier to #include "widget.h" than to redefine them. This makes it
> possible to get rid of a load of unnecessary #include's of widget.h and
> dialog.h.
> 
> Patch is against HEAD. Any reason not to commit it?

Yes.

> --- mc/src/background.c	2005-05-29 13:47:21.000000000 +0200
> +++ mc.include_widget/src/background.c	2005-07-09 13:52:09.000000000 +0200
> @@ -38,7 +38,6 @@
>  #include "global.h"
>  #include "background.h"
>  #include "tty.h"	/* doupdate() */
> -#include "dialog.h"	/* do_refresh() */
>  #include "wtools.h"
>  #include "fileopctx.h"	/* FileOpContext */
>  #include "key.h"	/* add_select_channel(), delete_select_channel() */

background.c should include every header it uses directly. It uses 
do_refresh() from dialog.h directly. Therefore it should be in the 
#include list.

I haven't checked the other files, but they are likely to contain 
similar code.

Roland



More information about the mc-devel mailing list