Author Topic: Comment correct in common_functions.script?  (Read 2605 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5720
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Comment correct in common_functions.script?
« on: April 07, 2013, 05:03:08 am »
In trunk\src\plugins\scriptedwizard\resources\common_functions.script

Code
function VerifyMacro(macro)
{
    // try to make it a real path and verify it's existence
    local dir = ReplaceMacros(macro, true);

    // verify if there are macros used at all...
    if (macro.Matches(dir))
    {
        return (_T("")); // no macros used -> return empty
    }

    return dir;
}
I think "try to make it a real path and verify it's existence" is not correct, this function just try to expand macro, than compare whether the original string and the expanded string are the same. This means it try to see whether a string have macro usages in it.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.