Type casting warning fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-07-15 06:34:04 +00:00
parent 9d6eda5f3d
commit 5b7ab9385f
5 changed files with 29 additions and 28 deletions

View File

@@ -631,36 +631,36 @@ wxLayoutObjectCmd::Read(wxString &istr)
if(obj->m_StyleInfo->m_fg_valid) if(obj->m_StyleInfo->m_fg_valid)
{ {
int red, green, blue; unsigned char red, green, blue;
ReadString(tmp, istr); ReadString(tmp, istr);
tmp.ToLong(&l); tmp.ToLong(&l);
red = (int) l; red = (unsigned char) l;
ReadString(tmp, istr); ReadString(tmp, istr);
tmp.ToLong(&l); tmp.ToLong(&l);
green = (int) l; green = (unsigned char) l;
ReadString(tmp, istr); ReadString(tmp, istr);
tmp.ToLong(&l); tmp.ToLong(&l);
blue = (int) l; blue = (unsigned char) l;
obj->m_StyleInfo->m_fg = wxColour(red, green, blue); obj->m_StyleInfo->m_fg = wxColour(red, green, blue);
} }
if(obj->m_StyleInfo->m_bg_valid) if(obj->m_StyleInfo->m_bg_valid)
{ {
int red, green, blue; unsigned char red, green, blue;
ReadString(tmp, istr); ReadString(tmp, istr);
tmp.ToLong(&l); tmp.ToLong(&l);
red = (int) l; red = (unsigned char) l;
ReadString(tmp, istr); ReadString(tmp, istr);
tmp.ToLong(&l); tmp.ToLong(&l);
green = (int) l; green = (unsigned char) l;
ReadString(tmp, istr); ReadString(tmp, istr);
tmp.ToLong(&l); tmp.ToLong(&l);
blue = (int) l; blue = (unsigned char) l;
obj->m_StyleInfo->m_bg = wxColour(red, green, blue); obj->m_StyleInfo->m_bg = wxColour(red, green, blue);
} }

View File

@@ -248,12 +248,12 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
wxChar ch2=xitle[s+2]&0xff; wxChar ch2=xitle[s+2]&0xff;
wxChar ch3=xitle[s+3]&0xff; wxChar ch3=xitle[s+3]&0xff;
s+=4; // next character s+=4; // next character
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]='<EFBFBD>'; } if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=_T('<EFBFBD>'); }
if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]='<EFBFBD>'; } if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=_T('<EFBFBD>'); }
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]='<EFBFBD>'; } if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=_T('<EFBFBD>'); }
if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]='<EFBFBD>'; } if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]=_T('<EFBFBD>'); }
if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]='<EFBFBD>'; } if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]=_T('<EFBFBD>'); }
if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]='<EFBFBD>'; } if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]=_T('<EFBFBD>'); }
} else { } else {
title[d++]=ch; title[d++]=ch;
s++; s++;

View File

@@ -122,7 +122,7 @@ bool ParseTableArgument(wxChar *value)
while ((i < len) && (isdigit(ch) || ch == '.')) while ((i < len) && (isdigit(ch) || ch == '.'))
{ {
numberBuf[j] = ch; numberBuf[j] = (wxChar)ch;
j ++; j ++;
i ++; i ++;
ch = value[i]; ch = value[i];

View File

@@ -66,7 +66,7 @@ static inline wxChar* copystring(const wxChar* s)
{ return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); }
#endif #endif
const float versionNo = TEX2RTF_VERSION_NUMBER; const float versionNo = (float)TEX2RTF_VERSION_NUMBER;
TexChunk *currentMember = NULL; TexChunk *currentMember = NULL;
bool startedSections = false; bool startedSections = false;
@@ -287,8 +287,9 @@ bool MyApp::OnInit()
#ifdef NO_GUI #ifdef NO_GUI
ShowOptions(); ShowOptions();
exit(1); exit(1);
#endif #else
return false; return false;
#endif
} }
} }

View File

@@ -117,7 +117,7 @@ void OutputChunkToString(TexChunk *chunk, wxChar *buf)
buf[i] = 0; buf[i] = 0;
else else
{ {
buf[i] = ch; buf[i] = (wxChar)ch;
i ++; i ++;
} }
} }
@@ -494,7 +494,7 @@ void ReadTexReferences(wxChar *filename)
void BibEatWhiteSpace(wxSTD istream& str) 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)) while (!str.eof() && (ch == ' ' || ch == '\t' || ch == 13 || ch == 10 || ch == EOF))
{ {
@@ -502,18 +502,18 @@ void BibEatWhiteSpace(wxSTD istream& str)
BibLine ++; BibLine ++;
str.get(ch); str.get(ch);
if ((ch == EOF) || str.eof()) return; if ((ch == EOF) || str.eof()) return;
ch = str.peek(); ch = (char)str.peek();
} }
// Ignore end-of-line comments // Ignore end-of-line comments
if (ch == '%' || ch == ';' || ch == '#') if (ch == '%' || ch == ';' || ch == '#')
{ {
str.get(ch); str.get(ch);
ch = str.peek(); ch = (char)str.peek();
while (ch != 10 && ch != 13 && !str.eof()) while (ch != 10 && ch != 13 && !str.eof())
{ {
str.get(ch); str.get(ch);
ch = str.peek(); ch = (char)str.peek();
} }
BibEatWhiteSpace(str); BibEatWhiteSpace(str);
} }
@@ -524,14 +524,14 @@ void BibReadWord(wxSTD istream& istr, wxChar *buffer)
{ {
int i = 0; int i = 0;
buffer[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' && while (!istr.eof() && ch != ' ' && ch != '{' && ch != '(' && ch != 13 && ch != 10 && ch != '\t' &&
ch != ',' && ch != '=') ch != ',' && ch != '=')
{ {
istr.get(ch); istr.get(ch);
buffer[i] = ch; buffer[i] = ch;
i ++; i ++;
ch = istr.peek(); ch = (char)istr.peek();
} }
buffer[i] = 0; buffer[i] = 0;
} }
@@ -541,12 +541,12 @@ void BibReadToEOL(wxSTD istream& istr, wxChar *buffer)
{ {
int i = 0; int i = 0;
buffer[i] = 0; buffer[i] = 0;
char ch = istr.peek(); char ch = (char)istr.peek();
bool inQuotes = false; bool inQuotes = false;
if (ch == '"') if (ch == '"')
{ {
istr.get(ch); istr.get(ch);
ch = istr.peek(); ch = (char)istr.peek();
inQuotes = true; inQuotes = true;
} }
// If in quotes, read white space too. If not, // If in quotes, read white space too. If not,
@@ -558,7 +558,7 @@ void BibReadToEOL(wxSTD istream& istr, wxChar *buffer)
istr.get(ch); istr.get(ch);
buffer[i] = ch; buffer[i] = ch;
i ++; i ++;
ch = istr.peek(); ch = (char)istr.peek();
} }
if (ch == '"') if (ch == '"')
istr.get(ch); istr.get(ch);
@@ -572,7 +572,7 @@ void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = true,
int braceCount = 1; int braceCount = 1;
int i = 0; int i = 0;
buffer[i] = 0; buffer[i] = 0;
char ch = istr.peek(); char ch = (char)istr.peek();
bool stopping = false; bool stopping = false;
while (!istr.eof() && !stopping) while (!istr.eof() && !stopping)
{ {