Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dmd/func.d
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ extern (C++) class FuncDeclaration : Declaration
*/
static FuncDeclaration genCfunc(Parameters* fparams, Type treturn, const(char)* name, StorageClass stc = 0)
{
return genCfunc(fparams, treturn, Identifier.idPool(name, strlen(name)), stc);
return genCfunc(fparams, treturn, Identifier.idPool(name, cast(uint)strlen(name)), stc);
}

static FuncDeclaration genCfunc(Parameters* fparams, Type treturn, Identifier id, StorageClass stc = 0)
Expand Down
4 changes: 2 additions & 2 deletions src/dmd/identifier.d
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ nothrow:
*/
extern (D) static Identifier idPool(const(char)[] s)
{
return idPool(s.ptr, s.length);
return idPool(s.ptr, cast(uint)s.length);
}

static Identifier idPool(const(char)* s, size_t len)
static Identifier idPool(const(char)* s, uint len)
{
StringValue* sv = stringtable.update(s, len);
Identifier id = cast(Identifier)sv.ptrvalue;
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/identifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Identifier : public RootObject
static StringTable stringtable;
static Identifier *generateId(const char *prefix);
static Identifier *generateId(const char *prefix, size_t i);
static Identifier *idPool(const char *s, d_size_t len);
static Identifier *idPool(const char *s, unsigned len);

static inline Identifier *idPool(const char *s)
{
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/lexer.d
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class Lexer : ErrorHandler
}
break;
}
Identifier id = Identifier.idPool(cast(char*)t.ptr, p - t.ptr);
Identifier id = Identifier.idPool(cast(char*)t.ptr, cast(uint)(p - t.ptr));
t.ident = id;
t.value = cast(TOK)id.getValue();
anyToken = 1;
Expand Down
6 changes: 3 additions & 3 deletions src/dmd/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ private int tryMain(size_t argc, const(char)** argv)
/* At this point, name is the D source file name stripped of
* its path and extension.
*/
auto id = Identifier.idPool(name, strlen(name));
auto id = Identifier.idPool(name, cast(uint)strlen(name));
auto m = new Module(files[i], id, global.params.doDocComments, global.params.doHdrGeneration);
modules.push(m);
if (firstmodule)
Expand Down Expand Up @@ -2505,7 +2505,7 @@ private void parseModulePattern(const(char)* modulePattern, MatcherNode* dst, us
if (*modulePattern == '.')
{
assert(modulePattern > idStart, "empty module pattern");
*dst = MatcherNode(Identifier.idPool(idStart, modulePattern - idStart));
*dst = MatcherNode(Identifier.idPool(idStart, cast(uint)(modulePattern - idStart)));
modulePattern++;
idStart = modulePattern;
break;
Expand All @@ -2517,7 +2517,7 @@ private void parseModulePattern(const(char)* modulePattern, MatcherNode* dst, us
if (*modulePattern == '\0')
{
assert(modulePattern > idStart, "empty module pattern");
*lastNode = MatcherNode(Identifier.idPool(idStart, modulePattern - idStart));
*lastNode = MatcherNode(Identifier.idPool(idStart, cast(uint)(modulePattern - idStart)));
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/mtype.d
Original file line number Diff line number Diff line change
Expand Up @@ -5627,7 +5627,7 @@ extern (C++) abstract class TypeQualified : Type
/* Look for what user might have intended
*/
const p = mutableOf().unSharedOf().toChars();
auto id = Identifier.idPool(p, strlen(p));
auto id = Identifier.idPool(p, cast(uint)strlen(p));
if (const n = importHint(p))
error(loc, "`%s` is not defined, perhaps `import %s;` ?", p, n);
else if (auto s2 = sc.search_correct(id))
Expand Down