Changeset 55cff86 in mainline
- Timestamp:
- 2006-03-15T12:36:49Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2345061
- Parents:
- d73942c
- Location:
- libc
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/io/io.c
rd73942c r55cff86 68 68 size_t count; 69 69 70 if (str == NULL) { 71 return putnchars("(NULL)",6 ); 72 } 73 70 74 for (count = 0; str[count] != 0; count++); 71 75 if (write(1, (void * ) str, count) == count) { -
libc/generic/io/print.c
rd73942c r55cff86 204 204 break; 205 205 case 'c': 206 if ((retval = putnchars((char *)&va_arg(ap, unsigned long), sizeof(char))) == EOF) { 206 c = va_arg(ap, unsigned long); 207 if ((retval = putnchars(&c, sizeof(char))) == EOF) { 207 208 return -counter; 208 209 }; -
libc/include/stdarg.h
rd73942c r55cff86 30 30 #define __LIBC__STDARG_H__ 31 31 32 #include<types.h> 33 #include<stackarg.h> 34 32 35 #ifndef __VARARGS_DEFINED 33 # define __VARARGS_DEFINED36 # define __VARARGS_DEFINED 34 37 35 /* 36 * Variable argument list manipulation macros 37 * for architectures using stack to pass arguments. 38 */ 39 40 #include <types.h> 38 typedef __builtin_va_list va_list; 41 39 42 typedef struct va_list { 43 int pos; 44 uint8_t *last; 45 } va_list; 40 # define va_start(ap, last) __builtin_va_start(ap, last) 41 # define va_arg(ap, type) __builtin_va_arg(ap, type) 42 # define va_end(ap) __builtin_va_end(ap) 46 43 47 #define va_start(ap, lst) \ 48 (ap).pos = sizeof(lst); \ 49 (ap).last = (uint8_t *) &(lst) 50 51 #define va_arg(ap, type) \ 52 (*((type *)((ap).last + ((ap).pos += sizeof(type) ) - sizeof(type)))) 53 54 #define va_end(ap) 44 # endif 55 45 56 46 #endif 57 58 59 #endif
Note:
See TracChangeset
for help on using the changeset viewer.