Print this page
Cstyle cleanup


2719         char *e = NULL;
2720 
2721         switch (first[0]) {
2722         case 'f':
2723                 e = conv.f.buf;
2724                 break;
2725         case 'd':
2726                 e = conv.d.buf;
2727                 break;
2728         case 'e':
2729                 e = conv.ld.buf;
2730                 break;
2731         }
2732         last = first + fd->mangled_size + 1;
2733 
2734 #if defined(_BIG_ENDIAN)
2735         for (t = first + 1; t != last; t++, e++) {
2736                 if (!is_xdigit(t[0]))
2737                         return (first);
2738 
2739                 unsigned d1 = isdigit_l(t[0], db->cpp_loc) ? t[0] - '0' : t[0] - 'a' + 10;

2740                 t++;
2741                 unsigned d0 = isdigit_l(t[0], db->cpp_loc) ? t[0] - '0' : t[0] - 'a' + 10;

2742 
2743                 *e = (d1 << 4) + d0;
2744         }
2745 #elif defined(_LITTLE_ENDIAN)
2746         for (t = last - 1; t > first; t--, e++) {
2747                 if (!is_xdigit(t[0]))
2748                         return (first);
2749 
2750                 unsigned d0 = isdigit_l(t[0], db->cpp_loc) ? t[0] - '0' : t[0] - 'a' + 10;

2751                 t--;
2752                 unsigned d1 = isdigit_l(t[0], db->cpp_loc) ? t[0] - '0' : t[0] - 'a' + 10;

2753 
2754                 *e = (d1 << 4) + d0;
2755         }
2756         t = last;
2757 #else
2758 #error One of _BIG_ENDIAN or _LITTLE_ENDIAN must be defined
2759 #endif
2760 
2761         if (t[0] != 'E')
2762                 return (first);
2763 
2764         str_t num = { 0 };
2765         str_init(&num, db->cpp_ops);
2766 
2767         num.str_size = fd->max_demangled_size + 1;
2768         num.str_s = zalloc(db->cpp_ops, num.str_size);
2769         CK(num.str_s != NULL);
2770 
2771         int n = 0;
2772 




2719         char *e = NULL;
2720 
2721         switch (first[0]) {
2722         case 'f':
2723                 e = conv.f.buf;
2724                 break;
2725         case 'd':
2726                 e = conv.d.buf;
2727                 break;
2728         case 'e':
2729                 e = conv.ld.buf;
2730                 break;
2731         }
2732         last = first + fd->mangled_size + 1;
2733 
2734 #if defined(_BIG_ENDIAN)
2735         for (t = first + 1; t != last; t++, e++) {
2736                 if (!is_xdigit(t[0]))
2737                         return (first);
2738 
2739                 unsigned d1 = isdigit_l(t[0], db->cpp_loc) ?
2740                     t[0] - '0' : t[0] - 'a' + 10;
2741                 t++;
2742                 unsigned d0 = isdigit_l(t[0], db->cpp_loc) ?
2743                     t[0] - '0' : t[0] - 'a' + 10;
2744 
2745                 *e = (d1 << 4) + d0;
2746         }
2747 #elif defined(_LITTLE_ENDIAN)
2748         for (t = last - 1; t > first; t--, e++) {
2749                 if (!is_xdigit(t[0]))
2750                         return (first);
2751 
2752                 unsigned d0 = isdigit_l(t[0], db->cpp_loc) ?
2753                     t[0] - '0' : t[0] - 'a' + 10;
2754                 t--;
2755                 unsigned d1 = isdigit_l(t[0], db->cpp_loc) ?
2756                     t[0] - '0' : t[0] - 'a' + 10;
2757 
2758                 *e = (d1 << 4) + d0;
2759         }
2760         t = last;
2761 #else
2762 #error One of _BIG_ENDIAN or _LITTLE_ENDIAN must be defined
2763 #endif
2764 
2765         if (t[0] != 'E')
2766                 return (first);
2767 
2768         str_t num = { 0 };
2769         str_init(&num, db->cpp_ops);
2770 
2771         num.str_size = fd->max_demangled_size + 1;
2772         num.str_s = zalloc(db->cpp_ops, num.str_size);
2773         CK(num.str_s != NULL);
2774 
2775         int n = 0;
2776