Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and
-Wint-to-pointer-cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123719 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 910f449..7f00f99 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -1530,22 +1530,22 @@
 public:
   LabelRefVisit(LabelStmt *LS, SourceLocation labelLoc, CXCursor parent)
     : VisitorJob(parent, VisitorJob::LabelRefVisitKind, LS,
-                 (void*) labelLoc.getRawEncoding()) {}
+                 labelLoc.getPtrEncoding()) {}
   
   static bool classof(const VisitorJob *VJ) {
     return VJ->getKind() == VisitorJob::LabelRefVisitKind;
   }
   LabelStmt *get() const { return static_cast<LabelStmt*>(data[0]); }
   SourceLocation getLoc() const { 
-    return SourceLocation::getFromRawEncoding((unsigned)(uintptr_t) data[1]); }
+    return SourceLocation::getFromPtrEncoding(data[1]); }
 };
 class NestedNameSpecifierVisit : public VisitorJob {
 public:
   NestedNameSpecifierVisit(NestedNameSpecifier *NS, SourceRange R,
                            CXCursor parent)
     : VisitorJob(parent, VisitorJob::NestedNameSpecifierVisitKind,
-                 NS, (void*) R.getBegin().getRawEncoding(),
-                 (void*) R.getEnd().getRawEncoding()) {}
+                 NS, R.getBegin().getPtrEncoding(),
+                 R.getEnd().getPtrEncoding()) {}
   static bool classof(const VisitorJob *VJ) {
     return VJ->getKind() == VisitorJob::NestedNameSpecifierVisitKind;
   }
@@ -1583,7 +1583,7 @@
 public:
   MemberRefVisit(FieldDecl *D, SourceLocation L, CXCursor parent)
     : VisitorJob(parent, VisitorJob::MemberRefVisitKind, D,
-                 (void*) L.getRawEncoding()) {}
+                 L.getPtrEncoding()) {}
   static bool classof(const VisitorJob *VJ) {
     return VJ->getKind() == VisitorJob::MemberRefVisitKind;
   }
diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp
index 7bcd159..7ae9f7d 100644
--- a/tools/libclang/CXCursor.cpp
+++ b/tools/libclang/CXCursor.cpp
@@ -57,7 +57,7 @@
                                 bool FirstInDeclGroup) {
   assert(D && TU && "Invalid arguments!");
   CXCursor C = { getCursorKindForDecl(D),
-                 { D, (void*) (FirstInDeclGroup ? 1 : 0), TU }
+                 { D, (void*)(intptr_t) (FirstInDeclGroup ? 1 : 0), TU }
                };
   return C;
 }
@@ -560,4 +560,3 @@
   return flag;
 }
 } // end: extern "C"
-