Commit d62ca2bb9be6d6af2c0cbda47a6d7e51548060bf

Authored by bellard
1 parent 46152182

removed unused code


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2072 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 1 additions and 198 deletions
... ... @@ -112,13 +112,6 @@ __asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; int $0x80 ; p
112 112 return __res; \
113 113 }
114 114  
115   -int qemu_write(int fd, const void *buf, size_t n)
116   -{
117   - QEMU_SYSCALL3(write, fd, buf, n);
118   -}
119   -
120   -
121   -
122 115 /****************************************************************/
123 116 /* shmat replacement */
124 117  
... ... @@ -284,16 +277,6 @@ void *get_mmap_addr(unsigned long size)
284 277 #include <malloc.h>
285 278 #endif
286 279  
287   -int qemu_write(int fd, const void *buf, size_t n)
288   -{
289   - int ret;
290   - ret = write(fd, buf, n);
291   - if (ret < 0)
292   - return -errno;
293   - else
294   - return ret;
295   -}
296   -
297 280 void *get_mmap_addr(unsigned long size)
298 281 {
299 282 return NULL;
... ... @@ -462,181 +445,3 @@ char *qemu_strdup(const char *str)
462 445 strcpy(ptr, str);
463 446 return ptr;
464 447 }
465   -
466   -/****************************************************************/
467   -/* printf support */
468   -
469   -static inline int qemu_isdigit(int c)
470   -{
471   - return c >= '0' && c <= '9';
472   -}
473   -
474   -#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0)
475   -
476   -/* from BSD ppp sources */
477   -int qemu_vsnprintf(char *buf, int buflen, const char *fmt, va_list args)
478   -{
479   - int c, i, n;
480   - int width, prec, fillch;
481   - int base, len, neg;
482   - unsigned long val = 0;
483   - const char *f;
484   - char *str, *buf0;
485   - char num[32];
486   - static const char hexchars[] = "0123456789abcdef";
487   -
488   - buf0 = buf;
489   - --buflen;
490   - while (buflen > 0) {
491   - for (f = fmt; *f != '%' && *f != 0; ++f)
492   - ;
493   - if (f > fmt) {
494   - len = f - fmt;
495   - if (len > buflen)
496   - len = buflen;
497   - memcpy(buf, fmt, len);
498   - buf += len;
499   - buflen -= len;
500   - fmt = f;
501   - }
502   - if (*fmt == 0)
503   - break;
504   - c = *++fmt;
505   - width = prec = 0;
506   - fillch = ' ';
507   - if (c == '0') {
508   - fillch = '0';
509   - c = *++fmt;
510   - }
511   - if (c == '*') {
512   - width = va_arg(args, int);
513   - c = *++fmt;
514   - } else {
515   - while (qemu_isdigit(c)) {
516   - width = width * 10 + c - '0';
517   - c = *++fmt;
518   - }
519   - }
520   - if (c == '.') {
521   - c = *++fmt;
522   - if (c == '*') {
523   - prec = va_arg(args, int);
524   - c = *++fmt;
525   - } else {
526   - while (qemu_isdigit(c)) {
527   - prec = prec * 10 + c - '0';
528   - c = *++fmt;
529   - }
530   - }
531   - }
532   - /* modifiers */
533   - switch(c) {
534   - case 'l':
535   - c = *++fmt;
536   - break;
537   - default:
538   - break;
539   - }
540   - str = 0;
541   - base = 0;
542   - neg = 0;
543   - ++fmt;
544   - switch (c) {
545   - case 'd':
546   - i = va_arg(args, int);
547   - if (i < 0) {
548   - neg = 1;
549   - val = -i;
550   - } else
551   - val = i;
552   - base = 10;
553   - break;
554   - case 'o':
555   - val = va_arg(args, unsigned int);
556   - base = 8;
557   - break;
558   - case 'x':
559   - case 'X':
560   - val = va_arg(args, unsigned int);
561   - base = 16;
562   - break;
563   - case 'p':
564   - val = (unsigned long) va_arg(args, void *);
565   - base = 16;
566   - neg = 2;
567   - break;
568   - case 's':
569   - str = va_arg(args, char *);
570   - break;
571   - case 'c':
572   - num[0] = va_arg(args, int);
573   - num[1] = 0;
574   - str = num;
575   - break;
576   - default:
577   - *buf++ = '%';
578   - if (c != '%')
579   - --fmt; /* so %z outputs %z etc. */
580   - --buflen;
581   - continue;
582   - }
583   - if (base != 0) {
584   - str = num + sizeof(num);
585   - *--str = 0;
586   - while (str > num + neg) {
587   - *--str = hexchars[val % base];
588   - val = val / base;
589   - if (--prec <= 0 && val == 0)
590   - break;
591   - }
592   - switch (neg) {
593   - case 1:
594   - *--str = '-';
595   - break;
596   - case 2:
597   - *--str = 'x';
598   - *--str = '0';
599   - break;
600   - }
601   - len = num + sizeof(num) - 1 - str;
602   - } else {
603   - len = strlen(str);
604   - if (prec > 0 && len > prec)
605   - len = prec;
606   - }
607   - if (width > 0) {
608   - if (width > buflen)
609   - width = buflen;
610   - if ((n = width - len) > 0) {
611   - buflen -= n;
612   - for (; n > 0; --n)
613   - *buf++ = fillch;
614   - }
615   - }
616   - if (len > buflen)
617   - len = buflen;
618   - memcpy(buf, str, len);
619   - buf += len;
620   - buflen -= len;
621   - }
622   - *buf = 0;
623   - return buf - buf0;
624   -}
625   -
626   -void qemu_vprintf(const char *fmt, va_list ap)
627   -{
628   - char buf[1024];
629   - int len;
630   -
631   - len = qemu_vsnprintf(buf, sizeof(buf), fmt, ap);
632   - qemu_write(1, buf, len);
633   -}
634   -
635   -void qemu_printf(const char *fmt, ...)
636   -{
637   - va_list ap;
638   - va_start(ap, fmt);
639   - qemu_vprintf(fmt, ap);
640   - va_end(ap);
641   -}
642   -
... ...
... ... @@ -3,9 +3,7 @@
3 3  
4 4 #include <stdarg.h>
5 5  
6   -int qemu_vsnprintf(char *buf, int buflen, const char *fmt, va_list args);
7   -void qemu_vprintf(const char *fmt, va_list ap);
8   -void qemu_printf(const char *fmt, ...);
  6 +#define qemu_printf printf
9 7  
10 8 void *qemu_malloc(size_t size);
11 9 void *qemu_mallocz(size_t size);
... ...