]> git.saurik.com Git - wxWidgets.git/commitdiff
more fixes to compilation warnings from HP-UX build log. About 30% more to go
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 5 Jan 2000 15:35:04 +0000 (15:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 5 Jan 2000 15:35:04 +0000 (15:35 +0000)
<sigh>

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

25 files changed:
include/wx/date.h
include/wx/generic/choicdgg.h
include/wx/generic/dirdlgg.h
include/wx/generic/msgdlgg.h
include/wx/generic/textdlgg.h
include/wx/msw/control.h
include/wx/time.h
src/common/datetime.cpp
src/common/imagpcx.cpp
src/common/imagpng.cpp
src/common/imagtiff.cpp
src/common/socket.cpp
src/common/utilscmn.cpp
src/common/valtext.cpp
src/common/variant.cpp
src/common/zipstrm.cpp
src/generic/choicdgg.cpp
src/generic/dcpsg.cpp
src/generic/filedlgg.cpp
src/generic/msgdlgg.cpp
src/generic/numdlgg.cpp
src/generic/progdlgg.cpp
src/generic/splitter.cpp
src/generic/tbarsmpl.cpp
src/generic/textdlgg.cpp

index 1b3f2e778894d4a8adab62d17f5a9baaee501dab..11ff72017f7e8e60ccc6261958bf39c96aa60eda 100644 (file)
@@ -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; }
index 7dbf48525ab792c55b44f52111438324bfbf7ab4..bd0b45d7a02f39a95ef5832388c1c05d0874933c 100644 (file)
@@ -77,7 +77,7 @@ public:
 
 protected:
     int         m_selection;
-    int         m_dialogStyle;
+    long        m_dialogStyle;
     wxString    m_stringSelection;
     wxListBox  *m_listbox;
 
index 8b0318ccf75fd5b3ccb5c0017e4f8f30005b1188..2f06ecc14c5e8b90e340b92d2239cf3bea4db6d6 100644 (file)
@@ -8,29 +8,29 @@
 // RCS-ID:      $Id$
 // Licence:    wxWindows licence
 //
-// Notes:       wxDirDialog class written by Harm van der Heijden, 
+// Notes:       wxDirDialog class written by Harm van der Heijden,
 //              uses wxDirCtrl class written by Robert Roebling for the
 //              wxFile application, modified by Harm van der Heijden
 //
 // Description: This generic dirdialog implementation defines three classes:
 //              1) wxDirItemData(public wxTreeItemData) stores pathname and
 //              displayed name for each item in the directory tree
-//              2) wxDirCtrl(public wxTreeCtrl) is a tree widget that 
+//              2) wxDirCtrl(public wxTreeCtrl) is a tree widget that
 //              displays a directory tree. It is possible to define sections
-//              for fast access to parts of the file system (such as the 
+//              for fast access to parts of the file system (such as the
 //              user's homedir, /usr/local, /tmp ...etc), similar to
 //              Win95 Explorer's shortcuts to 'My Computer', 'Desktop', etc.
 //              3) wxDirDialog is the dialog box itself. The user can choose
 //              a directory by navigating the tree, or by typing a dir
 //              in an inputbox. The inputbox displays paths selected in the
 //              tree. It is possible to create new directories. The user
-//              will automatically be prompted for dir creation if he 
+//              will automatically be prompted for dir creation if he
 //              enters a non-existing dir.
 //
 // TODO/BUGS:   - standard sections only have reasonable defaults for Unix
 //                (but others are easily added in wxDirCtrl::SetupSections)
 //              - No direct support for "show hidden" toggle. Partly due
-//                to laziness on my part and partly because 
+//                to laziness on my part and partly because
 //                wxFindFirst/NextFile never seems to find hidden dirs
 //                anyway.
 //              - No automatic update of the tree (branch) after directory
 //                CDROM drive or something is involved) but that doesn't
 //                seem to do anything. Need to look into that.
 //              - Am still looking for an efficient way to delete wxTreeCtrl
-//                branches. DeleteChildren has disappeared and 
+//                branches. DeleteChildren has disappeared and
 //                CollapseAndReset( parent ) deletes the parent as well.
 //              - The dialog window layout is done using wxConstraints. It
-//                works, but it's not as simple as I'd like it to be (see 
+//                works, but it's not as simple as I'd like it to be (see
 //                comments in wxDirDialog::doSize)
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -103,9 +103,9 @@ class WXDLLEXPORT wxDirCtrl: public wxTreeCtrl
 public:
     bool           m_showHidden;
     wxTreeItemId   m_rootId;
