Cleanup: use C-style comments, double quote Python text

This commit is contained in:
Campbell Barton
2024-09-03 21:22:34 +10:00
parent e242157674
commit e34d9eeac7
16 changed files with 50 additions and 50 deletions

View File

@@ -14,7 +14,7 @@
static char *user_locale = NULL;
// get current locale
/* Get current locale. */
const char *osx_user_locale()
{
::free(user_locale);
@@ -24,8 +24,8 @@ const char *osx_user_locale()
NSLocale *myNSLocale = (NSLocale *)myCFLocale;
[myNSLocale autorelease];
// This produces gettext-invalid locale in recent macOS versions (11.4),
// like `ko-Kore_KR` instead of `ko_KR`. See #88877.
/* This produces gettext-invalid locale in recent macOS versions (11.4),
* like `ko-Kore_KR` instead of `ko_KR`. See #88877. */
// NSString *nsIdentifier = [myNSLocale localeIdentifier];
NSString *nsIdentifier = myNSLocale.languageCode;

View File

@@ -682,7 +682,7 @@ class ANIM_OT_slot_new_for_id(Operator):
@classmethod
def poll(cls, context):
animated_id = getattr(context, 'animated_id', None)
animated_id = getattr(context, "animated_id", None)
if not animated_id:
return False
if not animated_id.animation_data or not animated_id.animation_data.action:
@@ -694,7 +694,7 @@ class ANIM_OT_slot_new_for_id(Operator):
return True
def execute(self, context):
animated_id = getattr(context, 'animated_id', None)
animated_id = getattr(context, "animated_id", None)
action = animated_id.animation_data.action
slot = action.slots.new(for_id=animated_id)
@@ -706,7 +706,7 @@ class ANIM_OT_slot_unassign_from_id(Operator):
"""Un-assign the assigned Action Slot from an ID.
Note that _which_ ID should get this slot unassigned must be set in the
'animated_id' context pointer, using:
"animated_id" context pointer, using:
>>> layout.context_pointer_set("animated_id", animated_id)
"""
@@ -717,7 +717,7 @@ class ANIM_OT_slot_unassign_from_id(Operator):
@classmethod
def poll(cls, context):
animated_id = getattr(context, 'animated_id', None)
animated_id = getattr(context, "animated_id", None)
if not animated_id:
return False
if not animated_id.animation_data or not animated_id.animation_data.action_slot:
@@ -726,7 +726,7 @@ class ANIM_OT_slot_unassign_from_id(Operator):
return True
def execute(self, context):
animated_id = getattr(context, 'animated_id', None)
animated_id = getattr(context, "animated_id", None)
animated_id.animation_data.action_slot = None
return {'FINISHED'}

View File

@@ -326,11 +326,11 @@ class MaterialProperties_MixIn:
header, body = layout.panel("import_image_plane_material", default_closed=False)
header.label(text="Material")
if body:
body.prop(self, 'shader')
body.prop(self, "shader")
if self.shader == 'EMISSION':
body.prop(self, "emit_strength")
body.prop(self, 'render_method')
body.prop(self, "render_method")
if self.render_method == 'BLENDED':
body.prop(self, "show_transparent_back")
@@ -395,8 +395,8 @@ class TextureProperties_MixIn:
header, body = layout.panel("import_image_plane_texture", default_closed=False)
header.label(text="Texture")
if body:
body.prop(self, 'interpolation')
body.prop(self, 'extension')
body.prop(self, "interpolation")
body.prop(self, "extension")
row = body.row(align=False, heading="Alpha")
row.prop(self, "use_transparency", text="")

View File

@@ -516,7 +516,7 @@ class JoinUVs(Operator):
nbr_loops = len(mesh.loops)
# seems to be the fastest way to create an array
uv_array = array.array('f', [0.0] * 2) * nbr_loops
uv_array = array.array("f", [0.0] * 2) * nbr_loops
mesh.uv_layers.active.data.foreach_get("uv", uv_array)
objects = context.selected_editable_objects[:]

View File

@@ -555,7 +555,7 @@ class DATA_PT_camera_animation(CameraButtonsPanel, PropertiesAnimationMixin, Pro
'BLENDER_EEVEE_NEXT',
'BLENDER_WORKBENCH',
}
_animated_id_context_property = 'camera'
_animated_id_context_property = "camera"
class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):

View File

