Anonymous avatar Anonymous committed 0fea62f

Fixed warnings when compiling for 64-bit Windows.

Comments (0)

Files changed (15)

Contrib/AdvSplash/advsplash.c

 }
 
 void CALLBACK TimeProc(UINT uID,
-                       UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
+                       UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2)
 {
   int call = -1;
   switch (state) {

Contrib/Banner/Banner.c

 
 TCHAR buf[1024];
 
-BOOL CALLBACK BannerProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK BannerProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   if (uMsg == WM_INITDIALOG)
   {

Contrib/InstallOptions/InstallerOptions.cpp

     // this if statement prevents a stupid bug where a min/max length is assigned to a label control
     // where the user obviously has no way of changing what is displayed. (can you say, "infinite loop"?)
     if (pField->nType >= FIELD_CHECKLEN) {
-      nLength = mySendMessage(pField->hwnd, WM_GETTEXTLENGTH, 0, 0);
+      nLength = (int)mySendMessage(pField->hwnd, WM_GETTEXTLENGTH, 0, 0);
 
       if (((pField->nMaxLength > 0) && (nLength > pField->nMaxLength)) ||
          ((pField->nMinLength > 0) && (nLength < pField->nMinLength))) {
         if (!pszItem) return false;
 
         *pszBuffer = _T('\0');
-        int nNumItems = mySendMessage(hwnd, LB_GETCOUNT, 0, 0);
+        int nNumItems = (int)mySendMessage(hwnd, LB_GETCOUNT, 0, 0);
         for (int nIdx2 = 0; nIdx2 < nNumItems; nIdx2++) {
           if (mySendMessage(hwnd, LB_GETSEL, nIdx2, 0) > 0) {
             if (*pszBuffer) lstrcat(pszBuffer, _T("|"));
       case FIELD_DIRREQUEST:
       case FIELD_COMBOBOX:
       {
-        int nLength = mySendMessage(pField->hwnd, WM_GETTEXTLENGTH, 0, 0);
+        int nLength = (int)mySendMessage(pField->hwnd, WM_GETTEXTLENGTH, 0, 0);
         if (nLength > nBufLen) {
           FREE(pszBuffer);
           // add a bit extra so we do this less often
                 // CharNext()'s behavior at terminating null char.  But still
                 // definitely, unsafe.
               default:
-                lstrcpyn(p2, p1, CharNext(p1) - p1 + 1);
+                lstrcpyn(p2, p1, (int)(CharNext(p1) - p1 + 1));
                 break;
             }
           }
 #endif
 
 // pFields[nIdx].nParentIdx is used to store original windowproc
-int WINAPI StaticLINKWindowProc(HWND hWin, UINT uMsg, WPARAM wParam, LPARAM lParam)
+LRESULT WINAPI StaticLINKWindowProc(HWND hWin, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   int StaticField = FindControlIdx(GetDlgCtrlID(hWin));
   if (StaticField < 0)
 }
 #endif
 
-int WINAPI NumbersOnlyPasteWndProc(HWND hWin, UINT uMsg, WPARAM wParam, LPARAM lParam)
+LRESULT WINAPI NumbersOnlyPasteWndProc(HWND hWin, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   int nIdx = FindControlIdx(GetDlgCtrlID(hWin));
   if (nIdx < 0)
                     *pszEnd = _T('\0');
                     if (*pszStart)
                     {
-                      int nItem = mySendMessage(hwCtrl, LB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pszStart);
+                      int nItem = (int)mySendMessage(hwCtrl, LB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pszStart);
                       if (nItem != LB_ERR)
                         mySendMessage(hwCtrl, LB_SETSEL, TRUE, nItem);
                     }
                 }
               }
               else {
-                int nItem = mySendMessage(hwCtrl, nFindMsg, (WPARAM)-1, (LPARAM)pField->pszState);
+                int nItem = (int)mySendMessage(hwCtrl, nFindMsg, (WPARAM)-1, (LPARAM)pField->pszState);
                 if (nItem != CB_ERR) { // CB_ERR == LB_ERR == -1
                   mySendMessage(hwCtrl, nSetSelMsg, nItem, 0);
                 }
         case FIELD_ICON:
         case FIELD_BITMAP:
         {
-          WPARAM nImageType = pField->nType == FIELD_BITMAP ? IMAGE_BITMAP : IMAGE_ICON;
+          int nImageType = pField->nType == FIELD_BITMAP ? IMAGE_BITMAP : IMAGE_ICON;
           LPARAM nImage = 0;
 
           if (pField->pszText) {

Contrib/LangDLL/LangDLL.c

   UINT cp;
 } *langs;
 
-BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-  int i, size;
+  INT_PTR i;
+  int size;
   TCHAR *selected_language = NULL;
   static HFONT font;
   switch (uMsg) {
       for (i = visible_langs_num - 1; i >= 0; i--) {
         int cbi;
 
-        cbi = SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM) langs[i].name);
+        cbi = (int)SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM) langs[i].name);
         SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_SETITEMDATA, cbi, (LPARAM) langs[i].id);
 
         // remember selected language

Contrib/Library/RegTool/RegTool.c

   LPCSTR szRenameSec = "[Rename]\r\n"; // rename section marker
   HANDLE hfile;
   DWORD dwFileSize;
-  DWORD dwBytes;
+  SIZE_T dwBytes;
   DWORD dwRenameLinePos;
   char *pszWinInit;   // Contains the file contents of wininit.ini
 

Contrib/Makensisw/makensisw.cpp

   if (g_sdata.sigint_event) CloseHandle(g_sdata.sigint_event);
   FreeLibrary(hRichEditDLL);
   FinalizeUpdate();
-  ExitProcess(msg.wParam);
-  return msg.wParam;
+  ExitProcess((UINT)msg.wParam);
+  return (int)msg.wParam;
 }
 
 void SetScript(const TCHAR *script, bool clearArgs /*= true*/)
           if (GetSaveFileName(&l)) {
             HANDLE hFile = CreateFile(buf,GENERIC_WRITE,0,0,CREATE_ALWAYS,0,0);
             if (hFile) {
-              int len=SendDlgItemMessage(g_sdata.hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
+              int len=(int)SendDlgItemMessage(g_sdata.hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
               TCHAR *existing_text=(TCHAR*)GlobalAlloc(GPTR,len * sizeof(TCHAR));
               existing_text[0]=0;
               GetDlgItemText(g_sdata.hwnd, IDC_LOGWIN, existing_text, len);
       SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_EXGETSEL, 0, (LPARAM)&ft.chrg);
       if (ft.chrg.cpMax == ft.chrg.cpMin) ft.chrg.cpMin = 0;
       else ft.chrg.cpMin = ft.chrg.cpMax;
-      ft.chrg.cpMax = SendDlgItemMessage(hwndDlg, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0);
+      ft.chrg.cpMax = (int)SendDlgItemMessage(hwndDlg, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0);
       ft.lpstrText = lpfr->lpstrFindWhat;
-      ft.chrg.cpMin = SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_FINDTEXTEX, flags, (LPARAM)&ft);
+      ft.chrg.cpMin = (int)SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_FINDTEXTEX, flags, (LPARAM)&ft);
       if (ft.chrg.cpMin != -1) SendDlgItemMessage(hwndDlg, IDC_LOGWIN, EM_SETSEL, ft.chrgText.cpMin, ft.chrgText.cpMax);
       else MessageBeep(MB_ICONASTERISK);
     }
 
 void EnableSymbolSetButtons(HWND hwndDlg)
 {
-  int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETCOUNT, 0, 0);
+  int n = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETCOUNT, 0, 0);
   if(n > 0) {
     EnableWindow(GetDlgItem(hwndDlg, IDCLEAR), TRUE);
     EnableWindow(GetDlgItem(hwndDlg, IDSAVE), TRUE);
 
 void EnableSymbolEditButtons(HWND hwndDlg)
 {
-  int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
+  int n = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
   if(n == 0) {
     EnableWindow(GetDlgItem(hwndDlg, IDLEFT), FALSE);
     EnableWindow(GetDlgItem(hwndDlg, IDDEL), FALSE);
 
 TCHAR **GetSymbols(HWND hwndDlg)
 {
-  int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETCOUNT, 0, 0);
+  int n = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETCOUNT, 0, 0);
   TCHAR **symbols = NULL;
   if(n > 0) {
     HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, (n+1)*sizeof(TCHAR *));
     symbols = (TCHAR **)GlobalLock(hMem);
     for (int i = 0; i < n; i++) {
-      int len = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXTLEN, (WPARAM)i, 0);
+      int len = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXTLEN, (WPARAM)i, 0);
       symbols[i] = (TCHAR *)GlobalAlloc(GPTR, (len+1)*sizeof(TCHAR));
       SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXT, (WPARAM)i, (LPARAM)symbols[i]);
     }
           ResetSymbols();
           g_sdata.symbols = GetSymbols(hwndDlg);
 
-          int n = SendDlgItemMessage(hwndDlg, IDC_COMPRESSOR, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
+          int n = (int)SendDlgItemMessage(hwndDlg, IDC_COMPRESSOR, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
           if (n >= (int)COMPRESSOR_SCRIPT && n <= (int)COMPRESSOR_BEST) {
             g_sdata.default_compressor = (NCOMPRESSOR)n;
           }
           break;
         case IDRIGHT:
         {
-          int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXTLENGTH, 0, 0);
+          int n = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXTLENGTH, 0, 0);
           if(n > 0) {
             TCHAR *buf = (TCHAR *)GlobalAlloc(GPTR, (n+1)*sizeof(TCHAR));
             SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXT, n+1, (LPARAM)buf);
               break;
             }
 
-            n = SendDlgItemMessage(hwndDlg, IDC_VALUE, WM_GETTEXTLENGTH, 0, 0);
+            n = (int)SendDlgItemMessage(hwndDlg, IDC_VALUE, WM_GETTEXTLENGTH, 0, 0);
             if(n > 0) {
               TCHAR *buf2 = (TCHAR *)GlobalAlloc(GPTR, (n+1)*sizeof(TCHAR));
               SendDlgItemMessage(hwndDlg, IDC_VALUE, WM_GETTEXT, n+1, (LPARAM)buf2);
               buf = buf3;
               GlobalFree(buf2);
             }
-            int idx = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_ADDSTRING, 0, (LPARAM)buf);
+            int idx = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_ADDSTRING, 0, (LPARAM)buf);
             if (idx >= 0)
             {
               SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_SETSEL, FALSE, -1);
             break;
 
           int index;
