Commit Graph

64 Commits

Author SHA1 Message Date
PhoneDroid
c913317c28 [ Base ]: Updated SPDX 2025-10-14 10:00:04 -05:00
Markus Reitböck
5a423dab39 Base: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:01 +02:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Chris Hennes
26154f3846 Base: Eliminate use of deprecated PyWeakref_GetObject
Co-authored-by: João Matos <joao@tritao.eu>
2025-03-23 22:43:03 +01:00
Chris Hennes
3c43891b61 Base: Initialize tp_versions_used in PyTypeObject (3.13)
This field is undocumented, but exists in the source code for 3.13
(see https://github.com/python/cpython/blob/3.13/Include/cpython/object.h#L232)
and gives a compiler warning if left uninitialized.
2025-03-23 22:42:08 +01:00
mos
9f220319d0 Removed old Python code <3.10 2025-03-07 16:34:08 -06:00
Tobias Frost
460da406f8 spelling fixes (#18688)
* Fixes spelling of "Allow to" to "Allow one to"

and those variants:
Allows to -> Allows one to
allow to -> allow one to
allows to -> allows one to

* Fix "Let's -> Lets"

(and lower case variant.)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Base/PyObjectBase.cpp
Update src/App/ExtensionContainer.h
Update src/App/PropertyContainer.h

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Use gerund in user-facing texts.

* Use gerund for two more user-facing strings.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Tobias Frost <tobi@debian.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-13 11:22:20 -06:00
supermixed
bbb6eeb1ed Core: Import STEP: Cancel button does not cancel (#16499)
* Fix importing .step file when user cancelled import settings dialog
* Refactor object loading python code, fix not using settings when STEP options dialog not shown
* Use custom exception type for user cancelling import instead of `RuntimeError`
* Pull python code out to external file
2024-09-20 08:25:23 -05:00
marioalexis
fd5eb34d6a Base: Add PropertyError exception 2024-08-02 20:19:16 -03:00
wmayer
ca03d18355 Py3.12: initialize field 'tp_watched' 2024-02-12 11:41:49 -06:00
Ladislav Michl
3a25a66a05 Base: Do not use else before return 2024-01-21 16:14:12 +01:00
wmayer
a602003747 fix readability-isolate-declarations 2023-11-16 01:22:08 +01:00
wmayer
c5f5bfd22a fix readability-braces-around-statements 2023-11-16 01:22:08 +01:00
wmayer
985def3416 Base: apply clang format 2023-11-13 12:01:26 -05:00
wmayer
097d5d6fee Base: C++ core guidelines: init variables 2023-08-24 18:48:52 +02:00
wmayer
4210ab01e0 Base: modernize C++: use default member init 2023-08-23 19:51:44 +02:00
marioalexis
be8b5f345c Base: Replace C cast 2022-09-18 11:06:51 -05:00
Uwe
61303b0a01 [Base] remove some more superfluous nullptr checks 2022-07-18 13:07:16 +02:00
Uwe
4b2ffd2eca [Base] remove superfluous nullptr checks 2022-07-18 03:16:22 +02:00
wmayer
e2250d6966 Py3: properly port to Py3.11 2022-07-02 19:36:27 +02:00
wmayer
55828c22c0 Py: make FreeCAD to compile with Py3.11 2022-07-01 17:54:50 +02:00
wmayer
4183c45a01 Base: modernize C++11
* use nullptr
2022-03-23 16:57:25 +01:00
wmayer
585bcb8708 lgtm: [skip ci] FIXME comment
Change FIXME or remove it
2022-03-20 16:51:23 +01:00
wmayer
e4d1ed8366 Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError 2022-03-17 14:45:48 +01:00
wmayer
1f12dca2b4 Py: replace BaseExceptionFreeCADError with more suitable exception types 2022-03-17 13:54:23 +01:00
wmayer
a90a39a4c9 Base: add more custom Python exception types 2022-03-17 11:29:09 +01:00
wmayer
b78dc894e1 Core: Fix several coverity issues:
* CID 350582: Big parameter passed by value
* CID 350639: Big parameter passed by value
* CID 305234: Uncaught exception
* CID 316529: Uncaught exception
* CID 350597: Uncaught exception
* CID 350623: Uncaught exception
* CID 332690: Uncaught exception
* CID 332700: Unchecked return value
* CID 350576: Uninitialized scalar field
* CID 350587: Uninitialized scalar variable
* CID 192606: Uninitialized scalar field
* CID 332699: Uninitialized pointer field
* CID 350561: Dereference null return value
* CID 350610: Dereference null return value
* CID 350567: Dereference after null check
2022-03-13 13:53:32 +01:00
Uwe
6a9310499a [Base] Py and Placement: remove unused includes 2022-03-01 12:13:58 +01:00
wmayer
56c92d1198 Fix generation and build of python classes for 3.8 2021-04-27 14:35:34 +02:00
markus
d6fa0b1d18 Fix generation and build of python classes for 3.9 2021-04-27 00:41:53 +02:00
wmayer
3347c5e632 Base: [skip ci] do not make PyBaseProxy class declaration dependent on ATTR_TRACKING 2021-04-26 15:57:17 +02:00
wmayer
c563198b35 Base: remove some more deprecated Py2 code
and remove deprecated void from function signature and replace 0 or NULL with nullptr
2021-04-26 10:29:48 +02:00
wmayer
0edbea1316 Base: use Python's weak reference mechanism to avoid memory leaks due to cyclic dependencies 2021-04-23 11:02:19 +02:00
wmayer
0566443907 Base: [skip ci] remove Py2 code from PyObjectBase 2021-04-12 14:17:16 +02:00
luz paz
01b21e0d06 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01: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
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
9d62da9c8f Py3.8: [skip ci] missing initializer for member '_typeobject::tp_vectorcall' [-Wmissing-field-initializers] 2020-06-08 14:40:00 +02:00
luz.paz
011e5aedfa src/Base: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Base` files
2019-12-25 11:38:58 +01:00
Zheng, Lei
8f16147a40 Base: improve exception
For better FC and Python exception mapping.
2019-08-17 14:52:08 +02:00
wmayer
31b5614fbd add define to inactivate some code blocks if needed 2019-06-03 18:40:45 +02:00
wmayer
2aee1e8368 fixes 0003771: Memory leak in Part.Face.Surface 2019-01-23 22:38:51 +01:00
wmayer
ba40216791 fixes 0003311: SketchObjectPython - no addGeometry addConstraints setDriving...? 2018-09-27 21:47:03 +02:00
Michal Ulianko
2e2b8cba6a py3.7 fix
PyUnicode_AsUTF8() returns const char* in py3.7 instead of char*. Making
changes to reflect that which should also be safe in
other Python versions.
2018-09-01 22:44:39 +02:00
wmayer
5572f55312 clear dict when invalidating Py object to fix possible cyclic references 2018-08-25 21:49:57 +02:00
Unknown
e3eca59173 Misc. typo fixes
Various workbenches
2017-12-23 14:30:30 +01:00
wmayer
34db2e4c55 Py3: in Py2 use string instead of unicode for identifier 2017-06-03 10:51:05 +02:00
wmayer
bf162ebde9 py3: partially revert of getattr -> getattro because getattro is only needed for the static callback function
issue 0000995
2017-06-03 10:51:05 +02:00