Skip to content

Commit

Permalink
Refs #11814 Change gcc pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPiccardoSelg committed May 29, 2015
1 parent 7e2d871 commit cf3b62b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 34 deletions.
Expand Up @@ -22,6 +22,7 @@
#include "MantidVatesAPI/FilteringUpdateProgressAction.h"
#include "MantidVatesAPI/IgnoreZerosThresholdRange.h"

#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#include <boost/optional.hpp>

using namespace Mantid::VATES;
Expand Down Expand Up @@ -247,19 +248,7 @@ int vtkMDEWSource::RequestInformation(vtkInformation *vtkNotUsed(request), vtkIn
{
// If the MDEvent workspace has had top level splitting applied to it, then use the a depth of 1
if (auto split = Mantid::VATES::findRecursionDepthForTopLevelSplitting(m_wsName)) {

#if defined(__GNUC__)
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4 )
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
#endif
SetDepth(split.get());
#if defined(__GNUC__)
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4 )
#pragma GCC diagnostic pop
#endif
#endif
}

m_presenter->executeLoadMetadata();
Expand Down
19 changes: 8 additions & 11 deletions Code/Mantid/Vates/VatesAPI/test/BoxInfoTest.h
@@ -1,14 +1,20 @@
#ifndef VATES_API_BOX_INFO_TEST_H_
#define VATES_API_BOX_INFO_TEST_H_



#include <cxxtest/TestSuite.h>

#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#include "MantidVatesAPI/BoxInfo.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/BoxController.h"
#include "MantidKernel/PropertyWithValue.h"
#include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidDataObjects/MDLeanEvent.h"



using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::DataObjects::MDEventsTestHelper;
Expand Down Expand Up @@ -54,19 +60,10 @@ class BoxInfoTest : public CxxTest::TestSuite {
// Act
auto result = Mantid::VATES::findRecursionDepthForTopLevelSplitting(wsName);
// Assert
#if defined(__GNUC__)
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4 )
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
#endif

TSM_ASSERT("Should have recursion depth of 1 for top level splitting.",
result.get() == 1);
#if defined(__GNUC__)
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4 )
#pragma GCC diagnostic pop
#endif
#endif

// Clean up
AnalysisDataService::Instance().remove(wsName);
}
Expand Down
12 changes: 1 addition & 11 deletions Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp
Expand Up @@ -39,6 +39,7 @@
#include <QPointer>
#include <QSet>

#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#include <boost/optional.hpp>
#include <stdexcept>

Expand Down Expand Up @@ -299,21 +300,10 @@ pqPipelineSource* ViewBase::setPluginSource(QString pluginName, QString wsName)
// We are setting the recursion depth to 1 when we are dealing with MDEvent workspaces
// with top level splitting, but this is not updated in the plugin line edit field.
// We do this here.
#if defined(__GNUC__)
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4 )
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
#endif
if (auto split = Mantid::VATES::findRecursionDepthForTopLevelSplitting(wsName.toStdString())) {
vtkSMPropertyHelper(src->getProxy(),
"Recursion Depth").Set(split.get());
}
#if defined(__GNUC__)
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4 )
#pragma GCC diagnostic pop
#endif
#endif
// WORKAROUND END

// Update the source so that it retrieves the data from the Mantid workspace
Expand Down

0 comments on commit cf3b62b

Please sign in to comment.