mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-08-24 19:36:05 +08:00
Coding - Apply more flags from Clang-tidy (#977)
- Refactor boolean expressions and improve code readability across multiple files - Simplified boolean expressions by removing unnecessary comparisons to true/false. - Replaced explicit boolean checks with direct variable usage Used flags: readability-static-accessed-through-instance readability-simplify-boolean-expr performance-for-range-copy performance-move-const-arg misc-unused-parameters misc-redundant-expression
This commit is contained in:
@@ -27,7 +27,6 @@ Aspect_GenId::Aspect_GenId()
|
||||
myLowerBound(0),
|
||||
myUpperBound(INT_MAX / 2)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -28,7 +28,6 @@ Aspect_Grid::Aspect_Grid(const double theXOrigin,
|
||||
myIsActive(false),
|
||||
myDrawMode(Aspect_GDM_Lines)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
void Aspect_Grid::SetXOrigin(const double theOrigin)
|
||||
|
||||
@@ -26,7 +26,6 @@ Aspect_SkydomeBackground::Aspect_SkydomeBackground()
|
||||
myFogginess(0.0f),
|
||||
mySize(512)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -55,10 +54,7 @@ Aspect_SkydomeBackground::Aspect_SkydomeBackground(const gp_Dir& theSunDirection
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Aspect_SkydomeBackground::~Aspect_SkydomeBackground()
|
||||
{
|
||||
//
|
||||
}
|
||||
Aspect_SkydomeBackground::~Aspect_SkydomeBackground() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ Aspect_VKeySet::Aspect_VKeySet()
|
||||
: myKeys(0, Aspect_VKey_MAX),
|
||||
myModifiers(Aspect_VKeyFlags_NONE)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -33,10 +33,7 @@ Aspect_WindowInputListener::Aspect_WindowInputListener()
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Aspect_WindowInputListener::~Aspect_WindowInputListener()
|
||||
{
|
||||
//
|
||||
}
|
||||
Aspect_WindowInputListener::~Aspect_WindowInputListener() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -29,9 +29,7 @@
|
||||
|
||||
Cocoa_LocalPool::Cocoa_LocalPool()
|
||||
: myPoolObj ([[NSAutoreleasePool alloc] init])
|
||||
{
|
||||
//
|
||||
}
|
||||
{}
|
||||
|
||||
// =======================================================================
|
||||
// function : ~Cocoa_LocalPool
|
||||
|
||||
@@ -75,7 +75,6 @@ Font_TextFormatter::Font_TextFormatter()
|
||||
myBndWidth(0.0f),
|
||||
myMoveVec(0.0f, 0.0f)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -258,14 +258,11 @@ public:
|
||||
//! Returns true if the symbol is CR, BEL, FF, NP, BS or VT
|
||||
static inline bool IsCommandSymbol(const char32_t& theSymbol)
|
||||
{
|
||||
if (theSymbol == '\x0D' // CR (carriage return)
|
||||
|| theSymbol == '\a' // BEL (alarm)
|
||||
|| theSymbol == '\f' // FF (form feed) NP (new page)
|
||||
|| theSymbol == '\b' // BS (backspace)
|
||||
|| theSymbol == '\v') // VT (vertical tab)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return (theSymbol == '\x0D' // CR (carriage return)
|
||||
|| theSymbol == '\a' // BEL (alarm)
|
||||
|| theSymbol == '\f' // FF (form feed) NP (new page)
|
||||
|| theSymbol == '\b' // BS (backspace)
|
||||
|| theSymbol == '\v'); // VT (vertical tab)
|
||||
}
|
||||
|
||||
//! Returns true if the symbol separates words when wrapping is enabled
|
||||
|
||||
@@ -44,7 +44,6 @@ Graphic3d_Aspects::Graphic3d_Aspects()
|
||||
myToMapTexture(false),
|
||||
myIsTextZoomable(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -25,7 +25,6 @@ Graphic3d_BvhCStructureSetTrsfPers::Graphic3d_BvhCStructureSetTrsfPers(
|
||||
myBVH(new BVH_Tree<double, 3>()),
|
||||
myBuilder(theBuilder)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -42,7 +42,4 @@ Graphic3d_CubeMap::Graphic3d_CubeMap(const occ::handle<Image_PixMap>& thePixmap,
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Graphic3d_CubeMap::~Graphic3d_CubeMap()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_CubeMap::~Graphic3d_CubeMap() = default;
|
||||
|
||||
@@ -27,7 +27,6 @@ Graphic3d_CullingTool::Graphic3d_CullingTool()
|
||||
myCamScale(1.0),
|
||||
myPixelSize(1.0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -256,15 +256,11 @@ Graphic3d_FrameStats::Graphic3d_FrameStats()
|
||||
myLastFrameIndex(0),
|
||||
myIsLongLineFormat(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Graphic3d_FrameStats::~Graphic3d_FrameStats()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_FrameStats::~Graphic3d_FrameStats() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ Graphic3d_FrameStatsData::Graphic3d_FrameStatsData(Graphic3d_FrameStatsData&& th
|
||||
myTimers(std::move(theOther.myTimers)),
|
||||
myTimersMin(std::move(theOther.myTimersMin)),
|
||||
myTimersMax(std::move(theOther.myTimersMax)),
|
||||
myFps(std::move(theOther.myFps)),
|
||||
myFpsCpu(std::move(theOther.myFpsCpu)),
|
||||
myFpsImmediate(std::move(theOther.myFpsImmediate)),
|
||||
myFpsCpuImmediate(std::move(theOther.myFpsCpuImmediate))
|
||||
myFps(theOther.myFps),
|
||||
myFpsCpu(theOther.myFpsCpu),
|
||||
myFpsImmediate(theOther.myFpsImmediate),
|
||||
myFpsCpuImmediate(theOther.myFpsCpuImmediate)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -81,10 +81,10 @@ Graphic3d_FrameStatsData& Graphic3d_FrameStatsData::operator=(
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
myFps = std::move(theOther.myFps);
|
||||
myFpsCpu = std::move(theOther.myFpsCpu);
|
||||
myFpsImmediate = std::move(theOther.myFpsImmediate);
|
||||
myFpsCpuImmediate = std::move(theOther.myFpsCpuImmediate);
|
||||
myFps = theOther.myFps;
|
||||
myFpsCpu = theOther.myFpsCpu;
|
||||
myFpsImmediate = theOther.myFpsImmediate;
|
||||
myFpsCpuImmediate = theOther.myFpsCpuImmediate;
|
||||
myCounters = std::move(theOther.myCounters);
|
||||
myTimers = std::move(theOther.myTimers);
|
||||
myTimersMin = std::move(theOther.myTimersMin);
|
||||
|
||||
@@ -94,5 +94,4 @@ Graphic3d_GraphicDriverFactory::Graphic3d_GraphicDriverFactory(
|
||||
const TCollection_AsciiString& theName)
|
||||
: myName(theName)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ Graphic3d_Group::Graphic3d_Group(const occ::handle<Graphic3d_Structure>& theStru
|
||||
: myStructure(theStruct.operator->()),
|
||||
myIsClosed(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -34,10 +34,7 @@ Graphic3d_Layer::Graphic3d_Layer(Graphic3d_ZLayerId theId,
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Graphic3d_Layer::~Graphic3d_Layer()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_Layer::~Graphic3d_Layer() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_SequenceOfHClipPlane, Standard_Transient)
|
||||
Graphic3d_SequenceOfHClipPlane::Graphic3d_SequenceOfHClipPlane()
|
||||
: myToOverrideGlobal(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -24,12 +24,8 @@ Graphic3d_ShaderAttribute::Graphic3d_ShaderAttribute(const TCollection_AsciiStri
|
||||
: myName(theName),
|
||||
myLocation(theLocation)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Graphic3d_ShaderAttribute::~Graphic3d_ShaderAttribute()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_ShaderAttribute::~Graphic3d_ShaderAttribute() = default;
|
||||
|
||||
@@ -220,10 +220,7 @@ Graphic3d_ShaderManager::Graphic3d_ShaderManager(Aspect_GraphicsLibrary theGapi)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Graphic3d_ShaderManager::~Graphic3d_ShaderManager()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_ShaderManager::~Graphic3d_ShaderManager() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -80,10 +80,7 @@ occ::handle<Graphic3d_ShaderObject> Graphic3d_ShaderObject::CreateFromSource(
|
||||
// function : ~Graphic3d_ShaderObject
|
||||
// purpose : Releases resources of shader object
|
||||
// =======================================================================
|
||||
Graphic3d_ShaderObject::~Graphic3d_ShaderObject()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_ShaderObject::~Graphic3d_ShaderObject() = default;
|
||||
|
||||
// =======================================================================
|
||||
// function : IsDone
|
||||
|
||||
Executable → Regular
+1
-4
@@ -95,10 +95,7 @@ Graphic3d_ShaderProgram::Graphic3d_ShaderProgram()
|
||||
// function : ~Graphic3d_ShaderProgram
|
||||
// purpose : Releases resources of program object
|
||||
// =======================================================================
|
||||
Graphic3d_ShaderProgram::~Graphic3d_ShaderProgram()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_ShaderProgram::~Graphic3d_ShaderProgram() = default;
|
||||
|
||||
// =======================================================================
|
||||
// function : IsDone
|
||||
|
||||
@@ -31,10 +31,7 @@ template struct Graphic3d_UniformValue<NCollection_Vec4<int>>;
|
||||
// function : ~Graphic3d_ValueInterface
|
||||
// purpose : Releases memory resources of variable value
|
||||
// =======================================================================
|
||||
Graphic3d_ValueInterface::~Graphic3d_ValueInterface()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_ValueInterface::~Graphic3d_ValueInterface() = default;
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_ShaderVariable
|
||||
@@ -44,7 +41,6 @@ Graphic3d_ShaderVariable::Graphic3d_ShaderVariable(const TCollection_AsciiString
|
||||
: myName(theName),
|
||||
myValue(nullptr)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
||||
@@ -33,7 +33,6 @@ Graphic3d_StructureManager::Graphic3d_StructureManager(
|
||||
myGraphicDriver(theDriver),
|
||||
myDeviceLostFlag(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -25,7 +25,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Texture1Dmanual, Graphic3d_Texture1D)
|
||||
Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const TCollection_AsciiString& theFileName)
|
||||
: Graphic3d_Texture1D(theFileName, Graphic3d_TypeOfTexture_1D)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -33,7 +32,6 @@ Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const TCollection_AsciiStri
|
||||
Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const Graphic3d_NameOfTexture1D theNOT)
|
||||
: Graphic3d_Texture1D(theNOT, Graphic3d_TypeOfTexture_1D)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -41,5 +39,4 @@ Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const Graphic3d_NameOfTextu
|
||||
Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const occ::handle<Image_PixMap>& thePixMap)
|
||||
: Graphic3d_Texture1D(thePixMap, Graphic3d_TypeOfTexture_1D)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -63,7 +63,6 @@ Graphic3d_Texture2D::Graphic3d_Texture2D(const TCollection_AsciiString& theFileN
|
||||
: Graphic3d_TextureMap(theFileName, theType),
|
||||
myName(Graphic3d_NOT_2D_UNKNOWN)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -111,7 +110,6 @@ Graphic3d_Texture2D::Graphic3d_Texture2D(const occ::handle<Image_PixMap>& thePix
|
||||
: Graphic3d_TextureMap(thePixMap, theType),
|
||||
myName(Graphic3d_NOT_2D_UNKNOWN)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -48,10 +48,7 @@ Graphic3d_Texture3D::Graphic3d_Texture3D(
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Graphic3d_Texture3D::~Graphic3d_Texture3D()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_Texture3D::~Graphic3d_Texture3D() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -33,15 +33,11 @@ Graphic3d_TextureParams::Graphic3d_TextureParams()
|
||||
myToModulate(false),
|
||||
myToRepeat(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Graphic3d_TextureParams::~Graphic3d_TextureParams()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_TextureParams::~Graphic3d_TextureParams() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -114,10 +114,7 @@ Graphic3d_TextureRoot::Graphic3d_TextureRoot(const occ::handle<Image_PixMap>& th
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Graphic3d_TextureRoot::~Graphic3d_TextureRoot()
|
||||
{
|
||||
//
|
||||
}
|
||||
Graphic3d_TextureRoot::~Graphic3d_TextureRoot() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ Image_Diff::Image_Diff()
|
||||
: myColorTolerance(0.0),
|
||||
myIsBorderFilterOn(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -122,7 +122,6 @@ const char* Image_PixMap::ImageFormatToString(Image_CompressedFormat theFormat)
|
||||
Image_PixMap::Image_PixMap()
|
||||
: myImgFormat(Image_Format_Gray)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -39,7 +39,6 @@ Media_BufferPool::Media_BufferPool()
|
||||
: myPool(nullptr),
|
||||
myBufferSize(0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -271,11 +271,7 @@ bool Media_CodecContext::SendPacket(const occ::handle<Media_Packet>& thePacket)
|
||||
#ifdef HAVE_FFMPEG
|
||||
#if FFMPEG_HAVE_NEW_DECODE_API
|
||||
const int aRes = avcodec_send_packet(myCodecCtx, thePacket->Packet());
|
||||
if (aRes < 0 && aRes != AVERROR_EOF)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return aRes >= 0 || aRes == AVERROR_EOF;
|
||||
#else
|
||||
// For older FFmpeg versions, fallback to older decode API if needed
|
||||
const int aRes = avcodec_send_packet(myCodecCtx, thePacket->Packet());
|
||||
|
||||
@@ -178,7 +178,6 @@ Media_FormatContext::Media_FormatContext()
|
||||
myPtsStartBase(0.0),
|
||||
myDuration(0.0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -156,7 +156,6 @@ WNT_HIDSpaceMouse::WNT_HIDSpaceMouse(unsigned long theProductId,
|
||||
myProductId(theProductId),
|
||||
myValueRange(THE_RAW_RANGE_350)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -55,10 +55,7 @@ Wasm_Window::Wasm_Window(const TCollection_AsciiString& theCanvasId, const bool
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Wasm_Window::~Wasm_Window()
|
||||
{
|
||||
//
|
||||
}
|
||||
Wasm_Window::~Wasm_Window() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -175,10 +172,7 @@ void Wasm_Window::SetSizeBacking(const NCollection_Vec2<int>& theSize)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void Wasm_Window::InvalidateContent(const occ::handle<Aspect_DisplayConnection>&)
|
||||
{
|
||||
//
|
||||
}
|
||||
void Wasm_Window::InvalidateContent(const occ::handle<Aspect_DisplayConnection>&) {}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user