Loading...
--- Libc/Libc-1725.40.4/stdio/FreeBSD/vfprintf.c
+++ Libc/Libc-1244.20.1/stdio/FreeBSD/vfprintf.c
@@ -30,14 +30,6 @@
* SUCH DAMAGE.
*/
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wint-conversion"
-
-#include <TargetConditionals.h>
-#if !TARGET_OS_DRIVERKIT
-#define OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE 1
-#endif
-
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
@@ -74,13 +66,12 @@
#include <os/assumes.h>
#include <mach-o/dyld_priv.h>
-#include <mach/mach.h>
+#include <mach/vm_region.h>
#include "libc_private.h"
#include "local.h"
#include "fvwrite.h"
#include "printflocal.h"
-#include "libc_hooks_impl.h"
static int __sprint(FILE *, locale_t, struct __suio *);
#if 0
@@ -292,8 +283,6 @@
{
int ret;
- libc_hooks_will_write(fp, sizeof(*fp));
-
FLOCKFILE(fp);
ret = __xvprintf(XPRINTF_PLAIN, NULL, fp, loc, fmt0, ap);
FUNLOCKFILE(fp);
@@ -305,8 +294,6 @@
{
int ret;
-
- libc_hooks_will_write(fp, sizeof(*fp));
FLOCKFILE(fp);
ret = __xvprintf(XPRINTF_PLAIN, NULL, fp, __current_locale(), fmt0, ap);
@@ -881,31 +868,26 @@
static_format_checked = __printf_is_memory_read_only((void*)fmt0, strlen(fmt0));
}
if (!static_format_checked) {
-#if OS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE
- os_crash("%%n used in a non-immutable format string: %s", fmt0);
-#else
- os_crash("%%n used in a non-immutable format string");
-#endif
+ os_crash("%n used in a non-immutable format string");
}
#endif // ALLOW_DYNAMIC_PERCENT_N
- if (flags & LLONGINT) {
- LIBC_HOOKS_WRITE_SIMPLE_TYPE(ptr, long long, ret);
- } else if (flags & SIZET) {
- LIBC_HOOKS_WRITE_SIMPLE_TYPE(ptr, ssize_t, ret);
- } else if (flags & PTRDIFFT) {
- LIBC_HOOKS_WRITE_SIMPLE_TYPE(ptr, ptrdiff_t, ret);
- } else if (flags & INTMAXT) {
- LIBC_HOOKS_WRITE_SIMPLE_TYPE(ptr, intmax_t, ret);
- } else if (flags & LONGINT) {
- LIBC_HOOKS_WRITE_SIMPLE_TYPE(ptr, long, ret);
- } else if (flags & SHORTINT) {
- LIBC_HOOKS_WRITE_SIMPLE_TYPE(ptr, short, ret);
- } else if (flags & CHARINT) {
- LIBC_HOOKS_WRITE_SIMPLE_TYPE(ptr, signed char, ret);
- } else {
- LIBC_HOOKS_WRITE_SIMPLE_TYPE(ptr, int, ret);
- }
+ if (flags & LLONGINT)
+ *(long long *)ptr = ret;
+ else if (flags & SIZET)
+ *(ssize_t *)ptr = (ssize_t)ret;
+ else if (flags & PTRDIFFT)
+ *(ptrdiff_t *)ptr = ret;
+ else if (flags & INTMAXT)
+ *(intmax_t *)ptr = ret;
+ else if (flags & LONGINT)
+ *(long *)ptr = ret;
+ else if (flags & SHORTINT)
+ *(short *)ptr = ret;
+ else if (flags & CHARINT)
+ *(signed char *)ptr = ret;
+ else
+ *(int *)ptr = ret;
continue; /* no output */
}
case 'O':
@@ -969,7 +951,6 @@
ret = EOF;
goto error;
}
- libc_hooks_will_read(cp, size);
}
sign = '\0';
break;
@@ -1465,4 +1446,4 @@
return (ret < 0 || ret >= INT_MAX) ? -1 : (int)ret;
/* NOTREACHED */
}
-#pragma clang diagnostic pop
+