windows-vs2005b2-20050706
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 7 Jul 2005 01:23:15 +0000 (01:23 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 7 Jul 2005 01:23:15 +0000 (01:23 +0000)
Visual Studio 2005 Beta 2 has been released.   As part of this
release Microsoft has tightened the rules for their C++ compliance.

* no longer can a variable declared in a for() statement be used
  outside of the associated command block

* no longer can a function or variable be declared implicitly as
  'int'

* several types such as size_t have become 64-bit values on all platforms

* due to type changes the C++ function names in libraries have changed.
  This requires the use of different .DEF file export lists

65 files changed:
src/WINNT/afsadmsvr/TaAfsAdmSvrCallback.cpp
src/WINNT/afsadmsvr/TaAfsAdmSvrClientNotify.cpp
src/WINNT/afsadmsvr/TaAfsAdmSvrClientPing.cpp
src/WINNT/afsadmsvr/TaAfsAdmSvrGeneral.cpp
src/WINNT/afsadmsvr/TaAfsAdmSvrProperties.cpp
src/WINNT/afsapplib/NTMakefile
src/WINNT/afsapplib/TaAfsAppLib2005.def [new file with mode: 0644]
src/WINNT/afsapplib/al_help.cpp
src/WINNT/afsapplib/al_misc.cpp
src/WINNT/afsapplib/al_pump.cpp
src/WINNT/afsapplib/al_wizard.cpp
src/WINNT/afsapplib/ctl_date.cpp
src/WINNT/afsapplib/ctl_elapsed.cpp
src/WINNT/afsapplib/ctl_sockaddr.cpp
src/WINNT/afsapplib/ctl_spinner.cpp
src/WINNT/afsapplib/ctl_time.cpp
src/WINNT/afsapplib/dialog.cpp
src/WINNT/afsapplib/fastlist.cpp
src/WINNT/afsapplib/hashlist.cpp
src/WINNT/afsapplib/regexp.cpp
src/WINNT/afsapplib/resize.cpp
src/WINNT/afsapplib/subclass.cpp
src/WINNT/afsclass/afsclassfn.cpp
src/WINNT/afsclass/c_cell.cpp
src/WINNT/afsclass/c_notify.cpp
src/WINNT/afsclass/c_svr.cpp
src/WINNT/afsclass/internal.cpp
src/WINNT/afsd/afslogon.h
src/WINNT/afssvrcfg/config_server_page.cpp
src/WINNT/afssvrcfg/get_cur_config.cpp
src/WINNT/afssvrmgr/action.cpp
src/WINNT/afssvrmgr/alert.cpp
src/WINNT/afssvrmgr/cmdline.cpp
src/WINNT/afssvrmgr/columns.cpp
src/WINNT/afssvrmgr/dispatch.cpp
src/WINNT/afssvrmgr/display.cpp
src/WINNT/afssvrmgr/general.cpp
src/WINNT/afssvrmgr/helpfunc.cpp
src/WINNT/afssvrmgr/propcache.cpp
src/WINNT/afssvrmgr/svc_prop.cpp
src/WINNT/afssvrmgr/svr_address.cpp
src/WINNT/afssvrmgr/svr_hosts.cpp
src/WINNT/afssvrmgr/svr_security.cpp
src/WINNT/afsusrmgr/browse.cpp
src/WINNT/afsusrmgr/cmdline.cpp
src/WINNT/afsusrmgr/columns.cpp
src/WINNT/afsusrmgr/general.cpp
src/WINNT/afsusrmgr/helpfunc.cpp
src/WINNT/afsusrmgr/task.cpp
src/WINNT/afsusrmgr/winlist.cpp
src/WINNT/client_config/config.cpp
src/WINNT/client_config/drivemap.cpp
src/WINNT/client_config/tab_advanced.cpp
src/WINNT/client_config/tab_prefs.cpp
src/WINNT/client_creds/creds.cpp
src/WINNT/client_creds/credstab.cpp
src/WINNT/client_creds/shortcut.cpp
src/WINNT/client_creds/window.cpp
src/WINNT/client_exp/fs.h
src/WINNT/client_exp/gui2fs.cpp
src/WINNT/client_exp/set_afs_acl.cpp
src/WINNT/client_osi/osifd.h
src/WINNT/talocale/tal_main.cpp
src/WINNT/talocale/tal_string.cpp
src/WINNT/talocale/tal_string.h

index 2c7df7d..58e7964 100644 (file)
@@ -77,7 +77,8 @@ void AfsAdmSvr_CallbackManager (void)
       AfsAdmSvr_Enter();
 
       LPHASHLIST pList = New (HASHLIST);
-      for (LPENUM pEnum = l.pListCallbacks->FindFirst(); pEnum; pEnum = pEnum->FindNext())
+      LPENUM pEnum;
+      for (pEnum = l.pListCallbacks->FindFirst(); pEnum; pEnum = pEnum->FindNext())
          {
          LPCALLBACKDATA pData = (LPCALLBACKDATA)( pEnum->GetObject() );
          pList->Add (pData);
index 46c33f0..f30c788 100644 (file)
@@ -193,11 +193,13 @@ HASHVALUE CALLBACK ListenersKeyObject_HashData (LPHASHLISTKEY pKey, PVOID pData)
 BOOL SetActionNotification (HWND hNotify, BOOL fSet)
 {
    BOOL rc = TRUE;
+   size_t ii = 0;
+
    asc_Enter();
 
    if (!fSet)
       {
-      for (size_t ii = 0; ii < l.chActionListeners; ++ii)
+      for (ii = 0; ii < l.chActionListeners; ++ii)
          {
          if (l.ahActionListeners[ ii ] == hNotify)
             l.ahActionListeners[ ii ] = NULL;
@@ -205,7 +207,7 @@ BOOL SetActionNotification (HWND hNotify, BOOL fSet)
       }
    else // (fSet)
       {
-      for (size_t ii = 0; ii < l.chActionListeners; ++ii)
+      for (ii = 0; ii < l.chActionListeners; ++ii)
          {
          if (l.ahActionListeners[ ii ] == NULL)
             break;
index 4bd0031..1b2afd0 100644 (file)
@@ -51,7 +51,8 @@ void StartPingThread (DWORD idClient)
 {
    asc_Enter();
 
-   for (size_t ii = 0; ii < l.cdwClients; ++ii)
+   size_t ii;
+   for (ii = 0; ii < l.cdwClients; ++ii)
       {
       if (!l.adwClients[ ii ])
          break;
index 96ede09..9c46803 100644 (file)
@@ -128,7 +128,8 @@ BOOL AfsAdmSvr_fIsValidClient (DWORD idClient)
 BOOL AfsAdmSvr_AttachClient (LPCTSTR pszName, DWORD *pidClient, ULONG *pStatus)
 {
    AfsAdmSvr_Enter();
-   for (size_t iClient = 0; iClient < l.cClientsAllocated; ++iClient)
+   size_t iClient;
+   for (iClient = 0; iClient < l.cClientsAllocated; ++iClient)
       {
       if (!l.aClients[ iClient ])
          break;
@@ -160,7 +161,8 @@ BOOL AfsAdmSvr_AttachClient (LPCTSTR pszName, DWORD *pidClient, ULONG *pStatus)
 void AfsAdmSvr_DetachClient (DWORD idClient)
 {
    AfsAdmSvr_Enter();
-   for (size_t iClient = 0; iClient < l.cClientsAllocated; ++iClient)
+   size_t iClient;
+   for (iClient = 0; iClient < l.cClientsAllocated; ++iClient)
       {
       if (idClient == (DWORD)(l.aClients[ iClient ]))
          break;
@@ -464,7 +466,8 @@ size_t AfsAdmSvr_BeginOperation (DWORD idClient, LPASACTION pAction)
 
    ++l.cOperations;
 
-   for (size_t iOp = 0; iOp < l.cOperationsAllocated; ++iOp)
+   size_t iOp;
+   for (iOp = 0; iOp < l.cOperationsAllocated; ++iOp)
       {
       if (!l.aOperations[ iOp ].fInUse)
          break;
index aab2656..f24b740 100644 (file)
@@ -108,7 +108,8 @@ void AfsAdmSvr_SetCellRefreshRate (ASID idCell, ULONG cminRefreshRate)
    AfsAdmSvr_PrepCellRefresh();
    EnterCriticalSection (l.pcsRefreshThreads);
 
-   for (size_t iThread = 0; iThread < l.cRefreshThreads; ++iThread)
+   size_t iThread;
+   for (iThread = 0; iThread < l.cRefreshThreads; ++iThread)
       {
       LPREFRESHTHREAD pThread = &l.aRefreshThreads[ iThread ];
       if (pThread->idCell == idCell)
@@ -119,7 +120,7 @@ void AfsAdmSvr_SetCellRefreshRate (ASID idCell, ULONG cminRefreshRate)
       }
    if (iThread == l.cRefreshThreads)
       {
-      for (size_t iThread = 0; iThread < l.cRefreshThreads; ++iThread)
+      for (iThread = 0; iThread < l.cRefreshThreads; ++iThread)
          {
          LPREFRESHTHREAD pThread = &l.aRefreshThreads[ iThread ];
          if (pThread->idCell == 0)
index df0fe9d..8164cd6 100644 (file)
@@ -84,6 +84,11 @@ DLLLIBS = \
 
 DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\TaAfsAppLib.dll
 
+!IF ("$(AFSVER_CL)"<"1400")
+DEFFILE = TaAfsAppLib.def
+!ELSE
+DEFFILE = TaAfsAppLib2005.def
+!ENDIF
 
 # Since AfsAppLib links with TaAfsAdmSvrClient.lib--and both need stuff
 # like the HashList code--we'll get lots of unnecessary 4049 warnings from
@@ -93,7 +98,7 @@ LOCALLINKFLAGS = -IGNORE:4049
 
 # AfsAppLib needs to use an explicit .DEF file to get its entry points public
 
-LOCALLINKFLAGS = $(LOCALLINKFLAGS) /DEF:TaAfsAppLib.def
+LOCALLINKFLAGS = $(LOCALLINKFLAGS) /DEF:$(DEFFILE)
 
 # Also, AfsAppLib has a specific DLL entry-point which should be used
 
diff --git a/src/WINNT/afsapplib/TaAfsAppLib2005.def b/src/WINNT/afsapplib/TaAfsAppLib2005.def
new file mode 100644 (file)
index 0000000..52fc43b
--- /dev/null
@@ -0,0 +1,100 @@
+LIBRARY TAAFSAPPLIB
+
+DESCRIPTION 'Transarc Application Base DLL'
+
+EXPORTS
+
+    DllEntryPoint
+
+   ?TaLocaleReallocFunction@@YAHPAPAXIPAIII@Z
+   ?TaLocale_EnumModule@@YAHIPAPAUHINSTANCE__@@PAG@Z
+   ?TaLocale_GetDialogResource@@YAPBUDLGTEMPLATE@@HPAPAUHINSTANCE__@@@Z
+   ?TaLocale_GetLanguage@@YAGXZ
+   ?TaLocale_LoadCorrespondingModule@@YAPAUHINSTANCE__@@PAU1@G@Z
+   ?TaLocale_GetLanguageOverride@@YAGXZ
+   ?TaLocale_RemoveLanguageOverride@@YAXXZ
+   ?TaLocale_SetLanguageOverride@@YAXG@Z
+   ?TaLocale_LoadImage@@YAPAXHIHHI@Z
+   ?TaLocale_LoadMenu@@YAPAUHMENU__@@H@Z
+   ?TaLocale_LoadIcon@@YAPAUHICON__@@H@Z
+   ?TaLocale_LoadAccelerators@@YAPAUHACCEL__@@H@Z
+   ?TaLocale_GetResource@@YAPBXPBD0GPAPAUHINSTANCE__@@@Z
+   ?TaLocale_GetResourceEx@@YAPBXPBD0GPAPAUHINSTANCE__@@H@Z
+   ?TaLocale_GetStringResource@@YAPBUSTRINGTEMPLATE@@HPAPAUHINSTANCE__@@@Z
+   ?TaLocale_Initialize@@YAXXZ
+   ?TaLocale_SetLanguage@@YAXG@Z
+   ?TaLocale_SpecifyModule@@YAXPAUHINSTANCE__@@G@Z
+   ?Message@@YAHIHHPBDZZ
+   ?Message@@YAHIHPBD0ZZ
+   ?Message@@YAHIPBD00ZZ
+   ?Message@@YAHIPBDH0ZZ
+   ?Message_ThreadProc@@YGKPAX@Z
+   ?ModalDialog@@YAHHPAUHWND__@@P6GH0IIJ@Z@Z
+   ?ModalDialogParam@@YAHHPAUHWND__@@P6GH0IIJ@ZJ@Z
+   ?ModelessDialog@@YAPAUHWND__@@HPAU1@P6GH0IIJ@Z@Z
+   ?ModelessDialogParam@@YAPAUHWND__@@HPAU1@P6GH0IIJ@ZJ@Z
+   ?vMessage@@YAHIHHPBDPAD@Z
+   ?vMessage@@YAHIHPBD0PAD@Z
+   ?vMessage@@YAHIJJPBDPAD@Z
+   ?vMessage@@YAHIPBD00PAD@Z
+   ?vMessage@@YAHIPBDH0PAD@Z
+   ?AnsiToString@@YAPADPBD@Z
+   ?AnsiToUnicode@@YAPA_WPBD@Z
+   ?ChangeExtension@@YAXPADPBD1H@Z
+   ?CloneAnsi@@YAPADPAD@Z
+   ?CloneMultiString@@YAPADPBD@Z
+   ?CloneString@@YAPADPAD@Z
+   ?CloneUnicode@@YAPADPA_W@Z
+   ?CopyAnsiToString@@YAXPADPBDI@Z
+   ?CopyStringToAnsi@@YAXPADPBDI@Z
+   ?CopyAnsiToUnicode@@YAXPA_WPBDI@Z
+   ?CopyBaseFileName@@YAXPADPBD@Z
+   ?CopyStringToAnsi@@YAXPADPBDI@Z
+   ?CopyStringToUnicode@@YAXPA_WPBDI@Z
+   ?CopyUnicodeToAnsi@@YAXPADPB_WI@Z
+   ?CopyUnicodeToString@@YAXPADPB_WI@Z
+   ?FindBaseFileName@@YAPBDPBD@Z
+   ?FindExtension@@YAPBDPBD@Z
+   ?FixFormatString@@YAPADPAD@Z
+   ?FormatBytes@@YAXPAD0N@Z
+   ?FormatDouble@@YAXPAD0N@Z
+   ?FormatElapsed@@YAHPAD0PAU_SYSTEMTIME@@@Z
+   ?FormatError@@YAHPAD0K@Z
+   ?FormatLargeInt@@YAXPAD0PAT_LARGE_INTEGER@@@Z
+   ?FormatMultiString@@YAXPAPADHHPBDZZ
+   ?FormatMultiString@@YAXPAPADHPBD1ZZ
+   ?FormatSockAddr@@YAXPAD0PAUsockaddr_in@@@Z
+   ?FormatString@@YAPADHPBDZZ
+   ?FormatString@@YAPADPBD0ZZ
+   ?FormatTime@@YAHPAD0PAU_SYSTEMTIME@@HH@Z
+   ?FreeString@@YAXPBX0@Z
+   ?GetString@@YAXPADHH@Z
+   ?GetStringLength@@YAIH@Z
+   ?SearchMultiString@@YAHPBD0H@Z
+   ?SetErrorTranslationFunction@@YAXP6GHPADKG@Z@Z
+   ?StringToAnsi@@YAPADPBD@Z
+   ?StringToUnicode@@YAPA_WPBD@Z
+   ?TranslateError@@YAHPADK@Z
+   ?TranslateErrorFunc@@YAHPADKG@Z
+   ?UnicodeToAnsi@@YAPADPB_W@Z
+   ?UnicodeToString@@YAPADPB_W@Z
+   ?lsplitpath@@YAXPBDPAD111@Z
+   ?lstrchr@@YAPBDPBDD@Z
+   ?lstrncmpi@@YAHPBD0I@Z
+   ?lstrncpy@@YAXPADPBDI@Z
+   ?lstrrchr@@YAPBDPBDD@Z
+   ?lstrupr@@YAXPAD@Z
+   ?lstrzcpy@@YAXPADPBDI@Z
+   ?vFormatMultiString@@YAXPAPADHHPBDPAD@Z
+   ?vFormatMultiString@@YAXPAPADHJPBDPAD@Z
+   ?vFormatMultiString@@YAXPAPADHPBD1PAD@Z
+   ?vFormatString@@YAPADHPBDPAD@Z
+   ?vFormatString@@YAPADJPBDPAD@Z
+   ?vFormatString@@YAPADPBD0PAD@Z
+   ShowMemoryManager
+   WhileMemoryManagerShowing
+   IsMemoryManagerMessage
+   MemMgr_AllocateMemory
+   MemMgr_FreeMemory
+   MemMgr_TrackNew
+   MemMgr_TrackDelete
index a647ff7..4e0e708 100644 (file)
@@ -56,7 +56,8 @@ void AfsAppLib_RegisterHelpFile (LPTSTR pszFilename)
 
 void AfsAppLib_RegisterHelp (int idd, DWORD *adwContext, int idhOverview)
 {
-   for (size_t ih = 0; ih < g_cdh; ++ih)
+   size_t ih;
+   for (ih = 0; ih < g_cdh; ++ih)
       {
       if (!g_adh[ ih ].fInUse)
          continue;
index 438c6f6..574af87 100644 (file)
@@ -281,7 +281,8 @@ LPCELLLIST AfsAppLib_GetCellList (HKEY hkBase, LPTSTR pszRegPath)
    TCHAR szDefCell[ cchNAME ];
    if (AfsAppLib_GetLocalCell (szDefCell))
       {
-      for (size_t iclDef = 0; iclDef < lpcl->nCells; ++iclDef)
+      size_t iclDef;
+      for (iclDef = 0; iclDef < lpcl->nCells; ++iclDef)
          {
          if (lpcl->aCells[ iclDef ] == NULL)
             continue;
index 9e934c3..d5cb70c 100644 (file)
@@ -131,7 +131,8 @@ void AfsAppLib_RegisterModelessDialog (HWND hDlg)
 
    EnterCriticalSection (pcsPump);
 
-   for (size_t ii = 0; ii < cModeless; ++ii)
+   size_t ii;
+   for (ii = 0; ii < cModeless; ++ii)
       {
       if (aModeless[ ii ] == hDlg)
          break;
@@ -227,7 +228,8 @@ size_t GetWindowDataField (LPTSTR pszField)
       }
    EnterCriticalSection (pcsData);
 
-   for (size_t ii = 0; ii < cFields; ++ii)
+   size_t ii;
+   for (ii = 0; ii < cFields; ++ii)
       {
       if (!lstrcmpi (aFields[ ii ].szField, pszField))
          break;
@@ -302,7 +304,8 @@ DWORD SetWindowData (HWND hWnd, LPTSTR pszField, DWORD dwNewData)
    size_t iField;
    if ((iField = GetWindowDataField (pszField)) != (size_t)-1)
       {
-      for (size_t ii = 0; ii < cWindows; ++ii)
+      size_t ii;
+      for (ii = 0; ii < cWindows; ++ii)
          {
          if (aWindows[ ii ].hWnd == hWnd)
             {
index fe8b44f..e5a167a 100644 (file)
@@ -260,7 +260,8 @@ void WIZARD::SetState (int stNew, BOOL fForce)
       {
       if (stOriginal <= stNew)
          {
-         for (int st = stNew+1; st < (int)m_cStates; ++st)
+         int st;
+         for (st = stNew+1; st < (int)m_cStates; ++st)
             {
             LPWIZARD_STATE pState;
             if ((pState = FindState (st)) != NULL)
@@ -277,7 +278,8 @@ void WIZARD::SetState (int stNew, BOOL fForce)
          }
       else // (moving backwards?)
          {
-         for (int st = stNew-1; st >= 0; --st)
+         int st;
+         for (st = stNew-1; st >= 0; --st)
             {
             LPWIZARD_STATE pState;
             if ((pState = FindState (st)) != NULL)
@@ -574,7 +576,8 @@ void WIZARD::GeneratePalette (LPRGBQUAD argb)
       pPal->palVersion = 0x300;
       pPal->palNumEntries = 256;
 
-      for (size_t ii = 0; ii < 256; ++ii)
+      size_t ii;
+      for (ii = 0; ii < 256; ++ii)
          {
          pPal->palPalEntry[ ii ].peRed   = (argb) ? argb[ ii ].rgbRed : 0;
          pPal->palPalEntry[ ii ].peGreen = (argb) ? argb[ ii ].rgbGreen : 0;
@@ -583,8 +586,8 @@ void WIZARD::GeneratePalette (LPRGBQUAD argb)
          }
 
       for (COLORREF clr = clrWASH_DARKEST; clr <= clrWASH_BRIGHTEST; clr += clrWASH_INCREMENT)
-         {
-         for (size_t ii = 0; ii < 256; ++ii)
+         {            
+         for (ii = 0; ii < 256; ++ii)
             {
             if ( (pPal->palPalEntry[ ii ].peRed   == GetRValue (clr)) &&
                  (pPal->palPalEntry[ ii ].peGreen == GetGValue (clr)) &&
@@ -593,7 +596,7 @@ void WIZARD::GeneratePalette (LPRGBQUAD argb)
             }
          if (ii == 256)
             {
-            for (size_t ii = 10; ii < 246; ++ii)
+            for (ii = 10; ii < 246; ++ii)
                {
                if ( (pPal->palPalEntry[ ii ].peRed == 0) &&
                     (pPal->palPalEntry[ ii ].peGreen == 0) &&
index 1642608..c46b1b0 100644 (file)
@@ -162,7 +162,8 @@ BOOL CALLBACK DateProc (HWND hDate, UINT msg, WPARAM wp, LPARAM lp)
 
    if (msg == WM_CREATE)
       {
-      for (size_t iDate = 0; iDate < cDate; ++iDate)
+      size_t iDate;
+      for (iDate = 0; iDate < cDate; ++iDate)
          {
          if (aDate[ iDate ].hDate == NULL)
             break;
index 319a24d..77fa794 100644 (file)
@@ -167,7 +167,8 @@ BOOL CALLBACK ElapsedProc (HWND hElapsed, UINT msg, WPARAM wp, LPARAM lp)
 
    if (msg == WM_CREATE)
       {
-      for (size_t iElapsed = 0; iElapsed < cElapsed; ++iElapsed)
+      size_t iElapsed;
+      for (iElapsed = 0; iElapsed < cElapsed; ++iElapsed)
          {
          if (aElapsed[ iElapsed ].hElapsed == NULL)
             break;
index 7b1957e..2a2ef6e 100644 (file)
@@ -164,7 +164,8 @@ BOOL CALLBACK SockAddrProc (HWND hSockAddr, UINT msg, WPARAM wp, LPARAM lp)
 
    if (msg == WM_CREATE)
       {
-      for (size_t iSockAddr = 0; iSockAddr < cSockAddr; ++iSockAddr)
+      size_t iSockAddr;
+      for (iSockAddr = 0; iSockAddr < cSockAddr; ++iSockAddr)
          {
          if (aSockAddr[ iSockAddr ].hSockAddr == NULL)
             break;
index d715494..56a03dc 100644 (file)
@@ -183,7 +183,8 @@ BOOL CreateSpinner (HWND hBuddy,
 
    EnterCriticalSection (&csSpinners);
 
-   for (size_t ii = 0; ii < cSpinners; ++ii)
+   size_t ii;
+   for (ii = 0; ii < cSpinners; ++ii)
       {
       if (!aSpinners[ ii ].hSpinner)
          break;
index 1a0629e..65060ce 100644 (file)
@@ -166,7 +166,8 @@ BOOL CALLBACK TimeProc (HWND hTime, UINT msg, WPARAM wp, LPARAM lp)
 
    if (msg == WM_CREATE)
       {
-      for (size_t iTime = 0; iTime < cTime; ++iTime)
+      size_t iTime;
+      for (iTime = 0; iTime < cTime; ++iTime)
          {
          if (aTime[ iTime ].hTime == NULL)
             break;
index 9624313..e66f277 100644 (file)
@@ -140,7 +140,8 @@ BOOL CALLBACK PropTab_HookProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
 
    if (IsWindow (hTab))
       {
-      for (size_t ii = 0; ii < cPropSheets; ++ii)
+      size_t ii;
+      for (ii = 0; ii < cPropSheets; ++ii)
          {
          if (aPropSheets[ii].fInUse && (aPropSheets[ii].hSheet == hSheet))
             break;
@@ -158,7 +159,8 @@ BOOL CALLBACK PropTab_HookProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
          }
       if (ii < cPropSheets)
          {
-         for (size_t iTab = 0; iTab < aPropSheets[ii].psh->cTabs; ++iTab)
+         size_t iTab;
+         for (iTab = 0; iTab < aPropSheets[ii].psh->cTabs; ++iTab)
             {
             if (aPropSheets[ii].psh->aTabs[iTab].hDlg == hDlg)
                break;
@@ -346,7 +348,8 @@ BOOL CALLBACK PropSheet_HookProc (HWND hSheet, UINT msg, WPARAM wp, LPARAM lp)
 
 LPARAM PropSheet_FindTabParam (HWND hTab)
 {
-   for (size_t ii = 0; ii < cPropSheets; ++ii)
+   size_t ii;
+   for (ii = 0; ii < cPropSheets; ++ii)
       {
       if (aPropSheets[ii].fInUse && (aPropSheets[ii].hSheet == hTab))
          return aPropSheets[ii].psh->lpUser;
@@ -440,7 +443,8 @@ HWND PropSheet_ShowModeless (LPPROPSHEET psh, int nCmdShow)
    // Otherwise, we'd have to wait until the WM_INITDIALOG/IDINIT
    // messages were finished.
    //
-   for (size_t ii = 0; ii < cPropSheets; ++ii)
+   size_t ii;
+   for (ii = 0; ii < cPropSheets; ++ii)
       {
       if (!aPropSheets[ ii ].fInUse)
          break;
@@ -789,7 +793,8 @@ HLISTITEM cdecl FL_AddItem (HWND hList, LPVIEWINFO lpvi, LPARAM lp, int iImage1,
    va_start (arg, iImage1);
 
    LPTSTR apszColumns[ nCOLUMNS_MAX ];
-   for (size_t iColumn = 0; iColumn < lpvi->nColsAvail; ++iColumn)
+   size_t iColumn;
+   for (iColumn = 0; iColumn < lpvi->nColsAvail; ++iColumn)
       {
       apszColumns[ iColumn ] = va_arg (arg, LPTSTR);
       }
@@ -828,7 +833,8 @@ HLISTITEM cdecl FL_AddItem (HWND hList, LPVIEWINFO lpvi, LPARAM lp, int iImage1,
 
 BOOL FL_HitTestForHeaderBar (HWND hList, POINT ptClient)
 {
-   for (HWND hHeader = GetWindow (hList, GW_CHILD);
+   HWND hHeader;
+   for (hHeader = GetWindow (hList, GW_CHILD);
         hHeader != NULL;
         hHeader = GetWindow (hHeader, GW_HWNDNEXT))
       {
@@ -1163,7 +1169,8 @@ BOOL CALLBACK LV_SortView_Alphabetic (LPARAM lp1, LPARAM lp2, LPARAM lpSort)
 
 void LV_SortView (HWND hList, LPVIEWINFO lpvi)
 {
-   for (size_t iColSort = 0; iColSort < lpvi->nColsShown; ++iColSort)
+   size_t iColSort;
+   for (iColSort = 0; iColSort < lpvi->nColsShown; ++iColSort)
       {
       if ((lpvi->iSort & (~COLUMN_SORTREV)) == lpvi->aColumns[ iColSort ])
          break;
@@ -1191,7 +1198,8 @@ void cdecl LV_AddItem (HWND hList, LPVIEWINFO lpvi, int index, LPARAM lp, int iI
    va_start (arg, iImage);
 
    LPTSTR apszColumns[ nCOLUMNS_MAX ];
-   for (size_t iColumn = 0; iColumn < lpvi->nColsAvail; ++iColumn)
+   size_t iColumn;
+   for (iColumn = 0; iColumn < lpvi->nColsAvail; ++iColumn)
       {
       apszColumns[ iColumn ] = va_arg (arg, LPTSTR);
       }
@@ -1232,7 +1240,8 @@ void cdecl LV_AddItem (HWND hList, LPVIEWINFO lpvi, int index, LPARAM lp, int iI
 
 BOOL LV_HitTestForHeaderBar (HWND hList, POINT ptClient)
 {
-   for (HWND hHeader = GetWindow (hList, GW_CHILD);
+   HWND hHeader;
+   for (hHeader = GetWindow (hList, GW_CHILD);
         hHeader != NULL;
         hHeader = GetWindow (hHeader, GW_HWNDNEXT))
       {
@@ -1546,8 +1555,9 @@ BOOL CALLBACK ListBox_HScrollHook (HWND hList, UINT msg, WPARAM wp, LPARAM lp)
          int iItemSkip = (int)wp;
          int iItemMax = SendMessage (hList, LB_GETCOUNT, 0, 0);
          int cchMax = 0;
+         int iItem;
 
-         for (int iItem = 0; iItem < iItemMax; iItem++)
+         for (iItem = 0; iItem < iItemMax; iItem++)
             {
             if (iItem == iItemSkip)
                continue;
index 4065c86..3603a76 100644 (file)
@@ -3826,7 +3826,8 @@ void FastList_PerformSelectTest (LPFASTLIST pfl, HLISTITEM hItem)
          if (fLevel)
             {
             size_t iLevelItem = 0;
-            for (HLISTITEM hParent = hItem->hTreeParent; hParent; hParent = hParent->hTreeParent)
+            HLISTITEM hParent;
+            for (hParent = hItem->hTreeParent; hParent; hParent = hParent->hTreeParent)
                ++iLevelItem;
 
             size_t iLevelSelected = 0;
@@ -3840,7 +3841,8 @@ void FastList_PerformSelectTest (LPFASTLIST pfl, HLISTITEM hItem)
          if (fSibling)
             {
             BOOL fFound = FALSE;
-            for (HLISTITEM hSearch = hItem->hTreePrevious; !fFound && hSearch; hSearch = hSearch->hTreePrevious)
+            HLISTITEM hSearch;
+            for (hSearch = hItem->hTreePrevious; !fFound && hSearch; hSearch = hSearch->hTreePrevious)
                {
                if (hSearch == pfl->hSelectFirst)
                   fFound = TRUE;
index 3607bdc..8784602 100644 (file)
@@ -436,7 +436,8 @@ LPHASHLISTKEY HASHLIST::CreateKey (LPCTSTR pszKeyName, LPHASHFUNC_COMPAREOBJECTD
    LPHASHLISTKEY pKey = NULL;
    Enter();
 
-   for (size_t iKey = 0; iKey < m_cpKeys; ++iKey)
+   size_t iKey;
+   for (iKey = 0; iKey < m_cpKeys; ++iKey)
       {
       if (m_apKeys[ iKey ] == NULL)
          break;
@@ -855,7 +856,8 @@ void HASHLISTKEY::Resize (void)
       m_aBuckets[ iBucket ].iLast = iINVALID;
       }
 
-   for (size_t iObject = 0; ; ++iObject)
+   size_t iObject;
+   for (iObject = 0; ; ++iObject)
       {
       LPHASHLISTENTRY pEntry;
       if ((pEntry = GetEntry(m_aObjects,iObject)) == NULL)
@@ -903,7 +905,8 @@ LPHASHLISTKEYDEBUGINFO HASHLISTKEY::GetDebugInfo (void)
    //
    REALLOC (pInfo->aBuckets, pInfo->cBuckets, m_cBuckets, 1);
 
-   for (size_t iBucket = 0; iBucket < pInfo->cBuckets; ++iBucket)
+   size_t iBucket;
+   for (iBucket = 0; iBucket < pInfo->cBuckets; ++iBucket)
       {
       for (size_t iObject = m_aBuckets[ iBucket ].iFirst;
            iObject != iINVALID;
@@ -1085,7 +1088,8 @@ HASHVALUE HashAnsiString (LPCSTR pszStringA)
 {
    HASHVALUE hv = 0;
 
-   for (size_t cch = lstrlenA(pszStringA); cch >= 4; pszStringA += 4, cch -= 4)
+   size_t cch;
+   for (cch = lstrlenA(pszStringA); cch >= 4; pszStringA += 4, cch -= 4)
       hv += *(DWORD *)pszStringA;
 
    for (; cch; pszStringA++, cch--)
@@ -1098,7 +1102,8 @@ HASHVALUE HashUnicodeString (LPWSTR pszStringW)
 {
    HASHVALUE hv = 0;
 
-   for (size_t cch = lstrlenW(pszStringW); cch >= 2; pszStringW += 2, cch -= 2)
+   size_t cch;
+   for (cch = lstrlenW(pszStringW); cch >= 2; pszStringW += 2, cch -= 2)
       {
       hv += *(DWORD *)pszStringW;   // since HIBYTE(*psz) is usually zero,
       hv = (hv >> 24) | (hv << 8);  // rotate {hv} high-ward by 8 bits
index 8f5e333..81c1e15 100644 (file)
@@ -119,7 +119,8 @@ BOOL REGEXP::Compile (LPCTSTR pszExpr)
 
    // Start stripping characters from the expression
    //
-   for (BOOL rc = TRUE; rc; )
+   BOOL rc;
+   for (rc = TRUE; rc; )
       {
       TCHAR ch;
 
index b9c0e21..d92c2f5 100644 (file)
@@ -307,7 +307,8 @@ int rwFindOrAddWnd (HWND hWnd, rwWindowData *awd)
 {
             // Is the window handle listed in awl[] already?
             //
-   for (int ii = 0; ii < (int)cwl; ii++)
+   int ii;
+   for (ii = 0; ii < (int)cwl; ii++)
       {
       if (awl[ii].hWnd == hWnd)
          {
index 1f8d844..b4a1d01 100644 (file)
@@ -93,7 +93,8 @@ size_t nTargets = 0;
 
 BOOL Subclass_AddHook (HWND hTarget, PVOID wndProc)
 {
-   for (size_t iTarget = 0; iTarget < nTargets; ++iTarget)
+   size_t iTarget;
+   for (iTarget = 0; iTarget < nTargets; ++iTarget)
       {
       if (aTargets[ iTarget ].hTarget == hTarget)
          break;
@@ -114,8 +115,8 @@ BOOL Subclass_AddHook (HWND hTarget, PVOID wndProc)
 
    aTargets[ iTarget ].hTarget = hTarget;
 
-
-   for (size_t iHook = 0; iHook < aTargets[iTarget].nHooks; ++iHook)
+   size_t iHook;
+   for (iHook = 0; iHook < aTargets[iTarget].nHooks; ++iHook)
       {
       if (aTargets[ iTarget ].aHooks[ iHook ].wndProc == wndProc)
          break;
@@ -150,14 +151,16 @@ BOOL Subclass_AddHook (HWND hTarget, PVOID wndProc)
 
 void Subclass_RemoveHook (HWND hTarget, PVOID wndProc)
 {
-   for (size_t iTarget = 0; iTarget < nTargets; ++iTarget)
+   size_t iTarget;
+   for (iTarget = 0; iTarget < nTargets; ++iTarget)
       {
       if (aTargets[ iTarget ].hTarget == hTarget)
          break;
       }
    if (iTarget < nTargets)
       {
-      for (size_t iHook = 0; iHook < aTargets[iTarget].nHooks; ++iHook)
+      size_t iHook;
+      for (iHook = 0; iHook < aTargets[iTarget].nHooks; ++iHook)
          {
          if (aTargets[ iTarget ].aHooks[ iHook ].wndProc == wndProc)
             break;
@@ -183,7 +186,8 @@ void Subclass_RemoveHook (HWND hTarget, PVOID wndProc)
 
 PVOID Subclass_FindNextHook (HWND hTarget, PVOID wndProc)
 {
-   for (size_t iTarget = 0; iTarget < nTargets; ++iTarget)
+   size_t iTarget;
+   for (iTarget = 0; iTarget < nTargets; ++iTarget)
       {
       if (aTargets[ iTarget ].hTarget == hTarget)
          break;
@@ -191,7 +195,8 @@ PVOID Subclass_FindNextHook (HWND hTarget, PVOID wndProc)
    if (iTarget >= nTargets)
       return NULL;
 
-   for (size_t iHook = 0; iHook < aTargets[iTarget].nHooks; ++iHook)
+   size_t iHook;
+   for (iHook = 0; iHook < aTargets[iTarget].nHooks; ++iHook)
       {
       if (aTargets[ iTarget ].aHooks[ iHook ].wndProc == wndProc)
          break;
@@ -211,7 +216,8 @@ PVOID Subclass_FindNextHook (HWND hTarget, PVOID wndProc)
 
 LONG CALLBACK Subclass_WndProc (HWND hTarget, UINT msg, WPARAM wp, LPARAM lp)
 {
-   for (size_t iTarget = 0; iTarget < nTargets; ++iTarget)
+   size_t iTarget;
+   for (iTarget = 0; iTarget < nTargets; ++iTarget)
       {
       if (aTargets[ iTarget ].hTarget == hTarget)
          break;
@@ -219,7 +225,8 @@ LONG CALLBACK Subclass_WndProc (HWND hTarget, UINT msg, WPARAM wp, LPARAM lp)
    if (iTarget >= nTargets)
       return DefWindowProc (hTarget, msg, wp, lp);
 
-   for (size_t iHook = 0; iHook < aTargets[iTarget].nHooks; ++iHook)
+   size_t iHook;
+   for (iHook = 0; iHook < aTargets[iTarget].nHooks; ++iHook)
       {
       if (aTargets[ iTarget ].aHooks[ iHook ].wndProc != NULL)
          break;
index 850a796..5b862a8 100644 (file)
@@ -82,7 +82,8 @@ BOOL AfsClass_GetServerLogFile (LPIDENT lpiServer, LPTSTR pszLocal, LPTSTR pszRe
             //
             for (LPTSTR psz = wp.wpBosLogGet.pszLogData; psz && *psz; )
                {
-               for (LPTSTR pszNext = psz; *pszNext && (*pszNext != TEXT('\r')) && (*pszNext != TEXT('\n')); ++pszNext)
+               LPTSTR pszNext;
+               for (pszNext = psz; *pszNext && (*pszNext != TEXT('\r')) && (*pszNext != TEXT('\n')); ++pszNext)
                   ;
                DWORD cbWrite;
                DWORD cbWrote;
@@ -2495,7 +2496,8 @@ size_t AfsClass_AdminList_AddEntry (LPADMINLIST lpList, LPTSTR pszAdmin)
 
    if (lpList)
       {
-      for (size_t iEntry = 0; iEntry < lpList->cEntries; ++iEntry)
+      size_t iEntry;
+      for (iEntry = 0; iEntry < lpList->cEntries; ++iEntry)
          {
          if (!lpList->aEntries[ iEntry ].szAdmin[0])
             break;
@@ -3610,7 +3612,8 @@ size_t AfsClass_HostList_AddEntry (LPHOSTLIST lpList, LPTSTR pszHost)
 
    if (lpList)
       {
-      for (size_t iEntry = 0; iEntry < lpList->cEntries; ++iEntry)
+      size_t iEntry;
+      for (iEntry = 0; iEntry < lpList->cEntries; ++iEntry)
          {
          if (!lpList->aEntries[ iEntry ].szHost[0])
             break;
index f34b5d2..feb27bf 100644 (file)
@@ -135,7 +135,8 @@ void CELL::FreeServers (BOOL fNotify)
 
 void CELL::FreeUsers (BOOL fNotify)
 {
-   for (LPENUM pEnum = m_lGroups->FindLast(); pEnum; pEnum = pEnum->FindPrevious())
+   LPENUM pEnum;
+   for (pEnum = m_lGroups->FindLast(); pEnum; pEnum = pEnum->FindPrevious())
       {
       LPPTSGROUP lpGroup = (LPPTSGROUP)(pEnum->GetObject());
       if (fNotify)
@@ -590,7 +591,8 @@ BOOL CELL::RefreshServerList (BOOL fNotify, ULONG *pStatus)
          }
 
       size_t cServers = 0;
-      for (LPENUM pEnum = m_lServers->FindFirst(); pEnum; pEnum = pEnum->FindNext())
+      LPENUM pEnum;
+      for (pEnum = m_lServers->FindFirst(); pEnum; pEnum = pEnum->FindNext())
          ++cServers;
 
       if (cServers)
@@ -1873,7 +1875,8 @@ BOOL CELL::RefreshUsers (BOOL fNotify, ULONG *pStatus)
       //
       if (fNotify)
          {
-         for (LPENUM pEnum = m_lGroups->FindFirst(); pEnum; pEnum = pEnum->FindNext())
+         LPENUM pEnum;
+         for (pEnum = m_lGroups->FindFirst(); pEnum; pEnum = pEnum->FindNext())
             {
             LPPTSGROUP lpGroup = (LPPTSGROUP)(pEnum->GetObject());
             NOTIFYCALLBACK::SendNotificationToAll (evtCreate, lpGroup->GetIdentifier());
index 3de2a3d..50739b9 100644 (file)
@@ -48,8 +48,9 @@ NOTIFYCALLBACK::NOTIFYCALLBACK (NOTIFYCALLBACKPROC procUser, LPARAM lpUser)
 {
    procSupplied = procUser;
    lpSupplied = lpUser;
+   size_t iNotify;
 
-   for (size_t iNotify = 0; iNotify < nNotifyList; ++iNotify)
+   for (iNotify = 0; iNotify < nNotifyList; ++iNotify)
       {
       if (aNotifyList[ iNotify ] == NULL)
          break;
index 01ef4b6..9fd8eab 100644 (file)
@@ -158,7 +158,8 @@ void SERVER::FreeServices (void)
 
 void SERVER::SendDeleteNotifications (void)
 {
-   for (LPENUM pEnum = m_lAggregates->FindFirst(); pEnum; pEnum = pEnum->FindNext())
+   LPENUM pEnum;
+   for (pEnum = m_lAggregates->FindFirst(); pEnum; pEnum = pEnum->FindNext())
       {
       LPAGGREGATE lpAggregate = (LPAGGREGATE)(pEnum->GetObject());
       lpAggregate->SendDeleteNotifications ();
@@ -372,7 +373,8 @@ BOOL SERVER::RefreshAggregates (BOOL fNotify, ULONG *pStatus)
          // First thing is to forget about what aggregates we think we have
          // now.
          //
-         for (LPENUM pEnum = m_lAggregates->FindLast(); pEnum; pEnum = pEnum->FindPrevious())
+         LPENUM pEnum;
+         for (pEnum = m_lAggregates->FindLast(); pEnum; pEnum = pEnum->FindPrevious())
             {
             LPAGGREGATE lpAggregate = (LPAGGREGATE)(pEnum->GetObject());
             lpAggregate->SendDeleteNotifications();
@@ -465,7 +467,8 @@ BOOL SERVER::RefreshServices (BOOL fNotify, ULONG *pStatus)
 
          // First thing is to forget about what services we think we have now.
          //
-         for (LPENUM pEnum = m_lServices->FindLast(); pEnum; pEnum = pEnum->FindPrevious())
+         LPENUM pEnum;
+         for (pEnum = m_lServices->FindLast(); pEnum; pEnum = pEnum->FindPrevious())
             {
             LPSERVICE lpService = (LPSERVICE)(pEnum->GetObject());
             lpService->SendDeleteNotifications();
@@ -939,7 +942,8 @@ BOOL SERVER::CanTalkToServer (ULONG *pStatus)
    AfsClass_InitRefreshSections();
    EnterCriticalSection (pcsRefSec);
 
-   for (int idSection = 0; idSection < (int)cRefSec; ++idSection)
+   int idSection;
+   for (idSection = 0; idSection < (int)cRefSec; ++idSection)
       {
       if (!aRefSec[ idSection ].fInUse)
          break;
@@ -994,7 +998,8 @@ BOOL SERVER::CanTalkToServer (ULONG *pStatus)
    // Wait for that thread to terminate, or for our
    // newly-allocated RefSec entry to be marked Canceled.
    //
-   for (DWORD dw = STILL_ACTIVE; dw == STILL_ACTIVE; )
+   DWORD dw;
+   for (dw = STILL_ACTIVE; dw == STILL_ACTIVE; )
       {
       EnterCriticalSection (pcsRefSec);
 
@@ -1072,7 +1077,8 @@ BOOL SERVER::RefreshAll (ULONG *pStatus, double dInit, double dFactor)
             size_t nAggregates = 0;
             size_t iAggregate = 0;
             HENUM hEnum;
-            for (LPAGGREGATE lpAggregate = AggregateFindFirst (&hEnum); lpAggregate; lpAggregate = AggregateFindNext (&hEnum))
+            LPAGGREGATE lpAggregate;
+            for (lpAggregate = AggregateFindFirst (&hEnum); lpAggregate; lpAggregate = AggregateFindNext (&hEnum))
                {
                ++nAggregates;
                lpAggregate->Close();
@@ -1103,7 +1109,8 @@ BOOL SERVER::RefreshAll (ULONG *pStatus, double dInit, double dFactor)
             size_t nServices = 0;
             size_t iService = 0;
             HENUM hEnum;
-            for (LPSERVICE lpService = ServiceFindFirst (&hEnum); lpService; lpService = ServiceFindNext (&hEnum))
+            LPSERVICE lpService;
+            for (lpService = ServiceFindFirst (&hEnum); lpService; lpService = ServiceFindNext (&hEnum))
                {
                ++nServices;
                lpService->Close();
index 9bfbd58..6232da3 100644 (file)
@@ -238,7 +238,8 @@ void AfsClass_ParseRecurringTime (BOOL *pfEver, LPSYSTEMTIME pst, LPTSTR pszTime
 
       TCHAR szComponent[ cchRESOURCE ];
       lstrcpy (szComponent, pszTime);
-      for (LPTSTR pch = szComponent; isdigit(*pch); ++pch)
+      LPTSTR pch;
+      for (pch = szComponent; isdigit(*pch); ++pch)
          ;
       *pch = TEXT('\0');
 
index 46aa28b..46065c3 100644 (file)
@@ -29,6 +29,7 @@ SOFTWARE.
 #include <windows.h>
 #include <npapi.h>
 #include <ntsecapi.h>
+#include <tchar.h>
 #include <strsafe.h>
 
 
index eab047a..f1170c7 100644 (file)
@@ -119,37 +119,37 @@ BOOL CALLBACK ConfigServerPageDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM
 #define IF_WIZ(x)      { if (g_pWiz) (x); }
 
 // Global variables
-static HWND                    m_hDlg =                        0;              // Window handle of this dialog
-static BOOL                    m_bConfiguring =        FALSE;  // TRUE if configuring
-static BOOL                    m_bConfigured =         FALSE;  // TRUE if configuration was successful
-static BOOL                    m_bConfigFailed =       FALSE;  // TRUE if configuration failed
-static BOOL                    m_bCheckCancel =        FALSE;  // TRUE if user pressed cancel - we will ask for confirmation
-static BOOL                    m_bCancel =                     FALSE;  // TRUE if user confirmed cancel - we will cancel configuration
-static void*           m_hvosServer =          0;              // vos library server handle
-static const           MAX_STEPS =                     34;             // Max number of config steps
-static afs_status_t    m_nStatus;                                      // Error code if a cfg library function fails
-static int                     m_nResult;                                      // Boolean return code from cfg library calls
-static int                     m_nNumSteps;                            // Number of config steps that will be performed
-static BOOL                    m_bDbServersRestarted;          // TRUE if all Database servers were restarted
-static BOOL                    m_bMustChangeClientCell;        // TRUE if client is in different cell than server
+static HWND            m_hDlg =                0;      // Window handle of this dialog
+static BOOL            m_bConfiguring =        FALSE;  // TRUE if configuring
+static BOOL            m_bConfigured =         FALSE;  // TRUE if configuration was successful
+static BOOL            m_bConfigFailed =       FALSE;  // TRUE if configuration failed
+static BOOL            m_bCheckCancel =        FALSE;  // TRUE if user pressed cancel - we will ask for confirmation
+static BOOL            m_bCancel =             FALSE;  // TRUE if user confirmed cancel - we will cancel configuration
+static void*           m_hvosServer =          0;      // vos library server handle
+static const int       MAX_STEPS =             34;     // Max number of config steps
+static afs_status_t    m_nStatus;                      // Error code if a cfg library function fails
+static int             m_nResult;                      // Boolean return code from cfg library calls
+static int             m_nNumSteps;                    // Number of config steps that will be performed
+static BOOL            m_bDbServersRestarted;          // TRUE if all Database servers were restarted
+static BOOL            m_bMustChangeClientCell;        // TRUE if client is in different cell than server
 static HANDLE          m_hCellServDBUpdateEvent;
-static LPCTSTR      m_pszCellServDBUpdateEventName = TEXT("CellServDBUpdateEvent");
-static const           m_CallBackID = 6;
-static UINT                    m_nPartitionID = INVALID_PARTITION_ID;
-static BOOL                    m_bCellServDbUpdateErr = FALSE;
+static LPCTSTR          m_pszCellServDBUpdateEventName = TEXT("CellServDBUpdateEvent");
+static const int       m_CallBackID = 6;
+static UINT            m_nPartitionID = INVALID_PARTITION_ID;
+static BOOL            m_bCellServDbUpdateErr = FALSE;
 static TCHAR           m_szCellServDbUpdateErrMsg[cchRESOURCE];
-static LONG                    m_nServerUpdates = 0;
+static LONG            m_nServerUpdates = 0;
 static char *          m_pszCellDbHosts = 0;
-static BOOL                    m_bNoAuthMode = TRUE;
+static BOOL            m_bNoAuthMode = TRUE;
 static char            m_szVicepName[9];
-static BOOL                    m_bMustExit;
-static BOOL                    m_bCfgInfoInvalidated;
-static BOOL                    m_bUnconfiguringLastDBServer;
-static BOOL         m_bClientTokensSet;
-static BOOL         m_bRootAfsDriveMappingCreated;
-static char         m_szDriveToMapTo[3];
-static BOOL         m_bWeCreatedRootAfs;
-static BOOL         m_bWeCreatedRootCell;
+static BOOL            m_bMustExit;
+static BOOL            m_bCfgInfoInvalidated;
+static BOOL            m_bUnconfiguringLastDBServer;
+static BOOL             m_bClientTokensSet;
+static BOOL             m_bRootAfsDriveMappingCreated;
+static char             m_szDriveToMapTo[3];
+static BOOL             m_bWeCreatedRootAfs;
+static BOOL             m_bWeCreatedRootCell;
 
 static CRITICAL_SECTION m_CritSec;
 
index 6766e79..07ad676 100644 (file)
@@ -227,7 +227,8 @@ static BOOL AreWeLastDBServer(BOOL& bLast, afs_status_t& nStatus)
 
        char *psz = pszCellServDB;
 
-       for (int i = 0; *psz; psz += strlen(psz) + 1)
+        int i;
+       for (i = 0; *psz; psz += strlen(psz) + 1)
                i++;
 
        if (i == 1) {
@@ -430,7 +431,7 @@ static void ShowMsg(UINT uiMsgID)
 
 static void NextStep(UINT uiMsgID)
 {
-       static nCurStep = 1;
+       static int nCurStep = 1;
 
        if (bCancel)
                return;
index 4f93017..ae0c9d2 100644 (file)
@@ -793,7 +793,8 @@ BOOL Action_CompareNotifyParams (PNOTIFYPARAMS pParams1, PNOTIFYPARAMS pParams2)
 
 PACTION Action_Begin (ACTIONTYPE Type, PNOTIFYPARAMS pParams)
 {
-   for (size_t ii = 0; ii < l.cActions; ++ii)
+   size_t ii;
+   for (ii = 0; ii < l.cActions; ++ii)
       {
       if (!l.aActions[ii])
          break;
index 597db4c..4758f2f 100644 (file)
@@ -139,7 +139,8 @@ void Alert_EndUpdate (LPIDENT lpi, LPSERVER lpServer)
          BOOL fNeedBadCredsWarning = FALSE;
          BOOL fHaveBadCredsWarning = FALSE;
 
-         for (size_t iAlert = 0; iAlert < lpoaServer->nAlerts; ++iAlert)
+         size_t iAlert;
+         for (iAlert = 0; iAlert < lpoaServer->nAlerts; ++iAlert)
             {
             if (lpoaServer->aAlerts[ iAlert ].alert == alertSECONDARY)
                {
@@ -226,7 +227,8 @@ void Alert_RemoveSecondary (LPIDENT lpiChild)
    LPOBJECTALERTS lpoa;
    if ((lpoa = Alert_GetObjectAlerts (lpiChild, TRUE)) != NULL)
       {
-      for (size_t iAlert = 0; iAlert < lpoa->nAlerts; )
+      size_t iAlert;
+      for (iAlert = 0; iAlert < lpoa->nAlerts; )
          {
          if ( (lpoa->aAlerts[ iAlert ].alert == alertSECONDARY) &&
               (lpoa->aAlerts[ iAlert ].aiSECONDARY.lpiSecondary == lpiChild) )
@@ -342,7 +344,8 @@ void Alert_Scout_ServerStatus (LPIDENT lpi, ULONG status)
          if (lpoa->nAlerts && (lpoa->aAlerts[0].alert == alertBADCREDS))
             iInsert = 1;
 
-         for (size_t iHole = iInsert; iHole < lpoa->nAlerts; ++iHole)
+         size_t iHole;
+         for (iHole = iInsert; iHole < lpoa->nAlerts; ++iHole)
             {
             if (lpoa->aAlerts[ iHole ].alert == alertINVALID)
                break;
index 287250b..801f8f0 100644 (file)
@@ -74,7 +74,8 @@ void cdecl CommandLineHelp (int ids, LPTSTR pszFormat = NULL, ...);
 
 CMDLINEOP ParseCommandLine (LPTSTR pszCmdLine)
 {
-   for (size_t ii = 0; ii < nSWITCHES; ++ii)
+   size_t ii;
+   for (ii = 0; ii < nSWITCHES; ++ii)
       aSWITCHES[ ii ].fPresent = FALSE;
 
    // Search through pszCmdLine for switches; each switch must be
@@ -121,7 +122,8 @@ CMDLINEOP ParseCommandLine (LPTSTR pszCmdLine)
          {
          TCHAR szCopy[ cchRESOURCE ];
          lstrcpy (szCopy, pszCmdLine);
-         for (LPTSTR pch = szCopy;
+         LPTSTR pch;
+         for (pch = szCopy;
               *pch && !iswhite(*pch) && !(*pch == TEXT('/')) && !(*pch == TEXT(':'));
               ++pch)
             ;
@@ -161,7 +163,8 @@ CMDLINEOP ParseCommandLine (LPTSTR pszCmdLine)
             return opCLOSEAPP;
             }
          BOOL fQuoted = FALSE;
-         for (LPTSTR pszTarget = aSWITCHES[ ii ].szValue;
+         LPTSTR pszTarget;
+         for (pszTarget = aSWITCHES[ ii ].szValue;
               *pszCmdLine && !(*pszCmdLine == TEXT('/') && !fQuoted)
                           && !(iswhite(*pszCmdLine) && !fQuoted); )
             {
index 50a1c4f..c86bd8e 100644 (file)
@@ -250,9 +250,11 @@ void Columns_OnSelect (HWND hDlg)
    hList = GetDlgItem (hDlg, IDC_COL_AVAIL);
    LB_StartChange (hList);
 
-   for (size_t iAvail = 0; iAvail < lpvi->nColsAvail; ++iAvail)
+   size_t iAvail;
+   size_t iShown;
+   for (iAvail = 0; iAvail < lpvi->nColsAvail; ++iAvail)
       {
-      for (size_t iShown = 0; iShown < lpvi->nColsShown; ++iShown)
+      for (iShown = 0; iShown < lpvi->nColsShown; ++iShown)
          {
          if (lpvi->aColumns[ iShown ] == iAvail)
             break;
@@ -271,7 +273,7 @@ void Columns_OnSelect (HWND hDlg)
    hList = GetDlgItem (hDlg, IDC_COL_SHOWN);
    LB_StartChange (hList);
 
-   for (size_t iShown = 0; iShown < lpvi->nColsShown; ++iShown)
+   for (iShown = 0; iShown < lpvi->nColsShown; ++iShown)
       {
       iAvail = lpvi->aColumns[ iShown ];
       LB_AddItem (hList, lpvi->idsColumns[ iAvail ], (LPARAM)iAvail);
index cde4581..5291f86 100644 (file)
@@ -494,7 +494,8 @@ void NotifyMe (NOTIFYWHEN when, LPIDENT lpiObject, HWND hWnd, LPARAM lpUser)
 {
    EnterCriticalSection (&csDispatch);
 
-   for (size_t iDispatch = 0; iDispatch < nDispatchList; ++iDispatch)
+   size_t iDispatch;
+   for (iDispatch = 0; iDispatch < nDispatchList; ++iDispatch)
       {
       if ( (aDispatchList[ iDispatch ].hWnd == hWnd) &&
            (aDispatchList[ iDispatch ].when == when) &&
index 1eee297..b8da0da 100644 (file)
@@ -146,7 +146,8 @@ void Display_AddActOnDone (HWND hWnd, WORD wAct, LPIDENT lpiSelectOnDone)
       }
    EnterCriticalSection (pcsWindowActOnDone);
 
-   for (size_t ii = 0; ii < cWindowActOnDone; ++ii)
+   size_t ii;
+   for (ii = 0; ii < cWindowActOnDone; ++ii)
       {
       if (aWindowActOnDone[ ii ].hWnd == hWnd)
          break;
@@ -228,7 +229,8 @@ void UpdateDisplay (LPDISPLAYREQUEST pdr, BOOL fWait)
 
    EnterCriticalSection (pcsDisplayQueue);
 
-   for (size_t idq = 0; idq < cDisplayQueue; ++idq)
+   size_t idq;
+   for (idq = 0; idq < cDisplayQueue; ++idq)
       {
       if (!aDisplayQueue[idq].hChild)
          break;
@@ -329,7 +331,8 @@ DWORD WINAPI DisplayQueue_ThreadProc (PVOID lp)
          }
       else
          {
-         for (size_t idq = 0; idq < cDisplayQueue; ++idq)
+         size_t idq;
+         for (idq = 0; idq < cDisplayQueue; ++idq)
             {
             if (aDisplayQueue[idq].hChild)
                {
index 7ba40e1..634819b 100644 (file)
@@ -53,7 +53,8 @@ LONG *FindLongByWindow (HWND hWnd)
 
    EnterCriticalSection (pcsWindowList);
 
-   for (size_t ii = 0; !lpdw && ii < cWindowList; ++ii)
+   size_t ii;
+   for (ii = 0; !lpdw && ii < cWindowList; ++ii)
       {
       if (aWindowList[ ii ].hWnd == hWnd)
          lpdw = &aWindowList[ ii ].dw;
index 8643c8f..058e3d6 100644 (file)
@@ -220,7 +220,8 @@ LPTSTR Help_FindCommand_Search (UNIXUTIL *puu, LPTSTR pszKeyword)
          ++pszKeyword;
 
       // find the end of this word
-      for (LPTSTR pszNext = pszKeyword; *pszNext && !iswhite(*pszNext); )
+      LPTSTR pszNext;
+      for (pszNext = pszKeyword; *pszNext && !iswhite(*pszNext); )
          ++pszNext;
       if (!*pszNext)  // last word?  Gotta use it.
          break;
@@ -542,14 +543,16 @@ void Help_About_OnSysCommand (HWND hDlg, int &cmd)
    GetDlgItemText (hDlg, 0x051F, szSys, cchRESOURCE);
    if ((dw = NextSearch (cmd)) != 0)
       {
-      for (LPTSTR psz = &szSys[ lstrlen(szSys)-1 ]; *(psz-1) != TEXT('\n'); --psz);
+      LPTSTR psz;
+      for (psz = &szSys[ lstrlen(szSys)-1 ]; *(psz-1) != TEXT('\n'); --psz);
       lstrcpy (szSys2, psz);
       wsprintf (psz, TEXT("%c%s"), (TCHAR)dw, szSys2);
       SetDlgItemText (hDlg, 0x051F, szSys);
       }
    else // (dw == 0)
       {
-      for (LPTSTR psz = szSys; *psz && (*psz != TEXT('\n')); ++psz);
+      LPTSTR psz;
+      for (psz = szSys; *psz && (*psz != TEXT('\n')); ++psz);
       wsprintf (szSys2, TEXT("%s\n"), 1+psz);
       SetDlgItemText (hDlg, 0x051F, szSys2);
       }
index 4f7d38a..3fcc899 100644 (file)
@@ -36,7 +36,8 @@ void PropCache_Add (PropCache pcType, PVOID pv, HWND hDialog)
 {
    if (!PropCache_Search (pcType, pv))
       {
-      for (size_t iEntry = 0; iEntry < PropCache_nEntries; ++iEntry)
+      size_t iEntry;
+      for (iEntry = 0; iEntry < PropCache_nEntries; ++iEntry)
          {
          if (!PropCache_apce[ iEntry ].fInUse)
             break;
index cc08511..dc9ed2a 100644 (file)
@@ -256,7 +256,8 @@ void Services_General_OnEndTask_InitDialog (HWND hDlg, LPTASKPACKET ptp)
       SetDlgItemText (hDlg, IDC_SVC_TYPE, szText);
 
       LPTSTR pszParams = CloneString (TASKDATA(ptp)->cs.szParams);
-      for (LPTSTR pch = pszParams; pch && *pch; ++pch)
+      LPTSTR pch;
+      for (pch = pszParams; pch && *pch; ++pch)
          {
          if (*pch == TEXT('\r') || *pch == TEXT('\t') || *pch == TEXT('\n'))
             *pch = TEXT(' ');
index 792556d..5fd36c5 100644 (file)
@@ -291,7 +291,8 @@ void ChangeAddr_OnChange (HWND hDlg, LPSVR_CHANGEADDR_PARAMS lpp)
             // First see if the new IP address is already in the server's
             // list of IP addresses--if so, just delete the old address.
             //
-            for (size_t iAddr = 0; iAddr < lpp->ssOld.nAddresses; ++iAddr)
+            size_t iAddr;
+            for (iAddr = 0; iAddr < lpp->ssOld.nAddresses; ++iAddr)
                {
                int OldAddrInt;
                AfsClass_AddressToInt (&OldAddrInt, &lpp->ssOld.aAddresses[iAddr]);
index 36e0c25..7f63ac3 100644 (file)
@@ -271,7 +271,8 @@ void Server_Hosts_OnAddEntry (HWND hDlg, LPSVR_HOSTS_PARAMS lpp)
 
    if (ModalDialogParam (IDD_SVR_ADDHOST, hDlg, (DLGPROC)Server_AddHost_DlgProc, (LPARAM)pAdd) == IDOK)
       {
-      for (size_t iEntry = 0; iEntry < lpp->lpList->cEntries; ++iEntry)
+      size_t iEntry;
+      for (iEntry = 0; iEntry < lpp->lpList->cEntries; ++iEntry)
          {
          LPHOSTLISTENTRY pEntry = &lpp->lpList->aEntries[ iEntry ];
          if (pEntry->szHost[0] == TEXT('\0'))
index 0368ecd..8939185 100644 (file)
@@ -347,7 +347,8 @@ void Server_Lists_OnAddEntry (HWND hDlg, LPSVR_SECURITY_PARAMS lpp)
 
    AfsAppLib_FreeCellList (pp.lpcl);
 
-   for (size_t iEntry = 0; iEntry < lpp->lpAdmList->cEntries; ++iEntry)
+   size_t iEntry;
+   for (iEntry = 0; iEntry < lpp->lpAdmList->cEntries; ++iEntry)
       {
       LPADMINLISTENTRY pEntry = &lpp->lpAdmList->aEntries[ iEntry ];
       if (pEntry->szAdmin[0] == TEXT('\0'))
@@ -624,7 +625,8 @@ void Server_Keys_OnDelKey (HWND hDlg, LPSVR_SECURITY_PARAMS lpp)
 
 void FormatServerKey (LPTSTR psz, LPENCRYPTIONKEY pKey)
 {
-   for (size_t ii = 0; ii < ENCRYPTIONKEY_LEN; ++ii)
+   size_t ii;
+   for (ii = 0; ii < ENCRYPTIONKEY_LEN; ++ii)
       {
       if (pKey->key[ii])
          break;
@@ -650,7 +652,8 @@ void FormatServerKey (LPTSTR psz, LPENCRYPTIONKEY pKey)
 
 BOOL ScanServerKey (LPENCRYPTIONKEY pKey, LPTSTR psz)
 {
-   for (size_t ich = 0; psz && *psz; )
+   size_t ich;
+   for (ich = 0; psz && *psz; )
       {
       if (ich == ENCRYPTIONKEY_LEN)
          return FALSE;
index af7c7b6..4a86bcc 100644 (file)
@@ -341,6 +341,7 @@ void Browse_OnOK (HWND hDlg)
 void Browse_OnEndTask_EnumObjects (HWND hDlg, LPTASKPACKET ptp)
 {
    LPBROWSE_PARAMS lpp;
+   size_t ii;
    if ((lpp = (LPBROWSE_PARAMS)GetWindowLong (hDlg, DWL_USER)) != NULL)
       {
       HWND hList = GetDlgItem (hDlg, IDC_BROWSE_LIST);
@@ -359,7 +360,7 @@ void Browse_OnEndTask_EnumObjects (HWND hDlg, LPTASKPACKET ptp)
             {
             LPHASHLIST pListToSkip = New (HASHLIST);
 
-            for (size_t ii = 0; ii < lpp->pObjectsToSkip->cEntries; ++ii)
+            for (ii = 0; ii < lpp->pObjectsToSkip->cEntries; ++ii)
                pListToSkip->AddUnique ((PVOID)(lpp->pObjectsToSkip->aEntries[ii].idObject));
 
             for (ii = 0; ii < TASKDATA(ptp)->pAsidList->cEntries; )
@@ -376,7 +377,7 @@ void Browse_OnEndTask_EnumObjects (HWND hDlg, LPTASKPACKET ptp)
 
       // OK, we're ready to go--populate that list!
       //
-      for (size_t ii = 0; ii < TASKDATA(ptp)->pAsidList->cEntries; ++ii)
+      for (ii = 0; ii < TASKDATA(ptp)->pAsidList->cEntries; ++ii)
          {
          ULONG status;
          ASOBJPROP Properties;
index 36abdb6..be3788b 100644 (file)
@@ -64,7 +64,8 @@ void cdecl CommandLineHelp (int ids, LPTSTR pszFormat = NULL, ...);
 
 CMDLINEOP ParseCommandLine (LPTSTR pszCmdLine)
 {
-   for (size_t ii = 0; ii < nSWITCHES; ++ii)
+   size_t ii;
+   for (ii = 0; ii < nSWITCHES; ++ii)
       aSWITCHES[ ii ].fPresent = FALSE;
 
    // Search through pszCmdLine for switches; each switch must be
@@ -111,7 +112,8 @@ CMDLINEOP ParseCommandLine (LPTSTR pszCmdLine)
          {
          TCHAR szCopy[ cchRESOURCE ];
          lstrcpy (szCopy, pszCmdLine);
-         for (LPTSTR pch = szCopy;
+         LPTSTR pch;
+         for (pch = szCopy;
               *pch && !iswhite(*pch) && !(*pch == TEXT('/')) && !(*pch == TEXT(':'));
               ++pch)
             ;
@@ -151,7 +153,8 @@ CMDLINEOP ParseCommandLine (LPTSTR pszCmdLine)
             return opCLOSEAPP;
             }
          BOOL fQuoted = FALSE;
-         for (LPTSTR pszTarget = aSWITCHES[ ii ].szValue;
+         LPTSTR pszTarget;
+         for (pszTarget = aSWITCHES[ ii ].szValue;
               *pszCmdLine && !(*pszCmdLine == TEXT('/') && !fQuoted)
                           && !(iswhite(*pszCmdLine) && !fQuoted); )
             {
index 16eeefe..f91a0c9 100644 (file)
@@ -221,9 +221,11 @@ void Columns_OnSelect (HWND hDlg)
    hList = GetDlgItem (hDlg, IDC_COL_AVAIL);
    LB_StartChange (hList);
 
-   for (size_t iAvail = 0; iAvail < lpvi->nColsAvail; ++iAvail)
+   size_t iAvail;
+   size_t iShown;
+   for (iAvail = 0; iAvail < lpvi->nColsAvail; ++iAvail)
       {
-      for (size_t iShown = 0; iShown < lpvi->nColsShown; ++iShown)
+      for (iShown = 0; iShown < lpvi->nColsShown; ++iShown)
          {
          if (lpvi->aColumns[ iShown ] == iAvail)
             break;
@@ -242,7 +244,7 @@ void Columns_OnSelect (HWND hDlg)
    hList = GetDlgItem (hDlg, IDC_COL_SHOWN);
    LB_StartChange (hList);
 
-   for (size_t iShown = 0; iShown < lpvi->nColsShown; ++iShown)
+   for (iShown = 0; iShown < lpvi->nColsShown; ++iShown)
       {
       iAvail = lpvi->aColumns[ iShown ];
       LB_AddItem (hList, lpvi->idsColumns[ iAvail ], (LPARAM)iAvail);
index 4032b21..b6fdd8f 100644 (file)
@@ -156,7 +156,8 @@ void GetLocalSystemTime (LPSYSTEMTIME pst)
 
 void FormatServerKey (LPTSTR psz, PBYTE pKey)
 {
-   for (size_t ii = 0; ii < ENCRYPTIONKEYLENGTH; ++ii)
+   size_t ii;
+   for (ii = 0; ii < ENCRYPTIONKEYLENGTH; ++ii)
       {
       if (pKey[ii])
          break;
@@ -182,7 +183,8 @@ void FormatServerKey (LPTSTR psz, PBYTE pKey)
 
 BOOL ScanServerKey (PBYTE pKey, LPTSTR psz)
 {
-   for (size_t ich = 0; psz && *psz; )
+   size_t ich;
+   for (ich = 0; psz && *psz; )
       {
       if (ich == ENCRYPTIONKEYLENGTH)
          return FALSE;
index b58ec29..e267f88 100644 (file)
@@ -176,7 +176,8 @@ LPTSTR Help_FindCommand_Search (UNIXUTIL *puu, LPTSTR pszKeyword)
          ++pszKeyword;
 
       // find the end of this word
-      for (LPTSTR pszNext = pszKeyword; *pszNext && !iswhite(*pszNext); )
+      LPTSTR pszNext;
+      for (pszNext = pszKeyword; *pszNext && !iswhite(*pszNext); )
          ++pszNext;
       if (!*pszNext)  // last word?  Gotta use it.
          break;
@@ -485,17 +486,18 @@ void Help_About_OnSysCommand (HWND hDlg, int &cmd)
    DWORD dw;
    TCHAR szSys[cchRESOURCE];
    TCHAR szSys2[cchRESOURCE];
+   LPTSTR psz;
    GetDlgItemText (hDlg, 0x07E6, szSys, cchRESOURCE);
    if ((dw = NextSearch (cmd)) != 0)
       {
-      for (LPTSTR psz = &szSys[ lstrlen(szSys)-1 ]; *(psz-1) != TEXT('\n'); --psz);
+      for (psz = &szSys[ lstrlen(szSys)-1 ]; *(psz-1) != TEXT('\n'); --psz);
       lstrcpy (szSys2, psz);
       wsprintf (psz, TEXT("%c%s"), (TCHAR)dw, szSys2);
       SetDlgItemText (hDlg, 0x07E6, szSys);
       }
    else // (dw == 0)
       {
-      for (LPTSTR psz = szSys; *psz && (*psz != TEXT('\n')); ++psz);
+      for (psz = szSys; *psz && (*psz != TEXT('\n')); ++psz);
       wsprintf (szSys2, TEXT("%s\n"), 1+psz);
       SetDlgItemText (hDlg, 0x07E6, szSys2);
       }
index 4923ca5..a384b6c 100644 (file)
@@ -625,7 +625,8 @@ BOOL Task_User_GroupList_Set_Do (LPUSER_GROUPLIST_SET_PARAMS lpp, ULONG *pStatus
    // test it for inclusion of a particular group.
    //
    LPHASHLIST pGroupsAllow = New (HASHLIST);
-   for (size_t iGroup = 0; iGroup < lpp->pGroups->cEntries; ++iGroup)
+   size_t iGroup;
+   for (iGroup = 0; iGroup < lpp->pGroups->cEntries; ++iGroup)
       pGroupsAllow->AddUnique ((PVOID)(lpp->pGroups->aEntries[ iGroup ].idObject));
 
    // We'll have to do this next bit for each user in the supplied user-list
@@ -1182,7 +1183,8 @@ BOOL Task_Group_Members_Set_Do (LPGROUP_MEMBERS_SET_PARAMS lpp, ULONG *pStatus)
    // test it to see if a particular member should remain in a group.
    //
    LPHASHLIST pMembersAllow = New (HASHLIST);
-   for (size_t iMember = 0; iMember < lpp->pMembers->cEntries; ++iMember)
+   size_t iMember;
+   for (iMember = 0; iMember < lpp->pMembers->cEntries; ++iMember)
       pMembersAllow->AddUnique ((PVOID)(lpp->pMembers->aEntries[ iMember ].idObject));
 
    // We'll have to do this next bit for each group in the supplied group-list
@@ -1357,7 +1359,8 @@ BOOL Task_Group_Owned_Set_Do (LPGROUP_OWNED_SET_PARAMS lpp, ULONG *pStatus)
    // quickly test it for inclusion of a particular group.
    //
    LPHASHLIST pGroupsAllow = New (HASHLIST);
-   for (size_t iGroup = 0; iGroup < lpp->pOwnedGroups->cEntries; ++iGroup)
+   size_t iGroup;
+   for (iGroup = 0; iGroup < lpp->pOwnedGroups->cEntries; ++iGroup)
       pGroupsAllow->AddUnique ((PVOID)(lpp->pOwnedGroups->aEntries[ iGroup ].idObject));
 
    // Obtain the current list-of-groups-owned for this group
index 071bff6..62782c2 100644 (file)
@@ -43,7 +43,8 @@ void WindowList_Add (HWND hWnd, WINDOWLISTTYPE wlt, ASID idObject)
 {
    // See if this window is already in the list
    //
-   for (size_t ii = 0; ii < cWindowList; ++ii)
+   size_t ii;
+   for (ii = 0; ii < cWindowList; ++ii)
       {
       if (aWindowList[ ii ].hWnd == hWnd)
          return;
index 15b1b56..842b73b 100644 (file)
@@ -43,7 +43,8 @@ extern "C" {
 
 static DWORD log2 (DWORD dwValue)
 {
-   for (DWORD dwLog = 0; (DWORD)(1<<dwLog) < dwValue; ++dwLog)
+   DWORD dwLog;
+   for (dwLog = 0; (DWORD)(1<<dwLog) < dwValue; ++dwLog)
       ;
    return dwLog;
 }
@@ -349,7 +350,8 @@ BOOL Config_SetTrayIconFlag (BOOL fFlag, ULONG *pStatus)
 {
    Config_WriteUserNum (TEXT("ShowTrayIcon"), fFlag);
 
-   for (HWND hSearch = GetWindow (GetDesktopWindow(), GW_CHILD);
+   HWND hSearch;
+   for (hSearch = GetWindow (GetDesktopWindow(), GW_CHILD);
         hSearch && IsWindow(hSearch);
         hSearch = GetWindow (hSearch, GW_HWNDNEXT))
       {
@@ -434,7 +436,8 @@ BOOL Config_SetServerPrefs (PSERVERPREFS pPrefs, ULONG *pStatus)
    if (pPrefs)
       {
       size_t cChanged = 0;
-      for (size_t ii = 0; ii < pPrefs->cPrefs; ++ii)
+      size_t ii;
+      for (ii = 0; ii < pPrefs->cPrefs; ++ii)
          {
          if (pPrefs->aPrefs[ ii ].fChanged)
             ++cChanged;
index 2a8e30c..b0e17b1 100644 (file)
@@ -498,7 +498,8 @@ void QueryDriveMapList_ReadSubmounts (PDRIVEMAPLIST pList)
             if ( submountPath[0] != TEXT('\0') ) {
                 AdjustAfsPath (Submount.szMapping, submountPath, FALSE, TRUE);
 
-                for (size_t ii = 0; ii < pList->cSubmounts; ++ii)
+                size_t ii;
+                for (ii = 0; ii < pList->cSubmounts; ++ii)
                 {
                     if (!pList->aSubmounts[ii].szSubmount[0])
                         break;
index 4bd0245..a746735 100644 (file)
@@ -69,7 +69,8 @@ extern BOOL CALLBACK Binding_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
 
 static DWORD log2 (DWORD dwValue)
 {
-   for (DWORD dwLog = 0; (DWORD)(1<<dwLog) < dwValue; ++dwLog)
+   DWORD dwLog;
+   for (dwLog = 0; (DWORD)(1<<dwLog) < dwValue; ++dwLog)
       ;
    return dwLog;
 }
index d02e1d5..bbae69a 100644 (file)
@@ -463,7 +463,8 @@ void PrefsTab_OnImport (HWND hDlg)
                   // and the ranking.
                   //
                   TCHAR szServer[ MAX_PATH ];
-                  for (LPTSTR pszOut = szServer; *pszStart && !iswhite(*pszStart); )
+                  LPTSTR pszOut;
+                  for (pszOut = szServer; *pszStart && !iswhite(*pszStart); )
                      *pszOut++ = *pszStart++;
                   *pszOut = TEXT('\0');
 
@@ -502,7 +503,8 @@ void PrefsTab_MergeServerPrefs (PSERVERPREFS pGlobal, PSERVERPREFS pAdd)
    LPHASHLIST pList = New (HASHLIST);
    LPHASHLISTKEY pKey = pList->CreateKey (TEXT("IP Address"), IPKey_Compare, IPKey_HashObject, IPKey_HashData);
 
-   for (size_t ii = 0; ii < pGlobal->cPrefs; ++ii)
+   size_t ii;
+   for (ii = 0; ii < pGlobal->cPrefs; ++ii)
       {
       if (!pGlobal->aPrefs[ ii ].ipServer)
          continue;
@@ -544,7 +546,8 @@ void PrefsTab_AddItem (HWND hDlg, PSERVERPREF pPref, BOOL fSelect)
    BOOL fVLServers = IsDlgButtonChecked (hDlg, IDC_SHOW_VLS);
    PSERVERPREFS pPrefs = (fVLServers) ? g.Configuration.pVLServers : g.Configuration.pFServers;
 
-   for (size_t ii = 0; ii < pPrefs->cPrefs; ++ii)
+   size_t ii;
+   for (ii = 0; ii < pPrefs->cPrefs; ++ii)
       {
       if (pPrefs->aPrefs[ ii ].ipServer == pPref->ipServer)
          break;
index 4c76ee8..9576bae 100644 (file)
@@ -312,7 +312,8 @@ int GetCurrentCredentials (void)
          // credentials within a certain cell under the certain name.
          // Stick that knowledge in our g.aCreds array.
          //
-         for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
+         size_t iCreds;
+         for (iCreds = 0; iCreds < g.cCreds; ++iCreds)
             {
             if (!lstrcmpi (g.aCreds[ iCreds ].szCell, szCell))
                break;
index d9ac53e..c80ffe3 100644 (file)
@@ -90,7 +90,8 @@ void Creds_OnCheckRemind (HWND hDlg)
 {
    LPTSTR pszCell = (LPTSTR)GetWindowLong (hDlg, DWL_USER);
    lock_ObtainMutex(&g.credsLock);
-   for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
+   size_t iCreds;
+   for (iCreds = 0; iCreds < g.cCreds; ++iCreds)
       {
       if (!lstrcmpi (g.aCreds[ iCreds ].szCell, pszCell))
          break;
@@ -118,7 +119,8 @@ void Creds_OnUpdate (HWND hDlg)
       }
 
    lock_ObtainMutex(&g.credsLock);
-   for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
+   size_t iCreds;
+   for (iCreds = 0; iCreds < g.cCreds; ++iCreds)
       {
       if (!lstrcmpi (g.aCreds[ iCreds ].szCell, pszCell))
          break;
@@ -305,7 +307,8 @@ void NewCreds_OnInitDialog (HWND hDlg)
       }
 
    lock_ObtainMutex(&g.credsLock);
-   for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
+   size_t iCreds;
+   for (iCreds = 0; iCreds < g.cCreds; ++iCreds)
       {
       if (*pszCell && !lstrcmpi (g.aCreds[ iCreds ].szCell, pszCell))
          break;
@@ -413,6 +416,6 @@ void NewCreds_OnCancel (HWND hDlg)
 
       if (hChildDlg)
          CheckDlgButton (hChildDlg, IDC_CREDS_REMIND, FALSE);
-         }
+      }
 }
 
index 298f949..1281682 100644 (file)
@@ -65,8 +65,8 @@ BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc, LPTST
                    rc = ppf->Save (pszTarget, TRUE);
 #else
                    WORD wsz[ MAX_PATH ];
-                   MultiByteToWideChar (CP_ACP, 0, pszTarget, -1, wsz, MAX_PATH);
-                   rc = ppf->Save (wsz, TRUE);
+                   MultiByteToWideChar (CP_ACP, 0, pszTarget, -1, (LPWSTR)wsz, MAX_PATH);
+                   rc = ppf->Save ((LPCOLESTR)wsz, TRUE);
 #endif
                    }
                }
index 9675fcd..79dbfca 100644 (file)
@@ -333,7 +333,8 @@ void Main_OnCheckMenuRemind (void)
 {
    BOOL fRemind = FALSE;
    lock_ObtainMutex(&g.credsLock);
-   for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
+   size_t iCreds;
+   for (iCreds = 0; iCreds < g.cCreds; ++iCreds)
       {
       if (g.aCreds[ iCreds ].fRemind)
          fRemind = TRUE;
@@ -498,7 +499,8 @@ void Main_RepopulateTabs (BOOL fDestroyInvalid)
 
       size_t nCreds = 0;
       lock_ObtainMutex(&g.credsLock);
-      for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
+      size_t iCreds;
+      for (iCreds = 0; iCreds < g.cCreds; ++iCreds)
          {
          if (g.aCreds[ iCreds ].szCell[0])
             ++nCreds;
@@ -531,7 +533,8 @@ void Main_RepopulateTabs (BOOL fDestroyInvalid)
          {
          if (g.aCreds[ iCreds ].szCell[0])
             {
-            for (size_t ii = 0; ii < iTabOut; ++ii)
+            size_t ii;
+            for (ii = 0; ii < iTabOut; ++ii)
                {
                if (!ISCELLTAB (aTabs[ii]))
                   continue;
index cd2efdc..f1c7fac 100644 (file)
@@ -23,6 +23,6 @@ extern int CleanAcl(struct Acl *);
 
 extern void Die(int, char *);
 
-static SetVolCmd(struct cmd_syndesc *);
+static int SetVolCmd(struct cmd_syndesc *);
 
 #endif /* FS_H_ENV */
index f45a6b4..64a2d1c 100644 (file)
@@ -418,7 +418,7 @@ char *SkipLine (register char *astr)
 }
 
 /* tell if a name is 23 or -45 (digits or minus digits), which are bad names we must prune */
-static BadName(register char *aname)
+static int BadName(register char *aname)
 {
     register int tc;
 
@@ -813,7 +813,8 @@ BOOL SaveACL(const CString& strCellName, const CString& strDir, const CStringArr
     pAcl = EmptyAcl(strCellName);
 
     // Set its normal rights
-    for (int i = 0; i < normal.GetSize(); i += 2) {
+    int i;
+    for (i = 0; i < normal.GetSize(); i += 2) {
         rights = Convert(normal[i + 1], 0, &rtype);
         ChangeList(pAcl, TRUE, normal[i], rights);
     }
@@ -878,7 +879,8 @@ BOOL CopyACL(const CString& strToDir, const CStringArray& normal, const CStringA
     enum rtype rtype;
 
     // Set normal rights
-    for (int i = 0; i < normal.GetSize(); i += 2) {
+    int i;
+    for (i = 0; i < normal.GetSize(); i += 2) {
         LONG rights = Convert(normal[i + 1], 0, &rtype);
         ChangeList(pToAcl, TRUE, normal[i], rights);
     }
index d446743..3a405f2 100644 (file)
@@ -99,7 +99,8 @@ BOOL CSetAfsAcl::OnInitDialog()
        m_NormalRights.SetTabStops(58);
        m_NegativeRights.SetTabStops(58);
 
-       for (int i = 0; i < m_Normal.GetSize(); i += 2)
+        int i;
+       for (i = 0; i < m_Normal.GetSize(); i += 2)
                m_NormalRights.AddString(m_Normal[i + 1] + "\t" + m_Normal[i]);
 
        for (i = 0; i < m_Negative.GetSize(); i += 2)
index f2e84ca..f9822f5 100644 (file)
@@ -79,16 +79,16 @@ extern osi_fdType_t *osi_RegisterFDType(char *, osi_fdOps_t *, void *);
 
 extern long osi_UnregisterFDType(char *);
 
-extern osi_AddFDFormatInfo(osi_fdType_t *typep, long region, long index,
+extern int osi_AddFDFormatInfo(osi_fdType_t *typep, long region, long index,
        char *labelp, long format);
 
-extern osi_InitFD(void);
+extern int osi_InitFD(void);
 
 extern osi_fd_t *osi_AllocFD(char *);
 
 extern osi_fd_t *osi_FindFD(long);
 
-extern osi_CloseFD(osi_fd_t *);
+extern int osi_CloseFD(osi_fd_t *);
 
 extern long osi_FDTypeCreate(osi_fdType_t *, osi_fd_t **);
 
index ebea1ad..4120587 100644 (file)
@@ -182,7 +182,8 @@ void TaLocale_SpecifyModule (HINSTANCE hInstance, WORD wSearchPriority)
    // so, remove it (its priority may be changing, or we may actually
    // have been asked to remove it).
    //
-   for (size_t iModule = 0; iModule < l_cModules; ++iModule)
+   size_t iModule;
+   for (iModule = 0; iModule < l_cModules; ++iModule)
       {
       if (l_aModules[ iModule ].wPriority == 0)  // end of list?
          break;
@@ -211,7 +212,8 @@ void TaLocale_SpecifyModule (HINSTANCE hInstance, WORD wSearchPriority)
             break;
          }
 
-      for (size_t iTarget = iModule; iTarget < l_cModules; ++iTarget)
+      size_t iTarget;
+      for (iTarget = iModule; iTarget < l_cModules; ++iTarget)
          {
          if (l_aModules[ iTarget ].wPriority == 0)  // end of list?
             break;
index bae31ee..f1a96e5 100644 (file)
@@ -12,6 +12,8 @@ extern "C" {
 #include <afs/stds.h>
 }
 
+#include <windows.h>
+#include <windowsx.h>
 #include <WINNT/talocale.h>
 #include <stdlib.h>
 
@@ -371,7 +373,8 @@ LPTSTR cdecl vFormatString (LONG pszSource, LPCTSTR pszFmt, va_list arg)
       if ((psz = (LPTSTR)lstrchr (&szFmt[1], TEXT('%'))) != NULL)
          *psz = 0;
 
-      for (int ii = 1; szFmt[ii] == TEXT('-') || szFmt[ii] == TEXT(','); ii++)
+      int ii;
+      for (ii = 1; szFmt[ii] == TEXT('-') || szFmt[ii] == TEXT(','); ii++)
          ;
       cchMin = _ttol (&szFmt[ii]);
 
@@ -962,7 +965,8 @@ void FormatBytes (LPTSTR pszTarget, LPTSTR pszFormatUser, double cb)
       {
       lstrcpy (szFormat, pszFormatUser);
 
-      for (LPTSTR pch = &szFormat[1]; *pch; ++pch)
+      LPTSTR pch;
+      for (pch = &szFormat[1]; *pch; ++pch)
          {
          if (!isfmtgarbage(*pch))
             {
@@ -988,8 +992,8 @@ void FormatBytes (LPTSTR pszTarget, LPTSTR pszFormatUser, double cb)
             // Cheesy bit: if all we have are 0's and "."'s, just
             // make the number read "0".
             //
-
-   for (TCHAR *pch = szJustTheNumber; *pch; ++pch)
+   TCHAR * pch;
+   for (pch = szJustTheNumber; *pch; ++pch)
       {
       if (*pch != TEXT('0') && *pch != TEXT('.'))
          break;
@@ -1654,7 +1658,8 @@ LPTSTR FixFormatString (LPTSTR pszFormat)
       {
       lstrcpy (szFormat, pszFormat);
 
-      for (LPTSTR pch = &szFormat[1]; *pch; ++pch)
+      LPTSTR pch;
+      for (pch = &szFormat[1]; *pch; ++pch)
          {
          if (!isfmtgarbage(*pch))
             {
index 6cffea8..f7a5015 100644 (file)
@@ -104,7 +104,5 @@ extern void lstrzcpy (LPTSTR pszTarget, LPCTSTR pszSource, size_t cchMax);
 
 extern void lsplitpath (LPCTSTR pszSource,
                  LPTSTR pszDrive, LPTSTR pszPath, LPTSTR pszBase, LPTSTR pszExt);
-
-
 #endif