mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +03:00
Fix some warnings.
These are easy to solve and reduce the noise in the Travis build.
This commit is contained in:
parent
1d12c61c62
commit
024b14cd7f
8 changed files with 10 additions and 16 deletions
|
@ -1212,7 +1212,7 @@ int main(int argc, char **argv)
|
|||
if (strcmp(m->srcfile->name->str, global.main_d) == 0)
|
||||
{
|
||||
static const char buf[] = "void main(){}";
|
||||
m->srcfile->setbuffer((void *)buf, sizeof(buf));
|
||||
m->srcfile->setbuffer(const_cast<char *>(buf), sizeof(buf));
|
||||
m->srcfile->ref = 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -599,7 +599,6 @@ LLConstant* DtoDefineClassInfo(ClassDeclaration* cd)
|
|||
LOG_SCOPE;
|
||||
|
||||
assert(cd->type->ty == Tclass);
|
||||
TypeClass* cdty = static_cast<TypeClass*>(cd->type);
|
||||
|
||||
IrAggr* ir = getIrAggr(cd);
|
||||
ClassDeclaration* cinfo = Type::typeinfoclass;
|
||||
|
|
|
@ -623,8 +623,7 @@ static void set_param_attrs(TypeFunction* f, llvm::Function* func, FuncDeclarati
|
|||
size_t n = Parameter::dim(f->parameters);
|
||||
for (size_t k = 0; k < n; k++)
|
||||
{
|
||||
Parameter* fnarg = Parameter::getNth(f->parameters, k);
|
||||
assert(fnarg);
|
||||
assert(Parameter::getNth(f->parameters, k));
|
||||
|
||||
llvm::AttrBuilder a = irFty.args[k]->attrs;
|
||||
if (a.hasAttributes())
|
||||
|
@ -674,8 +673,7 @@ static void set_param_attrs(TypeFunction* f, llvm::Function* func, FuncDeclarati
|
|||
|
||||
for (size_t k = 0; k < n; ++k)
|
||||
{
|
||||
Parameter* fnarg = Parameter::getNth(f->parameters, k);
|
||||
assert(fnarg);
|
||||
assert(Parameter::getNth(f->parameters, k));
|
||||
|
||||
attrptr[k] = irFty.args[k]->attrs;
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ void DtoBuildDVarArgList(std::vector<LLValue*>& args,
|
|||
size_t asz = (sz + Target::ptrsize - 1) & ~(Target::ptrsize -1);
|
||||
if (sz != asz)
|
||||
{
|
||||
if (sz < Target::ptrsize)
|
||||
if (sz < static_cast<size_t>(Target::ptrsize))
|
||||
{
|
||||
vtypes.back() = DtoSize_t();
|
||||
}
|
||||
|
|
|
@ -371,7 +371,7 @@ public:
|
|||
const unsigned elemSize = gDataLayout->getTypeStoreSize(
|
||||
base->getType()->getContainedType(0));
|
||||
|
||||
IF_LOG Logger::println("adding offset: %u (elem size: %u)", e->offset, elemSize);
|
||||
IF_LOG Logger::println("adding offset: %llu (elem size: %u)", static_cast<unsigned long long>(e->offset), elemSize);
|
||||
|
||||
if (e->offset % elemSize == 0)
|
||||
{
|
||||
|
|
|
@ -2030,7 +2030,7 @@ public:
|
|||
{
|
||||
LLValue* thisarg = p->func()->thisArg;
|
||||
assert(thisarg && "null thisarg, but we're in assert(this) exp;");
|
||||
LLValue* thisptr = DtoLoad(p->func()->thisArg);
|
||||
LLValue* thisptr = DtoLoad(thisarg);
|
||||
condty = e->e1->type->toBasetype();
|
||||
cond = new DImValue(condty, thisptr);
|
||||
}
|
||||
|
@ -2935,8 +2935,7 @@ public:
|
|||
IF_LOG Logger::print("DotTypeExp::toElem: %s @ %s\n", e->toChars(), e->type->toChars());
|
||||
LOG_SCOPE;
|
||||
|
||||
Type* t = e->sym->getType();
|
||||
assert(t);
|
||||
assert(e->sym->getType());
|
||||
result = toElem(e->e1);
|
||||
}
|
||||
|
||||
|
|
|
@ -613,13 +613,11 @@ public:
|
|||
unsigned hasptrs = tc->hasPointers() ? 1 : 0;
|
||||
b.push_uint(hasptrs);
|
||||
|
||||
ClassDeclaration* tscd = Type::typeinfostruct;
|
||||
|
||||
// On x86_64, class TypeInfo_Struct contains 2 additional fields
|
||||
// (m_arg1/m_arg2) which are used for the X86_64 System V ABI varargs
|
||||
// implementation. They are not present on any other cpu/os.
|
||||
assert((global.params.targetTriple.getArch() != llvm::Triple::x86_64 && tscd->fields.dim == 11) ||
|
||||
(global.params.targetTriple.getArch() == llvm::Triple::x86_64 && tscd->fields.dim == 13));
|
||||
assert((global.params.targetTriple.getArch() != llvm::Triple::x86_64 && Type::typeinfostruct->fields.dim == 11) ||
|
||||
(global.params.targetTriple.getArch() == llvm::Triple::x86_64 && Type::typeinfostruct->fields.dim == 13));
|
||||
|
||||
//void function(void*) xdtor;
|
||||
b.push_funcptr(sd->dtor);
|
||||
|
|
|
@ -98,7 +98,7 @@ void AggrTypeBuilder::addAggregate(AggregateDeclaration *ad)
|
|||
const size_t n = ad->fields.dim;
|
||||
LLSmallVector<VarDeclaration*, 16> data(n, NULL);
|
||||
|
||||
int errors = global.errors;
|
||||
unsigned int errors = global.errors;
|
||||
|
||||
// first fill in the fields with explicit initializers
|
||||
for (size_t index = 0; index < n; ++index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue