Fix a bug found by Coverity.

This commit is contained in:
jean-pierre charras 2023-07-08 09:51:23 +02:00
parent d26aa7dc20
commit 70ffd971e3
1 changed files with 11 additions and 5 deletions

View File

@ -58,8 +58,11 @@
#define CUSTOMPANEL_COUNTMAX 8 // Max number of netlist plugins #define CUSTOMPANEL_COUNTMAX 8 // Max number of netlist plugins
/* panel (notebook page) identifiers */ /* panel (notebook page) identifiers
enum panel_netlist_index * if modified, fix also the DEFINED_NETLISTS_COUNT value
* PANEL_NETLIST_INDEX values are used as index in m_PanelNetType[]
*/
enum PANEL_NETLIST_INDEX
{ {
PANELPCBNEW = 0, /* Handle Netlist format Pcbnew */ PANELPCBNEW = 0, /* Handle Netlist format Pcbnew */
PANELORCADPCB2, /* Handle Netlist format OracdPcb2 */ PANELORCADPCB2, /* Handle Netlist format OracdPcb2 */
@ -71,6 +74,9 @@ enum panel_netlist_index
* others use PANELCUSTOMBASE+1, PANELCUSTOMBASE+2.. */ * others use PANELCUSTOMBASE+1, PANELCUSTOMBASE+2.. */
}; };
// The count of panels for internally defined netlist formats
// (the max count of panel is DEFINED_NETLISTS_COUNT+CUSTOMPANEL_COUNTMAX)
#define DEFINED_NETLISTS_COUNT 6
/* wxPanels for creating the NoteBook pages for each netlist format: */ /* wxPanels for creating the NoteBook pages for each netlist format: */
class EXPORT_NETLIST_PAGE : public wxPanel class EXPORT_NETLIST_PAGE : public wxPanel
@ -168,7 +174,7 @@ private:
public: public:
SCH_EDIT_FRAME* m_Parent; SCH_EDIT_FRAME* m_Parent;
EXPORT_NETLIST_PAGE* m_PanelNetType[5 + CUSTOMPANEL_COUNTMAX]; EXPORT_NETLIST_PAGE* m_PanelNetType[DEFINED_NETLISTS_COUNT + CUSTOMPANEL_COUNTMAX];
}; };