From: Sam Hartman Date: Fri, 14 Oct 2011 14:40:36 +0000 (+0000) Subject: Fixed some warnings and Windows 64 portability issues in the leash executable X-Git-Tag: krb5-1.10-alpha1~37 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a0216e21ff6d3885557d145c78c8547187cbc83a;p=krb5.git Fixed some warnings and Windows 64 portability issues in the leash executable Signed-off-by: Alexey Melnikov git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25338 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/windows/leash/CLeashDragListBox.cpp b/src/windows/leash/CLeashDragListBox.cpp index 205889b86..275388430 100644 --- a/src/windows/leash/CLeashDragListBox.cpp +++ b/src/windows/leash/CLeashDragListBox.cpp @@ -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); diff --git a/src/windows/leash/Leash.cpp b/src/windows/leash/Leash.cpp index eb2c11026..dbd2fe513 100644 --- a/src/windows/leash/Leash.cpp +++ b/src/windows/leash/Leash.cpp @@ -37,6 +37,8 @@ #include +#include + #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); diff --git a/src/windows/leash/LeashMessageBox.cpp b/src/windows/leash/LeashMessageBox.cpp index 0fd218229..fd96bc828 100644 --- a/src/windows/leash/LeashMessageBox.cpp +++ b/src/windows/leash/LeashMessageBox.cpp @@ -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 diff --git a/src/windows/leash/LeashMessageBox.h b/src/windows/leash/LeashMessageBox.h index 57f1360a8..93174059a 100644 --- a/src/windows/leash/LeashMessageBox.h +++ b/src/windows/leash/LeashMessageBox.h @@ -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: diff --git a/src/windows/leash/LeashView.cpp b/src/windows/leash/LeashView.cpp index a2f93336b..e97ab762d 100644 --- a/src/windows/leash/LeashView.cpp +++ b/src/windows/leash/LeashView.cpp @@ -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 diff --git a/src/windows/leash/LeashView.h b/src/windows/leash/LeashView.h index 591bc426f..36d842306 100644 --- a/src/windows/leash/LeashView.h +++ b/src/windows/leash/LeashView.h @@ -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)