more HP-UX compilation warnings fixed (187th try)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5929 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-09 17:51:16 +00:00
parent 61b1a1af1b
commit 06b466c74f
9 changed files with 168 additions and 133 deletions

View File

@@ -41,7 +41,7 @@ public:
// class: the owner will get timer notifications which can be handled with // class: the owner will get timer notifications which can be handled with
// EVT_TIMER // EVT_TIMER
wxTimerBase(wxEvtHandler *owner, int id = -1) wxTimerBase(wxEvtHandler *owner, int id = -1)
{ Init(); SetOwner(owner, -1); } { Init(); SetOwner(owner, id); }
// same as ctor above // same as ctor above
void SetOwner(wxEvtHandler *owner, int id = -1) void SetOwner(wxEvtHandler *owner, int id = -1)

View File

@@ -92,7 +92,7 @@ public:
// compatibility only, don't use // compatibility only, don't use
void SetString(const wxString& to_tokenize, void SetString(const wxString& to_tokenize,
const wxString& delims, const wxString& delims,
bool ret_delim) bool WXUNUSED(ret_delim))
{ {
SetString(to_tokenize, delims, wxTOKEN_RET_DELIMS); SetString(to_tokenize, delims, wxTOKEN_RET_DELIMS);
} }

View File

@@ -2694,9 +2694,9 @@ struct wxRotationPixel
struct wxRotationPoint struct wxRotationPoint
{ {
wxRotationPoint (double _x, double _y) : x(_x), y(_y) {} wxRotationPoint (double _x, double _y) : x(_x), y(_y) {}
wxRotationPoint (const wxPoint & p) : x(p.x), y(p.y) {} wxRotationPoint (const wxPoint & p) : x(p.x), y(p.y) {}
double x, y; double x, y;
}; };
static const wxRotationPixel gs_BlankPixel = {0,0,0}; static const wxRotationPixel gs_BlankPixel = {0,0,0};
@@ -2766,7 +2766,7 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i
if (offset_after_rotation != NULL) if (offset_after_rotation != NULL)
{ {
*offset_after_rotation = wxPoint (x1, y1); *offset_after_rotation = wxPoint (x1, y1);
} }
@@ -2822,34 +2822,34 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i
// If the point is exactly at one point of the grid of the source // If the point is exactly at one point of the grid of the source
// image, then don't interpolate -- just assign the pixel // image, then don't interpolate -- just assign the pixel
if (d1 < gs_Epsilon) // d1,d2,d3,d4 are positive -- no need for abs() if (d1 < gs_Epsilon) // d1,d2,d3,d4 are positive -- no need for abs()
{ {
result_data[y][x] = v1; result_data[y][x] = v1;
} }
else if (d2 < gs_Epsilon) else if (d2 < gs_Epsilon)
{ {
result_data[y][x] = v2; result_data[y][x] = v2;
} }
else if (d3 < gs_Epsilon) else if (d3 < gs_Epsilon)
{ {
result_data[y][x] = v3; result_data[y][x] = v3;
} }
else if (d4 < gs_Epsilon) else if (d4 < gs_Epsilon)
{ {
result_data[y][x] = v4; result_data[y][x] = v4;
} }
else else
{ {
// weights for the weighted average are proportional to the inverse of the distance // weights for the weighted average are proportional to the inverse of the distance
const double w1 = 1/d1, w2 = 1/d2, w3 = 1/d3, w4 = 1/d4; const double w1 = 1/d1, w2 = 1/d2, w3 = 1/d3, w4 = 1/d4;
for (int i = 0; i < 3; i++) // repeat calculation for R, G, and B for (int i = 0; i < 3; i++) // repeat calculation for R, G, and B
{ {
result_data[y][x].rgb[i] = result_data[y][x].rgb[i] =
(unsigned char) ( (w1 * v1.rgb[i] + w2 * v2.rgb[i] + (unsigned char) ( (w1 * v1.rgb[i] + w2 * v2.rgb[i] +
w3 * v3.rgb[i] + w4 * v4.rgb[i]) / w3 * v3.rgb[i] + w4 * v4.rgb[i]) /
(w1 + w2 + w3 + w4) ); (w1 + w2 + w3 + w4) );
} }
} }
} }
else else

View File

