Code cleanup: header files should be self-sufficient #98922

Closed
opened 2022-06-16 07:03:23 +02:00 by Alan Eneev · 6 comments

Self-sufficient header files are files that can be compiled stand alone.

Having self-sufficient header files allow easier code management. With self-sufficient headers removing an include from a .c or .h file doesn't break some other .h file elsewhere in the code base.

Self-sufficient header files are files that can be compiled stand alone. Having self-sufficient header files allow easier code management. With self-sufficient headers removing an include from a .c or .h file doesn't break some other .h file elsewhere in the code base.
Author

Added subscriber: @ae

Added subscriber: @ae
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Member

Hi, no need to open a separate ticket to describe the patch.
Also- Have you discussed this change with developers before submitting the patch? If not, you can reach them in #blender-coders

Hi, no need to open a separate ticket to describe the patch. Also- Have you discussed this change with developers before submitting the patch? If not, you can reach them in [#blender-coders ](https://blender.chat/channel/blender-coders)
Author

Thank you, I thought I'd open a ticket to link a series of patches to it.

I started with includes for size_t, in source/ directory, but I suppose there are more issues throughout the code base besides stddef.h and size_t.

I did reach out to #blender-build, but didn't receive a reply yet, and thought I'd do this proactively -- this change wasn't too much work.
And if this patch were to go through, I'd work on making necessary changes to enforce self-contained headers in other parts of the codebase, and adding cmake checks to ensure that new headers are self-contained.

I'll ping #blender-coders, thank you for the poniter.

Thank you, I thought I'd open a ticket to link a series of patches to it. I started with includes for size_t, in source/ directory, but I suppose there are more issues throughout the code base besides stddef.h and size_t. I did reach out to #blender-build, but didn't receive a reply yet, and thought I'd do this proactively -- this change wasn't too much work. And if this patch were to go through, I'd work on making necessary changes to enforce self-contained headers in other parts of the codebase, and adding cmake checks to ensure that new headers are self-contained. I'll ping #blender-coders, thank you for the poniter.
Member

I thought I'd open a ticket to link a series of patches to it.

Hi, you can of course open a ticket to track your own changes.
But I would suggest to discuss this with developers before spending hours on any work :)

I did reach out to #blender-build, but didn't receive a reply yet

Blender-builds is not the appropriate channel. That channel is used for reporting build issues.

> I thought I'd open a ticket to link a series of patches to it. Hi, you can of course open a ticket to track your own changes. But I would suggest to discuss this with developers before spending hours on any work :) > I did reach out to #blender-build, but didn't receive a reply yet Blender-builds is not the appropriate channel. That channel is used for reporting build issues.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#98922
No description provided.