]> granicus.if.org Git - clang/commitdiff
Replace non-standard %lld printf usage with PRId64.
authorYaron Keren <yaron.keren@gmail.com>
Thu, 14 May 2015 05:40:50 +0000 (05:40 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Thu, 14 May 2015 05:40:50 +0000 (05:40 +0000)
See also r180024.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237339 91177308-0d34-0410-b5e6-96231b3b80d8

tools/c-index-test/c-index-test.c

index 56f39c2e12cb50586bbd087b7116a5973d3b7c16..c19648bba4b3c26fbf43923950536c5033e8537d 100644 (file)
@@ -5,6 +5,7 @@
 #include "clang-c/CXCompilationDatabase.h"
 #include "clang-c/BuildSystem.h"
 #include "clang-c/Documentation.h"
+#include "llvm/Support/DataTypes.h"
 #include <ctype.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -824,7 +825,7 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
               }
               break;
             case CXTemplateArgumentKind_Integral:
-              printf(" [Template arg %d: kind: %d, intval: %lld]",
+              printf(" [Template arg %d: kind: %d, intval: %" PRId64 "]",
                      I, TAK, clang_Cursor_getTemplateArgumentValue(Cursor, I));
               break;
             default:
@@ -1361,14 +1362,14 @@ static enum CXChildVisitResult PrintTypeSize(CXCursor cursor, CXCursor p,
   {
     long long Size = clang_Type_getSizeOf(T);
     if (Size >= 0 || Size < -1 ) {
-      printf(" [sizeof=%lld]", Size);
+      printf(" [sizeof=%" PRId64 "]", Size);
     }
   }
   /* Print the type alignof if applicable. */
   {
     long long Align = clang_Type_getAlignOf(T);
     if (Align >= 0 || Align < -1) {
-      printf(" [alignof=%lld]", Align);
+      printf(" [alignof=%" PRId64 "]", Align);
     }
   }
   /* Print the record field offset if applicable. */
@@ -1393,10 +1394,10 @@ static enum CXChildVisitResult PrintTypeSize(CXCursor cursor, CXCursor p,
                                                   FieldName);
         long long Offset2 = clang_Cursor_getOffsetOfField(cursor);
         if (Offset == Offset2){
-            printf(" [offsetof=%lld]", Offset);
+            printf(" [offsetof=%" PRId64 "]", Offset);
         } else {
             /* Offsets will be different in anonymous records. */
-            printf(" [offsetof=%lld/%lld]", Offset, Offset2);
+            printf(" [offsetof=%" PRId64 "/%" PRId64 "]", Offset, Offset2);
         }
       }
     }
@@ -3999,7 +4000,7 @@ static int read_diagnostics(const char *filename) {
 }
 
 static int perform_print_build_session_timestamp(void) {
-  printf("%lld\n", clang_getBuildSessionTimestamp());
+  printf("%" PRId64 "\n", clang_getBuildSessionTimestamp());
   return 0;
 }