Commit Graph

759 Commits

Author SHA1 Message Date
Benjamin Nauck
be7cc40106 [Base] Remove unused std::make_unique back port
std::make_unique was introduced in c++14, so no need to have it back
ported anymore.
2021-03-06 21:20:32 +01:00
Benjamin Nauck
8a2cfc268e [Base] Remove includes to StdStlTools.h as that's not needed anymore
std::make_unique was introduced in c++14, so no need to use the back
ported version
2021-03-06 21:20:32 +01:00
David Carter
6c57cebc9b Base: fixes #0004586: Conversion error for PoundForce (lbf) 2021-03-03 12:39:49 +01:00
wmayer
dd4dd204d0 App/Gui: fix memory leaks:
+ add function to cleanup units and quantities in debug build
+ fix reference leak in PropertyVector::getPyPathValue()
+ fix reference leak in PropertyPlacement::getPyPathValue()
+ in InterpreterSingleton::init() use a static std::vector<wchar_t*> instead of a C array
  to free memory at program end
+ in MainWindow::closeEvent() explicitly delete all task watchers
+ in ReportOutputObserver constructor pass parent to QObject
+ in PropertyEditor destructor explicitly delete QItemEditorFactory
2021-02-27 10:56:19 +01:00
wmayer
8a855f67d9 Base: [skip ci] take care of case-sensitivity of header file 2021-02-18 10:17:03 +01:00
Chris Hennes
52e861b181 LGTM: Remove unused Time() function
The ConsoleSingleton::Time() function is flagged by LGTM for using
two different unsafe time-related functions. It is not called anywhere
in the current codebase, and is not exposed in the Python API, so was
removed rather than being repaired.
2021-02-11 12:51:31 +01:00
wmayer
0b58f8b4f5 Base: [skip ci] fix MSVC build failure 2021-02-08 09:58:25 +01:00
Chris Hennes
53972c62e3 Remove catch block for plain C strings
LGTM complains about this construct leaking memory. Commit 227cf6de88
eliminated the parts of FreeCAD that throw those strings. This commit
eliminates the catch block.
2021-02-07 13:41:42 +01:00
wmayer
0d5b38385c [skip ci] Do not throw plain C string as exception 2021-02-06 15:52:21 +01:00
luz paz
d0d2581410 Fix various typos [skip ci]
Found via codespell v2.1.dev0  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/doc/SourceDocu
```
2021-02-03 14:08:57 +01:00
Mateusz Skowroński
98f63ba60f Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
wmayer
64fdf4c799 Py: [skip ci] replace PyList_Append with Py::List::append 2020-12-13 16:44:14 +01:00
donovaly
a2b523fb39 [TD] fix unit mismatch bug
- also make global decimal option italic since it only affects new dimensions
- also fix a typo in UnitsApi.h
2020-12-03 15:50:06 +01:00
luz paz
01b21e0d06 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
wmayer
56c608932f Win: [skip ci] check if NOMINMAX is already defined before setting it 2020-11-11 13:34:42 +01:00
wmayer
27070858f0 Base: [skip ci] fix several -Wunused-parameter warnings 2020-11-06 08:15:44 +01:00
wmayer
42a723d172 Base: [skip ci] fix several -Wunused-parameter warnings 2020-11-06 08:14:00 +01:00
wmayer
e22286f5b4 Base: [skip ci] expose Type::createInstance and Type::createInstanceByName to Python 2020-10-29 17:18:10 +01:00
wmayer
5c35325cc0 Py3: suppress warnings about un-initialized/deprecated tp_print slot 2020-10-18 14:45:31 +02:00
wmayer
409ceb6ec5 macOS: [skip ci] suppress some more Py3.8 warnings, suppress warnings about deprecated OpenGL API 2020-10-17 23:53:47 +02:00
wmayer
1d289252c4 Py3: [skip ci] fix warning: missing field 'tp_print' initializer [-Wmissing-field-initializers]
This warning is only specific to Py3.8. See https://docs.python.org/3/c-api/typeobj.html
2020-10-15 15:25:42 +02:00
luz paz
df93939be3 Fix various typos [skip-ci]
Found via `codespell v2.0.dev0`  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-10-08 18:21:15 +02:00
wmayer
1a15d566d5 Part: [skip ci] include OCC hesder to PCHs, fix compiler warning when trying to delete void pointer 2020-09-28 20:23:33 +02:00
wmayer
27b9192539 Base: [skip ci] allow to replace twin object of PyObjectBase 2020-09-28 11:21:20 +02:00
wmayer
033e4d900b Base: [skip ci] Coverity: Uncaught exception 2020-09-14 18:34:25 +02:00
wmayer
a51d2bab99 Base: Py2 related fix 2020-09-04 19:02:29 +02:00
wmayer
6f7118850b Base: [skip ci] Various fixes in InterpreterSingleton::runStringWithKey:
+ fix memory leak (localDictionary) by replacing C API with PyCXX
+ don't write the whole code as error message if an error occurs. Python raises an exception with all relevant information for debugging
2020-09-04 09:58:21 +02:00
mwganson
69f43d7bf3 [CheckGeometry] fix segfault, reformat output with lower case, use try/except to check for runtime python errors and fall back on OCCT method if script failed. 2020-09-03 12:09:38 +02:00
mwganson
720668a7a5 [check geometry] decrement some pyobject references 2020-09-03 12:09:38 +02:00
mwganson
cf9118d249 [CheckGeometry] fix python2 build 2020-09-03 12:09:38 +02:00
mwganson
179d687f0e [CheckGeometry] fix py2 build failure 2020-09-03 12:09:38 +02:00
mwganson
3c19765c37 [CheckGeometry] update a source code comment 2020-09-03 12:09:38 +02:00
mwganson
ed3ff7db5e [CheckGeometry] add new shapecontent builder instead of OCCT's to correct some errors in OCCT's values and to add for some more advanced information, e.g. volume or area, add new method to Base::Interpreter runStringWithKey() -- allows to run a python script and get a string return value 2020-09-03 12:09:38 +02:00
wandererfan
4c233cd9e9 [Base]use degree symbol in Imperial schemes 2020-08-29 11:13:35 -04:00
Bernd Hahnebach
0c9e6c6158 Base: add new unit schema for mm and N for use in FEM 2020-08-07 19:19:44 +02:00
wmayer
6f2b33381e Base: [skip ci] add class ViewOrthoProjMatrix for orthogonal projections in 3d 2020-08-07 13:06:06 +02:00
wmayer
adf662b13d remove superfluous includes of iostream, use iosfwd instead 2020-07-28 15:22:23 +02:00
wmayer
41ca54de70 LGTM: [skip ci] remove some obsolete FIXME comments from source code 2020-07-28 09:49:20 +02:00
wmayer
826de6beff LGTM: [skip ci]: Ambiguously signed bit-field member
Until C++11 bit fields with integral types should have explicit signedness only.
It is implementation specific whether an -typed bit field is signed, so there could be unexpected sign extension or overflow.

This means that if depending on the compiler int32_t is not explicitly defined as signed the UnitSignature structure may not work
as expected. Since C++14 this has changed and an int of a bit-field is always signed:
https://stackoverflow.com/questions/33723631/signed-bit-field-in-c14
2020-07-27 16:00:47 +02:00
wmayer
9367e73e92 LGTM: [skip ci] fix: Inconsistent definition of copy constructor and assignment ('Rule of Two')
Remove user-defined copy constructor of Exception classes without assignment operator
2020-07-27 13:47:41 +02:00
wmayer
57d23463b1 LGTM: [skip ci] fix: Wrong type of arguments to formatting function 2020-07-24 19:58:48 +02:00
wmayer
5f0b6714b4 Coverity: Suppress false-positives 2020-07-20 17:34:28 +02:00
wmayer
1a34d3da1f Coverity: Uncaught exception 2020-07-20 17:34:26 +02:00
wmayer
5a45efd5f9 Coverity: Uninitialized scalar variable 2020-07-20 17:34:23 +02:00
wmayer
94dbcc83ce PVS: V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. 2020-07-18 10:59:27 +02:00
Cyril Waechter
b926149363 Fix comment in Quantity.cpp 2020-07-11 19:37:47 +02:00
wmayer
d2fd870e44 Base: fix build failure for Py2 2020-06-30 10:27:53 +02:00
wmayer
9eb5a90d94 Base: let PyStreambuf figure out if String or Bytes object must be written to file 2020-06-29 18:04:32 +02:00
wmayer
4b8cf63c14 [skip ci] improve possibility to create a QApplication in a thread 2020-06-21 00:07:21 +02:00
wmayer
9f9ee6d89e Base: [skip ci] include sstream in swigpyrun source files 2020-06-20 11:28:48 +02:00