1. more HP-UX warning fixes (almost done...)

2. added a macro WXUNUSED_UNLESS_DEBUG()


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-01-06 15:42:32 +00:00
parent c0f587c500
commit 6f2a55e34a
14 changed files with 77 additions and 74 deletions

View File

@@ -972,23 +972,23 @@ public:
// ------------------------------------------------------------------------
// return the timespan for the given number of seconds
static wxTimeSpan Seconds(int sec) { return wxTimeSpan(0, 0, sec); }
static wxTimeSpan Seconds(long sec) { return wxTimeSpan(0, 0, sec); }
static wxTimeSpan Second() { return Seconds(1); }
// return the timespan for the given number of minutes
static wxTimeSpan Minutes(int min) { return wxTimeSpan(0, min, 0 ); }
static wxTimeSpan Minutes(long min) { return wxTimeSpan(0, min, 0 ); }
static wxTimeSpan Minute() { return Minutes(1); }
// return the timespan for the given number of hours
static wxTimeSpan Hours(int hours) { return wxTimeSpan(hours, 0, 0); }
static wxTimeSpan Hours(long hours) { return wxTimeSpan(hours, 0, 0); }
static wxTimeSpan Hour() { return Hours(1); }
// return the timespan for the given number of days
static wxTimeSpan Days(int days) { return Hours(24 * days); }
static wxTimeSpan Days(long days) { return Hours(24 * days); }
static wxTimeSpan Day() { return Days(1); }
// return the timespan for the given number of weeks
static wxTimeSpan Weeks(int days) { return Days(7 * days); }
static wxTimeSpan Weeks(long days) { return Days(7 * days); }
static wxTimeSpan Week() { return Weeks(1); }
// default ctor constructs the 0 time span
@@ -997,10 +997,10 @@ public:
// from separate values for each component, date set to 0 (hours are
// not restricted to 0..24 range, neither are minutes, seconds or
// milliseconds)
inline wxTimeSpan(int hours,
int minutes = 0,
int seconds = 0,
int milliseconds = 0);
inline wxTimeSpan(long hours,
long minutes = 0,
long seconds = 0,
long milliseconds = 0);
// default copy ctor is ok

View File

@@ -362,10 +362,10 @@ wxDateTime wxDateTime::ToTimezone(const wxDateTime::TimeZone& tz,
// wxTimeSpan construction
// ----------------------------------------------------------------------------
wxTimeSpan::wxTimeSpan(int hours, int minutes, int seconds, int milliseconds)
wxTimeSpan::wxTimeSpan(long hours, long minutes, long seconds, long milliseconds)
{
// assign first to avoid precision loss
m_diff = (long)hours;
m_diff = hours;
m_diff *= 60l;
m_diff += minutes;
m_diff *= 60l;

View File

@@ -317,6 +317,13 @@ typedef int wxWindowID;
#define WXUNUSED(identifier) identifier
#endif
// some arguments are only used in debug mode, but unused in release one
#ifdef __WXDEBUG__
#define WXUNUSED_UNLESS_DEBUG(param) param
#else
#define WXUNUSED_UNLESS_DEBUG(param) WXUNUSED(param)
#endif
// ----------------------------------------------------------------------------
// portable calling conventions macros
// ----------------------------------------------------------------------------

View File

@@ -107,7 +107,7 @@ public:
wxRegionIterator();
wxRegionIterator(const wxRegion& region);
void Reset() { m_current = 0; }
void Reset() { m_current = 0u; }
void Reset(const wxRegion& region);
operator bool () const;
@@ -125,8 +125,8 @@ public:
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
private:
long m_current;
wxRegion m_region;
size_t m_current;
wxRegion m_region;
private:
DECLARE_DYNAMIC_CLASS(wxRegionIterator);

View File

@@ -107,7 +107,7 @@ public:
wxRegionIterator();
wxRegionIterator(const wxRegion& region);
void Reset() { m_current = 0; }
void Reset() { m_current = 0u; }
void Reset(const wxRegion& region);
operator bool () const;
@@ -125,8 +125,8 @@ public:
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
private:
long m_current;
wxRegion m_region;
size_t m_current;
wxRegion m_region;
private:
DECLARE_DYNAMIC_CLASS(wxRegionIterator);