more fixes to compilation warnings from HP-UX build log. About 30% more to go
<sigh> git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -81,8 +81,8 @@ public:
|
||||
long operator-(const wxDate &dt) const
|
||||
{ return GetJulianDate() - dt.GetJulianDate(); }
|
||||
|
||||
wxDate &operator+=(long i) { m_date += wxTimeSpan::Days(i); return *this; }
|
||||
wxDate &operator-=(long i) { m_date -= wxTimeSpan::Days(i); return *this; }
|
||||
wxDate &operator+=(long i) { m_date += wxTimeSpan::Days((int)i); return *this; }
|
||||
wxDate &operator-=(long i) { m_date -= wxTimeSpan::Days((int)i); return *this; }
|
||||
|
||||
wxDate &operator++() { return *this += 1; }
|
||||
wxDate &operator++(int) { return *this += 1; }
|
||||
|
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
protected:
|
||||
int m_selection;
|
||||
int m_dialogStyle;
|
||||
long m_dialogStyle;
|
||||
wxString m_stringSelection;
|
||||
wxListBox *m_listbox;
|
||||
|
||||
|
@@ -38,7 +38,7 @@ public:
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
int m_dialogStyle;
|
||||
long m_dialogStyle;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
@@ -47,7 +47,7 @@ public:
|
||||
protected:
|
||||
wxTextCtrl *m_textctrl;
|
||||
wxString m_value;
|
||||
int m_dialogStyle;
|
||||
long m_dialogStyle;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
@@ -72,16 +72,16 @@ public:
|
||||
bool operator!=(const wxTime& t) const { return m_time != t.m_time; }
|
||||
|
||||
friend wxTime WXDLLEXPORT operator+(const wxTime& t, long s)
|
||||
{ return wxTime(t.m_time + wxTimeSpan::Seconds(s)); }
|
||||
{ return wxTime(t.m_time + wxTimeSpan::Seconds((int)s)); }
|
||||
friend wxTime WXDLLEXPORT operator+(long s, const wxTime& t)
|
||||
{ return wxTime(t.m_time + wxTimeSpan::Seconds(s)); }
|
||||
{ return wxTime(t.m_time + wxTimeSpan::Seconds((int)s)); }
|
||||
|
||||
long operator-(const wxTime& t) const
|
||||
{ return (m_time - t.m_time).GetValue().ToLong(); }
|
||||
wxTime operator-(long s) const
|
||||
{ return wxTime(m_time - wxTimeSpan::Seconds(s)); }
|
||||
void operator+=(long s) { m_time += wxTimeSpan::Seconds(s); }
|
||||
void operator-=(long s) { m_time -= wxTimeSpan::Seconds(s); }
|
||||
{ return wxTime(m_time - wxTimeSpan::Seconds((int)s)); }
|
||||
void operator+=(long s) { m_time += wxTimeSpan::Seconds((int)s); }
|
||||
void operator-=(long s) { m_time -= wxTimeSpan::Seconds((int)s); }
|
||||
bool IsBetween(const wxTime& a, const wxTime& b) const
|
||||
{ return *this >= a && *this <= b; }
|
||||
|
||||
|
@@ -1258,18 +1258,18 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
||||
wxASSERT_MSG( jdn > -2, _T("JDN out of range") );
|
||||
|
||||
// calculate the century
|
||||
int temp = (jdn + JDN_OFFSET) * 4 - 1;
|
||||
int century = temp / DAYS_PER_400_YEARS;
|
||||
long temp = (jdn + JDN_OFFSET) * 4 - 1;
|
||||
long century = temp / DAYS_PER_400_YEARS;
|
||||
|
||||
// then the year and day of year (1 <= dayOfYear <= 366)
|
||||
temp = ((temp % DAYS_PER_400_YEARS) / 4) * 4 + 3;
|
||||
int year = (century * 100) + (temp / DAYS_PER_4_YEARS);
|
||||
int dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1;
|
||||
long year = (century * 100) + (temp / DAYS_PER_4_YEARS);
|
||||
long dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1;
|
||||
|
||||
// and finally the month and day of the month
|
||||
temp = dayOfYear * 5 - 3;
|
||||
int month = temp / DAYS_PER_5_MONTHS;
|
||||
int day = (temp % DAYS_PER_5_MONTHS) / 5 + 1;
|
||||
long month = temp / DAYS_PER_5_MONTHS;
|
||||
long day = (temp % DAYS_PER_5_MONTHS) / 5 + 1;
|
||||
|
||||
// month is counted from March - convert to normal
|
||||
if ( month < 10 )
|
||||
@@ -1296,18 +1296,18 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
||||
tm.year = (int)year;
|
||||
tm.mon = (Month)(month - 1); // algorithm yields 1 for January, not 0
|
||||
tm.mday = (wxDateTime_t)day;
|
||||
tm.msec = timeOnly % 1000;
|
||||
tm.msec = (wxDateTime_t)(timeOnly % 1000);
|
||||
timeOnly -= tm.msec;
|
||||
timeOnly /= 1000; // now we have time in seconds
|
||||
|
||||
tm.sec = timeOnly % 60;
|
||||
tm.sec = (wxDateTime_t)(timeOnly % 60);
|
||||
timeOnly -= tm.sec;
|
||||
timeOnly /= 60; // now we have time in minutes
|
||||
|
||||
tm.min = timeOnly % 60;
|
||||
tm.min = (wxDateTime_t)(timeOnly % 60);
|
||||
timeOnly -= tm.min;
|
||||
|
||||
tm.hour = timeOnly / 60;
|
||||
tm.hour = (wxDateTime_t)(timeOnly / 60);
|
||||
|
||||
return tm;
|
||||
}
|
||||
@@ -1734,7 +1734,7 @@ int wxDateTime::IsDST(wxDateTime::Country country) const
|
||||
|
||||
wxDateTime& wxDateTime::MakeTimezone(const TimeZone& tz, bool noDST)
|
||||
{
|
||||
int secDiff = GetTimeZone() + tz.GetOffset();
|
||||
long secDiff = GetTimeZone() + tz.GetOffset();
|
||||
|
||||
// we need to know whether DST is or not in effect for this date unless
|
||||
// the test disabled by the caller
|
||||
@@ -1770,7 +1770,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
||||
}
|
||||
else
|
||||
{
|
||||
time += tz.GetOffset();
|
||||
time += (int)tz.GetOffset();
|
||||
|
||||
#ifdef __VMS__ // time is unsigned so avoid the warning
|
||||
int time2 = (int) time;
|
||||
@@ -2563,7 +2563,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
|
||||
haveHour = TRUE;
|
||||
hourIsIn12hFormat = TRUE;
|
||||
hour = num % 12; // 12 should be 0
|
||||
hour = (wxDateTime_t)(num % 12); // 12 should be 0
|
||||
break;
|
||||
|
||||
case _T('j'): // day of the year
|
||||
@@ -2819,7 +2819,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date,
|
||||
}
|
||||
|
||||
haveYear = TRUE;
|
||||
year = 1900 + num;
|
||||
year = 1900 + (wxDateTime_t)num;
|
||||
break;
|
||||
|
||||
case _T('Y'): // year with century
|
||||
@@ -3059,7 +3059,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
haveYear = TRUE;
|
||||
|
||||
// no roll over - 99 means 99, not 1999 for us
|
||||
year = val;
|
||||
year = (wxDateTime_t)val;
|
||||
}
|
||||
else if ( isMonth )
|
||||
{
|
||||
@@ -3103,7 +3103,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
|
||||
haveDay = TRUE;
|
||||
|
||||
day = val;
|
||||
day = (wxDateTime_t)val;
|
||||
}
|
||||
}
|
||||
else // not a number
|
||||
|
@@ -370,7 +370,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream)
|
||||
key = (r << 16) | (g << 8) | b;
|
||||
|
||||
hnode = (wxHNode *) h.Get(key);
|
||||
p[i] = hnode->index;
|
||||
p[i] = (unsigned char)hnode->index;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -141,18 +141,18 @@ bool wxPNGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
|
||||
png_set_expand( png_ptr );
|
||||
png_set_filler( png_ptr, 0xff, PNG_FILLER_AFTER );
|
||||
|
||||
image->Create( width, height );
|
||||
image->Create( (int)width, (int)height );
|
||||
|
||||
if (!image->Ok())
|
||||
goto error_nolines;
|
||||
|
||||
lines = (unsigned char **)malloc( height * sizeof(unsigned char *) );
|
||||
lines = (unsigned char **)malloc( (size_t)(height * sizeof(unsigned char *)) );
|
||||
if (lines == NULL)
|
||||
goto error_nolines;
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
if ((lines[i] = (unsigned char *)malloc(width * (sizeof(unsigned char) * 4))) == NULL)
|
||||
if ((lines[i] = (unsigned char *)malloc( (size_t)(width * (sizeof(unsigned char) * 4)))) == NULL)
|
||||
{
|
||||
for ( unsigned int n = 0; n < i; n++ )
|
||||
free( lines[n] );
|
||||
|
@@ -163,7 +163,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
image->Create( w, h );
|
||||
image->Create( (int)w, (int)h );
|
||||
if (!image->Ok())
|
||||
{
|
||||
if (verbose)
|
||||
|
@@ -154,7 +154,7 @@ public:
|
||||
|
||||
void Notify()
|
||||
{
|
||||
*m_state = m_new_val; // Change the value
|
||||
*m_state = (int)m_new_val; // Change the value
|
||||
}
|
||||
};
|
||||
|
||||
@@ -177,7 +177,7 @@ wxUint32 wxSocketBase::DeferRead(char *buffer, wxUint32 nbytes)
|
||||
timer.m_state = (int *)&m_defer_buffer;
|
||||
timer.m_new_val = 0;
|
||||
|
||||
timer.Start(m_timeout * 1000, FALSE);
|
||||
timer.Start((int)(m_timeout * 1000), FALSE);
|
||||
|
||||
// If the socket is readable, call DoDefer for the first time
|
||||
if (GSocket_Select(m_socket, GSOCK_INPUT_FLAG))
|
||||
@@ -352,8 +352,8 @@ wxSocketBase& wxSocketBase::ReadMsg(char* buffer, wxUint32 nbytes)
|
||||
do
|
||||
{
|
||||
discard_len = ((len2 > MAX_DISCARD_SIZE)? MAX_DISCARD_SIZE : len2);
|
||||
discard_len = _Read(discard_buffer, discard_len);
|
||||
len2 -= discard_len;
|
||||
discard_len = _Read(discard_buffer, (wxUint32)discard_len);
|
||||
len2 -= (wxUint32)discard_len;
|
||||
}
|
||||
while ((discard_len > 0) && len2);
|
||||
|
||||
@@ -431,7 +431,7 @@ wxUint32 wxSocketBase::DeferWrite(const char *buffer, wxUint32 nbytes)
|
||||
timer.m_state = (int *)&m_defer_buffer;
|
||||
timer.m_new_val = 0;
|
||||
|
||||
timer.Start(m_timeout * 1000, FALSE);
|
||||
timer.Start((int)(m_timeout * 1000), FALSE);
|
||||
|
||||
// If the socket is writable, call DoDefer for the first time
|
||||
if (GSocket_Select(m_socket, GSOCK_OUTPUT_FLAG))
|
||||
@@ -648,7 +648,7 @@ void wxSocketBase::DoDefer()
|
||||
else
|
||||
{
|
||||
m_defer_buffer += ret;
|
||||
m_defer_timer->Start(m_timeout * 1000, FALSE);
|
||||
m_defer_timer->Start((int)(m_timeout * 1000), FALSE);
|
||||
}
|
||||
|
||||
//wxLogMessage("DoDefer ha transferido %d bytes", ret);
|
||||
@@ -798,7 +798,7 @@ bool wxSocketBase::_Wait(long seconds, long milliseconds, wxSocketEventFlags fla
|
||||
{
|
||||
timer.m_state = &state;
|
||||
timer.m_new_val = 0;
|
||||
timer.Start(timeout, TRUE);
|
||||
timer.Start((int)timeout, TRUE);
|
||||
}
|
||||
|
||||
// Active polling (without using events)
|
||||
|
@@ -865,19 +865,14 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style,
|
||||
{
|
||||
case wxID_OK:
|
||||
return wxOK;
|
||||
break;
|
||||
case wxID_YES:
|
||||
return wxYES;
|
||||
break;
|
||||
case wxID_NO:
|
||||
return wxNO;
|
||||
break;
|
||||
default:
|
||||
case wxID_CANCEL:
|
||||
return wxCANCEL;
|
||||
break;
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
||||
#if wxUSE_TEXTDLG
|
||||
|
@@ -269,7 +269,7 @@ void wxTextValidator::OnChar(wxKeyEvent& event)
|
||||
|
||||
if ( m_validatorWindow )
|
||||
{
|
||||
int keyCode = event.KeyCode();
|
||||
long keyCode = event.KeyCode();
|
||||
|
||||
// we don't filter special keys and Delete
|
||||
if (
|
||||
|
@@ -387,7 +387,7 @@ bool wxVariantDataLong::Write(wxOutputStream& str) const
|
||||
{
|
||||
wxTextOutputStream s(str);
|
||||
|
||||
s.Write32(m_value);
|
||||
s.Write32((size_t)m_value);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ wxZipInputStream::wxZipInputStream(const wxString& archive, const wxString& file
|
||||
m_lasterror = wxStream_READ_ERR;
|
||||
return;
|
||||
}
|
||||
m_Size = zinfo.uncompressed_size;
|
||||
m_Size = (size_t)zinfo.uncompressed_size;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1609,8 +1609,8 @@ void wxPostScriptDC::EndDoc ()
|
||||
wxCoord wx_printer_translate_x, wx_printer_translate_y;
|
||||
double wx_printer_scale_x, wx_printer_scale_y;
|
||||
|
||||
wx_printer_translate_x = m_printData.GetPrinterTranslateX();
|
||||
wx_printer_translate_y = m_printData.GetPrinterTranslateY();
|
||||
wx_printer_translate_x = (wxCoord)m_printData.GetPrinterTranslateX();
|
||||
wx_printer_translate_y = (wxCoord)m_printData.GetPrinterTranslateY();
|
||||
|
||||
wx_printer_scale_x = m_printData.GetPrinterScaleX();
|
||||
wx_printer_scale_y = m_printData.GetPrinterScaleY();
|
||||
@@ -1737,8 +1737,8 @@ void wxPostScriptDC::StartPage()
|
||||
wxCoord translate_x, translate_y;
|
||||
double scale_x, scale_y;
|
||||
|
||||
translate_x = m_printData.GetPrinterTranslateX();
|
||||
translate_y = m_printData.GetPrinterTranslateY();
|
||||
translate_x = (wxCoord)m_printData.GetPrinterTranslateX();
|
||||
translate_y = (wxCoord)m_printData.GetPrinterTranslateY();
|
||||
|
||||
scale_x = m_printData.GetPrinterScaleX();
|
||||
scale_y = m_printData.GetPrinterScaleY();
|
||||
|
@@ -735,7 +735,7 @@ void wxFileDialog::OnChoice( wxCommandEvent &event )
|
||||
|
||||
void wxFileDialog::OnCheck( wxCommandEvent &event )
|
||||
{
|
||||
m_list->ShowHidden( event.GetInt() );
|
||||
m_list->ShowHidden( event.GetInt() != 0 );
|
||||
}
|
||||
|
||||
void wxFileDialog::OnActivated( wxListEvent &event )
|
||||
|
@@ -129,7 +129,7 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
|
||||
wxString valStr;
|
||||
valStr.Printf(wxT("%lu"), m_value);
|
||||
m_spinctrl = new wxSpinCtrl(this, -1, valStr, wxDefaultPosition, wxSize( 140, -1 ) );
|
||||
m_spinctrl->SetRange(m_min, m_max);
|
||||
m_spinctrl->SetRange((int)m_min, (int)m_max);
|
||||
inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 );
|
||||
// add both
|
||||
topsizer->Add( inputsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 );
|
||||
|
@@ -202,7 +202,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
||||
sizeDlg.y += 2*LAYOUT_Y_MARGIN;
|
||||
|
||||
// try to make the dialog not square but rectangular of reasonabel width
|
||||
sizeDlg.x = wxMax(widthText, 4*sizeDlg.y/3);
|
||||
sizeDlg.x = (wxCoord)wxMax(widthText, 4*sizeDlg.y/3);
|
||||
sizeDlg.x *= 3;
|
||||
sizeDlg.x /= 2;
|
||||
SetClientSize(sizeDlg);
|
||||
|
@@ -162,8 +162,8 @@ void wxSplitterWindow::OnIdle(wxIdleEvent& WXUNUSED(event))
|
||||
|
||||
void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
|
||||
{
|
||||
long x = event.GetX();
|
||||
long y = event.GetY();
|
||||
wxCoord x = event.GetX(),
|
||||
y = event.GetY();
|
||||
|
||||
// reset the cursor
|
||||
#ifdef __WXMOTIF__
|
||||
|
@@ -186,10 +186,10 @@ bool wxToolBarSimple::DoInsertTool(size_t WXUNUSED(pos),
|
||||
{
|
||||
// Calculate reasonable max size in case Layout() not called
|
||||
if ((tool->m_x + tool->GetBitmap1().GetWidth() + m_xMargin) > m_maxWidth)
|
||||
m_maxWidth = (tool->m_x + tool->GetWidth() + m_xMargin);
|
||||
m_maxWidth = (wxCoord)((tool->m_x + tool->GetWidth() + m_xMargin));
|
||||
|
||||
if ((tool->m_y + tool->GetBitmap1().GetHeight() + m_yMargin) > m_maxHeight)
|
||||
m_maxHeight = (tool->m_y + tool->GetHeight() + m_yMargin);
|
||||
m_maxHeight = (wxCoord)((tool->m_y + tool->GetHeight() + m_yMargin));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
Reference in New Issue
Block a user