Skip to content

Commit

Permalink
lexer 64-bit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Dec 6, 2013
1 parent 9e060a6 commit b99bca7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lexer.c
Expand Up @@ -540,7 +540,7 @@ void Lexer::scan(Token *t)
break;
}
} while (*p == '\\');
t->len = stringbuffer.offset;
t->len = (unsigned)stringbuffer.offset;
stringbuffer.writeByte(0);
t->ustring = (utf8_t *)mem.malloc(stringbuffer.offset);
memcpy(t->ustring, stringbuffer.data, stringbuffer.offset);
Expand Down Expand Up @@ -631,7 +631,7 @@ void Lexer::scan(Token *t)
Lstr:
t->value = TOKstring;
t->postfix = 0;
t->len = strlen((char *)t->ustring);
t->len = (unsigned)strlen((char *)t->ustring);
}
else if (id == Id::VERSIONX)
{ unsigned major = 0;
Expand Down Expand Up @@ -1326,7 +1326,7 @@ TOK Lexer::wysiwygStringConstant(Token *t, int tc)
case '`':
if (c == tc)
{
t->len = stringbuffer.offset;
t->len = (unsigned)stringbuffer.offset;
stringbuffer.writeByte(0);
t->ustring = (utf8_t *)mem.malloc(stringbuffer.offset);
memcpy(t->ustring, stringbuffer.data, stringbuffer.offset);
Expand Down Expand Up @@ -1397,7 +1397,7 @@ TOK Lexer::hexStringConstant(Token *t)
{ error("odd number (%d) of hex characters in hex string", n);
stringbuffer.writeByte(v);
}
t->len = stringbuffer.offset;
t->len = (unsigned)stringbuffer.offset;
stringbuffer.writeByte(0);
t->ustring = (utf8_t *)mem.malloc(stringbuffer.offset);
memcpy(t->ustring, stringbuffer.data, stringbuffer.offset);
Expand Down Expand Up @@ -1581,7 +1581,7 @@ TOK Lexer::delimitedStringConstant(Token *t)
error("delimited string must end in %s\"", hereid->toChars());
else
error("delimited string must end in %c\"", delimright);
t->len = stringbuffer.offset;
t->len = (unsigned)stringbuffer.offset;
stringbuffer.writeByte(0);
t->ustring = (utf8_t *)mem.malloc(stringbuffer.offset);
memcpy(t->ustring, stringbuffer.data, stringbuffer.offset);
Expand Down Expand Up @@ -1635,7 +1635,7 @@ TOK Lexer::tokenStringConstant(Token *t)
}

Ldone:
t->len = p - 1 - pstart;
t->len = (unsigned)(p - 1 - pstart);
t->ustring = (utf8_t *)mem.malloc(t->len + 1);
memcpy(t->ustring, pstart, t->len);
t->ustring[t->len] = 0;
Expand Down Expand Up @@ -1694,7 +1694,7 @@ TOK Lexer::escapeStringConstant(Token *t, int wide)
break;

case '"':
t->len = stringbuffer.offset;
t->len = (unsigned)stringbuffer.offset;
stringbuffer.writeByte(0);
t->ustring = (utf8_t *)mem.malloc(stringbuffer.offset);
memcpy(t->ustring, stringbuffer.data, stringbuffer.offset);
Expand Down

0 comments on commit b99bca7

Please sign in to comment.