r237339 - Replace non-standard %lld printf usage with PRId64.

Yaron Keren yaron.keren at gmail.com
Wed May 13 22:40:50 PDT 2015


Author: yrnkrn
Date: Thu May 14 00:40:50 2015
New Revision: 237339

URL: http://llvm.org/viewvc/llvm-project?rev=237339&view=rev
Log:
Replace non-standard %lld printf usage with PRId64.

See also r180024.


Modified:
    cfe/trunk/tools/c-index-test/c-index-test.c

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=237339&r1=237338&r2=237339&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Thu May 14 00:40:50 2015
@@ -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,
               }
               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 PrintType
   {
     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 PrintType
                                                   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 *
 }
 
 static int perform_print_build_session_timestamp(void) {
-  printf("%lld\n", clang_getBuildSessionTimestamp());
+  printf("%" PRId64 "\n", clang_getBuildSessionTimestamp());
   return 0;
 }
 





More information about the cfe-commits mailing list