[PATCH 5/5] profile.h: fix incomplete type

Tomaz Canabrava tcanabrava at kde.org
Fri Nov 6 05:23:42 PST 2015


On Fri, Nov 6, 2015 at 11:20 AM, Lubomir I. Ivanov <neolit123 at gmail.com>
wrote:

> From: "Lubomir I. Ivanov" <neolit123 at gmail.com>
>
> ruleritem.cpp throws an error about incomplete type
> 'struct gas_pressures'.
>
> 'struct gas_pressures' is defined in dive.h, so every header
> that has usage of the type needs to include dive.h.
>
> Such a header is profile.h which has 'struct gas_pressures pressures'
> in 'struct plot_data', by including dive.h on top of profile.h
> every source file (e.g. ruleritem.cpp) that includes profile.h will
> now receive knowledge of a complete 'struct gas_pressures' type.
>
> Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
> ---
> dive.h is a pretty big header and it has a lot of stuff which has
> to go. files like ruleritem.cpp need not know about things like:
>
> extern int subsurface_zip_close(struct zip *zip);
> extern void subsurface_console_init(bool dedicated);
> extern void subsurface_console_exit(void);
>

Completely agree - we really need to reestructure our sources.


> ---
>  subsurface-core/profile.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/subsurface-core/profile.h b/subsurface-core/profile.h
> index a6dbfcf..71929f8 100644
> --- a/subsurface-core/profile.h
> +++ b/subsurface-core/profile.h
> @@ -5,6 +5,8 @@
>  extern "C" {
>  #endif
>
> +#include "dive.h"
> +
>  typedef enum {
>         STABLE,
>         SLOW,
> --
> 1.7.11.msysgit.0
>
> _______________________________________________
> subsurface mailing list
> subsurface at subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151106/853db198/attachment.html>


More information about the subsurface mailing list