Skip to content

Commit

Permalink
sz should be a unsigned char
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Nov 14, 2013
1 parent 0e04187 commit cc590e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ctfe.h
Expand Up @@ -123,7 +123,7 @@ ArrayLiteralExp *createBlockDuplicatedArrayLiteral(Loc loc, Type *type,

/// Create a string literal consisting of 'value' duplicated 'dim' times.
StringExp *createBlockDuplicatedStringLiteral(Loc loc, Type *type,
unsigned value, size_t dim, int sz);
unsigned value, size_t dim, unsigned char sz);


/* Set dest = src, where both dest and src are container value literals
Expand Down
2 changes: 1 addition & 1 deletion src/ctfeexpr.c
Expand Up @@ -489,7 +489,7 @@ ArrayLiteralExp *createBlockDuplicatedArrayLiteral(Loc loc, Type *type,
* Create a string literal consisting of 'value' duplicated 'dim' times.
*/
StringExp *createBlockDuplicatedStringLiteral(Loc loc, Type *type,
unsigned value, size_t dim, int sz)
unsigned value, size_t dim, unsigned char sz)
{
utf8_t *s = (utf8_t *)mem.calloc(dim + 1, sz);
for (size_t elemi = 0; elemi < dim; ++elemi)
Expand Down
2 changes: 1 addition & 1 deletion src/interpret.c
Expand Up @@ -2779,7 +2779,7 @@ Expression *recursivelyCreateArrayLiteral(Loc loc, Type *newtype, InterState *is
|| elemType->ty == Tdchar)
return createBlockDuplicatedStringLiteral(loc, newtype,
(unsigned)(elemType->defaultInitLiteral(loc)->toInteger()),
len, (int)elemType->size());
len, (unsigned char)elemType->size());
return createBlockDuplicatedArrayLiteral(loc, newtype,
elemType->defaultInitLiteral(loc),
len);
Expand Down

0 comments on commit cc590e7

Please sign in to comment.