From 5b7ab9385fd16c8eaec26d6e66df0c3b5ca70ef9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 15 Jul 2004 06:34:04 +0000 Subject: [PATCH] Type casting warning fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/richedit/wxllist.cpp | 16 ++++++++-------- utils/tex2rtf/src/rtfutils.cpp | 12 ++++++------ utils/tex2rtf/src/table.cpp | 2 +- utils/tex2rtf/src/tex2rtf.cpp | 5 +++-- utils/tex2rtf/src/texutils.cpp | 22 +++++++++++----------- 5 files changed, 29 insertions(+), 28 deletions(-) diff --git a/samples/richedit/wxllist.cpp b/samples/richedit/wxllist.cpp index 89d04ce7f9..8758ac8dca 100644 --- a/samples/richedit/wxllist.cpp +++ b/samples/richedit/wxllist.cpp @@ -631,36 +631,36 @@ wxLayoutObjectCmd::Read(wxString &istr) if(obj->m_StyleInfo->m_fg_valid) { - int red, green, blue; + unsigned char red, green, blue; ReadString(tmp, istr); tmp.ToLong(&l); - red = (int) l; + red = (unsigned char) l; ReadString(tmp, istr); tmp.ToLong(&l); - green = (int) l; + green = (unsigned char) l; ReadString(tmp, istr); tmp.ToLong(&l); - blue = (int) l; + blue = (unsigned char) l; obj->m_StyleInfo->m_fg = wxColour(red, green, blue); } if(obj->m_StyleInfo->m_bg_valid) { - int red, green, blue; + unsigned char red, green, blue; ReadString(tmp, istr); tmp.ToLong(&l); - red = (int) l; + red = (unsigned char) l; ReadString(tmp, istr); tmp.ToLong(&l); - green = (int) l; + green = (unsigned char) l; ReadString(tmp, istr); tmp.ToLong(&l); - blue = (int) l; + blue = (unsigned char) l; obj->m_StyleInfo->m_bg = wxColour(red, green, blue); } diff --git a/utils/tex2rtf/src/rtfutils.cpp b/utils/tex2rtf/src/rtfutils.cpp index 37b8fad4ec..24f498ad40 100644 --- a/utils/tex2rtf/src/rtfutils.cpp +++ b/utils/tex2rtf/src/rtfutils.cpp @@ -248,12 +248,12 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level) wxChar ch2=xitle[s+2]&0xff; wxChar ch3=xitle[s+3]&0xff; s+=4; // next character - if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]='ö'; } - if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]='ä'; } - if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]='ü'; } - if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]='Ö'; } - if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]='Ä'; } - if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]='Ü'; } + if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=_T('ö'); } + if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=_T('ä'); } + if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=_T('ü'); } + if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]=_T('Ö'); } + if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]=_T('Ä'); } + if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]=_T('Ü'); } } else { title[d++]=ch; s++; diff --git a/utils/tex2rtf/src/table.cpp b/utils/tex2rtf/src/table.cpp index b289cdbe2d..8fc61165cb 100644 --- a/utils/tex2rtf/src/table.cpp +++ b/utils/tex2rtf/src/table.cpp @@ -122,7 +122,7 @@ bool ParseTableArgument(wxChar *value) while ((i < len) && (isdigit(ch) || ch == '.')) { - numberBuf[j] = ch; + numberBuf[j] = (wxChar)ch; j ++; i ++; ch = value[i]; diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index e3b7b8ce4f..06778df3a9 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -66,7 +66,7 @@ static inline wxChar* copystring(const wxChar* s) { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } #endif -const float versionNo = TEX2RTF_VERSION_NUMBER; +const float versionNo = (float)TEX2RTF_VERSION_NUMBER; TexChunk *currentMember = NULL; bool startedSections = false; @@ -287,8 +287,9 @@ bool MyApp::OnInit() #ifdef NO_GUI ShowOptions(); exit(1); -#endif +#else return false; +#endif } } diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index 0f2c6385b5..b4ad55afbb 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -117,7 +117,7 @@ void OutputChunkToString(TexChunk *chunk, wxChar *buf) buf[i] = 0; else { - buf[i] = ch; + buf[i] = (wxChar)ch; i ++; } } @@ -494,7 +494,7 @@ void ReadTexReferences(wxChar *filename) void BibEatWhiteSpace(wxSTD istream& str) { - char ch = str.peek(); + char ch = (char)str.peek(); while (!str.eof() && (ch == ' ' || ch == '\t' || ch == 13 || ch == 10 || ch == EOF)) { @@ -502,18 +502,18 @@ void BibEatWhiteSpace(wxSTD istream& str) BibLine ++; str.get(ch); if ((ch == EOF) || str.eof()) return; - ch = str.peek(); + ch = (char)str.peek(); } // Ignore end-of-line comments if (ch == '%' || ch == ';' || ch == '#') { str.get(ch); - ch = str.peek(); + ch = (char)str.peek(); while (ch != 10 && ch != 13 && !str.eof()) { str.get(ch); - ch = str.peek(); + ch = (char)str.peek(); } BibEatWhiteSpace(str); } @@ -524,14 +524,14 @@ void BibReadWord(wxSTD istream& istr, wxChar *buffer) { int i = 0; buffer[i] = 0; - char ch = istr.peek(); + char ch = (char)istr.peek(); while (!istr.eof() && ch != ' ' && ch != '{' && ch != '(' && ch != 13 && ch != 10 && ch != '\t' && ch != ',' && ch != '=') { istr.get(ch); buffer[i] = ch; i ++; - ch = istr.peek(); + ch = (char)istr.peek(); } buffer[i] = 0; } @@ -541,12 +541,12 @@ void BibReadToEOL(wxSTD istream& istr, wxChar *buffer) { int i = 0; buffer[i] = 0; - char ch = istr.peek(); + char ch = (char)istr.peek(); bool inQuotes = false; if (ch == '"') { istr.get(ch); - ch = istr.peek(); + ch = (char)istr.peek(); inQuotes = true; } // If in quotes, read white space too. If not, @@ -558,7 +558,7 @@ void BibReadToEOL(wxSTD istream& istr, wxChar *buffer) istr.get(ch); buffer[i] = ch; i ++; - ch = istr.peek(); + ch = (char)istr.peek(); } if (ch == '"') istr.get(ch); @@ -572,7 +572,7 @@ void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = true, int braceCount = 1; int i = 0; buffer[i] = 0; - char ch = istr.peek(); + char ch = (char)istr.peek(); bool stopping = false; while (!istr.eof() && !stopping) { -- 2.45.2