Fixed some warnings and Windows 64 portability issues in the leash executable
authorSam Hartman <hartmans@mit.edu>
Fri, 14 Oct 2011 14:40:36 +0000 (14:40 +0000)
committerSam Hartman <hartmans@mit.edu>
Fri, 14 Oct 2011 14:40:36 +0000 (14:40 +0000)
Signed-off-by: Alexey Melnikov <aamelnikov@gmail.com>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25338 dc483132-0cff-0310-8789-dd5450dbe970

src/windows/leash/CLeashDragListBox.cpp
src/windows/leash/Leash.cpp
src/windows/leash/LeashMessageBox.cpp
src/windows/leash/LeashMessageBox.h
src/windows/leash/LeashView.cpp
src/windows/leash/LeashView.h

index 205889b8609f0213c41697de1cd8a2632b84abe2..27538843016c01e17c6d75caafbdcbd07f6e92c3 100644 (file)
@@ -66,7 +66,7 @@ void CLeashDragListBox::Dropped(int nSrcIndex, CPoint pt)
        if (nDestIndex == nSrcIndex || nDestIndex == nSrcIndex+1)
                return; //didn't move
        CString str1, str2;
-       DWORD dwData;
+       DWORD_PTR dwData;
        GetText(nSrcIndex, str1);
        GetText(nDestIndex, str2);
        dwData = GetItemData(nSrcIndex);
index eb2c11026c11c3124c7ffe87a5a0a5c4170371b4..dbd2fe5134028d5b101b5b2c1249a1252c2de9f9 100644 (file)
@@ -37,6 +37,8 @@
 
 #include <errno.h>
 
+#include <afxwin.h>
+
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #undef THIS_FILE
@@ -191,9 +193,9 @@ BOOL CLeashApp::InitInstance()
                 0 == stricmp(optionParam+1, "i"))
             {
                 LSH_DLGINFO_EX ldi;
-                               char username[64]="";
-                               char realm[192]="";
-                               int i=0, j=0;
+               char username[64]="";
+               char realm[192]="";
+               int i=0, j=0;
                 TicketList* ticketList = NULL;
                 if (WaitForSingleObject( ticketinfo.lockObj, INFINITE ) != WAIT_OBJECT_0)
                     throw("Unable to lock ticketinfo");
@@ -947,7 +949,7 @@ CLeashApp::ValidateConfigFiles()
                 }
 
                 char realmkey[256]="SYSTEM\\CurrentControlSet\\Control\\Lsa\\Kerberos\\Domains\\";
-                int  keylen = strlen(realmkey)-1;
+                size_t  keylen = strlen(realmkey)-1;
 
                 if ( domain[0] ) {
                     strncpy(realm,domain,256);
index 0fd21822917596b75af286e943c59c3fe1f8b132..fd96bc8286a1c04ee357a4a705cb47511805a13c 100644 (file)
@@ -61,7 +61,7 @@ END_MESSAGE_MAP()
 /////////////////////////////////////////////////////////////////////////////
 // CLeashMessageBox message handlers
 
-void CALLBACK CLeashMessageBox::MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT idEvent, DWORD dwTime)
+void CALLBACK CLeashMessageBox::MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT_PTR idEvent, DWORD dwTime)
 {
        ::KillTimer(hwnd, 2);
        ::SendMessage(hwnd, WM_CLOSE, 0, 0);
@@ -76,7 +76,7 @@ void CLeashMessageBox::OnOK()
 BOOL CLeashMessageBox::OnInitDialog()
 {
        CDialog::OnInitDialog();
-       UINT idTimer = SetTimer(2, m_dwTime, (TIMERPROC)MessageBoxTimer);
+       UINT_PTR idTimer = SetTimer(2, m_dwTime, &MessageBoxTimer);
 
        return TRUE;  // return TRUE unless you set the focus to a control
                      // EXCEPTION: OCX Property Pages should return FALSE
index 57f1360a8eb941a31358715d89da7e7cbcad00a4..93174059ab3f33943f9239693763cba9bda7473c 100644 (file)
@@ -31,7 +31,7 @@ class CLeashMessageBox : public CDialog
 {
 private:
        static DWORD m_dwTime;
-       static void CALLBACK MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT idEvent, DWORD dwTime);
+       static void CALLBACK MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT_PTR idEvent, DWORD dwTime);
 
        // Construction
 public:
index a2f93336b0bd77589f0ad7a95439d31130eb3ebe..e97ab762d2a61c3ea6f6aba5f3546a5943e95ea9 100644 (file)
@@ -96,7 +96,7 @@ BEGIN_MESSAGE_MAP(CLeashView, CFormView)
 END_MESSAGE_MAP()
 
 
-LONG CLeashView::m_ticketTimeLeft = 0;  // # of seconds left before tickets expire
+time_t CLeashView::m_ticketTimeLeft = 0;  // # of seconds left before tickets expire
 INT  CLeashView::m_forwardableTicket = 0;
 INT  CLeashView::m_proxiableTicket = 0;
 INT  CLeashView::m_renewableTicket = 0;
@@ -242,7 +242,7 @@ VOID CLeashView::OnClose(void)
     printf("OnClose\n");
 }
 
