Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Fix build #23

Merged
merged 8 commits into from Dec 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions .travis.yml
@@ -1,3 +1,9 @@
language: d
script:
- rdmd -unittest -d test/unittests.d

os:
- linux
- osx

d:
- dmd
- ldc
4 changes: 2 additions & 2 deletions bio/bam/bai/indexing.d
Expand Up @@ -30,12 +30,12 @@ import bio.bam.constants;
import bio.bam.bai.bin;
import bio.core.bgzf.chunk;

import std.stream;
import undead.stream;
import std.array;
import std.algorithm;
import std.system;
import std.exception;
import std.c.string;
import core.stdc.string;

// Suppose we have an alignment which covers bases on a reference,
// starting from one position and ending at another position.
Expand Down
2 changes: 1 addition & 1 deletion bio/bam/baifile.d
Expand Up @@ -28,7 +28,7 @@ public import bio.bam.bai.bin;
import bio.core.bgzf.virtualoffset;
import bio.bam.constants;

import std.stream;
import undead.stream;
import std.system;
import std.exception;
import std.algorithm;
Expand Down
1 change: 1 addition & 0 deletions bio/bam/randomaccessmanager.d
Expand Up @@ -50,6 +50,7 @@ import std.traits;
import std.exception;
import std.container;
import std.parallelism;
static import std.file;

