Merge "Bug 3330205 Thread safe strptime implementation"
diff --git a/libc/arch-x86/include/endian.h b/libc/arch-x86/include/endian.h
index ad37919..4a70536 100644
--- a/libc/arch-x86/include/endian.h
+++ b/libc/arch-x86/include/endian.h
@@ -31,14 +31,14 @@
 
 #if defined(_KERNEL) && !defined(I386_CPU)
 #define	__swap32md(x) ({						\
-	u_int32_t __swap32md_x = (x);					\
+	uint32_t __swap32md_x = (x);					\
 									\
 	__asm ("bswap %1" : "+r" (__swap32md_x));			\
 	__swap32md_x;							\
 })
 #else
 #define	__swap32md(x) ({						\
-	u_int32_t __swap32md_x = (x);					\
+	uint32_t __swap32md_x = (x);					\
 									\
 	__asm ("rorw $8, %w1; rorl $16, %1; rorw $8, %w1" :		\
 	    "+r" (__swap32md_x));					\
@@ -47,13 +47,13 @@
 #endif	/* _KERNEL && !I386_CPU */
 
 #define	__swap64md(x) ({						\
-	u_int64_t __swap64md_x = (x);					\
+	uint64_t __swap64md_x = (x);					\
 									\
-	(u_int64_t)__swap32md(__swap64md_x >> 32) |			\
-	    (u_int64_t)__swap32md(__swap64md_x & 0xffffffff) << 32;	\
+	(uint64_t)__swap32md(__swap64md_x >> 32) |			\
+	    (uint64_t)__swap32md(__swap64md_x & 0xffffffff) << 32;	\
 })
 #define	__swap16md(x) ({						\
-	u_int16_t __swap16md_x = (x);					\
+	uint16_t __swap16md_x = (x);					\
 									\
 	__asm ("rorw $8, %w1" : "+r" (__swap16md_x));			\
 	__swap16md_x;							\
diff --git a/libc/arch-x86/include/machine/_types.h b/libc/arch-x86/include/machine/_types.h
index be4f6e4..e9280a5 100644
--- a/libc/arch-x86/include/machine/_types.h
+++ b/libc/arch-x86/include/machine/_types.h
@@ -36,8 +36,8 @@
 #define _I386__TYPES_H_
 
 /* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */
-#ifndef _SIZE_T
-#  define _SIZE_T
+#ifndef _SIZE_T_DEFINED_
+#  define _SIZE_T_DEFINED_
 #  ifdef ANDROID
      typedef unsigned int  size_t;
 #  else
@@ -54,9 +54,6 @@
 typedef long           ptrdiff_t;
 #endif
 
-#define _OFF_T_DEFINED_
-#define _SIZE_T_DEFINED_
-
 #include <linux/types.h>
 
 /* 7.18.1.1 Exact-width integer types */
diff --git a/libc/bionic/md5.c b/libc/bionic/md5.c
index 087786f..1117c3b 100644
--- a/libc/bionic/md5.c
+++ b/libc/bionic/md5.c
@@ -237,7 +237,7 @@
 void
 MD5_Final (void *res, struct md5 *m)
 {
-  static unsigned char zeros[72];
+  unsigned char zeros[72];
   unsigned offset = (m->sz[0] / 8) % 64;
   unsigned int dstart = (120 - offset - 1) % 64 + 1;
 
diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c
index 2ce0361..5c52127 100644
--- a/libc/stdio/vfprintf.c
+++ b/libc/stdio/vfprintf.c
@@ -1219,7 +1219,6 @@
 {
 	int mode, dsgn;
 	char *digits, *bp, *rve;
-	static  char  temp[64];
 
 	if (ch == 'f') {
 		mode = 3;		/* ndigits after the decimal point */