diff --git a/source/dub/compilers/compiler.d b/source/dub/compilers/compiler.d index 7f39bcf..2eb8a9a 100644 --- a/source/dub/compilers/compiler.d +++ b/source/dub/compilers/compiler.d @@ -72,7 +72,7 @@ /// Replaces high level fields with low level fields and converts /// dmd flags to compiler-specific flags - void prepareBuildSettings(ref BuildSettings settings, in ref BuildPlatform platform, BuildSetting supported_fields = BuildSetting.all) const; + void prepareBuildSettings(ref BuildSettings settings, const scope ref BuildPlatform platform, BuildSetting supported_fields = BuildSetting.all) const; /// Removes any dflags that match one of the BuildOptions values and populates the BuildSettings.options field. void extractBuildOptions(ref BuildSettings settings) const; diff --git a/source/dub/compilers/dmd.d b/source/dub/compilers/dmd.d index 9936713..6f55ee0 100644 --- a/source/dub/compilers/dmd.d +++ b/source/dub/compilers/dmd.d @@ -167,7 +167,7 @@ if (!isWow64.isNull && !isWow64.get) assert(!bp.architecture.canFind("x86_omf")); if (!isWow64.isNull && isWow64.get) assert(bp.architecture.canFind("x86_64")); } - + version (LDC) unittest { BuildSettings settings; auto compiler = new DMDCompiler; @@ -180,7 +180,8 @@ assert(!bp.architecture.canFind("x86_omf")); } - void prepareBuildSettings(ref BuildSettings settings, in ref BuildPlatform platform, BuildSetting fields = BuildSetting.all) const + void prepareBuildSettings(ref BuildSettings settings, const scope ref BuildPlatform platform, + BuildSetting fields = BuildSetting.all) const { enforceBuildRequirements(settings); diff --git a/source/dub/compilers/gdc.d b/source/dub/compilers/gdc.d index bb0c27b..cec2dbc 100644 --- a/source/dub/compilers/gdc.d +++ b/source/dub/compilers/gdc.d @@ -85,7 +85,7 @@ ); } - void prepareBuildSettings(ref BuildSettings settings, in ref BuildPlatform platform, BuildSetting fields = BuildSetting.all) const + void prepareBuildSettings(ref BuildSettings settings, const scope ref BuildPlatform platform, BuildSetting fields = BuildSetting.all) const { enforceBuildRequirements(settings); diff --git a/source/dub/compilers/ldc.d b/source/dub/compilers/ldc.d index f62e964..8273e97 100644 --- a/source/dub/compilers/ldc.d +++ b/source/dub/compilers/ldc.d @@ -101,7 +101,7 @@ ); } - void prepareBuildSettings(ref BuildSettings settings, in ref BuildPlatform platform, BuildSetting fields = BuildSetting.all) const + void prepareBuildSettings(ref BuildSettings settings, const scope ref BuildPlatform platform, BuildSetting fields = BuildSetting.all) const { enforceBuildRequirements(settings); diff --git a/source/dub/compilers/utils.d b/source/dub/compilers/utils.d index 12c55f3..171f487 100644 --- a/source/dub/compilers/utils.d +++ b/source/dub/compilers/utils.d @@ -40,7 +40,7 @@ Linker files include static/dynamic libraries, resource files, object files and DLL definition files. */ -bool isLinkerFile(in ref BuildPlatform platform, string f) +bool isLinkerFile(const scope ref BuildPlatform platform, string f) { import std.path; switch (extension(f)) { @@ -79,7 +79,7 @@ This function tries to invoke "pkg-config" if possible and falls back to direct flag translation if that fails. */ -void resolveLibs(ref BuildSettings settings, in ref BuildPlatform platform) +void resolveLibs(ref BuildSettings settings, const scope ref BuildPlatform platform) { import std.string : format; import std.array : array; diff --git a/source/dub/dependencyresolver.d b/source/dub/dependencyresolver.d index 85e97de..eb4462c 100644 --- a/source/dub/dependencyresolver.d +++ b/source/dub/dependencyresolver.d @@ -45,8 +45,8 @@ ret ^= typeid(CONFIGS).getHash(&configs); return ret; } - bool opEqual(in ref TreeNodes other) const { return pack == other.pack && configs == other.configs; } - int opCmp(in ref TreeNodes other) const { + bool opEqual(const scope ref TreeNodes other) const { return pack == other.pack && configs == other.configs; } + int opCmp(const scope ref TreeNodes other) const { if (pack != other.pack) return pack < other.pack ? -1 : 1; if (configs != other.configs) return configs < other.configs ? -1 : 1; return 0; @@ -66,8 +66,8 @@ ret ^= typeid(CONFIG).getHash(&config); return ret; } - bool opEqual(in ref TreeNode other) const { return pack == other.pack && config == other.config; } - int opCmp(in ref TreeNode other) const { + bool opEqual(const scope ref TreeNode other) const { return pack == other.pack && config == other.config; } + int opCmp(const scope ref TreeNode other) const { if (pack != other.pack) return pack < other.pack ? -1 : 1; if (config != other.config) return config < other.config ? -1 : 1; return 0; @@ -286,7 +286,7 @@ string failedNode; - this(TreeNode parent, TreeNodes dep, in ref ResolveContext context, string file = __FILE__, size_t line = __LINE__) + this(TreeNode parent, TreeNodes dep, const scope ref ResolveContext context, string file = __FILE__, size_t line = __LINE__) { auto m = format("Unresolvable dependencies to package %s:", dep.pack.basePackageName); super(m, file, line); diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d index 5f54d4a..75250f4 100644 --- a/source/dub/generators/build.d +++ b/source/dub/generators/build.d @@ -27,7 +27,7 @@ import std.string; import std.encoding : sanitize; -string getObjSuffix(in ref BuildPlatform platform) +string getObjSuffix(const scope ref BuildPlatform platform) { return platform.platform.canFind("windows") ? ".obj" : ".o"; } @@ -412,7 +412,7 @@ /// Calls with path that resolve to the same file on the filesystem will return the same, /// unless they include different symbolic links (which are not resolved). - static string pathToObjName(in ref BuildPlatform platform, string path) + static string pathToObjName(const scope ref BuildPlatform platform, string path) { import std.digest.crc : crc32Of; import std.path : buildNormalizedPath, dirSeparator, relativePath, stripDrive; @@ -593,7 +593,7 @@ return prj.path ~ "source/app.d"; } -private NativePath getTargetPath(in ref BuildSettings bs, in ref GeneratorSettings settings) +private NativePath getTargetPath(const scope ref BuildSettings bs, const scope ref GeneratorSettings settings) { return NativePath(bs.targetPath) ~ settings.compiler.getTargetFileName(bs, settings.platform); } diff --git a/source/dub/generators/generator.d b/source/dub/generators/generator.d index 97d2985..3c5d6d7 100644 --- a/source/dub/generators/generator.d +++ b/source/dub/generators/generator.d @@ -308,7 +308,7 @@ visited.clear(); // 1. downwards inherits versions, debugVersions, and inheritable build settings - static void configureDependencies(in ref TargetInfo ti, TargetInfo[string] targets, size_t level = 0) + static void configureDependencies(const scope ref TargetInfo ti, TargetInfo[string] targets, size_t level = 0) { // do not use `visited` here as dependencies must inherit // configurations from *all* of their parents @@ -527,14 +527,14 @@ ti.pack.metadataCache = cache; } - private static void mergeFromDependent(in ref BuildSettings parent, ref BuildSettings child) + private static void mergeFromDependent(const scope ref BuildSettings parent, ref BuildSettings child) { child.addVersions(parent.versions); child.addDebugVersions(parent.debugVersions); child.addOptions(BuildOptions(parent.options & inheritedBuildOptions)); } - private static void mergeFromDependency(in ref BuildSettings child, ref BuildSettings parent, in ref BuildPlatform platform) + private static void mergeFromDependency(const scope ref BuildSettings child, ref BuildSettings parent, const scope ref BuildPlatform platform) { import dub.compilers.utils : isLinkerFile; diff --git a/source/dub/recipe/io.d b/source/dub/recipe/io.d index c66072e..994b3da 100644 --- a/source/dub/recipe/io.d +++ b/source/dub/recipe/io.d @@ -128,7 +128,7 @@ Note that the file extension must be either "json" or "sdl". */ -void writePackageRecipe(string filename, in ref PackageRecipe recipe) +void writePackageRecipe(string filename, const scope ref PackageRecipe recipe) { import dub.internal.vibecompat.core.file : openFile, FileMode; auto f = openFile(filename, FileMode.createTrunc); @@ -137,7 +137,7 @@ } /// ditto -void writePackageRecipe(NativePath filename, in ref PackageRecipe recipe) +void writePackageRecipe(NativePath filename, const scope ref PackageRecipe recipe) { writePackageRecipe(filename.toNativeString, recipe); } @@ -147,7 +147,7 @@ The extension of the supplied `filename` must be either "json" or "sdl". The output format is chosen accordingly. */ -void serializePackageRecipe(R)(ref R dst, in ref PackageRecipe recipe, string filename) +void serializePackageRecipe(R)(ref R dst, const scope ref PackageRecipe recipe, string filename) { import std.algorithm : endsWith; import dub.internal.vibecompat.data.json : writeJsonString; @@ -160,4 +160,3 @@ toSDL(recipe).toSDLDocument(dst); else assert(false, "writePackageRecipe called with filename with unknown extension: "~filename); } - diff --git a/source/dub/recipe/json.d b/source/dub/recipe/json.d index 791d485..54486c7 100644 --- a/source/dub/recipe/json.d +++ b/source/dub/recipe/json.d @@ -73,7 +73,7 @@ recipe.parseSubPackages(fullname, ps.opt!(Json[])); } -Json toJson(in ref PackageRecipe recipe) +Json toJson(const scope ref PackageRecipe recipe) { auto ret = recipe.buildSettings.toJson(); ret["name"] = recipe.name; @@ -152,7 +152,7 @@ config.buildSettings.parseJson(json, package_name); } -private Json toJson(in ref ConfigurationInfo config) +private Json toJson(const scope ref ConfigurationInfo config) { auto ret = config.buildSettings.toJson(); ret["name"] = config.name; @@ -245,7 +245,7 @@ } } -private Json toJson(in ref BuildSettingsTemplate bs) +private Json toJson(const scope ref BuildSettingsTemplate bs) { auto ret = Json.emptyObject; if( bs.dependencies !is null ){ @@ -302,7 +302,7 @@ tr.addRequirement(name, value.get!string); } -private Json toJson(in ref ToolchainRequirements tr) +private Json toJson(const scope ref ToolchainRequirements tr) { auto ret = Json.emptyObject; if (tr.dub != Dependency.any) ret["dub"] = serializeToJson(tr.dub); diff --git a/source/dub/recipe/packagerecipe.d b/source/dub/recipe/packagerecipe.d index a879991..e03fa92 100644 --- a/source/dub/recipe/packagerecipe.d +++ b/source/dub/recipe/packagerecipe.d @@ -341,7 +341,7 @@ } } -package(dub) void checkPlatform(in ref ToolchainRequirements tr, BuildPlatform platform, string package_name) +package(dub) void checkPlatform(const scope ref ToolchainRequirements tr, BuildPlatform platform, string package_name) { import dub.compilers.utils : dmdLikeVersionToSemverLike; import std.algorithm.iteration : map; diff --git a/source/dub/recipe/sdl.d b/source/dub/recipe/sdl.d index d13d4c8..cc6ab55 100644 --- a/source/dub/recipe/sdl.d +++ b/source/dub/recipe/sdl.d @@ -88,7 +88,7 @@ } } -Tag toSDL(in ref PackageRecipe recipe) +Tag toSDL(const scope ref PackageRecipe recipe) { Tag ret = new Tag; void add(T)(string field, T value) { ret.add(new Tag(null, field, [Value(value)])); } @@ -217,7 +217,7 @@ } } -private Tag toSDL(in ref ConfigurationInfo config) +private Tag toSDL(const scope ref ConfigurationInfo config) { auto ret = new Tag(null, "configuration", [Value(config.name)]); if (config.platforms.length) ret.add(new Tag(null, "platforms", config.platforms[].map!(p => Value(p)).array)); @@ -225,7 +225,7 @@ return ret; } -private Tag[] toSDL(in ref BuildSettingsTemplate bs) +private Tag[] toSDL(const scope ref BuildSettingsTemplate bs) { Tag[] ret; void add(string name, string value, string namespace = null) { ret ~= new Tag(namespace, name, [Value(value)]); }