@@ -1298,7 +1298,8 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
long by = y + (long)floor( double(size) * 2.0 / 3.0 ); // approximate baseline long by = y + (long)floor( double(size) * 2.0 / 3.0 ); // approximate baseline
// FIXME only correct for 90 degrees // FIXME only correct for 90 degrees
fprintf(m_pstream, "%d %d moveto\n", XLOG2DEV(x + size), YLOG2DEV(by) ); fprintf(m_pstream, "%d %d moveto\n",
XLOG2DEV((wxCoord)(x + size)), YLOG2DEV(by) );
fprintf(m_pstream, "%.8f rotate\n", angle); fprintf(m_pstream, "%.8f rotate\n", angle);
/* I don't know how to write char to a stream, so I use a mini string */ /* I don't know how to write char to a stream, so I use a mini string */
@@ -1336,8 +1337,8 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
if (m_font.GetUnderlined()) if (m_font.GetUnderlined())
{ {
long uy = (long)(y + size - m_underlinePosition); wxCoord uy = (wxCoord)(y + size - m_underlinePosition);
long w, h; wxCoord w, h;
GetTextExtent(text, &w, &h); GetTextExtent(text, &w, &h);
fprintf( m_pstream, fprintf( m_pstream,

View File

@@ -335,7 +335,7 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
} }
m_aMessages.Add(szString); m_aMessages.Add(szString);
m_aSeverity.Add(level); m_aSeverity.Add((int)level);
m_aTimes.Add((long)t); m_aTimes.Add((long)t);
m_bHasMessages = TRUE; m_bHasMessages = TRUE;
break; break;
@@ -660,7 +660,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
m_btnDetails = new wxButton(this, wxID_MORE, _T("&Details >>")); m_btnDetails = new wxButton(this, wxID_MORE, _T("&Details >>"));
sizerButtons->Add(m_btnDetails, 0, wxCENTRE|wxTOP, MARGIN/2 - 1); sizerButtons->Add(m_btnDetails, 0, wxCENTRE|wxTOP, MARGIN/2 - 1);
wxIcon icon = wxTheApp->GetStdIcon(style & wxICON_MASK); wxIcon icon = wxTheApp->GetStdIcon((int)(style & wxICON_MASK));
sizerAll->Add(new wxStaticBitmap(this, -1, icon), 0, wxCENTRE); sizerAll->Add(new wxStaticBitmap(this, -1, icon), 0, wxCENTRE);
const wxString& message = messages.Last(); const wxString& message = messages.Last();
sizerAll->Add(CreateTextSizer(message), 0, wxCENTRE|wxLEFT|wxRIGHT, MARGIN); sizerAll->Add(CreateTextSizer(message), 0, wxCENTRE|wxLEFT|wxRIGHT, MARGIN);

View File

@@ -78,8 +78,9 @@ void wxPlotArea::OnMouse( wxMouseEvent &event )
view_x *= 10; view_x *= 10;
view_y *= 10; view_y *= 10;
int x = event.GetX(); wxPoint pos = event.GetPosition();
int y = event.GetY(); int x = pos.x;
int y = pos.y;
x += view_x; x += view_x;
y += view_y; y += view_y;

View File

@@ -182,6 +182,23 @@ private:
// implementation // implementation
// ============================================================================= // =============================================================================
// ----------------------------------------------------------------------------
// private functions
// ----------------------------------------------------------------------------
// translate the key or mouse event flags to the type of selection we're
// dealing with
static void EventFlagsToSelType(long style,
bool shiftDown,
bool ctrlDown,
bool *is_multiple,
bool *extended_select,
bool *unselect_others)
{
*is_multiple = (style & wxTR_MULTIPLE) != 0;
*extended_select = shiftDown && is_multiple;
*unselect_others = !(extended_select || (ctrlDown && is_multiple));
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// wxTreeRenameTimer (internal) // wxTreeRenameTimer (internal)
@@ -781,7 +798,7 @@ wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& item, long& cookie) co
wxArrayGenericTreeItems& children = item.m_pItem->GetChildren(); wxArrayGenericTreeItems& children = item.m_pItem->GetChildren();
if ( (size_t)cookie < children.Count() ) if ( (size_t)cookie < children.Count() )
{ {
return children.Item(cookie++); return children.Item((size_t)cookie++);
} }
else else
{ {
@@ -913,7 +930,7 @@ wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text,
if (!HasFlag(wxTR_MULTIPLE)) if (!HasFlag(wxTR_MULTIPLE))
{ {
m_current = m_key_current = m_anchor; m_current = m_key_current = m_anchor;
m_current->SetHilight( TRUE ); m_current->SetHilight( TRUE );
} }
Refresh(); Refresh();
@@ -1182,7 +1199,7 @@ bool wxTreeCtrl::TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericT
{ {
if (TagAllChildrenUntilLast(children[n], last_item, select)) if (TagAllChildrenUntilLast(children[n], last_item, select))
return TRUE; return TRUE;
} }
} }
return FALSE; return FALSE;
@@ -1713,7 +1730,7 @@ void wxTreeCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
void wxTreeCtrl::OnChar( wxKeyEvent &event ) void wxTreeCtrl::OnChar( wxKeyEvent &event )
{ {
wxTreeEvent te( wxEVT_COMMAND_TREE_KEY_DOWN, GetId() ); wxTreeEvent te( wxEVT_COMMAND_TREE_KEY_DOWN, GetId() );
te.m_code = event.KeyCode(); te.m_code = (int)event.KeyCode();
te.SetEventObject( this ); te.SetEventObject( this );
GetEventHandler()->ProcessEvent( te ); GetEventHandler()->ProcessEvent( te );
@@ -1723,9 +1740,12 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event )
return; return;
} }
bool is_multiple=(GetWindowStyleFlag() & wxTR_MULTIPLE); // how should the selection work for this event?
bool extended_select=(event.ShiftDown() && is_multiple); bool is_multiple, extended_select, unselect_others;
bool unselect_others=!(extended_select || (event.ControlDown() && is_multiple)); EventFlagsToSelType(GetWindowStyleFlag(),
event.ShiftDown(),
event.ControlDown(),
&is_multiple, &extended_select, &unselect_others);
switch (event.KeyCode()) switch (event.KeyCode())
{ {
@@ -1905,8 +1925,8 @@ wxTreeItemId wxTreeCtrl::HitTest(const wxPoint& point, int& flags)
wxClientDC dc(this); wxClientDC dc(this);
PrepareDC(dc); PrepareDC(dc);
long x = dc.DeviceToLogicalX( (long)point.x ); wxCoord x = dc.DeviceToLogicalX( point.x );
long y = dc.DeviceToLogicalY( (long)point.y ); wxCoord y = dc.DeviceToLogicalY( point.y );
int w, h; int w, h;
GetSize(&w, &h); GetSize(&w, &h);
@@ -1993,8 +2013,8 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
wxClientDC dc(this); wxClientDC dc(this);
PrepareDC(dc); PrepareDC(dc);
long x = dc.DeviceToLogicalX( (long)event.GetX() ); wxCoord x = dc.DeviceToLogicalX( event.GetX() );
long y = dc.DeviceToLogicalY( (long)event.GetY() ); wxCoord y = dc.DeviceToLogicalY( event.GetY() );
int flags=0; int flags=0;
wxGenericTreeItem *item = m_anchor->HitTest( wxPoint(x,y), this, flags); wxGenericTreeItem *item = m_anchor->HitTest( wxPoint(x,y), this, flags);
@@ -2026,12 +2046,12 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
if (item == NULL) return; /* we hit the blank area */ if (item == NULL) return; /* we hit the blank area */
if (event.RightDown()) { if (event.RightDown()) {
wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,GetId()); wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,GetId());
nevent.m_item=item; nevent.m_item=item;
nevent.m_code=0; nevent.m_code=0;
nevent.SetEventObject(this); nevent.SetEventObject(this);
GetEventHandler()->ProcessEvent(nevent); GetEventHandler()->ProcessEvent(nevent);
return; return;
} }
if (event.LeftUp() && (item == m_current) && if (event.LeftUp() && (item == m_current) &&
@@ -2042,9 +2062,12 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
return; return;
} }
bool is_multiple=(GetWindowStyleFlag() & wxTR_MULTIPLE); // how should the selection work for this event?
bool extended_select=(event.ShiftDown() && is_multiple); bool is_multiple, extended_select, unselect_others;
bool unselect_others=!(extended_select || (event.ControlDown() && is_multiple)); EventFlagsToSelType(GetWindowStyleFlag(),
event.ShiftDown(),
event.ControlDown(),
&is_multiple, &extended_select, &unselect_others);
if (onButton) if (onButton)
{ {

View File

@@ -105,4 +105,9 @@ void _GSocket_Disable_Events(GSocket *socket)
_GSocket_Uninstall_Callback(socket, GSOCK_OUTPUT); _GSocket_Uninstall_Callback(socket, GSOCK_OUTPUT);
} }
#endif /* wxUSE_SOCKETS */ #else /* !wxUSE_SOCKETS */
/* some compilers don't like having empty source files */
static int wxDummyGsockVar = 0;
#endif /* wxUSE_SOCKETS/!wxUSE_SOCKETS */

View File

@@ -105,4 +105,9 @@ void _GSocket_Disable_Events(GSocket *socket)
_GSocket_Uninstall_Callback(socket, GSOCK_OUTPUT); _GSocket_Uninstall_Callback(socket, GSOCK_OUTPUT);
} }
#endif /* wxUSE_SOCKETS */ #else /* !wxUSE_SOCKETS */
/* some compilers don't like having empty source files */
static int wxDummyGsockVar = 0;
#endif /* wxUSE_SOCKETS/!wxUSE_SOCKETS */