@@ -961,7 +961,7 @@ TEST_F(ArmatureBoneCollections, bcoll_move_to_parent__root_unroot)
EXPECT_EQ(1, arm.collection_array[4]->child_count);
EXPECT_EQ(0, arm.collection_array[5]->child_count);
// TODO: test with circular parenthood.
/* TODO: test with circular parenthood. */
}
TEST_F(ArmatureBoneCollections, bcoll_move_to_parent__within_siblings)

View File

@@ -428,7 +428,7 @@ class MemoryBuffer {
MemoryBufferExtend extend_x = MemoryBufferExtend::Clip,
MemoryBufferExtend extend_y = MemoryBufferExtend::Clip) const
{
// Extend is completely ignored for constants. This may need to be fixed in the future.
/* Extend is completely ignored for constants. This may need to be fixed in the future. */
if (is_a_single_elem_) {
memcpy(result, buffer_, get_elem_bytes_len());
return;
@@ -446,7 +446,7 @@ class MemoryBuffer {
const float w = get_width();
const float h = get_height();
// compute (linear interpolation) intersection with Clip
/* Compute (linear interpolation) intersection with Clip. */
float mult = 1.0f;
if (extend_x == MemoryBufferExtend::Clip) {
mult = std::min(x + 1.0f, w - x);
@@ -460,7 +460,7 @@ class MemoryBuffer {
}
if (sampler == PixelSampler::Bilinear) {
// Sample using Extend or Repeat
/* Sample using Extend or Repeat. */
math::interpolate_bilinear_wrap_fl(buffer_,
result,
w,
@@ -471,12 +471,12 @@ class MemoryBuffer {
extend_x == MemoryBufferExtend::Repeat,
extend_y == MemoryBufferExtend::Repeat);
}
else { // PixelSampler::Bicubic
// Sample using Extend (Repeat is not implemented by interpolate_cubic_bspline)
else { /* #PixelSampler::Bicubic */
/* Sample using Extend (Repeat is not implemented by `interpolate_cubic_bspline`). */
math::interpolate_cubic_bspline_fl(buffer_, result, w, h, num_channels_, x, y);
}
// Multiply by Clip intersection
/* Multiply by Clip intersection. */
if (mult < 1.0f) {
for (int i = 0; i < num_channels_; ++i) {
result[i] *= mult;

View File

@@ -285,17 +285,17 @@ static void set_load_store(VkRenderingAttachmentInfo &r_rendering_attachment,
void VKFrameBuffer::subpass_transition_impl(const GPUAttachmentState depth_attachment_state,
Span<GPUAttachmentState> color_attachment_states)
{
// TODO: this is a fallback implementation. We should also provide support for
// `VK_EXT_dynamic_rendering_local_read`. This extension is only supported on Windows
// platforms (2024Q2), but would reduce the rendering synchronization overhead.
/* TODO: this is a fallback implementation. We should also provide support for
* `VK_EXT_dynamic_rendering_local_read`. This extension is only supported on Windows
* platforms (2024Q2), but would reduce the rendering synchronization overhead. */
VKContext &context = *VKContext::get();
if (is_rendering_) {
rendering_end(context);
// TODO: this might need a better implementation:
// READ -> DONTCARE
// WRITE -> LOAD, STORE based on previous value.
// IGNORE -> DONTCARE -> IGNORE
/* TODO: this might need a better implementation:
* READ -> DONTCARE
* WRITE -> LOAD, STORE based on previous value.
* IGNORE -> DONTCARE -> IGNORE */
load_stores.fill(default_load_store());
}
@@ -618,9 +618,9 @@ void VKFrameBuffer::rendering_ensure(VKContext &context)
depth_image_view = depth_texture.image_view_get(image_view_info).vk_handle();
}
// TODO: we should be able to use a single attachment info and only set the
// pDepthAttachment/pStencilAttachment to the same struct. But perhaps the stencil clear op
// might be different.
/* TODO: we should be able to use a single attachment info and only set the
* #pDepthAttachment/#pStencilAttachment to the same struct.
* But perhaps the stencil clear op might be different. */
{
VkRenderingAttachmentInfo &attachment_info = begin_rendering.node_data.depth_attachment;
attachment_info.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO;

View File

@@ -515,7 +515,7 @@ VkPipeline VKPipelinePool::get_or_create_graphics_pipeline(VKGraphicsInfo &graph
/* Common values */
vk_graphics_pipeline_create_info_.layout = graphics_info.vk_pipeline_layout;
// TODO: based on `vk_pipeline_base` we should update the flags.
/* TODO: based on `vk_pipeline_base` we should update the flags. */
vk_graphics_pipeline_create_info_.basePipelineHandle = vk_pipeline_base;
/* Build pipeline. */

View File

@@ -101,7 +101,7 @@ struct VKGraphicsInfo {
bool operator==(const FragmentShader &other) const
{
// TODO: Do not use hash.
/* TODO: Do not use hash. */
return vk_fragment_module == other.vk_fragment_module && hash() == other.hash();
}

View File

@@ -40,8 +40,8 @@ class VKShader : public Shader {
* the shader. In case for compute shaders without specialization constants this handle is also
* used as an early exit. In this case there is only 1 variation.
*/
// TODO: Should be refactored to stor the vk_pipeline_base_. What is the reason to store the last
// pipeline.
/* TODO: Should be refactored to store the `vk_pipeline_base_`.
* What is the reason to store the last pipeline. */
VkPipeline vk_pipeline_ = VK_NULL_HANDLE;
public:

View File

@@ -594,8 +594,8 @@ VkExtent3D VKTexture::vk_extent_3d(int mip_level) const
const VKImageView &VKTexture::image_view_get(const VKImageViewInfo &info)
{
if (is_texture_view()) {
// TODO: API should be improved as we don't support image view specialization.
// In the current API this is still possible to setup when using attachments.
/* TODO: API should be improved as we don't support image view specialization.
* In the current API this is still possible to setup when using attachments. */
return image_view_get(info.arrayed);
}
for (const VKImageView &image_view : image_views_) {

View File

@@ -24,10 +24,10 @@ class VKImmediate;
using AttributeMask = uint16_t;
// TODO: VKVertexAttributeObject should not contain any reference to VBO's. This should make the
// API be compatible with both VKBatch and VKImmediate.
// TODO: In steam of storing the bindings/attributes we should add a data structure that can store
// them. Building the bindings/attributes should be done inside VKPipelinePool.
/* TODO: VKVertexAttributeObject should not contain any reference to VBO's. This should make the
* API be compatible with both #VKBatch and #VKImmediate. */
/* TODO: In steam of storing the bindings/attributes we should add a data structure that can store
* them. Building the bindings/attributes should be done inside #VKPipelinePool. */
class VKVertexAttributeObject {
public:
bool is_valid = false;

View File

@@ -25,7 +25,7 @@ std::string make_safe_name(const std::string &name, [[maybe_unused]] bool allow_
}
std::string buf;
buf.resize(name.size()); // We won't be exceeding the size of the incoming string
buf.resize(name.size()); /* We won't be exceeding the size of the incoming string. */
bool first = true;
size_t offset = 0;

View File

@@ -26,8 +26,8 @@ pxr::UsdGeomXformable USDTransformWriter::create_xformable() const
{
pxr::UsdGeomXform xform;
// If prim exists, cast to UsdGeomXform (Solves merge transform and shape issue for animated
// exports)
/* If prim exists, cast to #UsdGeomXform
* (Solves merge transform and shape issue for animated exports). */
pxr::UsdPrim existing_prim = usd_export_context_.stage->GetPrimAtPath(
usd_export_context_.usd_path);
if (existing_prim.IsValid() && existing_prim.IsA<pxr::UsdGeomXform>()) {
@@ -73,7 +73,7 @@ void USDTransformWriter::do_write(HierarchyContext &context)
return;
}
float parent_relative_matrix[4][4]; // The object matrix relative to the parent.
float parent_relative_matrix[4][4]; /* The object matrix relative to the parent. */
if (should_apply_root_xform(context)) {
float matrix_world[4][4];

View File

@@ -33,7 +33,7 @@ def create_argparse():
parser.add_argument("-testdir", nargs=1)
parser.add_argument("-outdir", nargs=1)
parser.add_argument("-oiiotool", nargs=1)
parser.add_argument('--batch', default=False, action='store_true')
parser.add_argument("--batch", default=False, action="store_true")
return parser
@@ -49,11 +49,11 @@ def main():
from modules import render_report
report = render_report.Report("Sequencer", output_dir, oiiotool)
report.set_pixelated(True)
# default error tolerances are quite large, lower them
# Default error tolerances are quite large, lower them.
report.set_fail_threshold(1.0 / 255.0)
if os.path.basename(test_dir) == 'effects':
# effects test uses input images with nan/inf values on purpose,
# and they have slightly more variance between platforms
if os.path.basename(test_dir) == "effects":
# Effects test uses input images with nan/inf values on purpose,
# and they have slightly more variance between platforms.
report.set_fail_threshold(2.0 / 255.0)
report.set_fail_percent(0.01)
report.set_reference_dir("reference")