de-"register" src/WINNT
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 15 Jul 2009 23:58:47 +0000 (19:58 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Thu, 16 Jul 2009 00:38:17 +0000 (18:38 -0600)
Remove all uses of "register" from the src/WINNT source tree.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/104
Verified-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/afsd_flushvol.c
src/WINNT/afsd/cklog.c
src/WINNT/afsd/cm_aclent.c
src/WINNT/afsd/cm_dir.c
src/WINNT/afsd/symlink.c
src/WINNT/client_exp/gui2fs.cpp
src/WINNT/client_osi/osisleep.c
src/WINNT/client_osi/osiutils.c

index 124c1b6..4798e75 100644 (file)
@@ -48,7 +48,7 @@ static HANDLE                 gThreadHandle = NULL;
 afs_int32
 afsd_ServicePerformFlushVolumeCmd(char *data)
 {
-    register afs_int32 code;
+    afs_int32 code;
     struct ViceIoctl blob;
 
     afsi_log("Flushing Volume \"%s\"",data);
index d3a5177..2456fcb 100644 (file)
@@ -73,7 +73,7 @@ void main (argc, argv)
 static char *getpipepass() {
     static char gpbuf[BUFSIZ];
     /* read a password from stdin, stop on \n or eof */
-    register int i, tc;
+    int i, tc;
     memset(gpbuf, 0, sizeof(gpbuf));
     for(i=0; i<(sizeof(gpbuf)-1); i++) {
        tc = fgetc(stdin);
index 77a1b5b..26b537a 100644 (file)
@@ -145,7 +145,7 @@ static cm_aclent_t *GetFreeACLEnt(cm_scache_t * scp)
  */
 long cm_AddACLCache(cm_scache_t *scp, cm_user_t *userp, afs_uint32 rights)
 {
-    register struct cm_aclent *aclp;
+    struct cm_aclent *aclp;
 
     lock_ObtainWrite(&cm_aclLock);
     for (aclp = scp->randomACLp; aclp; aclp = aclp->nextp) {
index 9710e8b..ac92932 100644 (file)
@@ -854,9 +854,9 @@ int
 cm_DirHash(char *string)
 {
     /* Hash a string to a number between 0 and NHASHENT. */
-    register unsigned char tc;
-    register int hval;
-    register int tval;
+    unsigned char tc;
+    int hval;
+    int tval;
     hval = 0;
     while ((tc = (*string++))) {
        hval *= 173;
index bd40b64..1911cd7 100644 (file)
@@ -47,9 +47,9 @@ void Die();
 
 #if 0
 foldcmp (a, b)
-    register char *a;
-    register char *b; {
-    register char t, u;
+    char *a;
+    char *b; {
+    char t, u;
     while (1) {
         t = *a++;
         u = *b++;
@@ -62,10 +62,10 @@ foldcmp (a, b)
 #endif
 
 /* this function returns TRUE (1) if the file is in AFS, otherwise false (0) */
-static int InAFS(register char *apath)
+static int InAFS(char *apath)
 {
     struct ViceIoctl blob;
-    register afs_int32 code;
+    afs_int32 code;
 
     blob.in_size = 0;
     blob.out_size = MAXSIZE;
@@ -258,7 +258,7 @@ static BOOL IsAdmin (void)
 /* return a static pointer to a buffer */
 static char *Parent(apath)
 char *apath; {
-    register char *tp;
+    char *tp;
     strcpy(tspace, apath);
     tp = strrchr(tspace, '\\');
     if (tp) {
@@ -272,16 +272,16 @@ char *apath; {
 }
 
 
-static ListLinkCmd(register struct cmd_syndesc *as, void *arock)
+static ListLinkCmd(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code;
+    afs_int32 code;
     struct ViceIoctl blob;
     int error;
-    register struct cmd_item *ti;
+    struct cmd_item *ti;
     char orig_name[1024];              /*Original name, may be modified*/
     char true_name[1024];              /*``True'' dirname (e.g., symlink target)*/
     char parent_dir[1024];             /*Parent directory of true name*/
-    register char *last_component;     /*Last component of true name*/
+    char *last_component;      /*Last component of true name*/
 #ifndef WIN32
     struct stat statbuff;              /*Buffer for status info*/
 #endif /* not WIN32 */
@@ -423,9 +423,9 @@ static ListLinkCmd(register struct cmd_syndesc *as, void *arock)
     return error;
 }
 
-static MakeLinkCmd(register struct cmd_syndesc *as, void *arock)
+static MakeLinkCmd(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code;
+    afs_int32 code;
     struct ViceIoctl blob;
     char * parent;
     char path[1024] = "";
@@ -489,14 +489,14 @@ static MakeLinkCmd(register struct cmd_syndesc *as, void *arock)
  *         symlink (or ``.'' if none is provided)
  *      tp: Set to point to the actual name of the symlink to nuke.
  */
-static RemoveLinkCmd(register struct cmd_syndesc *as, void *arock)
+static RemoveLinkCmd(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code=0;
+    afs_int32 code=0;
     struct ViceIoctl blob;
-    register struct cmd_item *ti;
+    struct cmd_item *ti;
     char tbuffer[1024];
     char lsbuffer[1024];
-    register char *tp;
+    char *tp;
     
     for(ti=as->parms[0].items; ti; ti=ti->next) {
        /* once per file */
@@ -609,8 +609,8 @@ static int debug = 0;
 
 int wmain(int argc, wchar_t **wargv)
 {
-    register afs_int32 code;
-    register struct cmd_syndesc *ts;
+    afs_int32 code;
+    struct cmd_syndesc *ts;
     char ** argv;
     
 #ifdef AFS_AIX32_ENV
index c0c01f3..de1fbb4 100644 (file)
@@ -212,7 +212,7 @@ CStringArray& StripPath(CStringArray& files)
 
 void Flush(const CStringArray& files)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     int error = 0;
 
@@ -237,7 +237,7 @@ void Flush(const CStringArray& files)
 
 void FlushVolume(const CStringArray& files)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     int error = 0;
 
@@ -259,7 +259,7 @@ void FlushVolume(const CStringArray& files)
 
 void WhichCell(CStringArray& files)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     int error;
     CString str;
@@ -297,7 +297,7 @@ void WhichCell(CStringArray& files)
 
 void WSCellCmd()
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     
     HOURGLASS hourglass;
@@ -318,7 +318,7 @@ void WSCellCmd()
 
 BOOL CheckVolumes()
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     
     blob.in_size = 0;
@@ -336,7 +336,7 @@ BOOL CheckVolumes()
 
 void SetCacheSizeCmd(LONG nNewCacheSize)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     
     HOURGLASS hourglass;
@@ -354,7 +354,7 @@ void SetCacheSizeCmd(LONG nNewCacheSize)
 
 void WhereIs(CStringArray& files)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     CStringArray servers;
     CStringArray resultFiles;
@@ -501,9 +501,9 @@ struct Acl {
     struct AclEntry *minuslist;
 };
 
-int foldcmp (register char *a, register char *b)
+int foldcmp (char *a, char *b)
 {
-    register char t, u;
+    char t, u;
     while (1) {
         t = *a++;
         u = *b++;
@@ -516,7 +516,7 @@ int foldcmp (register char *a, register char *b)
 
 extern "C" void ZapList(struct AclEntry *alist)
 {
-    register struct AclEntry *tp, *np;
+    struct AclEntry *tp, *np;
 
     for (tp = alist; tp; tp = np) {
         np = tp->next;
@@ -553,7 +553,7 @@ extern "C" int PruneList (struct AclEntry **ae, int dfs)
     return ctr;
 }
 
-char *SkipLine (register char *astr)
+char *SkipLine (char *astr)
 {
     while (*astr != '\n') 
         astr++;
@@ -564,9 +564,9 @@ 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 int BadName(register char *aname)
+static int BadName(char *aname)
 {
-    register int tc;
+    int tc;
 
     /* all must be '-' or digit to be bad */
     while (tc = *aname++) {
@@ -577,7 +577,7 @@ static int BadName(register char *aname)
     return 1;
 }
 
-CString GetRightsString(register LONG arights, int dfs)
+CString GetRightsString(LONG arights, int dfs)
 {
     CString str;
 
@@ -633,7 +633,7 @@ char *AclToString(struct Acl *acl)
 
 struct Acl *EmptyAcl(const CString& strCellName)
 {
-    register struct Acl *tp;
+    struct Acl *tp;
     CStringUtf8 ustrCell(strCellName);
     
     tp = (struct Acl *)malloc(sizeof (struct Acl));
@@ -647,7 +647,7 @@ struct Acl *EmptyAcl(const CString& strCellName)
 
 struct Acl *EmptyAcl(char *astr)
 {
-    register struct Acl *tp;
+    struct Acl *tp;
     int junk;
 
     tp = (struct Acl *)malloc(sizeof (struct Acl));
@@ -753,7 +753,7 @@ ParseAcl (char *astr)
    any changes to the list, and 0 otherwise */
 extern "C" int CleanAcl(struct Acl *aa)
 {
-    register struct AclEntry *te, **le, *ne;
+    struct AclEntry *te, **le, *ne;
     int changes;
 
     HOURGLASS hourglass;
@@ -798,8 +798,8 @@ extern "C" int CleanAcl(struct Acl *aa)
 
 void CleanACL(CStringArray& names)
 {
-    register LONG code;
-    register struct Acl *ta;
+    LONG code;
+    struct Acl *ta;
     struct ViceIoctl blob;
     int changes;
 
@@ -854,8 +854,8 @@ void CleanACL(CStringArray& names)
 // Derived from fs.c's ListAclCmd
 BOOL GetRights(const CString& strDir, CStringArray& strNormal, CStringArray& strNegative)
 {
-    register LONG code;
-    register struct Acl *ta;
+    LONG code;
+    struct Acl *ta;
     struct ViceIoctl blob;
     struct AclEntry *te;
     int idf = 0; //getidf(as, parm_listacl_id);
@@ -904,7 +904,7 @@ BOOL GetRights(const CString& strDir, CStringArray& strNormal, CStringArray& str
     return TRUE;
 }
 
-struct AclEntry *FindList(register struct AclEntry *pCurEntry, const char *entryName)
+struct AclEntry *FindList(struct AclEntry *pCurEntry, const char *entryName)
 {
     while (pCurEntry) {
         if (!foldcmp(pCurEntry->name, PCCHAR(entryName)))
@@ -965,7 +965,7 @@ enum rtype {add, destroy, deny};
 
 static LONG Convert(const CString& strRights, int dfs, enum rtype *rtypep)
 {
-    register int i, len;
+    int i, len;
     LONG mode;
 
     *rtypep = add;     /* add rights, by default */
@@ -1006,7 +1006,7 @@ static LONG Convert(const CString& strRights, int dfs, enum rtype *rtypep)
 
 BOOL SaveACL(const CString& strCellName, const CString& strDir, const CStringArray& normal, const CStringArray& negative)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     struct Acl *pAcl;
     LONG rights;
@@ -1050,7 +1050,7 @@ BOOL SaveACL(const CString& strCellName, const CString& strDir, const CStringArr
 
 BOOL CopyACL(const CString& strToDir, const CStringArray& normal, const CStringArray& negative, BOOL bClear)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     struct Acl *pToAcl;
     int idf = 0; // getidf(as, parm_copyacl_id);
@@ -1443,7 +1443,7 @@ GetCell(const CString & path)
 
 BOOL ListMount(CStringArray& files)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     int error;
 
@@ -1666,7 +1666,7 @@ BOOL IsSymlink(const CString& strName)
 
 BOOL IsMountPoint(const CString& path)
 {
-    register LONG code = 0;
+    LONG code = 0;
     struct ViceIoctl blob;
     char lsbuffer[1024];
 
@@ -1714,7 +1714,7 @@ BOOL IsMountPoint(const CString& path)
  */
 BOOL RemoveMount(CStringArray& files)
 {
-    register LONG code = 0;
+    LONG code = 0;
     struct ViceIoctl blob;
     BOOL error = FALSE;
     CStringArray results;
@@ -1769,7 +1769,7 @@ BOOL RemoveMount(CStringArray& files)
 
 BOOL GetVolumeInfo(CString strFile, CVolInfo& volInfo)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     struct VolumeStatus *status;
     char *name;
@@ -1818,7 +1818,7 @@ BOOL GetVolumeInfo(CString strFile, CVolInfo& volInfo)
        
 BOOL SetVolInfo(CVolInfo& volInfo)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     struct VolumeStatus *status;
     char *input;
@@ -1872,9 +1872,9 @@ void GetCellName(const CString& cellNamep, struct afsconf_cell *infop)
 
 BOOL CheckServers(const CString& strCellName, WHICH_CELLS nCellsToCheck, BOOL bFast)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
-    register LONG j;
+    LONG j;
     LONG temp = 0;
     struct afsconf_cell info;
     struct chservinfo checkserv;
@@ -2142,7 +2142,7 @@ void ListSymbolicLinkPath(const char *strName,char *strPath,UINT nlenPath)
 
 BOOL ListSymlink(CStringArray& files)
 {
-    register LONG code;
+    LONG code;
     struct ViceIoctl blob;
     int error;
     CStringArray symlinks;
index a625083..93f8daf 100644 (file)
@@ -420,7 +420,7 @@ void osi_TSignalForMLs(osi_turnstile_t *turnp, int stillHaveReaders, CRITICAL_SE
  */
 void osi_SleepSpin(LONG_PTR sleepValue, CRITICAL_SECTION *releasep)
 {
-    register LONG_PTR idx;
+    LONG_PTR idx;
     int code;
     osi_sleepInfo_t *sp;
     CRITICAL_SECTION *csp;
@@ -473,9 +473,9 @@ void osi_SleepSpin(LONG_PTR sleepValue, CRITICAL_SECTION *releasep)
 /* utility function to wakeup someone sleeping in SleepSched */
 void osi_WakeupSpin(LONG_PTR sleepValue)
 {
-    register LONG_PTR idx;
-    register CRITICAL_SECTION *csp;
-    register osi_sleepInfo_t *tsp;
+    LONG_PTR idx;
+    CRITICAL_SECTION *csp;
+    osi_sleepInfo_t *tsp;
 
     idx = osi_SLEEPHASH(sleepValue);
     csp = &osi_critSec[idx];
index c9918cd..a3a82bf 100644 (file)
@@ -38,11 +38,11 @@ void osi_LongToUID(long inval, UUID *outuidp)
 /* compare two UIDs in the dictionary ordering */
 int osi_UIDCmp(UUID *uid1p, UUID *uid2p)
 {
-       register int i;
-        unsigned int v1;
-        unsigned int v2;
-        unsigned char *t1p;
-        unsigned char *t2p;
+       int i;
+        int v1;
+        int v2;
+        char *t1p;
+        char *t2p;
        
        if (uid1p->Data1 < uid2p->Data1) return -1;
         else if (uid1p->Data1 > uid2p->Data1) return 1;