Browse Source

Merge branch 'master' into UseNewMetaDataTypesInFBXConverter

Kim Kulling 2 years ago
parent
commit
05249353d4

+ 10 - 0
.github/workflows/sanitizer.yml

@@ -57,3 +57,13 @@ jobs:
     - name: test
       run: cd build/bin && ./unit
       shell: bash
+
+  job3:
+    name: printf-sanitizer
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
+    
+    - name: run scan_printf script
+      run: ./scripts/scan_printf.sh
+      shell: bash

+ 1 - 1
code/AssetLib/Ogre/OgreXmlSerializer.cpp

@@ -490,7 +490,7 @@ bool OgreXmlSerializer::ImportSkeleton(Assimp::IOSystem *pIOHandler, MeshXml *me
     OgreXmlSerializer serializer(xmlParser.get());
     XmlNode root = xmlParser->getRootNode();
     if (std::string(root.name()) != nnSkeleton) {
-        printf("\nSkeleton is not a valid root: %s\n", root.name());
+        ASSIMP_LOG_VERBOSE_DEBUG("nSkeleton is not a valid root: ", root.name(), ".");
         for (auto &a : root.children()) {
             if (std::string(a.name()) == nnSkeleton) {
                 root = a;

+ 0 - 1
include/assimp/MemoryIOWrapper.h

@@ -150,7 +150,6 @@ public:
     // -------------------------------------------------------------------
     /// @brief Tests for the existence of a file at the given path.
     bool Exists(const char* pFile) const override {
-        printf("Exists\n");
         if (0 == strncmp( pFile, AI_MEMORYIO_MAGIC_FILENAME, AI_MEMORYIO_MAGIC_FILENAME_LENGTH ) ) {
             return true;
         }

+ 13 - 0
scripts/scan_printf.sh

@@ -0,0 +1,13 @@
+#!/bin/bash
+
+grep \
+  --include=\*.{c,cpp,h} \
+  --exclude={pstdint,m3d}.h \
+  -rnw include code \
+  -e '^\s*printf'
+
+if [ $? -eq 0 ]; then
+  echo "Debug statement(s) detected. Please uncomment (using single-line comment), remove, or manually add to exclude filter, if appropriate" 
+  exit 1
+fi
+