summaryrefslogtreecommitdiff
path: root/ACE/bin/PythonACE/fuzz/cpp_inline.py
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/bin/PythonACE/fuzz/cpp_inline.py')
-rw-r--r--ACE/bin/PythonACE/fuzz/cpp_inline.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/ACE/bin/PythonACE/fuzz/cpp_inline.py b/ACE/bin/PythonACE/fuzz/cpp_inline.py
new file mode 100644
index 00000000000..1db614c103b
--- /dev/null
+++ b/ACE/bin/PythonACE/fuzz/cpp_inline.py
@@ -0,0 +1,23 @@
+""" Checks for ACE_INLINE or and ASYS_INLINE in a .cpp file """
+from _types import source_files
+type_list = source_files
+
+
+import re
+from sys import stderr
+regex = re.compile ("(^\s*ACE_INLINE)|(^\s*ASYS_INLINE)", re.MULTILINE)
+
+error_message = ": error: ACE_INLINE or ASYS_INLINE found in .cpp file\n"
+
+def handler (file_name, file_content):
+ if regex.search (file_content) != None:
+ # Lets take some time to generate a detailed error report
+ # since we appear to have a violation
+ lines = file_content.splitlines ()
+ for line in range (len (lines)):
+ if regex.search (lines[line]) != None:
+ stderr.write (file_name + ':' + str (line + 1) + error_message)
+
+ return 1
+ else:
+ return 0