Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4241 → Rev 4245

/trunk/uspace/lib/libc/include/string.h
40,6 → 40,7
#include <bool.h>
 
#define U_SPECIAL '?'
#define U_BOM 0xfeff
 
/**< No size limit constant */
#define STR_NO_LIMIT ((size_t) -1)
/trunk/uspace/lib/libc/Makefile.toolchain
26,10 → 26,10
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration\
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32 -finput-charset=UTF-8\
-Wmissing-prototypes -O3 -nostdlib -nostdinc -imacros\
$(LIBC_PREFIX)/../../../config.h -I$(LIBC_PREFIX)/include -pipe -g
CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration \
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32 -finput-charset=UTF-8 \
-Wmissing-prototypes -O3 -nostdlib -nostdinc -imacros \
$(LIBC_PREFIX)/../../../config.h -I$(LIBC_PREFIX)/include -pipe -g
LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a
AFLAGS =
 
/trunk/uspace/lib/libc/generic/io/printf_core.c
248,7 → 248,7
* @return Number of characters printed, negative value on failure.
*/
static int print_str(char *str, int width, unsigned int precision,
uint32_t flags, printf_spec_t *ps)
uint32_t flags, printf_spec_t *ps)
{
if (str == NULL)
return printf_putstr(nullstr, ps);
296,16 → 296,19
* @return Number of wide characters printed, negative value on failure.
*/
static int print_wstr(wchar_t *str, int width, unsigned int precision,
uint32_t flags, printf_spec_t *ps)
uint32_t flags, printf_spec_t *ps)
{
if (str == NULL)
return printf_putstr(nullstr, ps);
 
if (*str == U_BOM)
str++;
/* Print leading spaces. */
size_t strw = wstr_length(str);
if (precision == 0)
precision = strw;
 
/* Left padding */
count_t counter = 0;
width -= precision;
315,15 → 318,15
counter++;
}
}
 
/* Part of @a wstr fitting into the alloted space. */
int retval;
size_t size = wstr_lsize(str, precision);
if ((retval = printf_wputnchars(str, size, ps)) < 0)
return -counter;
 
counter += retval;
 
/* Right padding */
while (width-- > 0) {
if (printf_putchar(' ', ps) == 1)