git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46405
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Convert decimal integer to 2-character hex string
WXDLLIMPEXP_BASE void wxDecToHex(int dec, wxChar *buf);
// Convert decimal integer to 2-character hex string
WXDLLIMPEXP_BASE void wxDecToHex(int dec, wxChar *buf);
+WXDLLIMPEXP_BASE void wxDecToHex(int dec, char* ch1, char* ch2);
WXDLLIMPEXP_BASE wxString wxDecToHex(int dec);
// ----------------------------------------------------------------------------
WXDLLIMPEXP_BASE wxString wxDecToHex(int dec);
// ----------------------------------------------------------------------------
+// Convert decimal integer to 2 characters
+void wxDecToHex(int dec, char* ch1, char* ch2)
+{
+ int firstDigit = (int)(dec/16.0);
+ int secondDigit = (int)(dec - (firstDigit*16.0));
+ (*ch1) = (char) hexArray[firstDigit];
+ (*ch2) = (char) hexArray[secondDigit];
+}
+
// Convert decimal integer to 2-character hex string
wxString wxDecToHex(int dec)
{
// Convert decimal integer to 2-character hex string
wxString wxDecToHex(int dec)
{
wxLogDebug(wxT("ICStart error %d"), (int) err);
return false;
}
wxLogDebug(wxT("ICStart error %d"), (int) err);
return false;
}
// (non-Mac, non-MSW)
#ifdef __UNIX__
// (non-Mac, non-MSW)
#ifdef __UNIX__
-// Array used in DecToHex conversion routine.
-static char hexArray[] = "0123456789ABCDEF";
-
-// Convert decimal integer to 2-character hex string
-inline void wxRichTextDecToHex(int dec, char* buf)
-{
- int firstDigit = (int)(dec/16.0);
- int secondDigit = (int)(dec - (firstDigit*16.0));
- buf[0] = hexArray[firstDigit];
- buf[1] = hexArray[secondDigit];
-}
-
// Write data in hex to a stream
bool wxRichTextImageBlock::WriteHex(wxOutputStream& stream)
{
// Write data in hex to a stream
bool wxRichTextImageBlock::WriteHex(wxOutputStream& stream)
{
char* b = buf;
for (i = 0; i < (n/2); i++)
{
char* b = buf;
for (i = 0; i < (n/2); i++)
{
- wxRichTextDecToHex(m_data[j], b);
+ wxDecToHex(m_data[j], b, b+1);