-LONG CLeashView::LeashTime()
+time_t CLeashView::LeashTime()
 {
     _tzset();
     return time(0);
@@ -285,7 +285,7 @@ VOID CLeashView::UpdateTicketTime(TICKETINFO& ti)
 
 
 VOID CALLBACK EXPORT CLeashView::TimerProc(HWND hWnd, UINT nMsg,
-                                           UINT nIDEvent, DWORD dwTime)
+                                           UINT_PTR nIDEvent, DWORD dwTime)
 {
     // All of the work is being done in the PreTranslateMessage method
     // in order to have access to the object
index 591bc426fd298cab3b6bf9d85d3b502e8f8e253b..36d842306df1534f6d4130d5f1c5d55297e7aa9c 100644 (file)
@@ -114,8 +114,8 @@ private:
     static INT                 m_warningOfTicketTimeLeftLockKrb5;
     static INT                 m_updateDisplayCount;
     static INT         m_alreadyPlayedDisplayCount;
-    static LONG                        m_ticketTimeLeft;
-       static BOOL                     m_lowTicketAlarmSound;
+    static time_t              m_ticketTimeLeft;
+    static BOOL                        m_lowTicketAlarmSound;
     static LONG         m_timerMsgNotInProgress;
 
        VOID ResetTreeNodes();
@@ -130,19 +130,19 @@ private:
     //void   GetRowWidthHeight(CDC* pDC, LPCSTR theString, int& nRowWidth,
     //                         int& nRowHeight, int& nCharWidth);
     static VOID        AlarmBeep();
-       static VOID     CALLBACK EXPORT TimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent,
-                                          DWORD dwTime);
-       static VOID     UpdateTicketTime(TICKETINFO& ticketinfo);
-       static INT      GetLowTicketStatus(int);
-       static LONG     LeashTime();
+    static VOID        CALLBACK EXPORT TimerProc(HWND hWnd, UINT nMsg, UINT_PTR nIDEvent,
+                                         DWORD dwTime);
+    static VOID        UpdateTicketTime(TICKETINFO& ticketinfo);
+    static INT GetLowTicketStatus(int);
+    static time_t      LeashTime();
 
     void   SetTrayIcon(int nim, int state=0);
     void   SetTrayText(int nim, CString tip);
 
     BOOL   UpdateDisplay();
     static UINT InitTicket(void *);
-       static UINT RenewTicket(void *);
-       static UINT ImportTicket(void *);
+    static UINT RenewTicket(void *);
+    static UINT ImportTicket(void *);
 
 protected: // create from serialization only
        DECLARE_DYNCREATE(CLeashView)