home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / stlport / stl / _num_put.c < prev    next >
C/C++ Source or Header  |  2002-02-08  |  19KB  |  551 lines

  1. /*
  2.  * Copyright (c) 1999
  3.  * Silicon Graphics Computer Systems, Inc.
  4.  *
  5.  * Copyright (c) 1999 
  6.  * Boris Fomitchev
  7.  *
  8.  * This material is provided "as is", with absolutely no warranty expressed
  9.  * or implied. Any use is at your own risk.
  10.  *
  11.  * Permission to use or copy this software for any purpose is hereby granted 
  12.  * without fee, provided the above notices are retained on all copies.
  13.  * Permission to modify the code and to distribute modified code is granted,
  14.  * provided the above notices are retained, and a notice that the code was
  15.  * modified is included with the above copyright notice.
  16.  *
  17.  */ 
  18. #ifndef _STLP_NUM_PUT_C
  19. #define _STLP_NUM_PUT_C
  20.  
  21. #ifndef _STLP_INTERNAL_NUM_PUT_H
  22. # include <stl/_num_put.h>
  23. #endif
  24.  
  25. # if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
  26.  
  27. #ifndef _STLP_LIMITS_H
  28. # include <stl/_limits.h>
  29. #endif
  30.  
  31. _STLP_BEGIN_NAMESPACE
  32.  
  33. // _M_do_put_float and its helper functions.  Strategy: write the output
  34. // to a buffer of char, transform the buffer to _CharT, and then copy
  35. // it to the output.
  36.  
  37. template <class _CharT, class _OutputIter,class _Float>
  38. _OutputIter _STLP_CALL
  39. _M_do_put_float(_OutputIter __s, ios_base& __f, _CharT __fill,_Float    __x);
  40.  
  41.  
  42. //----------------------------------------------------------------------
  43. // num_put facet
  44.  
  45. template <class _CharT, class _OutputIter>
  46. _OutputIter  _STLP_CALL
  47. __copy_float_and_fill(const _CharT* __first, const _CharT* __last,
  48.                       _OutputIter __out,
  49.                       ios_base::fmtflags __flags,
  50.                       streamsize __width, _CharT __fill,
  51.                       _CharT __xplus, _CharT __xminus) {
  52.   if (__width <= __last - __first)
  53.     return copy(__first, __last, __out);
  54.   else {
  55.     streamsize __pad = __width - (__last - __first);
  56.     ios_base::fmtflags __dir = __flags & ios_base::adjustfield;
  57.  
  58.     if (__dir == ios_base::left) {
  59.       __out = copy(__first, __last, __out);
  60.       return fill_n(__out, __pad, __fill);
  61.     }
  62.     else if (__dir == ios_base::internal && __first != __last &&
  63.              (*__first == __xplus || *__first == __xminus)) {
  64.       *__out++ = *__first++;
  65.       __out = fill_n(__out, __pad, __fill);
  66.       return copy(__first, __last, __out);
  67.     }
  68.     else {
  69.       __out = fill_n(__out, __pad, __fill);
  70.       return copy(__first, __last, __out);
  71.     }
  72.   }
  73. }
  74.  
  75. #ifndef _STLP_NO_WCHAR_T
  76. // Helper routine for wchar_t
  77. template <class _OutputIter>
  78. _OutputIter  _STLP_CALL
  79. __put_float(char* __ibuf, char* __iend, _OutputIter __out,
  80.             ios_base& __f, wchar_t __fill,
  81.             wchar_t __decimal_point,
  82.             wchar_t __sep, const string& __grouping)
  83. {
  84.   const ctype<wchar_t>& __ct = *(ctype<wchar_t>*)__f._M_ctype_facet() ;
  85.  
  86.   wchar_t __wbuf[128];
  87.   wchar_t* __eend = __convert_float_buffer(__ibuf, __iend, __wbuf,
  88.                                            __ct, __decimal_point);
  89.   if (__grouping.size() != 0) {
  90.     // In order to do separator-insertion only to the left of the
  91.     // decimal point, we adjust the size of the first (right-most)
  92.     // group.  We need to be careful if there is only one entry in
  93.     // grouping:  in this case we need to duplicate the first entry.
  94.  
  95.     string __new_grouping = __grouping;
  96.     wchar_t* __decimal_pos = find(__wbuf, __eend, __decimal_point);
  97.     if (__grouping.size() == 1)
  98.       __new_grouping.push_back(__grouping[0]);
  99.  
  100.     // dwa 1/24/00 - try as I might, there doesn't seem to be a way
  101.     // to suppress the warning
  102.     __new_grouping[0] += __STATIC_CAST(char, __eend - __decimal_pos);
  103.     ptrdiff_t __len = __insert_grouping(__wbuf, __eend, __new_grouping,
  104.                     __sep,
  105.                     __ct.widen('+'), __ct.widen('-'),
  106.                     0);
  107.     __eend = __wbuf + __len;
  108.   }
  109.  
  110.   return __copy_float_and_fill(__wbuf, __eend, __out,
  111.                                __f.flags(), __f.width(0), __fill,
  112.                                __ct.widen('+'), __ct.widen('-')); 
  113. }
  114. # endif /* WCHAR_T */
  115.  
  116. // Helper routine for char
  117. template <class _OutputIter>
  118. _OutputIter  _STLP_CALL
  119. __put_float(char* __ibuf, char* __iend, _OutputIter __out,
  120.             ios_base& __f, char __fill,
  121.             char __decimal_point,
  122.             char __sep, const string& __grouping)
  123. {
  124.   __adjust_float_buffer(__ibuf, __iend, __decimal_point);
  125.   if (__grouping.size() != 0) {
  126.     string __new_grouping = __grouping;
  127.     const char * __decimal_pos = find(__ibuf, __iend, __decimal_point);
  128.     if (__grouping.size() == 1)
  129.       __new_grouping.push_back(__grouping[0]);
  130.     __new_grouping[0] += __STATIC_CAST(char, (__iend - __decimal_pos));
  131.     ptrdiff_t __len = __insert_grouping(__ibuf, __iend, __new_grouping,
  132.                     __sep, '+', '-', 0);
  133.     __iend = __ibuf + __len;
  134.   }
  135.  
  136.   return __copy_float_and_fill(__ibuf, __iend, __out,
  137.                                __f.flags(), __f.width(0), __fill, '+', '-');
  138. }
  139.  
  140. template <class _CharT, class _OutputIter, class _Float>
  141. _OutputIter _STLP_CALL
  142. _M_do_put_float(_OutputIter __s, ios_base& __f,
  143.                 _CharT __fill, _Float __x)
  144. {
  145.   char   __buf[128];
  146.   char* __iend = __write_float(__buf, __f.flags(), (int)__f.precision(), __x);
  147.  
  148.   //  locale __loc = __f.getloc();
  149.   const numpunct<_CharT>& __np = *(const numpunct<_CharT>*)__f._M_numpunct_facet();
  150.   
  151.   return __put_float(__buf, __iend, __s, __f, __fill,
  152.                      __np.decimal_point(),
  153.              __np.thousands_sep(), __f._M_grouping());
  154. }
  155.  
  156. // _M_do_put_integer and its helper functions.
  157.  
  158. template <class _CharT, class _OutputIter>
  159. _OutputIter _STLP_CALL
  160. __copy_integer_and_fill(const _CharT* __buf, ptrdiff_t __len,
  161.                         _OutputIter __out,
  162.                         ios_base::fmtflags __flg, streamsize __wid, _CharT __fill,
  163.                         _CharT __xplus, _CharT __xminus)
  164. {
  165.   if (__len >= __wid)
  166.     return copy(__buf, __buf + __len, __out);
  167.   else {
  168.     ptrdiff_t __pad = __wid - __len;
  169.     ios_base::fmtflags __dir = __flg & ios_base::adjustfield;
  170.  
  171.     if (__dir == ios_base::left) {
  172.       __out = copy(__buf, __buf + __len, __out);
  173.       return fill_n(__out, __pad, __fill);
  174.     }
  175.     else if (__dir == ios_base::internal && __len != 0 &&
  176.              (__buf[0] == __xplus || __buf[0] == __xminus)) {
  177.       *__out++ = __buf[0];
  178.       __out = fill_n(__out, __pad, __fill);
  179.       return copy(__buf + 1, __buf + __len, __out);
  180.     }
  181.     else if (__dir == ios_base::internal && __len >= 2 &&
  182.              (__flg & ios_base::showbase) &&
  183.              (__flg & ios_base::basefield) == ios_base::hex) {
  184.       *__out++ = __buf[0];
  185.       *__out++ = __buf[1];
  186.       __out = fill_n(__out, __pad, __fill);
  187.       return copy(__buf + 2, __buf + __len, __out);
  188.     }
  189.     else {
  190.       __out = fill_n(__out, __pad, __fill);
  191.       return copy(__buf, __buf + __len, __out);
  192.     }
  193.   }
  194. }
  195.  
  196. #ifndef _STLP_NO_WCHAR_T
  197. // Helper function for wchar_t
  198. template <class _OutputIter>
  199. _OutputIter _STLP_CALL
  200. __put_integer(char* __buf, char* __iend, _OutputIter __s,
  201.               ios_base& __f,
  202.               ios_base::fmtflags __flags, wchar_t __fill)
  203. {
  204.   locale __loc = __f.getloc();
  205.   //  const ctype<wchar_t>& __ct = use_facet<ctype<wchar_t> >(__loc);
  206.   const ctype<wchar_t>& __ct = *(const ctype<wchar_t>*)__f._M_ctype_facet();
  207.  
  208.   wchar_t __xplus  = __ct.widen('+');
  209.   wchar_t __xminus = __ct.widen('-');
  210.  
  211.   wchar_t __wbuf[64];
  212.   __ct.widen(__buf, __iend, __wbuf);
  213.   ptrdiff_t __len = __iend - __buf;
  214.   wchar_t* __eend = __wbuf + __len;
  215.  
  216.   //  const numpunct<wchar_t>& __np = use_facet<numpunct<wchar_t> >(__loc);
  217.   //  const string& __grouping = __np.grouping();
  218.  
  219.   const numpunct<wchar_t>& __np = *(const numpunct<wchar_t>*)__f._M_numpunct_facet();
  220.   const string& __grouping = __f._M_grouping();
  221.  
  222.   if (!__grouping.empty()) {
  223.     int __basechars;
  224.     if (__flags & ios_base::showbase)
  225.       switch (__flags & ios_base::basefield) {
  226.     case ios_base::hex: __basechars = 2; break;
  227.     case ios_base::oct: __basechars = 1; break;
  228.     default: __basechars = 0;
  229.       }
  230.     else
  231.       __basechars = 0;
  232.  
  233.     __len = __insert_grouping(__wbuf, __eend, __grouping, __np.thousands_sep(),
  234.                   __xplus, __xminus, __basechars);
  235.   }
  236.  
  237.   return __copy_integer_and_fill((wchar_t*)__wbuf, __len, __s,
  238.                                  __flags, __f.width(0), __fill, __xplus, __xminus);
  239. }
  240. #endif
  241.  
  242. // Helper function for char
  243. template <class _OutputIter>
  244. _OutputIter _STLP_CALL
  245. __put_integer(char* __buf, char* __iend, _OutputIter __s,
  246.               ios_base& __f, ios_base::fmtflags __flags, char __fill)
  247. {
  248.   ptrdiff_t __len = __iend - __buf;
  249.  
  250.   //  const numpunct<char>& __np = use_facet<numpunct<char> >(__f.getloc());
  251.   //  const string& __grouping = __np.grouping();
  252.  
  253.   const numpunct<char>& __np = *(const numpunct<char>*)__f._M_numpunct_facet();
  254.   const string& __grouping = __f._M_grouping();
  255.  
  256.   if (!__grouping.empty()) {
  257.     int __basechars;
  258.     if (__flags & ios_base::showbase)
  259.       switch (__flags & ios_base::basefield) {
  260.     case ios_base::hex: __basechars = 2; break;
  261.     case ios_base::oct: __basechars = 1; break;
  262.     default: __basechars = 0;
  263.       }
  264.     else
  265.       __basechars = 0;
  266.  
  267.      // make sure there is room at the end of the buffer
  268.      // we pass to __insert_grouping
  269.     char __grpbuf[64];
  270.     copy(__buf, __iend, (char *) __grpbuf);
  271.     __buf = __grpbuf;
  272.     __iend = __grpbuf + __len; 
  273.     __len = __insert_grouping(__buf, __iend, __grouping, __np.thousands_sep(), 
  274.                               '+', '-', __basechars);
  275.   }
  276.   
  277.   return __copy_integer_and_fill(__buf, __len, __s, __flags, __f.width(0), __fill, '+', '-');
  278. }
  279.  
  280. #ifdef _STLP_LONG_LONG
  281. typedef _STLP_LONG_LONG __max_int_t;
  282. typedef unsigned _STLP_LONG_LONG __umax_int_t;
  283. #else
  284. typedef long __max_int_t;
  285. typedef unsigned long __umax_int_t;
  286. #endif
  287.  
  288. extern const char __hex_char_table_lo[];
  289. extern const char __hex_char_table_hi[];
  290.  
  291. template <class _Integer>
  292. inline char* _STLP_CALL
  293. __write_decimal_backward(char* __ptr, _Integer __x, ios_base::fmtflags __flags, const __true_type& /* is_signed */)
  294. {
  295.   __max_int_t __temp = __x;
  296.  
  297.   const bool __negative = __x < 0 ;
  298.  
  299.   if (__negative) __temp = -__temp;
  300.  
  301.   for (; __temp != 0; __temp /= 10)
  302.     *--__ptr = (int)(__temp % 10) + '0';      
  303.   // put sign if requested
  304.   if (__negative)
  305.     *--__ptr = '-';
  306.   else if (__flags & ios_base::showpos)
  307.     *--__ptr = '+';
  308.   return __ptr;
  309. }
  310.  
  311. template <class _Integer>
  312. inline char* _STLP_CALL
  313. __write_decimal_backward(char* __ptr, _Integer __x, ios_base::fmtflags, const __false_type& /* is_signed */)
  314. {
  315.   for (; __x != 0; __x /= 10)
  316.     *--__ptr = (int)(__x % 10) + '0';
  317.   return __ptr;
  318. }
  319.  
  320. template <class _Integer>
  321. char* _STLP_CALL
  322. __write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x)
  323. {
  324.   char* __ptr = __buf;
  325.   __umax_int_t __temp;
  326.  
  327.   if (__x == 0) {
  328.     *--__ptr = '0';
  329.     if ((__flags & ios_base::showpos) && ( (__flags & (ios_base::hex | ios_base::oct)) == 0 ))
  330.       *--__ptr = '+';
  331.   }
  332.   else {
  333.     
  334.     switch (__flags & ios_base::basefield) {
  335.     case ios_base::oct:
  336.       __temp = __x;
  337.       // if the size of integer is less than 8, clear upper part
  338.       if ( sizeof(__x) < 8  && sizeof(__umax_int_t) >= 8 )
  339.         __temp &= 0xFFFFFFFF;
  340.  
  341.       for (; __temp != 0; __temp >>=3)
  342.         *--__ptr = (((unsigned)__temp)& 0x7) + '0';
  343.       
  344.       // put leading '0' is showbase is set
  345.       if (__flags & ios_base::showbase)
  346.         *--__ptr = '0';
  347.       break;
  348.     case ios_base::hex: 
  349.       {
  350.         const char* __table_ptr = (__flags & ios_base::uppercase) ? 
  351.           __hex_char_table_hi : __hex_char_table_lo;
  352.       __temp = __x;
  353.       // if the size of integer is less than 8, clear upper part
  354.       if ( sizeof(__x) < 8  && sizeof(__umax_int_t) >= 8 )
  355.         __temp &= 0xFFFFFFFF;
  356.  
  357.         for (; __temp != 0; __temp >>=4)
  358.           *--__ptr = __table_ptr[((unsigned)__temp & 0xF)];
  359.         
  360.         if (__flags & ios_base::showbase) {
  361.           *--__ptr = __table_ptr[16];
  362.           *--__ptr = '0';
  363.         }
  364.       }
  365.       break;
  366.     default: 
  367.       {
  368. #if defined(__HP_aCC) && (__HP_aCC == 1)
  369.         bool _IsSigned = !((_Integer)-1 > 0);
  370.     if (_IsSigned)
  371.       __ptr = __write_decimal_backward(__ptr, __x, __flags, __true_type() );
  372.         else
  373.       __ptr = __write_decimal_backward(__ptr, __x, __flags, __false_type() );
  374. #else
  375.     typedef typename __bool2type<numeric_limits<_Integer>::is_signed>::_Ret _IsSigned;
  376.     __ptr = __write_decimal_backward(__ptr, __x, __flags, _IsSigned());
  377. # endif
  378.       }
  379.       break;
  380.     }  
  381.   }
  382.   // return pointer to beginning of the string
  383.   return __ptr;
  384. }
  385.  
  386. //
  387. // num_put<>
  388. //
  389.  
  390. # if ( _STLP_STATIC_TEMPLATE_DATA > 0 )
  391.  
  392. template <class _CharT, class _OutputIterator>
  393. locale::id num_put<_CharT, _OutputIterator>::id;
  394. # else /* ( _STLP_STATIC_TEMPLATE_DATA > 0 ) */
  395.  
  396. typedef num_put<char, const char*> num_put_char;
  397. typedef num_put<char, char*> num_put_char_2;
  398. typedef num_put<char, ostreambuf_iterator<char, char_traits<char> > > num_put_char_3;
  399.  
  400. __DECLARE_INSTANCE(locale::id, num_put_char::id, );
  401. __DECLARE_INSTANCE(locale::id, num_put_char_2::id, );
  402. __DECLARE_INSTANCE(locale::id, num_put_char_3::id, );
  403.  
  404. # ifndef _STLP_NO_WCHAR_T
  405.  
  406. typedef num_put<wchar_t, const wchar_t*> num_put_wchar_t;
  407. typedef num_put<wchar_t, wchar_t*> num_put_wchar_t_2;
  408. typedef num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > num_put_wchar_t_3;
  409.  
  410. __DECLARE_INSTANCE(locale::id, num_put_wchar_t::id, );
  411. __DECLARE_INSTANCE(locale::id, num_put_wchar_t_2::id, );
  412. __DECLARE_INSTANCE(locale::id, num_put_wchar_t_3::id, );
  413.  
  414. # endif
  415.  
  416. # endif /* ( _STLP_STATIC_TEMPLATE_DATA > 0 ) */
  417.  
  418. // issue 118
  419.  
  420. # ifndef _STLP_NO_BOOL
  421.  
  422. template <class _CharT, class _OutputIter>  
  423. _OutputIter 
  424. num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, 
  425.                                      char_type __fill,  bool __val) const {
  426.   if (!(__f.flags() & ios_base::boolalpha))
  427.     return this->do_put(__s, __f, __fill, __STATIC_CAST(long,__val));
  428.  
  429.   locale __loc = __f.getloc();
  430.   //  typedef numpunct<_CharT> _Punct;
  431.   //  const _Punct& __np = use_facet<_Punct>(__loc);
  432.  
  433.   const numpunct<_CharT>& __np = *(const numpunct<_CharT>*)__f._M_numpunct_facet();
  434.  
  435.   basic_string<_CharT> __str = __val ? __np.truename() : __np.falsename();
  436.  
  437.   // Reuse __copy_integer_and_fill.  Since internal padding makes no
  438.   // sense for bool, though, make sure we use something else instead.
  439.   // The last two argument to __copy_integer_and_fill are dummies.
  440.   ios_base::fmtflags __flags = __f.flags();
  441.   if ((__flags & ios_base::adjustfield) == ios_base::internal)
  442.     __flags = (__flags & ~ios_base::adjustfield) | ios_base::right;
  443.  
  444.   return __copy_integer_and_fill(__str.c_str(), __str.size(), __s,
  445.                                  __flags, __f.width(0), __fill,
  446.                                  (_CharT) 0, (_CharT) 0);
  447. }
  448.  
  449. # endif
  450.  
  451. template <class _CharT, class _OutputIter>
  452. _OutputIter 
  453. num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
  454.                                      long __val) const {
  455.  
  456.   char __buf[64];               // Large enough for a base 8 64-bit integer,
  457.                                 // plus any necessary grouping.  
  458.   ios_base::fmtflags __flags = __f.flags();
  459.   char* __ibeg = __write_integer_backward((char*)__buf+64, __flags, __val);  
  460.   return __put_integer(__ibeg, (char*)__buf+64, __s, __f, __flags, __fill);
  461. }
  462.  
  463.  
  464. template <class _CharT, class _OutputIter>  
  465. _OutputIter 
  466. num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
  467.                      unsigned long __val) const {
  468.   char __buf[64];               // Large enough for a base 8 64-bit integer,
  469.                                 // plus any necessary grouping.
  470.   
  471.   ios_base::fmtflags __flags = __f.flags();
  472.   char* __ibeg = __write_integer_backward((char*)__buf+64, __flags, __val);
  473.   return __put_integer(__ibeg, (char*)__buf+64, __s, __f, __flags, __fill);
  474. }
  475.  
  476. template <class _CharT, class _OutputIter>  
  477. _OutputIter 
  478. num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
  479.                                      double __val) const {
  480.   return _M_do_put_float(__s, __f, __fill, __val);
  481. }
  482.  
  483. #ifndef _STLP_NO_LONG_DOUBLE
  484. template <class _CharT, class _OutputIter>  
  485. _OutputIter 
  486. num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
  487.                                      long double __val) const {
  488.   return _M_do_put_float(__s, __f, __fill, __val);
  489. }
  490. #endif
  491.  
  492. #ifdef _STLP_LONG_LONG
  493. template <class _CharT, class _OutputIter>  
  494. _OutputIter 
  495. num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
  496.                                      _STLP_LONG_LONG __val) const {
  497.   char __buf[64];               // Large enough for a base 8 64-bit integer,
  498.                                 // plus any necessary grouping.
  499.   
  500.   ios_base::fmtflags __flags = __f.flags();
  501.   char* __ibeg = __write_integer_backward((char*)__buf+64, __flags, __val);
  502.   return __put_integer(__ibeg, (char*)__buf+64, __s, __f, __flags, __fill);
  503. }
  504.  
  505. template <class _CharT, class _OutputIter>  
  506. _OutputIter 
  507. num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
  508.                                      unsigned _STLP_LONG_LONG __val) const {
  509.   char __buf[64];               // Large enough for a base 8 64-bit integer,
  510.                                 // plus any necessary grouping.
  511.   
  512.   ios_base::fmtflags __flags = __f.flags();
  513.   char* __ibeg = __write_integer_backward((char*)__buf+64, __flags, __val);  
  514.   return __put_integer(__ibeg, (char*)__buf+64, __s, __f, __flags, __fill);
  515. }
  516.  
  517. #endif /* _STLP_LONG_LONG */
  518.  
  519.  
  520. // lib.facet.num.put.virtuals "12 For conversion from void* the specifier is %p."
  521. template <class _CharT, class _OutputIter>
  522. _OutputIter
  523. num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT /*__fill*/,
  524.                      const void* __val) const {
  525.   locale __loc = __f.getloc();
  526.   const ctype<_CharT>& __c_type = *(const ctype<_CharT>*)__f._M_ctype_facet();
  527.   ios_base::fmtflags __save_flags = __f.flags();
  528.  
  529.   __f.setf(ios_base::hex, ios_base::basefield);
  530.   __f.setf(ios_base::showbase);
  531.   __f.setf(ios_base::internal, ios_base::adjustfield);
  532.   __f.width((sizeof(void*) * 2) + 2); // digits in pointer type plus '0x' prefix
  533. # if defined(_STLP_LONG_LONG) && !defined(__MRC__) //*ty 11/24/2001 - MrCpp can not cast from void* to long long
  534.   _OutputIter result = this->do_put(__s, __f, __c_type.widen('0'), __REINTERPRET_CAST(unsigned _STLP_LONG_LONG,__val));
  535. # else
  536.   _OutputIter result = this->do_put(__s, __f, __c_type.widen('0'), __REINTERPRET_CAST(unsigned long,__val));
  537. # endif
  538.   __f.flags(__save_flags);
  539.   return result;
  540. }
  541.  
  542. _STLP_END_NAMESPACE
  543.  
  544. # endif /* _STLP_EXPOSE_STREAM_IMPLEMENTATION */
  545.  
  546. #endif /* _STLP_NUM_PUT_C */
  547.  
  548. // Local Variables:
  549. // mode:C++
  550. // End:
  551.