Skip to content

Commit 2c8d313

Browse files
committed
Fix formatting
1 parent a78ffce commit 2c8d313

14 files changed

+1550
-1490
lines changed

PhaseExplorer.sln

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2012
2+
# Visual Studio 14
3+
VisualStudioVersion = 14.0.25420.1
4+
MinimumVisualStudioVersion = 10.0.40219.1
45
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhaseExplorer", "PhaseExplorer\PhaseExplorer.csproj", "{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}"
56
EndProject
67
Global
78
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9+
Debug|Any CPU = Debug|Any CPU
10+
Debug|x64 = Debug|x64
811
Debug|x86 = Debug|x86
12+
Release|Any CPU = Release|Any CPU
13+
Release|x64 = Release|x64
914
Release|x86 = Release|x86
1015
EndGlobalSection
1116
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Debug|x64.ActiveCfg = Debug|x64
20+
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Debug|x64.Build.0 = Debug|x64
1221
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Debug|x86.ActiveCfg = Debug|x86
1322
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Debug|x86.Build.0 = Debug|x86
23+
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
24+
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Release|Any CPU.Build.0 = Release|Any CPU
25+
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Release|x64.ActiveCfg = Release|x64
26+
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Release|x64.Build.0 = Release|x64
1427
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Release|x86.ActiveCfg = Release|x86
1528
{6E96C13B-CAF2-444C-9C11-6BCF2E33C2EB}.Release|x86.Build.0 = Release|x86
1629
EndGlobalSection
30+
GlobalSection(SolutionProperties) = preSolution
31+
HideSolutionNode = FALSE
32+
EndGlobalSection
1733
EndGlobal

PhaseExplorer/BlazedPhaseDLL.cs

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,71 @@
55

66
public static class BlazedPhaseDLL
77
{
8-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
9-
unsafe delegate double* FPhase();
8+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
9+
unsafe delegate double* FPhase();
1010

11-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
12-
delegate void FRelease();
11+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
12+
delegate void FRelease();
1313

14-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
15-
unsafe delegate void FCompute(int argc, void** argv);
14+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
15+
unsafe delegate void FCompute(int argc, void** argv);
1616

17-
static int Width;
18-
static int Height;
19-
static double X;
20-
static double Y;
17+
static int Width;
18+
static int Height;
19+
static double X;
20+
static double Y;
2121

22-
public static void SetParameters(int width, int height, double x, double y)
23-
{
24-
Width = width;
25-
Height = height;
26-
X = x;
27-
Y = y;
28-
}
22+
public static void SetParameters(int width, int height, double x, double y)
23+
{
24+
Width = width;
25+
Height = height;
26+
X = x;
27+
Y = y;
28+
}
2929

30-
unsafe public static PhaseOutput ComputePhase(string dll)
31-
{
32-
var file = Common.OSTest.IsWindows() ? String.Format("./libphase++{0}.dll", dll) : (Common.OSTest.IsRunningOnMac() ? String.Format("./libphase++{0}.dylib", dll) : String.Format("./libphase++{0}.so", dll));
30+
unsafe public static PhaseOutput ComputePhase(string dll)
31+
{
32+
var file = Common.OSTest.IsWindows() ? String.Format("./libphase++{0}.dll", dll) : (Common.OSTest.IsRunningOnMac() ? String.Format("./libphase++{0}.dylib", dll) : String.Format("./libphase++{0}.so", dll));
3333

34-
if (File.Exists(file))
35-
{
36-
IntPtr pLibrary = DLLLoader.LoadLibrary(file);
37-
IntPtr pCompute = DLLLoader.GetProcAddress(pLibrary, "Compute");
38-
IntPtr pPhase = DLLLoader.GetProcAddress(pLibrary, "Phase");
39-
IntPtr pRelease = DLLLoader.GetProcAddress(pLibrary, "Release");
34+
if (File.Exists(file))
35+
{
36+
IntPtr pLibrary = DLLLoader.LoadLibrary(file);
37+
IntPtr pCompute = DLLLoader.GetProcAddress(pLibrary, "Compute");
38+
IntPtr pPhase = DLLLoader.GetProcAddress(pLibrary, "Phase");
39+
IntPtr pRelease = DLLLoader.GetProcAddress(pLibrary, "Release");
4040

41-
var Compute = DLLLoader.LoadFunction<FCompute>(pCompute);
42-
var Phase = DLLLoader.LoadFunction<FPhase>(pPhase);
43-
var Release = DLLLoader.LoadFunction<FRelease>(pRelease);
41+
var Compute = DLLLoader.LoadFunction<FCompute>(pCompute);
42+
var Phase = DLLLoader.LoadFunction<FPhase>(pPhase);
43+
var Release = DLLLoader.LoadFunction<FRelease>(pRelease);
4444

45-
void** Parameters = stackalloc void*[4];
45+
void** Parameters = stackalloc void*[4];
4646

47-
var width = Width;
48-
var height = Height;
49-
var x = X;
50-
var y = Y;
47+
var width = Width;
48+
var height = Height;
49+
var x = X;
50+
var y = Y;
5151

52-
Parameters[0] = &width;
53-
Parameters[1] = &height;
54-
Parameters[2] = &x;
55-
Parameters[3] = &y;
52+
Parameters[0] = &width;
53+
Parameters[1] = &height;
54+
Parameters[2] = &x;
55+
Parameters[3] = &y;
5656

57-
Compute(4, Parameters);
57+
Compute(4, Parameters);
5858

59-
var output = Phase();
59+
var output = Phase();
6060

61-
var phase = new PhaseOutput(output, width * height);
61+
var phase = new PhaseOutput(output, width * height);
6262

63-
// Free resources
64-
Release();
63+
// Free resources
64+
Release();
6565

66-
DLLLoader.FreeLibrary(pLibrary);
66+
DLLLoader.FreeLibrary(pLibrary);
6767

68-
return phase;
69-
}
68+
return phase;
69+
}
7070

71-
var length = Width * Height > 0 ? Width * Height : 256 * 256;
71+
var length = Width * Height > 0 ? Width * Height : 256 * 256;
7272

73-
return new PhaseOutput(length);
74-
}
73+
return new PhaseOutput(length);
74+
}
7575
}

0 commit comments

Comments
 (0)