@ -1,149 +0,0 @@ |
|||
Index: ./lib/__v_printf.c
|
|||
===================================================================
|
|||
RCS file: /cvs/dietlibc/lib/__v_printf.c,v |
|||
retrieving revision 1.33 |
|||
retrieving revision 1.35 |
|||
diff -u -r1.33 -r1.35
|
|||
--- ./lib/__v_printf.c 10 Jan 2007 22:51:09 -0000 1.33
|
|||
+++ ./lib/__v_printf.c 17 May 2007 05:00:42 -0000 1.35
|
|||
@@ -19,9 +19,9 @@
|
|||
#define B_WRITE(fn,buf,sz) { if ((unsigned long)(sz) > (((unsigned long)(int)(-1))>>1) || len+(int)(sz)<len) return -1; A_WRITE(fn,buf,sz); } while (0) |
|||
|
|||
static const char pad_line[2][16]= { " ", "0000000000000000", }; |
|||
-static int write_pad(int* dlen,struct arg_printf* fn, int len, int padwith) {
|
|||
+static int write_pad(unsigned int* dlen,struct arg_printf* fn, unsigned int len, int padwith) {
|
|||
int nr=0; |
|||
- if (len<0 || *dlen+len<len) return -1;
|
|||
+ if ((int)len<0 || *dlen+len<len) return -1;
|
|||
for (;len>15;len-=16,nr+=16) { |
|||
A_WRITE(fn,pad_line[(padwith=='0')?1:0],16); |
|||
} |
|||
@@ -34,7 +34,7 @@
|
|||
|
|||
int __v_printf(struct arg_printf* fn, const char *format, va_list arg_ptr) |
|||
{ |
|||
- int len=0;
|
|||
+ unsigned int len=0;
|
|||
#ifdef WANT_ERROR_PRINTF |
|||
int _errno = errno; |
|||
#endif |
|||
@@ -51,7 +51,7 @@
|
|||
#define s u_str.s |
|||
|
|||
int retval; |
|||
- unsigned char ch, padwith=' ';
|
|||
+ unsigned char ch, padwith=' ', precpadwith=' ';
|
|||
|
|||
char flag_in_sign=0; |
|||
char flag_upcase=0; |
|||
@@ -172,7 +172,7 @@
|
|||
if (flag_dot && sz>preci) sz=preci; |
|||
preci=0; |
|||
flag_dot^=flag_dot; |
|||
- padwith=' ';
|
|||
+ padwith=precpadwith=' ';
|
|||
|
|||
print_out: |
|||
{ |
|||
@@ -192,46 +192,46 @@
|
|||
sz-=todo; |
|||
width-=todo; |
|||
} |
|||
-
|
|||
- if (!flag_left) {
|
|||
- if (flag_dot) {
|
|||
- vs=preci>sz?preci:sz;
|
|||
- if (write_pad(&len,fn,(signed int)width-(signed int)vs,' '))
|
|||
- return -1;
|
|||
- if (todo) {
|
|||
- B_WRITE(fn,sign,todo);
|
|||
- len+=todo;
|
|||
- }
|
|||
- if (write_pad(&len,fn,(signed int)preci-(signed int)sz,'0'))
|
|||
- return -1;
|
|||
- } else {
|
|||
- if (todo && padwith=='0') {
|
|||
- B_WRITE(fn,sign,todo);
|
|||
- len+=todo; todo=0;
|
|||
- }
|
|||
- if (write_pad(&len,fn,(signed int)width-(signed int)sz, padwith))
|
|||
- return -1;
|
|||
- if (todo) {
|
|||
- B_WRITE(fn,sign,todo);
|
|||
- len+=todo;
|
|||
- }
|
|||
- }
|
|||
- B_WRITE(fn,s,sz); len+=sz;
|
|||
- } else if (flag_left) {
|
|||
- if (todo) {
|
|||
- B_WRITE(fn,sign,todo);
|
|||
- len+=todo;
|
|||
- }
|
|||
- if (write_pad(&len,fn,(signed int)preci-(signed int)sz, '0'))
|
|||
+
|
|||
+ /* These are the cases for 1234 or "1234" respectively:
|
|||
+ %.6u -> "001234"
|
|||
+ %6u -> " 1234"
|
|||
+ %06u -> "001234"
|
|||
+ %-6u -> "1234 "
|
|||
+ %.6s -> "1234"
|
|||
+ %6s -> " 1234"
|
|||
+ %06s -> " 1234"
|
|||
+ %-6s -> "1234 "
|
|||
+ %6.5u -> " 01234"
|
|||
+ %6.5s -> " 1234"
|
|||
+ In this code, for %6.5s, 6 is width, 5 is preci.
|
|||
+ flag_dot means there was a '.' and preci is set.
|
|||
+ flag_left means there was a '-'.
|
|||
+ sz is 4 (strlen("1234")).
|
|||
+ padwith will be '0' for %06u, ' ' otherwise.
|
|||
+ precpadwith is '0' for %u, ' ' for %s.
|
|||
+ */
|
|||
+
|
|||
+ if (flag_dot && width==0) width=preci;
|
|||
+ if (!flag_dot) preci=sz;
|
|||
+ if (!flag_left) { /* do left-side padding */
|
|||
+ if (write_pad(&len,fn,width-preci,padwith))
|
|||
return -1; |
|||
- B_WRITE(fn,s,sz); len+=sz;
|
|||
- vs=preci>sz?preci:sz;
|
|||
- if ((signed int)width-(signed int)vs<0) return -1;
|
|||
- if (write_pad(&len,fn,(signed int)width-(signed int)vs, ' '))
|
|||
+ }
|
|||
+ if (todo) {
|
|||
+ B_WRITE(fn,sign,todo);
|
|||
+ len+=todo;
|
|||
+ }
|
|||
+ /* do preci padding */
|
|||
+ if (write_pad(&len,fn,preci-sz,precpadwith))
|
|||
+ return -1;
|
|||
+ /* write actual string */
|
|||
+ B_WRITE(fn,s,sz); len+=sz;
|
|||
+ if (flag_left) {
|
|||
+ if (write_pad(&len,fn,width-preci,padwith))
|
|||
return -1; |
|||
- } else {
|
|||
- B_WRITE(fn,s,sz); len+=sz;
|
|||
} |
|||
+
|
|||
break; |
|||
} |
|||
|
|||
@@ -327,6 +327,8 @@
|
|||
++sz; |
|||
} else flag_in_sign=0; |
|||
|
|||
+ precpadwith='0';
|
|||
+
|
|||
goto print_out; |
|||
|
|||
#ifdef WANT_FLOATING_POINT_IN_PRINTF |
|||
@@ -374,6 +376,8 @@
|
|||
} |
|||
|
|||
sz=strlen(s); |
|||
+ if (width<sz) width=sz;
|
|||
+ padwith='0';
|
|||
flag_dot=0; |
|||
flag_hash=0; |
|||
goto print_out; |
@ -1,8 +1,8 @@ |
|||
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|||
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|||
# |
|||
# Filename: package/.../dietlibc/nfds_t.patch |
|||
# Copyright (C) 2008 The OpenSDE Project |
|||
# Filename: package/.../dietlibc/nfds_t.patch.disabled |
|||
# Copyright (C) 2008 - 2009 The OpenSDE Project |
|||
# |
|||
# More information can be found in the files COPYING and README. |
|||
# |
@ -1,41 +0,0 @@ |
|||
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|||
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|||
# |
|||
# Filename: package/.../dietlibc/wchar.h.patch |
|||
# Copyright (C) 2006 The T2 SDE Project |
|||
# |
|||
# More information can be found in the files COPYING and README. |
|||
# |
|||
# This patch file is dual-licensed. It is available under the license the |
|||
# patched project is licensed under, as long as it is an OpenSource license |
|||
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms |
|||
# of the GNU General Public License as published by the Free Software |
|||
# Foundation; either version 2 of the License, or (at your option) any later |
|||
# version. |
|||
# --- SDE-COPYRIGHT-NOTE-END --- |
|||
|
|||
The wchar.h mostly has prototypes that are not implemented. Configure |
|||
might succeed, but link will fail. |
|||
|
|||
- Rene Rebe <rene@exactcod.de> |
|||
|
|||
--- ./include/wchar.h.vanilla 2006-07-21 23:23:03.000000000 +0200
|
|||
+++ ./include/wchar.h 2006-07-21 23:23:21.000000000 +0200
|
|||
@@ -23,6 +23,8 @@
|
|||
#define WEOF 0xffffffffu |
|||
#endif |
|||
|
|||
+#if 0
|
|||
+
|
|||
struct tm; |
|||
|
|||
typedef struct { |
|||
@@ -94,6 +96,8 @@
|
|||
int wprintf(const wchar_t *__restrict__, ...); |
|||
int wscanf(const wchar_t *__restrict__, ...); |
|||
|
|||
+#endif
|
|||
+
|
|||
__END_DECLS |
|||
|
|||
#endif |