Skip to content

Commit 7fb3bef

Browse files
committed
Linux build fixes
1 parent 5f2cd52 commit 7fb3bef

File tree

6 files changed

+35
-29
lines changed

6 files changed

+35
-29
lines changed

deadcodebase/dccore/log.d

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,16 @@ class Log
9090
import std.string;
9191
import std.conv;
9292
static import std.stdio;
93-
version (linux)
94-
std.stdio.writeln("*Messages* " ~ format(msgs));
9593

9694
static if (msgs.length == 1)
9795
auto fmtmsg = format(msgs[0].to!string);
9896
else
9997
auto fmtmsg = format(msgs[0].to!string, msgs[1..$]);
10098

99+
100+
version (linux)
101+
std.stdio.writeln("*Messages* " ~ fmtmsg);
102+
101103
if (_file.getFP() !is null)
102104
{
103105
_file.writeln(fmtmsg);

libdeadcode/src/application.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ class Application
19541954
kill(*existingProcess);
19551955
_runningExtensionProcesses.remove(path);
19561956
}
1957-
auto pid = spawnProcess(path, stdin, stdout, stderr, null, Config.suppressConsole);
1957+
auto pid = spawnProcess(path, stdin, stdout, stderr, null, std.process.Config.suppressConsole);
19581958
// Error check
19591959
_runningExtensionProcesses[path] = pid;
19601960
}

libdeadcode/src/behavior/behavior.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class NullBehavior : EditorBehavior
4242
{
4343
import std.stdio;
4444
version (linux)
45-
writeln("NullBehavior got event ", event, " Window ID: ", event.windowID);
45+
writeln("NullBehavior got event ", event);
4646
return EventUsed.no;
4747
}
4848
}

libdeadcode/src/gui/gui.d

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class GUI
2828
Uint32 _lastScrollTick;
2929