-  
+
     wxDirCtrl();
-    wxDirCtrl(wxWindow *parent, const wxWindowID id = -1, 
+    wxDirCtrl(wxWindow *parent, const wxWindowID id = -1,
              const wxString &dir = wxDirDialogDefaultFolderStr,
              const wxPoint& pos = wxDefaultPosition,
              const wxSize& size = wxDefaultSize,
@@ -116,12 +116,12 @@ public:
     void OnCollapseItem(wxTreeEvent &event );
     void OnBeginEditItem(wxTreeEvent &event );
     void OnEndEditItem(wxTreeEvent &event );
-    
+
 protected:
     void CreateItems(const wxTreeItemId &parent);
     void SetupSections();
     wxArrayString m_paths, m_names;
-    
+
 private:
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS(wxDirCtrl)
@@ -135,7 +135,7 @@ class WXDLLEXPORT wxDirDialog: public wxDialog
 {
 public:
     wxDirDialog() {}
-    wxDirDialog(wxWindow *parent, 
+    wxDirDialog(wxWindow *parent,
                const wxString& message = wxFileSelectorPromptStr,
                const wxString& defaultPath = wxEmptyString,
                long style = 0, const wxPoint& pos = wxDefaultPosition);
@@ -152,7 +152,7 @@ public:
     void OnTreeSelected( wxTreeEvent &event );
     void OnTreeKeyDown( wxTreeEvent &event );
     void OnOK(wxCommandEvent& event);
-    void OnCancel(wxCommandEvent& event); 
+    void OnCancel(wxCommandEvent& event);
     void OnNew(wxCommandEvent& event);
     // void OnCheck(wxCommandEvent& event);
 
@@ -165,7 +165,7 @@ protected:
     wxTextCtrl    *m_input;
     wxCheckBox    *m_check;  // not yet used
     wxButton      *m_ok, *m_cancel, *m_new;
-    
+
 private:
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS(wxDirDialog)
index f5a75bf12407ebbe19ce425b96c8ed8333af7bde..80e9d48827499e74c9a374aac89e7e31c2d94752 100644 (file)
@@ -38,9 +38,9 @@ public:
     void OnCancel(wxCommandEvent& event);
 
 private:
-    int     m_dialogStyle;
+    long m_dialogStyle;
 
-DECLARE_EVENT_TABLE()
+    DECLARE_EVENT_TABLE()
 };
 
 #if !defined( __WXMSW__ ) && !defined( __WXMAC__) && !defined(__WXPM__)
index e95ab6dc2d206e731e625996828e910c520572d8..61b9117583b36ae5b634106d2aa81f01b1221a1f 100644 (file)
@@ -47,7 +47,7 @@ public:
 protected:
     wxTextCtrl *m_textctrl;
     wxString    m_value;
-    int         m_dialogStyle;
+    long        m_dialogStyle;
 
 private:
     DECLARE_EVENT_TABLE()
index e63718755f778845223f780be1590c4a64fa8add..0819a8a478c55ef76b7e5d88f7237dae3539c1c2 100644 (file)
@@ -48,77 +48,77 @@ public:
 
     virtual ~wxControl();
 
-   // Simulates an event
-   virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
+    // Simulates an event
+    virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
 
-   // implementation from now on
-   // --------------------------
+    // implementation from now on
+    // --------------------------
 
-   // Calls the callback and appropriate event handlers
-   bool ProcessCommand(wxCommandEvent& event);
+    // Calls the callback and appropriate event handlers
+    bool ProcessCommand(wxCommandEvent& event);
 
-   // MSW-specific
+    // MSW-specific
 #ifdef __WIN95__
-   virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
+    virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
 #endif // Win95
 
-   // For ownerdraw items
-   virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
-   virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
+    // For ownerdraw items
+    virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
+    virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
 
-   wxArrayLong GetSubcontrols() { return m_subControls; }
+    wxArrayLong GetSubcontrols() { return m_subControls; }
 
-   void OnEraseBackground(wxEraseEvent& event);
+    void OnEraseBackground(wxEraseEvent& event);
 
-   virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
-                               WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+    virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+            WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
 
 #if WXWIN_COMPATIBILITY
-   virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
-   wxColour* GetButtonColour() const { return NULL; }
+    virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
+    wxColour* GetButtonColour() const { return NULL; }
 
-   inline virtual void SetLabelFont(const wxFont& font);
-   inline virtual void SetButtonFont(const wxFont& font);
-   inline wxFont& GetLabelFont() const;
-   inline wxFont& GetButtonFont() const;
+    inline virtual void SetLabelFont(const wxFont& font);
+    inline virtual void SetButtonFont(const wxFont& font);
+    inline wxFont& GetLabelFont() const;
+    inline wxFont& GetButtonFont() const;
 
-   // Adds callback
-   inline void Callback(const wxFunction function);
+    // Adds callback
+    inline void Callback(const wxFunction function);
 
-   wxFunction GetCallback() { return m_callback; }
+    wxFunction GetCallback() { return m_callback; }
 
 protected:
-   wxFunction       m_callback;     // Callback associated with the window
+    wxFunction       m_callback;     // Callback associated with the window
 #endif // WXWIN_COMPATIBILITY
 
 protected:
-   // for controls like radiobuttons which are really composite this array
-   // holds the ids (not HWNDs!) of the sub controls
-   wxArrayLong m_subControls;
-
-   virtual wxSize DoGetBestSize() const;
-
-   // create the control of the given class with the given style, returns FALSE
-   // if creation failed
-   //
-   // All parameters except classname and style are optional, if the
-   // size/position are not given, they should be set later with SetSize() and,
-   // label (the title of the window), of course, is left empty. The extended
-   // style is determined from the style and the app 3D settings automatically
-   // if it's not specified explicitly.
-   bool MSWCreateControl(const wxChar *classname,
-                         WXDWORD style,
-                         const wxPoint& pos = wxDefaultPosition,
-                         const wxSize& size = wxDefaultSize,
-                         const wxString& label = wxEmptyString,
-                         WXDWORD exstyle = (WXDWORD)-1);
-
-   // determine the extended styles combination for this window (may slightly
-   // modify style parameter, this is why it's non const)
-   WXDWORD GetExStyle(WXDWORD& style, bool *want3D) const;
+    // for controls like radiobuttons which are really composite this array
+    // holds the ids (not HWNDs!) of the sub controls
+    wxArrayLong m_subControls;
+
+    virtual wxSize DoGetBestSize() const;
+
+    // create the control of the given class with the given style, returns FALSE
+    // if creation failed
+    //
+    // All parameters except classname and style are optional, if the
+    // size/position are not given, they should be set later with SetSize() and,
+    // label (the title of the window), of course, is left empty. The extended
+    // style is determined from the style and the app 3D settings automatically
+    // if it's not specified explicitly.
+    bool MSWCreateControl(const wxChar *classname,
+            WXDWORD style,
+            const wxPoint& pos = wxDefaultPosition,
+            const wxSize& size = wxDefaultSize,
+            const wxString& label = wxEmptyString,
+            WXDWORD exstyle = (WXDWORD)-1);
+
+    // determine the extended styles combination for this window (may slightly
+    // modify style parameter, this is why it's non const)
+    WXDWORD GetExStyle(WXDWORD& style, bool *want3D) const;
 
 private:
-   DECLARE_EVENT_TABLE()
+    DECLARE_EVENT_TABLE()
 };
 
 
index f345d849949ef9faadb7d6de3f8f96471c30f971..d2c87ec77a274570f8901faa5c8c770ff62d4327 100644 (file)
@@ -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; }
 
index f5e71c17a900e972f387903b8e6c8bd249e438cb..e933221766669dae48e32f7c6572d19948c1dfed 100644 (file)
@@ -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
index d28a456f6a3d13797b5acc2ccc3f08e3f667ab5f..e6f2f05a87c2d0c9bfc66f99155f3084062eef7b 100644 (file)
@@ -303,7 +303,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream)
     wxHashTable h(wxKEY_INTEGER);   // image histogram
     unsigned long key;              // key in the hashtable
     unsigned int i;
