summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp4
-rw-r--r--clang/lib/Sema/SemaType.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index a677662f401..4dd84d8555e 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -61,7 +61,7 @@ void Sema::ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
PI.TypeInfo = Context.getObjCSelType().getAsOpaquePtr();
ActOnParamDeclarator(PI, FnBodyScope);
- for (int i = 0; i < MDecl->getNumParams(); i++) {
+ for (unsigned i = 0, e = MDecl->getNumParams(); i != e; ++i) {
ParmVarDecl *PDecl = MDecl->getParamDecl(i);
PI.Ident = PDecl->getIdentifier();
PI.IdentLoc = PDecl->getLocation(); // user vars have a real location.
@@ -613,7 +613,7 @@ bool Sema::MatchTwoMethodDeclarations(const ObjCMethodDecl *Method,
if (Method->getResultType().getCanonicalType() !=
PrevMethod->getResultType().getCanonicalType())
return false;
- for (int i = 0; i < Method->getNumParams(); i++) {
+ for (unsigned i = 0, e = Method->getNumParams(); i != e; ++i) {
ParmVarDecl *ParamDecl = Method->getParamDecl(i);
ParmVarDecl *PrevParamDecl = PrevMethod->getParamDecl(i);
if (ParamDecl->getCanonicalType() != PrevParamDecl->getCanonicalType())
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index f717b4139a5..d4cb979563f 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -383,7 +383,7 @@ QualType Sema::ObjCGetTypeForMethodDefinition(DeclTy *D) {
ArgTys.push_back(Context.getObjCIdType());
ArgTys.push_back(Context.getObjCSelType());
- for (int i = 0; i < MDecl->getNumParams(); i++) {
+ for (int i = 0, e = MDecl->getNumParams(); i != e; ++i) {
ParmVarDecl *PDecl = MDecl->getParamDecl(i);
QualType ArgTy = PDecl->getType();
assert(!ArgTy.isNull() && "Couldn't parse type?");
OpenPOWER on IntegriCloud