- HandlerMinelayerData: BUILD_RTI Guards für RTI-Abhängigkeiten - svcTabCommon: Export-Header-Fix via Fallback-Target - TrainingAreaBase: Stub-Header für BUILD_RTI=OFF - ddsfts: Include-Pfad und Dependency-Fixes - BUILD_RTI=OFF Compilation vollständig unterstützt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Entire-Checkpoint: 01M0JNZA586SACX1PRZ2DJAE5S
53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Entfernt m_logger Member-Initialisierungen in Constructor Initializer Lists.
|
|
Pattern: , m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()...)
|
|
"""
|
|
|
|
import os
|
|
import re
|
|
import sys
|
|
|
|
def remove_logger_init(filepath):
|
|
"""Remove m_logger initialization from constructor initializer lists."""
|
|
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
|
content = f.read()
|
|
|
|
original = content
|
|
|
|
# Pattern 1: m_logger in der Mitte der Initializer-Liste (mit Komma davor)
|
|
pattern1 = r',\s*m_logger\([^)]+\)'
|
|
content = re.sub(pattern1, '', content)
|
|
|
|
# Pattern 2: m_logger als einzige/letzte Initialisierung (mit Komma davor und newline danach)
|
|
pattern2 = r',\s*m_logger\([^)]+\)\s*\n'
|
|
content = re.sub(pattern2, '\n', content)
|
|
|
|
# Pattern 3: m_logger als einzige Initialisierung nach dem Doppelpunkt
|
|
pattern3 = r':\s*m_logger\([^)]+\)\s*\n'
|
|
content = re.sub(pattern3, ':\n', content)
|
|
|
|
if content != original:
|
|
with open(filepath, 'w', encoding='utf-8') as f:
|
|
f.write(content)
|
|
return True
|
|
return False
|
|
|
|
def main():
|
|
if len(sys.argv) < 2:
|
|
print("Usage: remove_logger_inits.py <file1> [file2] ...")
|
|
sys.exit(1)
|
|
|
|
modified = 0
|
|
for filepath in sys.argv[1:]:
|
|
if os.path.isfile(filepath):
|
|
if remove_logger_init(filepath):
|
|
print(f"Fixed: {filepath}")
|
|
modified += 1
|
|
else:
|
|
print(f"Skip (not file): {filepath}")
|
|
|
|
print(f"\nModified {modified} files")
|
|
|
|
if __name__ == '__main__':
|
|
main() |