+
     // See if we can save as 8 bit.
     //
     if (image->CountColours(256) <= 256)
@@ -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;
             }
@@ -388,7 +388,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream)
 
         RLEencode(p, bytesperline * nplanes, stream);
     }
-    
+
     free(p);
 
     // For 8 bit images, build the palette and write it to the stream
index cee55ca261b4e1183a171b9b1639bbaa6c9396ab..f869ffedee51cb09a7e1601ed3860d7629e08267 100644 (file)
@@ -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] );
index f60d864a40b7ceea2757bcf592e95b0c4b82bf52..a3b07a77d42051b61185c50aa596c9b8a42c575b 100644 (file)
@@ -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)
index 6ee284089eb4507e5bc1a26a96f02a24d9ea7ace..a00beb5e2f844460bf8f279690578cad5ad2f518 100644 (file)
@@ -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)
index a9fda2f4acc5416af274f405994ddf577124342b..ec09523cc72792eb76a717b543dc6bb4e92c45e5 100644 (file)
@@ -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
index 2d6bbca2f47fe88680d084d21d8b8cd414190e8d..6e65f76bef957e5e7e4764cd9864c1ae9db3e933 100644 (file)
@@ -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 (
index a3ee8bf67f3ab19d5da3a68f1b85b06de6910009..a8ab35073d36e317380553c42afecf6aa4a3173d 100644 (file)
@@ -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;
 }
 
