Fix steam-engine build on msvc, and add a script for listing mem ranges.

develop
Alexander Gavrilov 2012-09-03 10:28:17 +04:00
parent 2249cb14fa
commit 1618ccf5bb
2 changed files with 16 additions and 2 deletions

@ -105,7 +105,7 @@ void decrement_flow(df::coord pos, int amount)
auto pldes = Maps::getTileDesignation(pos);
if (!pldes) return;
int nsize = std::max(0, pldes->bits.flow_size - amount);
int nsize = std::max(0, int(pldes->bits.flow_size - amount));
pldes->bits.flow_size = nsize;
pldes->bits.flow_forbid = (nsize > 3 || pldes->bits.liquid_type == tile_liquid::Magma);
@ -382,7 +382,7 @@ struct workshop_hook : df::building_workshopst {
if (!liquid)
continue;
if (cnt == 0 || random() < RAND_MAX/2)
if (cnt == 0 || rand() < RAND_MAX/2)
{
cnt++;
boil_unit(liquid);

@ -0,0 +1,14 @@
-- Prints memory ranges of the process.
for _,v in ipairs(dfhack.internal.getMemRanges()) do
local access = { '-', '-', '-', 'p' }
if v.read then access[1] = 'r' end
if v.write then access[2] = 'w' end
if v.execute then access[3] = 'x' end
if not v.valid then
access[4] = '?'
elseif v.shared then
access[4] = 's'
end
print(string.format('%08x-%08x %s %s', v.start_addr, v.end_addr, table.concat(access), v.name))
end