diff options
Diffstat (limited to 'include/pstdint.h')
-rw-r--r-- | include/pstdint.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/pstdint.h b/include/pstdint.h index a8de63fd7..b034ae086 100644 --- a/include/pstdint.h +++ b/include/pstdint.h @@ -5,11 +5,11 @@ *
* Copyright (c) 2005-2011 Paul Hsieh
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@@ -17,7 +17,7 @@ * documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -730,15 +730,15 @@ typedef uint_least32_t uint_fast32_t; #if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
-/*
+/*
* Please compile with the maximum warning settings to make sure macros are not
* defined more than once.
*/
-
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-
+
#define glue3_aux(x,y,z) x ## y ## z
#define glue3(x,y,z) glue3_aux(x,y,z)
@@ -748,7 +748,7 @@ typedef uint_least32_t uint_fast32_t; #define DECL(us,bits) glue3(DECL,us,) (bits)
#define TESTUMAX(bits) glue3(u,bits,=) glue3(~,u,bits); if (glue3(UINT,bits,_MAX) glue3(!=,u,bits)) printf ("Something wrong with UINT%d_MAX\n", bits)
-
+
int main () {
DECL(I,8)
DECL(U,8)
@@ -765,7 +765,7 @@ int main () { char str0[256], str1[256];
sprintf (str0, "%d %x\n", 0, ~0);
-
+
sprintf (str1, "%d %x\n", i8, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with i8 : %s\n", str1);
sprintf (str1, "%u %x\n", u8, ~0);
@@ -773,20 +773,20 @@ int main () { sprintf (str1, "%d %x\n", i16, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with i16 : %s\n", str1);
sprintf (str1, "%u %x\n", u16, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with u16 : %s\n", str1);
+ if (0 != strcmp (str0, str1)) printf ("Something wrong with u16 : %s\n", str1);
sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with i32 : %s\n", str1);
sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with u32 : %s\n", str1);
-#ifdef INT64_MAX
+#ifdef INT64_MAX
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with i64 : %s\n", str1);
#endif
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with imax : %s\n", str1);
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
- if (0 != strcmp (str0, str1)) printf ("Something wrong with umax : %s\n", str1);
-
+ if (0 != strcmp (str0, str1)) printf ("Something wrong with umax : %s\n", str1);
+
TESTUMAX(8);
TESTUMAX(16);
TESTUMAX(32);
|