index 22b27e5439d88e46a4711995e47f2e9dcbc9933c..54cb0c86387a67eba8b3ba6265672efb799b8c9b 100644 (file)
@@ -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;
 }
 
 
index 4e6b969ccc1daa5cae15e17d6cce9b83c56d381a..ec8857fa4dcca430e8f1a03f73805f8a655f25d8 100644 (file)
@@ -235,14 +235,14 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent),
     m_dialogStyle = style;
 
     wxBeginBusyCursor();
-    
+
     wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
 
     // 1) text message
     topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
-    
+
     // 2) list box
-    m_listbox = new wxListBox( this, wxID_LISTBOX, wxDefaultPosition, wxSize(160,100) , 
+    m_listbox = new wxListBox( this, wxID_LISTBOX, wxDefaultPosition, wxSize(160,100) ,
                                         n, choices, wxLB_ALWAYS_SB );
     m_listbox->SetSelection( m_selection );
     if (clientData)
@@ -262,7 +262,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent),
 
     SetAutoLayout( TRUE );
     SetSizer( topsizer );
-    
+
     topsizer->SetSizeHints( this );
     topsizer->Fit( this );
 
index cdba095cf4b166f62c3ed186843535a310f6c34a..0b51f71a6f3eee941e67f5f3d14d50f9d511b769 100644 (file)
@@ -1008,7 +1008,7 @@ void wxPostScriptDC::SetFont( const wxFont& font )
     fprintf( m_pstream, "%f scalefont setfont\n", YLOG2DEVREL(m_font.GetPointSize() * 1000) / 1000.0F);
                 // this is a hack - we must scale font size (in pts) according to m_scaleY but
                 // YLOG2DEVREL works with wxCoord type (int or longint). Se we first convert font size
-                // to 1/1000th of pt and then back. 
+                // to 1/1000th of pt and then back.
 }
 
 void wxPostScriptDC::SetPen( const wxPen& pen )
