diff --git a/src/ctfe.h b/src/ctfe.h index c584b7cb076f..ff93ba02e92b 100644 --- a/src/ctfe.h +++ b/src/ctfe.h @@ -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 diff --git a/src/ctfeexpr.c b/src/ctfeexpr.c index fdeb3876f95d..97f390c84ddf 100644 --- a/src/ctfeexpr.c +++ b/src/ctfeexpr.c @@ -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) diff --git a/src/interpret.c b/src/interpret.c index af33f68d9f7d..be19875cde92 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -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);