-          int num = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, 1, (LPARAM) &index);
+          int num = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, 1, (LPARAM) &index);
           if(num == 1) {
-            int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXTLEN, (WPARAM)index, 0);
+            int n = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXTLEN, (WPARAM)index, 0);
             if(n > 0) {
               TCHAR *buf = (TCHAR *)GlobalAlloc(GPTR, (n+1)*sizeof(TCHAR));
               SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETTEXT, (WPARAM)index, (LPARAM)buf);
         break;
         case IDDEL:
         {
-          int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
+          int n = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
           int *items = (int *)GlobalAlloc(GPTR, n*sizeof(int));
           SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, (WPARAM)n, (LPARAM)items);
           int i;
         case IDC_SYMBOL:
           if(HIWORD(wParam) == EN_CHANGE)
           {
-            int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXTLENGTH, 0, 0);
+            int n = (int)SendDlgItemMessage(hwndDlg, IDC_SYMBOL, WM_GETTEXTLENGTH, 0, 0);
             if(n > 0) {
               EnableWindow(GetDlgItem(hwndDlg, IDRIGHT), TRUE);
             }
         case IDOK:
         {
           int n;
-          n = SendDlgItemMessage(hwndDlg, IDC_COMPRESSOR, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
+          n = (int)SendDlgItemMessage(hwndDlg, IDC_COMPRESSOR, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
           if(n >= (int)COMPRESSOR_SCRIPT && n <= (int)COMPRESSOR_BEST) {
             SetCompressor((NCOMPRESSOR)n);
           }
         }
         case IDDEL:
         {
-          int n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
+          int n = (int)SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
           if(n != CB_ERR) {
-            long len = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETLBTEXTLEN, (WPARAM)n, 0);
+            long len = (int)SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETLBTEXTLEN, (WPARAM)n, 0);
             TCHAR *buf = (TCHAR *)GlobalAlloc(GPTR, (len+1)*sizeof(TCHAR));
             if(SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETLBTEXT, (WPARAM)n, (LPARAM)buf) != CB_ERR) {
               SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_DELETESTRING, n, 0);
         {
           if(HIWORD(wParam) == CBN_SELCHANGE)
           {
-            int n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
+            int n = (int)SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
             if(n == CB_ERR) {
               EnableWindow(GetDlgItem(hwndDlg, IDDEL), FALSE);
             }
           }
           else if(HIWORD(wParam) == CBN_DBLCLK)
           {
-            int n = SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
+            int n = (int)SendDlgItemMessage(hwndDlg, IDC_NAMES, CB_GETCURSEL, 0, 0);
             if (n != CB_ERR)
             {
               SendDlgItemMessage(hwndDlg, IDOK, BM_CLICK, 0, 0);

Contrib/Makensisw/utils.cpp

 
 void CopyToClipboard(HWND hwnd) {
   if (!hwnd||!OpenClipboard(hwnd)) return;
-  int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
+  int len=(int)SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
   HGLOBAL mem = GlobalAlloc(GMEM_MOVEABLE,(len+1)*sizeof(TCHAR));
   if (!mem) { CloseClipboard(); return; }
   TCHAR *existing_text = (TCHAR *)GlobalLock(mem);
   TCHAR buf[1024];
   bool found = false;
 
-  line_count = SendDlgItemMessage(g_sdata.hwnd, IDC_LOGWIN, EM_GETLINECOUNT, 0, 0);
+  line_count = (DWORD)SendDlgItemMessage(g_sdata.hwnd, IDC_LOGWIN, EM_GETLINECOUNT, 0, 0);
   for(i=0; i<line_count; i++) {
     *((LPWORD)buf) = sizeof(buf); 
     SendDlgItemMessage(g_sdata.hwnd, IDC_LOGWIN, EM_GETLINE, (WPARAM)i, (LPARAM)buf);

Contrib/NSISdl/connection.h

     short get_remote_port(void) { return m_remote_port; } // this returns the remote port of connection
   
   protected:
-    int  m_socket;
+    SOCKET m_socket;
     short m_remote_port;
     char *m_recv_buffer;
     char *m_send_buffer;

Contrib/NSISdl/nsisdl.cpp

 
         long c;
 
-        c = SendMessage(hwndP, PBM_SETBARCOLOR, 0, 0);
+        c = (long)SendMessage(hwndP, PBM_SETBARCOLOR, 0, 0);
         SendMessage(hwndP, PBM_SETBARCOLOR, 0, c);
         SendMessage(pb, PBM_SETBARCOLOR, 0, c);
 
-        c = SendMessage(hwndP, PBM_SETBKCOLOR, 0, 0);
+        c = (long)SendMessage(hwndP, PBM_SETBKCOLOR, 0, 0);
         SendMessage(hwndP, PBM_SETBKCOLOR, 0, c);
         SendMessage(pb, PBM_SETBKCOLOR, 0, c);
 
         // set font
-        long hFont = SendMessage((HWND) lParam, WM_GETFONT, 0, 0);
-        SendMessage(pb, WM_SETFONT, hFont, 0);
-        SendMessage(s, WM_SETFONT, hFont, 0);
+        HFONT hFont = (HFONT)SendMessage((HWND) lParam, WM_GETFONT, 0, 0);
+        SendMessage(pb, WM_SETFONT, (WPARAM)hFont, 0);
+        SendMessage(s, WM_SETFONT, (WPARAM)hFont, 0);
 
         ShowWindow(pb, SW_SHOWNA);
         ShowWindow(s, SW_SHOWNA);

Contrib/StartMenu/StartMenu.c

 
 void (__stdcall *validate_filename)(TCHAR *);
 
-BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
 static BOOL CALLBACK ParentWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
 void AddFolderFromReg(int nFolder);
 
 {
   long s;
 
-  s = GetWindowLongPtr(hWnd, GWL_STYLE);
-  SetWindowLongPtr(hWnd, GWL_STYLE, s | dwStyle);
-  s = GetWindowLongPtr(hWnd, GWL_EXSTYLE);
-  SetWindowLongPtr(hWnd, GWL_EXSTYLE, s | WS_EX_RIGHT | WS_EX_RTLREADING);
+  s = GetWindowLong(hWnd, GWL_STYLE);
+  SetWindowLong(hWnd, GWL_STYLE, s | dwStyle);
+  s = GetWindowLong(hWnd, GWL_EXSTYLE);
+  SetWindowLong(hWnd, GWL_EXSTYLE, s | WS_EX_RIGHT | WS_EX_RTLREADING);
 }
 
 #define ProgressiveSetWindowPos(hwWindow, x, cx, cy) \
    \
   y_offset += cy + 3;
 
-BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   HWND hwLocation = GetDlgItem(hwndDlg, IDC_LOCATION);
   HWND hwDirList = GetDlgItem(hwndDlg, IDC_DIRLIST);

Contrib/nsDialogs/nsDialogs.c

   return &g_dialog.controls[id - 1];
 }
 
-BOOL CALLBACK ParentProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK ParentProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
-  BOOL res;
+  LRESULT res;
 
   if (message == WM_NOTIFY_OUTER_NEXT)
   {
   return CallWindowProc(ctl->oldWndProc, hwnd, message, wParam, lParam);
 }
 
-BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   switch (uMsg)
   {

Contrib/nsExec/nsexec.c

 #ifndef _UNICODE
   if (bOEM == TRUE) OemToCharBuff(pStr, (char*)pStr, lstrlen(pStr));
 #endif
-  nItemCount=SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);
+  nItemCount=(int)SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);
   item.mask=LVIF_TEXT;
   item.pszText=(TCHAR *)pStr;
   item.cchTextMax=0;

Source/exehead/Ui.c

 }
 
 #ifdef NSIS_CONFIG_VISIBLE_SUPPORT
-BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
 static int CALLBACK WINAPI BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
 #ifdef NSIS_CONFIG_LICENSEPAGE
-static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
 #endif
-static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-static BOOL CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
 #endif//NSIS_CONFIG_VISIBLE_SUPPORT
 
 static DWORD WINAPI install_thread(LPVOID p);
 static void NSISCALL set_language()
 {
   LANGID lang_mask=(LANGID)~0;
-  LANGID lang=myatoi(state_language);
+  LANGID lang=(LANGID)myatoi(state_language);
   char *language_table=0;
   int lang_num;
   int *selected_langtable=0;
   return 0;
 }
 
-BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   if (uMsg == WM_INITDIALOG || uMsg == WM_NOTIFY_OUTER_NEXT)
   {
 #endif
     };
 
-    m_delta = wParam;
+    m_delta = (int)wParam;
 
     if (uMsg == WM_INITDIALOG)
     {
 #include <richedit.h>
 #undef _RICHEDIT_VER
 static DWORD dwRead;
-DWORD CALLBACK StreamLicense(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
+DWORD CALLBACK StreamLicense(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 {
   lstrcpyn((LPTSTR)pbBuff,(LPTSTR)(dwCookie+dwRead),cb/sizeof(TCHAR));
   *pcb=lstrlen((LPTSTR)pbBuff)*sizeof(TCHAR);
 }
 #ifdef _UNICODE
 // on-the-fly conversion of Unicode to ANSI (because Windows doesn't recognize Unicode RTF data)
-DWORD CALLBACK StreamLicenseRTF(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
+DWORD CALLBACK StreamLicenseRTF(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
 {
   size_t len = lstrlen(((LPWSTR) dwCookie)+dwRead);
   len = min(len, cb/sizeof(WCHAR));
 }
 #endif
 
-static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   page *m_this_page=g_this_page;
   HWND hwLicense;
 #endif
 
 #ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
-static BOOL CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   if (uMsg == WM_INITDIALOG)
   {
 
 #define sumsecsfield(x) _sumsecsfield(SECTION_OFFSET(x))
 
-static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   static int dontsetdefstyle;
   page *thispage = g_this_page;
     {
       static TCHAR bt[NSIS_MAX_STRLEN];
       BROWSEINFO bi = {0,};
-      ITEMIDLIST *idlist;
+      LPITEMIDLIST idlist;
       bi.hwndOwner = hwndDlg;
       bi.pszDisplayName = g_tmp;
       bi.lpfn = BrowseCallbackProc;
 
 static WNDPROC oldTreeWndProc;
 static LPARAM last_selected_tree_item;
-static DWORD WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static LRESULT WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   if (uMsg == WM_CHAR && wParam == VK_SPACE) {
     NotifyCurWnd(WM_TREEVIEW_KEYHACK);
   return CallWindowProc(oldTreeWndProc,hwnd,uMsg,wParam,lParam);
 }
 
-static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   const int wParamSelChangeNotifyInstTypeChanged = -1;
   static HTREEITEM *hTreeItems;
       {
         int j;
         if (i != NSIS_MAX_INST_TYPES) noCombo = 0;
-        j=SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)GetNSISStringTT(install_types[i]));
+        j=(int)SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)GetNSISStringTT(install_types[i]));
         SendMessage(hwndCombo1,CB_SETITEMDATA,j,i);
       }
     }
 
   if (uMsg == WM_COMMAND && LOWORD(wParam) == IDC_COMBO1 && HIWORD(wParam) == CBN_SELCHANGE)
   {
-    int t = SendMessage(hwndCombo1,CB_GETCURSEL,0,0);
+    int t = (int)SendMessage(hwndCombo1,CB_GETCURSEL,0,0);
     if (t != CB_ERR)
     {
-      int whichcfg = SendMessage(hwndCombo1, CB_GETITEMDATA, t, 0);
+      int whichcfg = (int)SendMessage(hwndCombo1, CB_GETITEMDATA, t, 0);
 
       if (whichcfg == CB_ERR || !install_types[whichcfg])
         whichcfg = NSIS_MAX_INST_TYPES;
 #if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_COMPONENTPAGE)
     if (wParam != 0)
     {
-      int secid = wParam;
+      int secid = (int)wParam;
       if (wParamSelChangeNotifyInstTypeChanged != secid) --secid;
       ExecuteCallbackFunctionWithr0Int(CB_ONSELCHANGE,secid);
     }
 
 #ifdef NSIS_CONFIG_VISIBLE_SUPPORT
 
-static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   HWND linsthwnd=insthwnd;
   if (uMsg == WM_INITDIALOG)
         i = count;
         while (i--)
           // Add 2 for the CR/LF combination that must follow every line.
-          total += 2+SendMessage(linsthwnd,LVM_GETITEMTEXT,i,(LPARAM)&item);
+          total += 2+(int)SendMessage(linsthwnd,LVM_GETITEMTEXT,i,(LPARAM)&item);
 
         // 2nd pass - store detail view strings on the clipboard
         // Clipboard MSDN docs say mem must be GMEM_MOVEABLE

Source/exehead/exec.c

 {
   if (v < 0)
   {
-    return myatoi(g_usrvars[-(v+1)]);
+    return (int)myatoi(g_usrvars[-(v+1)]);
   }
   return v;
 }
   return (int)myatoi(GetNSISStringTT(parms[id_]));
 }
 
-static int NSISCALL GetIntPtrFromParm(int id_)
+static INT_PTR NSISCALL GetIntPtrFromParm(int id_)
 {
   return myatoi(GetNSISStringTT(parms[id_]));
 }
     case EW_FINDWINDOW:
     case EW_SENDMESSAGE:
       {
-        int v;
+        DWORD_PTR v;
         INT_PTR b3=GetIntPtrFromParm(3);
         INT_PTR b4=GetIntPtrFromParm(4);
         if (parm5&1) b3=(INT_PTR)GetStringFromParm(0x33);
           HWND hwnd=(HWND)GetIntPtrFromParm(1);
           int msg=GetIntFromParm(2);
 
-          if (parm5>>2) exec_error += !SendMessageTimeout(hwnd,msg,b3,b4,SMTO_NORMAL,parm5>>2,(LPDWORD)&v);
+          if (parm5>>2) exec_error += !SendMessageTimeout(hwnd,msg,b3,b4,SMTO_NORMAL,parm5>>2,&v);
           // Jim Park: This sends script messages.  Some messages require
           // settings for Unicode.  This means the user's script may need
           // to change for Unicode NSIS.
         {
           TCHAR *buf0=GetStringFromParm(0x01);
           TCHAR *buf1=GetStringFromParm(0x12);
-          v=(int)FindWindowEx((HWND)b3,(HWND)b4,buf0[0]?buf0:NULL,buf1[0]?buf1:NULL);
+          v=(DWORD_PTR)FindWindowEx((HWND)b3,(HWND)b4,buf0[0]?buf0:NULL,buf1[0]?buf1:NULL);
         }
 
         if (parm0>=0)

Source/exehead/fileform.c

 
 #ifdef NSIS_CONFIG_VISIBLE_SUPPORT
 #if defined(NSIS_CONFIG_CRC_SUPPORT) || defined(NSIS_COMPRESS_WHOLE)
-BOOL CALLBACK verProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK verProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   if (uMsg == WM_INITDIALOG)
   {
 static char _outbuffer[OBUFSIZE];
 extern int m_length;
 extern int m_pos;
-extern BOOL CALLBACK verProc(HWND, UINT, WPARAM, LPARAM);
-extern BOOL CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
+extern INT_PTR CALLBACK verProc(HWND, UINT, WPARAM, LPARAM);
+extern INT_PTR CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
 static int NSISCALL __ensuredata(int amount)
 {
   int needed=amount-(dbd_size-dbd_pos);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.