Skip to content

Refactor core C++ files toward Google C++ style#2

Open
RogerTeng wants to merge 2 commits intomainfrom
codex/refactor-repo-to-google-c++-style
Open

Refactor core C++ files toward Google C++ style#2
RogerTeng wants to merge 2 commits intomainfrom
codex/refactor-repo-to-google-c++-style

Conversation

@RogerTeng
Copy link
Copy Markdown
Owner

Motivation

  • Align project-owned C++ sources with Google C++ style for consistent formatting and naming.
  • Replace legacy PImpl identifiers and inconsistent constant names to improve readability and maintainability.
  • Harden the sample application by adding argument validation and safer buffer handling.

Description

  • Add an include guard and reformat DTLN_AEC.h, rename the private implementation type to Impl and the member to impl_, and update public API signatures accordingly.
  • Rework DTLN_AEC.cpp to use consistent constant names (kWindowSize, kWindowShift, kFftForTensorSize, kNumModels, kNumThreads), apply Google-style spacing and indentation, and bracket third-party includes with // NOLINTBEGIN/// NOLINTEND.
  • Refactor AecSample.cpp to validate argc, check file opens and initialization failures, return non-zero on error, and replace manual new[]/delete[] buffers with std::vector<short>.
  • Apply clang-format with the Google style to the modified files to enforce the changes.

Testing

  • Formatted files in-place with clang-format -style=Google -i DTLN_AEC/DTLN_AEC.h DTLN_AEC/DTLN_AEC.cpp AecSample.cpp and the command completed successfully.
  • Verified formatting with clang-format --dry-run --Werror -style=Google AecSample.cpp DTLN_AEC/DTLN_AEC.cpp DTLN_AEC/DTLN_AEC.h and the check passed.
  • A dry-run without an explicit Google style using clang-format --dry-run --Werror reported formatting differences and failed as expected.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant