From: Eric Bollengier Date: Thu, 2 Sep 2021 09:41:37 +0000 (+0200) Subject: Fix compilation warning on STATUS_PKT X-Git-Tag: Release-11.3.2~353 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec54ba46a4d513d138af434f6f5b52a486813ea1;p=thirdparty%2Fbacula.git Fix compilation warning on STATUS_PKT --- diff --git a/bacula/src/lib/bcollector.h b/bacula/src/lib/bcollector.h index d7e55875c..047edde2d 100644 --- a/bacula/src/lib/bcollector.h +++ b/bacula/src/lib/bcollector.h @@ -25,10 +25,10 @@ * Author: Radosław Korzeniewski, radekk@inteos.pl, Inteos Sp. z o.o. */ -#ifndef __BCOLLECTOR_H_ -#define __BCOLLECTOR_H_ +#ifndef BCOLLECTOR_H_ +#define BCOLLECTOR_H_ -struct STATUS_PKT; /* Forward declaration */ +class STATUS_PKT; /* Forward declaration */ /* Supported backend types */ enum { @@ -86,4 +86,4 @@ void free_collector_resource(COLLECTOR &res_collector); int render_updcollector_status(POOL_MEM &buf); void api_render_updcollector_status(OutputWriter &ow); -#endif /* __BCOLLECTOR_H_ */ +#endif /* BCOLLECTOR_H_ */ diff --git a/bacula/src/lib/parse_conf.h b/bacula/src/lib/parse_conf.h index a2402aab5..fe976397a 100644 --- a/bacula/src/lib/parse_conf.h +++ b/bacula/src/lib/parse_conf.h @@ -41,7 +41,7 @@ struct RES_ITEM1; /* Declare forward referenced structure */ struct RES_ITEM2; /* Declare forward referenced structure */ class RES; /* Declare forward referenced structure */ struct HPKT; /* Declare forward referenced structure */ -struct STATUS_PKT; /* Declare forward referenced structure */ +class STATUS_PKT; /* Declare forward referenced structure */ typedef void (RES_HANDLER)(HPKT &hpkt); typedef void (MSG_RES_HANDLER)(LEX *lc, RES_ITEM *item, int index, int pass); diff --git a/bacula/src/lib/status-pkt.h b/bacula/src/lib/status-pkt.h index c4c2ae4bc..238862c3d 100644 --- a/bacula/src/lib/status-pkt.h +++ b/bacula/src/lib/status-pkt.h @@ -26,8 +26,8 @@ * */ -#ifndef __STATUS_PKT_H_ -#define __STATUS_PKT_H_ +#ifndef STATUS_PKT_H_ +#define STATUS_PKT_H_ /* * Packet to send to output_status() @@ -37,12 +37,14 @@ public: BSOCK *bs; /* used on Unix machines */ void *context; /* Win32 */ void (*callback)(const char *msg, int len, void *context); /* Win32 */ - char api_opts[MAX_NAME_LENGTH]; int api; /* set if we want API output, with api level */ + char api_opts[MAX_NAME_LENGTH]; /* Methods */ - STATUS_PKT() { memset(this, 0, sizeof(STATUS_PKT)); }; + STATUS_PKT(): bs(NULL), callback(NULL), api(0) { + *api_opts = 0; + }; ~STATUS_PKT() { }; }; -#endif \ No newline at end of file +#endif