Skip to content

Commit 7109bbb

Browse files
committed
restore (null) printing
1 parent d94a7ea commit 7109bbb

1 file changed

Lines changed: 64 additions & 16 deletions

File tree

dka64/patches/newlib-3.0.0.patch

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7120,10 +7120,10 @@ index eb645868b..d536e0daa 100644
71207120
syscall_dir=syscalls
71217121
;;
71227122
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h
7123-
index cbc0fa989..8fb71e6f5 100644
7123+
index cbc0fa989..5326f7259 100644
71247124
--- a/newlib/libc/include/stdio.h
71257125
+++ b/newlib/libc/include/stdio.h
7126-
@@ -227,7 +227,7 @@ int fgetpos (FILE *, _fpos_t *);
7126+
@@ -227,13 +227,13 @@ int fgetpos (FILE *, _fpos_t *);
71277127
#else
71287128
int fgetpos (FILE *__restrict, fpos_t *__restrict);
71297129
#endif
@@ -7132,15 +7132,25 @@ index cbc0fa989..8fb71e6f5 100644
71327132
#ifdef _COMPILING_NEWLIB
71337133
int fsetpos (FILE *, const _fpos_t *);
71347134
#else
7135-
@@ -438,7 +438,7 @@ size_t _fread_r (struct _reent *, void *__restrict, size_t _size, size_t _n, FIL
7135+
int fsetpos (FILE *, const fpos_t *);
7136+
#endif
7137+
-long ftell ( FILE *);
7138+
+off_t ftell ( FILE *);
7139+
void rewind (FILE *);
7140+
void clearerr (FILE *);
7141+
int feof (FILE *);
7142+
@@ -438,9 +438,9 @@ size_t _fread_r (struct _reent *, void *__restrict, size_t _size, size_t _n, FIL
71367143
size_t _fread_unlocked_r (struct _reent *, void *__restrict, size_t _size, size_t _n, FILE *__restrict);
71377144
int _fscanf_r (struct _reent *, FILE *__restrict, const char *__restrict, ...)
71387145
_ATTRIBUTE ((__format__ (__scanf__, 3, 4)));
71397146
-int _fseek_r (struct _reent *, FILE *, long, int);
71407147
+int _fseek_r (struct _reent *, FILE *, off_t, int);
71417148
int _fseeko_r (struct _reent *, FILE *, _off_t, int);
7142-
long _ftell_r (struct _reent *, FILE *);
7149+
-long _ftell_r (struct _reent *, FILE *);
7150+
+off_t _ftell_r (struct _reent *, FILE *);
71437151
_off_t _ftello_r (struct _reent *, FILE *);
7152+
void _rewind_r (struct _reent *, FILE *);
7153+
size_t _fwrite_r (struct _reent *, const void *__restrict, size_t _size, size_t _n, FILE *__restrict);
71447154
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
71457155
index 2082dfdb1..e535f189b 100644
71467156
--- a/newlib/libc/include/sys/config.h
@@ -7753,7 +7763,7 @@ index 000000000..4eb278e2f
77537763
+
77547764
+#endif /* _NEWLIB_STDIO_H */
77557765
diff --git a/newlib/libc/reent/getreent.c b/newlib/libc/reent/getreent.c
7756-
index 5fa98e96b..21029bbd1 100644
7766+
index 5fa98e96b..ef8a15e1b 100644
77577767
--- a/newlib/libc/reent/getreent.c
77587768
+++ b/newlib/libc/reent/getreent.c
77597769
@@ -1,3 +1,4 @@
@@ -7766,19 +7776,21 @@ index 5fa98e96b..21029bbd1 100644
77667776

77677777
#endif
77687778
+#endif
7779+
\ No newline at end of file
77697780
diff --git a/newlib/libc/reent/gettimeofdayr.c b/newlib/libc/reent/gettimeofdayr.c
7770-
index 9b982a993..4c69dca4c 100644
7781+
index 9b982a993..8c0aaac8c 100644
77717782
--- a/newlib/libc/reent/gettimeofdayr.c
77727783
+++ b/newlib/libc/reent/gettimeofdayr.c
7773-
@@ -51,6 +51,7 @@ DESCRIPTION
7784+
@@ -51,7 +51,7 @@ DESCRIPTION
77747785
Check libc.a to see if its available on yours.
77757786
*/
77767787

7777-
+/*
7778-
int
7788+
-int
7789+
+/*int
77797790
_gettimeofday_r (struct _reent *ptr,
77807791
struct timeval *ptimeval,
7781-
@@ -63,5 +64,5 @@ _gettimeofday_r (struct _reent *ptr,
7792+
void *ptimezone)
7793+
@@ -63,5 +63,5 @@ _gettimeofday_r (struct _reent *ptr,
77827794
ptr->_errno = errno;
77837795
return ret;
77847796
}
@@ -7833,7 +7845,7 @@ index b358d2b4a..29cec0229 100644
78337845
/* no more input: return partial result */
78347846
#ifdef __SCLE
78357847
diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c
7836-
index 9b3ea986c..47c1d92d6 100644
7848+
index 9b3ea986c..7c633e11f 100644
78377849
--- a/newlib/libc/stdio/fseek.c
78387850
+++ b/newlib/libc/stdio/fseek.c
78397851
@@ -83,7 +83,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
@@ -7845,7 +7857,7 @@ index 9b3ea986c..47c1d92d6 100644
78457857
int whence)
78467858
{
78477859
return _fseeko_r (ptr, fp, offset, whence);
7848-
@@ -93,10 +93,11 @@ _fseek_r (struct _reent *ptr,
7860+
@@ -93,7 +93,7 @@ _fseek_r (struct _reent *ptr,
78497861

78507862
int
78517863
fseek (register FILE *fp,
@@ -7854,12 +7866,30 @@ index 9b3ea986c..47c1d92d6 100644
78547866
int whence)
78557867
{
78567868
return _fseek_r (_REENT, fp, offset, whence);
7857-
}
7869+
diff --git a/newlib/libc/stdio/ftell.c b/newlib/libc/stdio/ftell.c
7870+
index e4a246199..f73baab68 100644
7871+
--- a/newlib/libc/stdio/ftell.c
7872+
+++ b/newlib/libc/stdio/ftell.c
7873+
@@ -82,7 +82,7 @@ static char sccsid[] = "%W% (Berkeley) %G%";
7874+
#include <errno.h>
7875+
#include "local.h"
78587876

7859-
+
7860-
#endif /* !_REENT_ONLY */
7877+
-long
7878+
+off_t
7879+
_ftell_r (struct _reent *ptr,
7880+
register FILE * fp)
7881+
{
7882+
@@ -99,7 +99,7 @@ _ftell_r (struct _reent *ptr,
7883+
7884+
#ifndef _REENT_ONLY
7885+
7886+
-long
7887+
+off_t
7888+
ftell (register FILE * fp)
7889+
{
7890+
return _ftell_r (_REENT, fp);
78617891
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
7862-
index c4bf2dbe3..df8b7eace 100644
7892+
index c4bf2dbe3..d756df37d 100644
78637893
--- a/newlib/libc/stdio/vfprintf.c
78647894
+++ b/newlib/libc/stdio/vfprintf.c
78657895
@@ -112,6 +112,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
@@ -7871,6 +7901,24 @@ index c4bf2dbe3..df8b7eace 100644
78717901
#if defined(LIBC_SCCS) && !defined(lint)
78727902
/*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/
78737903
static char *rcsid = "$Id$";
7904+
@@ -1438,7 +1440,7 @@ reswitch: switch (ch) {
7905+
string:
7906+
#endif
7907+
sign = '\0';
7908+
-#ifndef __OPTIMIZE_SIZE__
7909+
+//#ifndef __OPTIMIZE_SIZE__
7910+
/* Behavior is undefined if the user passed a
7911+
NULL string when precision is not 0.
7912+
However, if we are not optimizing for size,
7913+
@@ -1448,7 +1450,7 @@ string:
7914+
size = ((unsigned) prec > 6U) ? 6 : prec;
7915+
}
7916+
else
7917+
-#endif /* __OPTIMIZE_SIZE__ */
7918+
+//#endif /* __OPTIMIZE_SIZE__ */
7919+
#ifdef _MB_CAPABLE
7920+
if (ch == 'S' || (flags & LONGINT)) {
7921+
mbstate_t ps;
78747922
diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c
78757923
index b97235559..298f68a9c 100644
78767924
--- a/newlib/libc/stdio/vfscanf.c

0 commit comments

Comments
 (0)