diff --git a/common/dialogs/dialog_file_dir_picker.cpp b/common/dialogs/dialog_file_dir_picker.cpp index 1a8a82e9ea..002decb289 100644 --- a/common/dialogs/dialog_file_dir_picker.cpp +++ b/common/dialogs/dialog_file_dir_picker.cpp @@ -1,5 +1,7 @@ /* * Copyright (C) 2018 CERN + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * * Author: Maciej Suminski * * This program is free software: you can redistribute it and/or modify it @@ -27,6 +29,8 @@ DIALOG_FILE_DIR_PICKER::DIALOG_FILE_DIR_PICKER( wxWindow* parent, const wxString : DIALOG_SHIM( parent, wxID_ANY, title, wxDefaultPosition, wxSize( 500, 600 ), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ) { + m_showHidden = nullptr; + wxString path = defaultPath.IsEmpty() ? wxGetCwd() : defaultPath; m_filesOnly = style & FD_RETURN_FILESONLY; diff --git a/eeschema/cmp_tree_model.cpp b/eeschema/cmp_tree_model.cpp index 2f25334528..7308f12178 100644 --- a/eeschema/cmp_tree_model.cpp +++ b/eeschema/cmp_tree_model.cpp @@ -105,11 +105,12 @@ int CMP_TREE_NODE::Compare( CMP_TREE_NODE const& aNode1, CMP_TREE_NODE const& aN CMP_TREE_NODE::CMP_TREE_NODE() : Parent( nullptr ), - Type( INVALID ), - IntrinsicRank( 0 ), - Score( kLowestDefaultScore ), - Unit( 0 ), - IsRoot( false ) + Type( INVALID ), + IntrinsicRank( 0 ), + Score( kLowestDefaultScore ), + SearchTextNormalized( false ), + Unit( 0 ), + IsRoot( false ) {} diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index 5a4855ac74..4a874b47eb 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -115,7 +115,8 @@ protected: public: FIELDS_EDITOR_GRID_DATA_MODEL( SCH_EDIT_FRAME* aFrame, SCH_REFERENCE_LIST& aComponentList ) : m_frame( aFrame ), - m_componentRefs( aComponentList ) + m_componentRefs( aComponentList ), + m_sortAscending( false ) { m_componentRefs.SplitReferences(); } diff --git a/eeschema/sim/ngspice.cpp b/eeschema/sim/ngspice.cpp index f85d075ae5..8818b50722 100644 --- a/eeschema/sim/ngspice.cpp +++ b/eeschema/sim/ngspice.cpp @@ -2,6 +2,8 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2016-2018 CERN + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * * @author Tomasz Wlostowski * @author Maciej Suminski * @@ -37,7 +39,8 @@ using namespace std; static const wxChar* const traceNgspice = wxT( "KICAD_NGSPICE" ); -NGSPICE::NGSPICE() +NGSPICE::NGSPICE() : + m_error( false ) { init_dll(); } diff --git a/include/drc_item.h b/include/drc_item.h index 813ee433c7..5f2441aad2 100644 --- a/include/drc_item.h +++ b/include/drc_item.h @@ -96,6 +96,7 @@ public: aMainText, aMainText, aMainPos, aMainPos ); m_hasSecondItem = false; + m_parent = nullptr; } /** diff --git a/include/eagle_parser.h b/include/eagle_parser.h index 7ccb3de657..257aa2e6a5 100644 --- a/include/eagle_parser.h +++ b/include/eagle_parser.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 2012-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2012-2018 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2017 CERN * @author Alejandro GarcĂ­a Montoro * @@ -214,6 +214,7 @@ public: */ OPTIONAL_XML_ATTRIBUTE( const wxString& aData ) { + m_data = T(); m_isAvailable = !aData.IsEmpty(); if( m_isAvailable ) diff --git a/include/libeval/numeric_evaluator.h b/include/libeval/numeric_evaluator.h index 000c913790..621977afd6 100644 --- a/include/libeval/numeric_evaluator.h +++ b/include/libeval/numeric_evaluator.h @@ -80,12 +80,13 @@ namespace numEval struct TokenType { - union { - double dValue; - int iValue; - }; - bool valid; - char text[32]; + union { + double dValue; + int iValue; + }; + + bool valid; + char text[32]; }; } // namespace numEval @@ -94,101 +95,101 @@ class NumericEvaluator { enum class Unit { Invalid, Metric, Inch, Mil }; public: - NumericEvaluator(); - ~NumericEvaluator(); + NumericEvaluator(); + ~NumericEvaluator(); - /* Initialization and destruction. init() is invoked be the constructor and should not be needed - * by the user. - * clear() should be invoked by the user if a new input string is to be processed. It will reset - * the parser and clear the original expression value for a requested object (if pObj != null). - */ - void init(); - void clear(const void* pObj = nullptr); + /* Initialization and destruction. init() is invoked be the constructor and should not be needed + * by the user. + * clear() should be invoked by the user if a new input string is to be processed. It will reset + * the parser and clear the original expression value for a requested object (if pObj != null). + */ + void init(); + void clear(const void* pObj = nullptr); - /* Set the decimal separator for the input string. Defaults to '.' */ - void setDecimalSeparator(char sep); + /* Set the decimal separator for the input string. Defaults to '.' */ + void setDecimalSeparator(char sep); - /* Enable or disable support for input string storage. - * If enabled the input string is saved if process(const char*, const void*) is used. - */ - void enableTextInputStorage(bool w) { bClTextInputStorage = w; } + /* Enable or disable support for input string storage. + * If enabled the input string is saved if process(const char*, const void*) is used. + */ + void enableTextInputStorage(bool w) { bClTextInputStorage = w; } - /* Used by the lemon parser */ - void parseError(const char* s); - void parseOk(); - void parseSetResult(double); + /* Used by the lemon parser */ + void parseError(const char* s); + void parseOk(); + void parseSetResult(double); - /* Check if previous invokation of process() was successful */ - inline bool isValid() const { return !bClError; } + /* Check if previous invokation of process() was successful */ + inline bool isValid() const { return !bClError; } - /* Result of string processing. Undefined if !isValid() */ - inline const char* result() const { return clToken.token; } + /* Result of string processing. Undefined if !isValid() */ + inline const char* result() const { return clToken.token; } - /* Evaluate input string. - * Result can be retrieved by result(). - * Returns true if input string could be evaluated, otherwise false. - */ - bool process(const char* s); + /* Evaluate input string. + * Result can be retrieved by result(). + * Returns true if input string could be evaluated, otherwise false. + */ + bool process(const char* s); - /* Like process(const char*) but also stores input string in a std:map with key pObj. */ - bool process(const char* s, const void* pObj); + /* Like process(const char*) but also stores input string in a std:map with key pObj. */ + bool process(const char* s, const void* pObj); - /* Retrieve old input string with key pObj. */ - const char* textInput(const void* pObj) const; + /* Retrieve old input string with key pObj. */ + const char* textInput(const void* pObj) const; - /* Add/set variable with value */ - void setVar(const std::string&, double value); + /* Add/set variable with value */ + void setVar(const std::string&, double value); - /* Get value of variable. Returns 0.0 if not defined. */ - double getVar(const std::string&); + /* Get value of variable. Returns 0.0 if not defined. */ + double getVar(const std::string&); - /* Remove single variable */ - void removeVar(const std::string& s) { clVarMap.erase(s); } + /* Remove single variable */ + void removeVar(const std::string& s) { clVarMap.erase(s); } - /* Remove all variables */ - void clearVar() { clVarMap.clear(); } + /* Remove all variables */ + void clearVar() { clVarMap.clear(); } protected: /* Token type used by the tokenizer */ - struct Token { - int token; - numEval::TokenType value; - }; + struct Token { + int token; + numEval::TokenType value; + }; - /* Begin processing of a new input string */ - void newString(const char* s); + /* Begin processing of a new input string */ + void newString(const char* s); - /* Tokenizer: Next token/value taken from input string. */ - Token getToken(); + /* Tokenizer: Next token/value taken from input string. */ + Token getToken(); - /* Used by processing loop */ - void parse(int token, numEval::TokenType value); + /* Used by processing loop */ + void parse(int token, numEval::TokenType value); private: - void* pClParser; // the current lemon parser state machine + void* pClParser; // the current lemon parser state machine - /* Token state for input string. */ - struct TokenStat { - enum { OutLen=32 }; - TokenStat() : input(0), token(0), inputLen(0) { /* empty */ } - const char* input; // current input string ("var=4") - char* token; // output token ("var", type:VAR; "4", type:VALUE) - size_t inputLen; // strlen(input) - size_t pos; // current index - } clToken; + /* Token state for input string. */ + struct TokenStat { + enum { OutLen=32 }; + TokenStat() : input(0), token(0), inputLen(0), pos(0) { /* empty */ } + const char* input; // current input string ("var=4") + char* token; // output token ("var", type:VAR; "4", type:VALUE) + size_t inputLen; // strlen(input) + size_t pos; // current index + } clToken; - char cClDecSep; // decimal separator ('.') + char cClDecSep; // decimal separator ('.') - /* Parse progress. Set by parser actions. */ - bool bClError; - bool bClParseFinished; + /* Parse progress. Set by parser actions. */ + bool bClError; + bool bClParseFinished; - bool bClTextInputStorage; // Enable input string storage used by process(const char*, const void*) + bool bClTextInputStorage; // Enable input string storage used by process(const char*, const void*) - Unit eClUnitDefault; // Default unit for values + Unit eClUnitDefault; // Default unit for values - std::map clObjMap; // Map pointer to text entry -> (original) input string - std::map clVarMap; + std::map clObjMap; // Map pointer to text entry -> (original) input string + std::map clVarMap; };