Ticket #1297 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Create a single definition of unSetInt

Reported by: Peter Peterson Owned by: Janik Zikovsky
Priority: minor Milestone: Iteration 26
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Michael Whitty

Description

A quick search of the source code shows lots of definitions of

  ///a flag int value to indicate that the value wasn't set by users
  static const int unSetInt = INT_MAX-15;

which frequently copy even the comment. This should be set as a global constant somewhere in the Property hierarchy.

Change History

comment:1 Changed 10 years ago by Russell Taylor

We have a global definition already - see EMPTY_INT() in System.h/cpp

It's true that all these local ones could go though. I don't know what the reason for the magic 15 is - probably it's no good reason.

comment:2 Changed 10 years ago by Peter Peterson

This ticket should remain open for the bit of work involved in moving the other references to use the centralized one.

comment:3 Changed 10 years ago by Peter Peterson

(In [4792]) Moved to use central value for an unassigned integer. Refs #1297.

comment:4 Changed 10 years ago by Janik Zikovsky

  • Owner set to Janik Zikovsky
  • Status changed from new to accepted
  • Component set to Mantid

I can finish this one...

comment:5 Changed 10 years ago by Janik Zikovsky

(In [6167]) Refs #1297: Cleanup of unSetInt to Mantid::EMPTY_INT()

comment:6 Changed 10 years ago by Janik Zikovsky

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:7 Changed 10 years ago by Michael Whitty

  • Status changed from verify to verifying
  • Tester set to Michael Whitty

comment:8 Changed 10 years ago by Michael Whitty

  • Status changed from verifying to reopened
  • Resolution fixed deleted
  • Milestone changed from Iteration 25 to Iteration 26

there are still several occurances of the old unSetInt in various forms hanging around to clean up after the release.

Find all "INT_MAX-15", Match case, Subfolders, Find Results 1, "C:\MANTID\Code\Mantid\", "*.cpp;*.h"
  C:\MANTID\Code\Mantid\includes\MantidAlgorithms\CropWorkspace.h(105):  static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidAlgorithms\DetectorEfficiencyCor.h(134):  static const int UNSETINT = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidAlgorithms\DetectorEfficiencyVariation.h(112):      static const int UNSETINT = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidAlgorithms\MedianDetectorTest.h(129):      static const int UNSETINT = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidDataHandling\LoadDAE.h(124):      static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidDataHandling\LoadRaw.h(112):      static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidDataHandling\LoadRaw2.h(118):      static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidDataHandling\LoadRaw3.h(140):      static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidDataHandling\LoadRawBin0.h(108):      static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidDataHandling\LoadRawHelper.h(182):      static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidNexus\LoadISISNexus.h(164):            static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidNexus\LoadNeXus.h(104):      static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidNexus\SaveNeXus.h(88):      static const int unSetInt = INT_MAX-15;
  C:\MANTID\Code\Mantid\includes\MantidNexus\SaveNexusProcessed.h(90):      static const int unSetInt = INT_MAX-15;
  Matching lines: 14    Matching files: 14    Total files searched: 1727

comment:9 Changed 10 years ago by Janik Zikovsky

  • Status changed from reopened to accepted

comment:10 Changed 10 years ago by Janik Zikovsky

  • Status changed from accepted to verify
  • Resolution set to fixed

I think those files in the "Code\Mantid\includes" are copied there by one of the build systems (scons?) and those were old versions Michael was seeing. I don't have any unSetInt.

comment:11 Changed 10 years ago by Michael Whitty

  • Status changed from verify to verifying

comment:12 Changed 10 years ago by Michael Whitty

  • Status changed from verifying to closed

apologies, you are right. don't know how they got there, as I've never used scons on this machine.

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2144

Note: See TracTickets for help on using tickets.