@@ -1142,9 +1142,9 @@ void wxPostScriptDC::SetBrush( const wxBrush& brush )
 void wxPostScriptDC::DoDrawText( const wxString& text, wxCoord x, wxCoord y )
 {
     wxCHECK_RET( m_ok && m_pstream, wxT("invalid postscript dc") );
-    
+
     wxCoord text_w, text_h, text_descent;
-    
+
     GetTextExtent(text, &text_w, &text_h, &text_descent);
 
     SetFont( m_font );
@@ -1266,9 +1266,9 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
         if (!m_colour)
         {
             // Anything not white is black
-            if (! (red == (unsigned char) 255 && 
-                  blue == (unsigned char) 255 &&
-                  green == (unsigned char) 255))
+            if (! (red == (unsigned char) 255 &&
+                   blue == (unsigned char) 255 &&
+                   green == (unsigned char) 255))
             {
                 red = (unsigned char) 0;
                 green = (unsigned char) 0;
@@ -1282,11 +1282,11 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
             double redPS = (double)(red) / 255.0;
             double bluePS = (double)(blue) / 255.0;
             double greenPS = (double)(green) / 255.0;
-       
-           fprintf( m_pstream, 
-                   "%.8f %.8f %.8f setrgbcolor\n",
-                   redPS, greenPS, bluePS );
-               
+
+            fprintf( m_pstream,
+                    "%.8f %.8f %.8f setrgbcolor\n",
+                    redPS, greenPS, bluePS );
+
             m_currentRed = red;
             m_currentBlue = blue;
             m_currentGreen = green;
@@ -1298,13 +1298,13 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
     long by = y + (long)floor( double(size) * 2.0 / 3.0 ); // approximate baseline
 
     // 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(x + size), YLOG2DEV(by) );
     fprintf(m_pstream, "%.8f rotate\n", angle);
 
     /* I don't know how to write char to a stream, so I use a mini string */
     char tmpbuf[2];
     tmpbuf[1] = 0;
-    
+
     fprintf( m_pstream, "(" );
     const wxWX2MBbuf textbuf = text.mb_str();
     int len = strlen(textbuf);
@@ -1315,22 +1315,22 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
         if (c == ')' || c == '(' || c == '\\')
         {
             /* Cope with special characters */
-           fprintf( m_pstream, "\\" );
-           tmpbuf[0] = (char) c;
-           fprintf( m_pstream, tmpbuf );
+            fprintf( m_pstream, "\\" );
+            tmpbuf[0] = (char) c;
+            fprintf( m_pstream, tmpbuf );
         }
         else if ( c >= 128 )
         {
             /* Cope with character codes > 127 */
-           fprintf(m_pstream, "\\%o", c);
+            fprintf(m_pstream, "\\%o", c);
         }
         else
-       {
-           tmpbuf[0] = (char) c;
-           fprintf( m_pstream, tmpbuf );
-       }
+        {
+            tmpbuf[0] = (char) c;
+            fprintf( m_pstream, tmpbuf );
+        }
     }
-    
+
     fprintf( m_pstream, ") show\n" );
     fprintf( m_pstream, "%.8f rotate\n", -angle );
 
@@ -1340,13 +1340,13 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
         long w, h;
         GetTextExtent(text, &w, &h);
 
-        fprintf( m_pstream, 
+        fprintf( m_pstream,
                  "gsave\n"
-                 "%d %d moveto\n"              
+                 "%d %d moveto\n"
                  "%ld setlinewidth\n"
                  "%d %d lineto\n"
                  "stroke\n"
-                 "grestore\n", 
+                 "grestore\n",
                  XLOG2DEV(x), YLOG2DEV(uy),
                  (long)m_underlineThickness,
                  XLOG2DEV(x + w), YLOG2DEV(uy) );
@@ -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();
@@ -1972,7 +1972,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
         }
 #endif
 #endif
-        
+
         if (afmFile==NULL)
         {
             wxLogDebug( wxT("GetTextExtent: can't open AFM file '%hs'\n"), afmName.c_str() );
index c43b4f642866aa22df8f431c353fafcc252a2aca..bd3124e1e179c048dbad6235b83690bb19373c50 100644 (file)
@@ -109,7 +109,7 @@ wxFileData::wxFileData( const wxString &name, const wxString &fname )
 
     struct stat buff;
     stat( m_fileName.fn_str(), &buff );
-    
+
 #ifndef __EMX__
     struct stat lbuff;
     lstat( m_fileName.fn_str(), &lbuff );
@@ -187,7 +187,7 @@ wxString wxFileData::GetEntry( int num )
         }
         break;
         case 1:
-        {   
+        {
             if (m_isDir) s = _("<DIR>");
             else if (m_isLink) s = _("<LINK>");
             else s = LongToString( m_size );
@@ -396,7 +396,7 @@ void wxFileCtrl::Update()
     }
 
     SortItems( ListCompare, 0 );
-    
+
     SetColumnWidth( 1, wxLIST_AUTOSIZE );
     SetColumnWidth( 2, wxLIST_AUTOSIZE );
     SetColumnWidth( 3, wxLIST_AUTOSIZE );
@@ -586,10 +586,10 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
 
     m_message = message;
     m_dialogStyle = style;
-    
+
     if ((m_dialogStyle & wxMULTIPLE ) && !(m_dialogStyle & wxOPEN))
         m_dialogStyle |= wxOPEN;
-    
+
     m_dir = defaultDir;
     if ((m_dir.IsEmpty()) || (m_dir == wxT(".")))
     {
@@ -674,10 +674,10 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
     mainsizer->Add( staticsizer, 0, wxEXPAND | wxLEFT|wxRIGHT|wxBOTTOM, 10 );
 
     if (m_dialogStyle & wxMULTIPLE)
-        m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition, 
+        m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
                                 wxSize(440,180), wxLC_LIST | wxSUNKEN_BORDER );
     else
-        m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition, 
+        m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
                                 wxSize(440,180), wxLC_LIST | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
     mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 );
 
@@ -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 )
@@ -753,16 +753,16 @@ void wxFileDialog::OnTextEnter( wxCommandEvent &WXUNUSED(event) )
 void wxFileDialog::OnSelected( wxListEvent &event )
 {
     if (FindFocus() != m_list) return;
-    
+
     wxString filename( event.m_item.m_text );
     if (filename == wxT("..")) return;
-    
+
     wxString dir;
     m_list->GetDir( dir );
     if (dir != wxT("/")) dir += wxT("/");
     dir += filename;
     if (wxDirExists(dir)) return;
-    
+
     m_text->SetValue( filename );
 }
 
@@ -850,7 +850,7 @@ void wxFileDialog::HandleAction( const wxString &fn )
     }
 
     SetPath( filename );