3030
CtxVar!(MainEventSource) eventSource;
31-
31+
3232
class Timeout
3333
{
3434
bool done;
@@ -37,7 +37,7 @@ class GUI
3737
shared(TimeoutEvent) ev;
3838
int msInit;
3939

40-
static sNextID = 1;
40+
static sNextID = 1;
4141
this()
4242
{
4343
id = sNextID++;
@@ -112,9 +112,9 @@ class GUI
112112
static import io.file;
113113
import platform.system;
114114
import gui.resources;
115-
auto g = new GUI(gs is null ? new graphics.graphicssystem.OpenGLSystem() : gs);
115+
auto g = new GUI(gs is null ? new OpenGLSystem() : gs);
116116
g._graphicsSystem.init();
117-
the = g;
117+
the = g;
118118
g.ioManager = new io.iomanager.IOManager;
119119
// g.ioManager.add(new io.iomanager.ScanProtocol);
120120
g.ioManager.add(new io.file.FileProtocol);
@@ -133,7 +133,7 @@ class GUI
133133
g.locationsManager.addListener(g.shaderProgramManager);
134134
g.locationsManager.addListener(g.textureManager);
135135
g.locationsManager.addListener(g.materialManager);
136-
g.locationsManager.addListener(g.styleSheetManager);
136+
g.locationsManager.addListener(g.styleSheetManager);
137137

138138
return g;
139139

@@ -246,7 +246,8 @@ class GUI
246246
{
247247
output("Frame %s", i++);
248248
auto worst = frame;
249-
foreach(zone; zones.filter!(z => z.startTime >= worst.startTime && z.endTime <= worst.endTime))
249+
auto r = zones.filter!(z => z.startTime >= worst.startTime && z.endTime <= worst.endTime);
250+
foreach(zone; r)
250251
{
251252
output(" %s: %s ms from %s to %s",
252253
zone.info, hnsToMS(zone.duration), hnsToS(zone.startTime), hnsToS(zone.endTime));
@@ -265,7 +266,7 @@ class GUI
265266
{
266267
output(" eventCount : %s\n", var);
267268
}
268-
}
269+
}
269270

270271
void stop()
271272
{
@@ -275,8 +276,8 @@ class GUI
275276
struct TimeoutHandle
276277
{
277278
static ulong _nextID = 1;
278-
GUI gui;
279-
ulong id;
279+
GUI gui;
280+
ulong id;
280281
bool abort()
281282
{
282283
if (gui !is null)
@@ -291,7 +292,7 @@ class GUI
291292
auto to = new FnTimeout!(Fn,Args)(cast(int)d.total!"msecs", fn, args);
292293
auto data = TimeoutHandle(this, to.id);
293294
to.ev = eventSource.scheduleTimeout(d, Variant(data));
294-
_timeouts ~= to;
295+
_timeouts ~= to;
295296
return data;
296297
}
297298

@@ -311,11 +312,11 @@ class GUI
311312
_timeouts[idx].ev = eventSource.scheduleTimeout(dur!"msecs"(_timeouts[idx].msInit), Variant(data));
312313
}
313314
else
314-
{
315+
{
315316
// Remove from list.
316317
_timeouts[idx] = _timeouts[$-1];
317318
_timeouts.length -= 1;
318-
assumeSafeAppend(_timeouts);
319+
assumeSafeAppend(_timeouts);
319320
}
320321
break;
321322
}
@@ -331,11 +332,11 @@ class GUI
331332
if (_timeouts[idx].id == id)
332333
{
333334
eventSource.abortTimeout(_timeouts[idx].ev);
334-
// Remove from list.
335-
_timeouts[idx] = _timeouts[$-1];
336-
_timeouts.length -= 1;
335+
// Remove from list.
336+
_timeouts[idx] = _timeouts[$-1];
337+
_timeouts.length -= 1;
337338
assumeSafeAppend(_timeouts);
338-
return true;
339+
return true;
339340
}
340341
}
341342
return false;
@@ -381,8 +382,8 @@ class GUI
381382
//import graphics.mesh : Mesh;
382383
//Mesh.numDrawCalls = 0;
383384
//Mesh.numBufferUploads= 0;
384-
385-
foreach (k, v; _windows)
385+
386+
foreach (k, v; _windows)
386387
{
387388
// TODO: cull hidden windows
388389
// TODO: fix double drawing of widgets because the are all drawn here and some of them
@@ -688,7 +689,7 @@ class GUI
688689
if (ge !is null)
689690
{
690691
auto w = ge.windowID in _windows;
691-
if (w !is null)
692+
if (w !is null)
692693
{
693694
w.dispatch(e);
694695
return;
@@ -709,12 +710,12 @@ class GUI
709710
}
710711

711712
if (e.type != GUIEvents.completed)
712-
{
713+
{
713714
import std.stdio;
714715
debug writeln("Event with no window target received ", e);
715716
}
716717
}
717-
718+
718719
void repaintAllWindows()
719720
{
720721
foreach(winID, win; _windows)

libdeadcode/src/io/tcp.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class APICall
3333
auto rpcClass = extensionapi.rpc.lookupRPCClass(objectType);
3434
rpcClass.unpackAndCall(unpacker, lookup, obj, result);
3535
ubyte[] res = pack(callID) ~ pack(true) ~ result;
36-
uint len = res.length;
36+
uint len = cast(uint)res.length;
3737
ubyte* lenubyte = cast(ubyte*)&len;
3838
client.conn.send(lenubyte[0..4]);
3939
client.conn.send(res);
4040
}
4141
else
4242
{
4343
ubyte[] res = pack(callID) ~ pack(false);
44-
uint len = res.length;
44+
uint len = cast(uint)res.length;
4545
ubyte* lenubyte = cast(ubyte*)&len;
4646
client.conn.send(lenubyte[0..4]);
4747
client.conn.send(res);
@@ -223,7 +223,7 @@ class TCPClient
223223
import std.conv;
224224
string callID = (nextCallID++).to!string;
225225
ubyte[] res = pack(callID) ~ pack(name) ~ pack(params);
226-
uint len = res.length;
226+
uint len = cast(uint)res.length;
227227
ubyte* lenubyte = cast(ubyte*)&len;
228228
conn.send(lenubyte[0..4]);
229229
conn.send(res);

libdeadcode/src/platform/system.d

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ mixin template platformMain(alias customMain)
120120
}
121121
version (linux)
122122
{
123-
123+
void killProcessWithThisProcess(HANDLE hProcess)
124+
{
125+
126+
}
124127
// http://stackoverflow.com/questions/284325/how-to-make-child-process-die-after-parent-exits
125128

126129
string getRunningExecutablePath()

0 commit comments

Comments
 (0)