debug {
import std.stdio;
Expand Down
3 changes: 2 additions & 1 deletion bio/bam/read.d
Expand Up @@ -72,7 +72,7 @@ import std.system;
import std.traits;
import std.array;
import std.bitmanip;
import std.c.stdlib;
import core.stdc.stdlib;

/**
Represents single CIGAR operation
Expand Down Expand Up @@ -1579,6 +1579,7 @@ unittest {

{
import std.typecons;
static import bio.bam.thirdparty.msgpack;
auto packer = bio.bam.thirdparty.msgpack.packer(Appender!(ubyte[])());
read.toMsgpack(packer);
auto data = packer.stream.data;
Expand Down
4 changes: 2 additions & 2 deletions bio/bam/reader.d
Expand Up @@ -94,8 +94,8 @@ class BamReader : IBamSamReader {
}
-------------------------------------------
*/
this(std.stream.Stream stream,
std.parallelism.TaskPool task_pool = std.parallelism.taskPool) {
this(undead.stream.Stream stream,
TaskPool task_pool = taskPool) {
_source_stream = new EndianStream(stream, Endian.littleEndian);
_task_pool = task_pool;

Expand Down
2 changes: 1 addition & 1 deletion bio/bam/readrange.d
Expand Up @@ -29,7 +29,7 @@ import bio.bam.reader;
import bio.core.bgzf.inputstream;
import bio.core.bgzf.virtualoffset;

import std.stream;
import undead.stream;
import std.algorithm;
import std.system;
import std.bitmanip;
Expand Down
2 changes: 1 addition & 1 deletion bio/bam/reference.d
Expand Up @@ -47,7 +47,7 @@ import bio.bam.region;
import bio.bam.randomaccessmanager;
import bio.core.bgzf.virtualoffset;

import std.stream;
import undead.stream;
import std.exception;
import std.array;

Expand Down
2 changes: 1 addition & 1 deletion bio/bam/referenceinfo.d
Expand Up @@ -23,7 +23,7 @@
*/
module bio.bam.referenceinfo;

import std.stream;
import undead.stream;
import std.exception;
import std.array;

Expand Down
2 changes: 1 addition & 1 deletion bio/bam/snpcallers/maq.d
Expand Up @@ -5,7 +5,7 @@ module bio.bam.snpcallers.maq;
*/

import core.stdc.math;
import std.math : LN2, LN10, isnan;
import std.math : LN2, LN10, isNaN;
import std.traits;
import std.range;
import std.algorithm;
Expand Down
2 changes: 1 addition & 1 deletion bio/bam/tagvalue.d
Expand Up @@ -296,7 +296,7 @@ string injectOpCast() {
}

cs ~= `(is(T == string)) {` ~
` if (is_string) {`
` if (is_string) {` ~
` return bam_typeid == 'Z' ? u.Z : u.H;`~
` } else if (is_integer || is_float || is_character) {`~
` `~injectSwitchPrimitive("string")~
Expand Down
12 changes: 6 additions & 6 deletions bio/bam/thirdparty/msgpack.d
Expand Up @@ -59,7 +59,7 @@ else
// for Converting Endian using ntohs and ntohl;
version(Windows)
{
import std.c.windows.winsock;
import core.stdc.windows.winsock;
}
else
{
Expand All @@ -82,7 +82,7 @@ static if (real.sizeof == double.sizeof) {
import std.numeric;
}

version(unittest) import std.file, std.c.string;
version(unittest) import std.file, core.stdc.string;


@trusted:
Expand Down Expand Up @@ -344,7 +344,7 @@ struct PackerImpl(Stream) if (isOutputRange!(Stream, ubyte) && isOutputRange!(St
* Params:
* withFieldName = serialize class / struct with field name
*/
this(bool withFieldName = false)
this(bool withFieldName)
{
withFieldName_ = withFieldName;
}
Expand Down Expand Up @@ -3145,7 +3145,7 @@ struct Value
* type = the type of value.
*/
@safe
this(Type type = Type.nil)
this(Type type)
{
this.type = type;
}
Expand Down Expand Up @@ -3617,7 +3617,7 @@ struct Value
ret ^= value.toHash();
}
return ret;
} catch assert(0);
} catch (Exception) assert(0);
}
}
}
Expand Down Expand Up @@ -4656,7 +4656,7 @@ mixin template MessagePackable(Members...)
if (withFieldName) {
packer.beginMap(this.tupleof.length);
foreach (i, member; this.tupleof) {
pack(getFieldName!(typeof(this), i));
packer.pack(getFieldName!(typeof(this), i));
packer.pack(member);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion bio/bam/utils/array.d
Expand Up @@ -23,7 +23,7 @@
*/
module bio.bam.utils.array;

import std.c.string;
import core.stdc.string;
import std.traits;

/// Modifies array in-place so that $(D slice) is replaced by
Expand Down
4 changes: 2 additions & 2 deletions bio/bam/writer.d
Expand Up @@ -35,7 +35,7 @@ import bio.core.utils.stream;

import std.parallelism;
import std.exception;
import std.stream;
import undead.stream;
import std.traits;
import std.system;
import std.algorithm;
Expand Down Expand Up @@ -73,7 +73,7 @@ final class BamWriter {
/// compression_level = compression level, must be in range -1..9
/// task_pool = task pool to use for parallel compression
/// buffer_size = size of BgzfOutputStream buffer
this(std.stream.Stream stream,
this(undead.stream.Stream stream,
int compression_level=-1,
std.parallelism.TaskPool task_pool=std.parallelism.taskPool,
size_t buffer_size=0)
Expand Down
2 changes: 1 addition & 1 deletion bio/core/bgzf/inputstream.d
Expand Up @@ -30,7 +30,7 @@ import bio.core.bgzf.chunk;
import bio.bam.constants;
import bio.core.utils.roundbuf;

import std.stream;
import undead.stream;
import std.exception;
import std.conv;
import std.parallelism;
Expand Down
8 changes: 4 additions & 4 deletions bio/core/bgzf/outputstream.d
Expand Up @@ -28,13 +28,13 @@ import bio.core.bgzf.compress;

import bio.core.utils.roundbuf;

import std.stream;
import undead.stream;
import std.exception;
import std.parallelism;
import std.array;
import std.algorithm : max;
import std.typecons;
import std.c.stdlib;
import core.stdc.stdlib;

alias void delegate(ubyte[], ubyte[]) BlockWriteHandler;

Expand Down Expand Up @@ -88,7 +88,7 @@ class BgzfOutputStream : Stream {

// 1 extra block to which we can write while n_tasks are executed
auto comp_buf_size = (2 * n_tasks + 2) * max_block_size;
auto p = cast(ubyte*)std.c.stdlib.malloc(comp_buf_size);
auto p = cast(ubyte*)core.stdc.stdlib.malloc(comp_buf_size);
_compression_buffer = p[0 .. comp_buf_size];
_buffer = _compression_buffer[0 .. block_size];
_tmp = _compression_buffer[max_block_size .. max_block_size * 2];
Expand Down Expand Up @@ -210,7 +210,7 @@ class BgzfOutputStream : Stream {
_stream.close();

writeable = false;
std.c.stdlib.free(_compression_buffer.ptr);
core.stdc.stdlib.free(_compression_buffer.ptr);
}

/// Adds EOF block. This function is called in close() method.
Expand Down
2 changes: 1 addition & 1 deletion bio/core/utils/bylinefast.d
Expand Up @@ -6,7 +6,7 @@ module bio.core.utils.bylinefast;

import std.stdio;
import std.string: indexOf;
import std.c.string: memmove;
import core.stdc.string: memmove;

/**
Reads by line in an efficient way (10 times faster than File.byLine from std.stdio).
Expand Down
7 changes: 4 additions & 3 deletions bio/core/utils/format.d
Expand Up @@ -34,8 +34,9 @@
*/
module bio.core.utils.format;

import std.c.stdio;
import std.c.stdlib;
import core.stdc.stdio;
import core.stdc.stdlib;
static import core.stdc.string;
import std.string;
import std.traits;
import std.array;
Expand Down Expand Up @@ -161,7 +162,7 @@ private {
if (isSomeString!T)
{
auto str = cast(const(char)[])s;
std.c.string.memcpy(sink, str.ptr, str.length);
core.stdc.string.memcpy(sink, str.ptr, str.length);
sink += str.length;
}

Expand Down
2 changes: 1 addition & 1 deletion bio/core/utils/outbuffer.d
Expand Up @@ -93,7 +93,7 @@ class OutBuffer {
/// Responsibility that there's enough capacity is on the user
void putUnsafe(T)(T bytes) if (is(T == ubyte[])) {
_heap_ptr[_heap_used .. _heap_used + bytes.length] = bytes[];
_heap_used += bytes.length;;
_heap_used += bytes.length;
}

/// ditto
Expand Down
7 changes: 3 additions & 4 deletions bio/core/utils/stream.d
@@ -1,6 +1,6 @@
module bio.core.utils.stream;

public import std.stream;
public import undead.stream;
import core.stdc.stdio;
import core.stdc.errno;
import core.stdc.string;
Expand All @@ -15,7 +15,7 @@ version(Posix){
version(Windows) {
private import std.file;
private import std.utf;
private import std.c.windows.windows;
private import core.stdc.windows.windows;
extern (Windows) {
DWORD GetFileType(HANDLE hFile);
}
Expand Down Expand Up @@ -48,7 +48,7 @@ FileMode toFileMode(string mode) {
return result;
}

final class File: std.stream.File {
final class File: undead.stream.File {
this(string filename, string mode="rb") {
version (Posix) {
// Issue 8528 workaround
Expand Down Expand Up @@ -135,7 +135,6 @@ final class File: std.stream.File {
if (ret <= 0) {
size = 0;
throw new ReadException("read timeout");
break;
}
} else {
throw new ReadException(to!string(strerror(errno)));
Expand Down
2 changes: 1 addition & 1 deletion bio/core/utils/switchendianness.d
@@ -1,5 +1,5 @@
/**
(Almost) a copy-paste from std/stream.d
(Almost) a copy-paste from undead.stream.d
*/
module bio.core.utils.switchendianness;

Expand Down