-    
+
     wxCommandEvent event;
     wxDialog::OnOK(event);
 }
@@ -919,7 +919,7 @@ void wxFileDialog::GetPaths( wxArrayString& paths ) const
         paths.Add( GetPath() );
         return;
     }
-    
+
     paths.Alloc( m_list->GetSelectedItemCount() );
 
     wxString dir;
index 1fea61eafe63cc149a36ae301b63f220ff4790c4..a574efd37423096d1ff3b1e7aa2e6afceb385b06 100644 (file)
@@ -68,7 +68,7 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
     wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
 
     wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL );
-    
+
     // 1) icon
     if (style & wxICON_MASK)
     {
@@ -76,12 +76,12 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
             this, -1, wxTheApp->GetStdIcon(style & wxICON_MASK));
          icon_text->Add( icon, 0, wxCENTER );
     }
-    
+
     // 2) text
     icon_text->Add( CreateTextSizer( message ), 0, wxCENTER | wxLEFT, 10 );
-    
+
     topsizer->Add( icon_text, 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
-    
+
 #if wxUSE_STATLINE
     // 3) static line
     topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
@@ -92,7 +92,7 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
 
     SetAutoLayout( TRUE );
     SetSizer( topsizer );
-    
+
     topsizer->SetSizeHints( this );
     topsizer->Fit( this );
     wxSize size( GetSize() );
index 17236fc66b1ffb5e07d4a92543ecea3e1a4c144a..e0d39f71535c3a91aeec279a9c3751dead7a3354 100644 (file)
@@ -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 );
index 99126cbffa3c6b2527bb0ecc5598800e6c2204f0..ca8ae78b8a33f6b1524497cacd9372f658724147 100644 (file)
@@ -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);
index 7070960e1e047667d7fdef8a01bd8d618b048fb4..66878cda3781b97100acc04a41fb6dc1418abfea 100644 (file)
@@ -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__
index 80c03b97f17fac3b1e0678b2c1c178518e4ad9de..bda7f6ced70b5b6ea38f0904eec7063de825bba1 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart and Markus Holzem
-// Licence:    wxWindows license
+// Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -86,11 +86,11 @@ public:
 IMPLEMENT_DYNAMIC_CLASS(wxToolBarSimple, wxControl)
 
 BEGIN_EVENT_TABLE(wxToolBarSimple, wxToolBarBase)
-       EVT_SIZE(wxToolBarSimple::OnSize)
+    EVT_SIZE(wxToolBarSimple::OnSize)
     EVT_SCROLL(wxToolBarSimple::OnScroll)
-       EVT_PAINT(wxToolBarSimple::OnPaint)
-       EVT_KILL_FOCUS(wxToolBarSimple::OnKillFocus)
-       EVT_MOUSE_EVENTS(wxToolBarSimple::OnMouseEvent)
+    EVT_PAINT(wxToolBarSimple::OnPaint)
+    EVT_KILL_FOCUS(wxToolBarSimple::OnKillFocus)
+    EVT_MOUSE_EVENTS(wxToolBarSimple::OnMouseEvent)
 END_EVENT_TABLE()
 
 // ============================================================================
@@ -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;
index cee822d7afd75f0adafd4e3e2b28eebb8ce2dfb3..e5e86c96e1e7506a846bb3ec2366c29056b20e62 100644 (file)
@@ -80,12 +80,12 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
     m_value = value;
 
     wxBeginBusyCursor();
-    
+
     wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
 
     // 1) text message
     topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
-    
+
     // 2) text ctrl
     m_textctrl = new wxTextCtrl(this, wxID_TEXT, value, wxDefaultPosition, wxSize(300, -1));
     topsizer->Add( m_textctrl, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );
@@ -97,10 +97,10 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
 
     // 4) buttons
     topsizer->Add( CreateButtonSizer( style ), 0, wxCENTRE | wxALL, 10 );
-    
+
     SetAutoLayout( TRUE );
     SetSizer( topsizer );
-    
+
     topsizer->SetSizeHints( this );
     topsizer->Fit( this );