Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 2208 → Rev 2209

/trunk/uspace/kbd/generic/key_buffer.c
111,4 → 111,3
/**
* @}
*/
 
/trunk/uspace/libc/include/async.h
122,6 → 122,7
{
psthread_inc_sercount();
}
 
static inline void async_serialize_end(void)
{
psthread_dec_sercount();
/trunk/uspace/libc/generic/io/printf.c
56,5 → 56,3
 
/** @}
*/
/trunk/uspace/libc/generic/io/io.c
37,15 → 37,14
#include <stdio.h>
#include <io/io.h>
 
static char nl = '\n';
const static char nl = '\n';
 
int puts(const char * str)
{
size_t count;
if (str == NULL) {
if (str == NULL)
return putnchars("(NULL)",6 );
}
for (count = 0; str[count] != 0; count++);
if (write(1, (void * ) str, count) == count) {
63,9 → 62,8
*/
int putnchars(const char * buf, size_t count)
{
if (write(1, (void * ) buf, count) == count) {
if (write(1, (void *) buf, count) == count)
return 0;
}
return EOF;
}
77,14 → 75,12
{
size_t count;
if (str == NULL) {
if (str == NULL)
return putnchars("(NULL)",6 );
}
 
for (count = 0; str[count] != 0; count++);
if (write(1, (void * ) str, count) == count) {
if (write(1, (void *) str, count) == count)
return 0;
}
return EOF;
}
92,9 → 88,8
int putchar(int c)
{
unsigned char ch = c;
if (write(1, (void *)&ch , 1) == 1) {
if (write(1, (void *) &ch, 1) == 1)
return c;
}
return EOF;
}
102,9 → 97,8
int getchar(void)
{
unsigned char c;
if (read(0, (void *)&c , 1) == 1) {
if (read(0, (void *) &c, 1) == 1)
return c;
}
return EOF;
}
/trunk/uspace/libc/generic/io/vprintf.c
36,10 → 36,11
#include <stdio.h>
#include <unistd.h>
#include <io/printf_core.h>
#include <futex.h>
 
int vprintf_write(const char *str, size_t count, void *unused);
atomic_t printf_futex = FUTEX_INITIALIZER;
 
int vprintf_write(const char *str, size_t count, void *unused)
static int vprintf_write(const char *str, size_t count, void *unused)
{
return write(1, str, count);
}
52,8 → 53,12
int vprintf(const char *fmt, va_list ap)
{
struct printf_spec ps = {(int(*)(void *, size_t, void *))vprintf_write, NULL};
return printf_core(fmt, &ps, ap);
 
futex_down(&printf_futex);
int ret = printf_core(fmt, &ps, ap);
futex_up(&printf_futex);
return ret;
}
 
/** @}
/trunk/uspace/libc/generic/io/vsnprintf.c
43,8 → 43,6
char *string; /* destination string */
};
 
int vsnprintf_write(const char *str, size_t count, struct vsnprintf_data *data);
 
/** Write string to given buffer.
* Write at most data->size characters including trailing zero. According to C99 has snprintf to return number
* of characters that would have been written if enough space had been available. Hence the return value is not
55,7 → 53,7
* @param data structure with destination string, counter of used space and total string size.
* @return number of characters to print (not characters really printed!)
*/
int vsnprintf_write(const char *str, size_t count, struct vsnprintf_data *data)
static int vsnprintf_write(const char *str, size_t count, struct vsnprintf_data *data)
{
size_t i;
i = data->size - data->len;
/trunk/uspace/libc/generic/io/printf_core.c
40,8 → 40,6
#include <io/printf_core.h>
#include <ctype.h>
#include <string.h>
/* For serialization */
#include <async.h>
 
#define __PRINTF_FLAG_PREFIX 0x00000001 /**< show prefixes 0x or 0*/
#define __PRINTF_FLAG_SIGNED 0x00000002 /**< signed / unsigned number */
92,15 → 90,13
{
size_t count;
if (str == NULL) {
if (str == NULL)
return printf_putnchars("(NULL)", 6, ps);
}
 
for (count = 0; str[count] != 0; count++);
 
if (ps->write((void *) str, count, ps->data) == count) {
if (ps->write((void *) str, count, ps->data) == count)
return 0;
}
return EOF;
}
447,9 → 443,6
int width, precision;
uint64_t flags;
/* Don't let other threads interfere */
async_serialize_start();
 
counter = 0;
while ((c = fmt[i])) {
681,10 → 674,8
counter += retval;
}
async_serialize_end();
return counter;
minus_out:
async_serialize_end();
return -counter;
}