Skip to content

Commit ac55e9c

Browse files
authored
Merge pull request #8249 from WalterBright/d_size_t2
change size_t to uint for OSX 64 bit merged-on-behalf-of: Walter Bright <WalterBright@users.noreply.github.com>
2 parents f75afc6 + 9bd653c commit ac55e9c

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/dmd/func.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ extern (C++) class FuncDeclaration : Declaration
22892289
*/
22902290
static FuncDeclaration genCfunc(Parameters* fparams, Type treturn, const(char)* name, StorageClass stc = 0)
22912291
{
2292-
return genCfunc(fparams, treturn, Identifier.idPool(name, strlen(name)), stc);
2292+
return genCfunc(fparams, treturn, Identifier.idPool(name, cast(uint)strlen(name)), stc);
22932293
}
22942294

22952295
static FuncDeclaration genCfunc(Parameters* fparams, Type treturn, Identifier id, StorageClass stc = 0)

src/dmd/identifier.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ nothrow:
143143
*/
144144
extern (D) static Identifier idPool(const(char)[] s)
145145
{
146-
return idPool(s.ptr, s.length);
146+
return idPool(s.ptr, cast(uint)s.length);
147147
}
148148

149-
static Identifier idPool(const(char)* s, size_t len)
149+
static Identifier idPool(const(char)* s, uint len)
150150
{
151151
StringValue* sv = stringtable.update(s, len);
152152
Identifier id = cast(Identifier)sv.ptrvalue;

src/dmd/identifier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Identifier : public RootObject
3939
static StringTable stringtable;
4040
static Identifier *generateId(const char *prefix);
4141
static Identifier *generateId(const char *prefix, size_t i);
42-
static Identifier *idPool(const char *s, d_size_t len);
42+
static Identifier *idPool(const char *s, unsigned len);
4343

4444
static inline Identifier *idPool(const char *s)
4545
{

src/dmd/lexer.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ class Lexer : ErrorHandler
494494
}
495495
break;
496496
}
497-
Identifier id = Identifier.idPool(cast(char*)t.ptr, p - t.ptr);
497+
Identifier id = Identifier.idPool(cast(char*)t.ptr, cast(uint)(p - t.ptr));
498498
t.ident = id;
499499
t.value = cast(TOK)id.getValue();
500500
anyToken = 1;

src/dmd/mars.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ private int tryMain(size_t argc, const(char)** argv)
655655
/* At this point, name is the D source file name stripped of
656656
* its path and extension.
657657
*/
658-
auto id = Identifier.idPool(name, strlen(name));
658+
auto id = Identifier.idPool(name, cast(uint)strlen(name));
659659
auto m = new Module(files[i], id, global.params.doDocComments, global.params.doHdrGeneration);
660660
modules.push(m);
661661
if (firstmodule)
@@ -2505,7 +2505,7 @@ private void parseModulePattern(const(char)* modulePattern, MatcherNode* dst, us
25052505
if (*modulePattern == '.')
25062506
{
25072507
assert(modulePattern > idStart, "empty module pattern");
2508-
*dst = MatcherNode(Identifier.idPool(idStart, modulePattern - idStart));
2508+
*dst = MatcherNode(Identifier.idPool(idStart, cast(uint)(modulePattern - idStart)));
25092509
modulePattern++;
25102510
idStart = modulePattern;
25112511
break;
@@ -2517,7 +2517,7 @@ private void parseModulePattern(const(char)* modulePattern, MatcherNode* dst, us
25172517
if (*modulePattern == '\0')
25182518
{
25192519
assert(modulePattern > idStart, "empty module pattern");
2520-
*lastNode = MatcherNode(Identifier.idPool(idStart, modulePattern - idStart));
2520+
*lastNode = MatcherNode(Identifier.idPool(idStart, cast(uint)(modulePattern - idStart)));
25212521
break;
25222522
}
25232523
}

src/dmd/mtype.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5647,7 +5647,7 @@ extern (C++) abstract class TypeQualified : Type
56475647
/* Look for what user might have intended
56485648
*/
56495649
const p = mutableOf().unSharedOf().toChars();
5650-
auto id = Identifier.idPool(p, strlen(p));
5650+
auto id = Identifier.idPool(p, cast(uint)strlen(p));
56515651
if (const n = importHint(p))
56525652
error(loc, "`%s` is not defined, perhaps `import %s;` ?", p, n);
56535653
else if (auto s2 = sc.search_correct(id))

0 commit comments

Comments
 (0)