Changeset 21176 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jul 2, 2009 4:05:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/mappings.cpp
r21172 r21176 33 33 void vbsfMappingInit(void) 34 34 { 35 int root; 35 unsigned root; 36 36 37 for (root = 0; root < RT_ELEMENTS(aIndexFromRoot); root++) 37 38 { 38 aIndexFromRoot[root] = ~0;39 aIndexFromRoot[root] = SHFL_ROOT_NIL; 39 40 } 40 41 } … … 54 55 } 55 56 56 int i; 57 57 SHFLROOT i; 58 58 for (i = 0; i < RT_ELEMENTS(FolderMapping); i++) 59 59 { … … 82 82 if (root < RT_ELEMENTS(aIndexFromRoot)) 83 83 { 84 int iMapping = aIndexFromRoot[root]; 85 86 if (0 <= iMapping && iMapping < RT_ELEMENTS(FolderMapping)) 84 SHFLROOT iMapping = aIndexFromRoot[root]; 85 86 if ( iMapping != SHFL_ROOT_NIL 87 && iMapping < RT_ELEMENTS(FolderMapping)) 87 88 { 88 89 return &FolderMapping[iMapping]; … … 93 94 } 94 95 95 static SHFLROOT vbsfMappingGetRootFromIndex(int iMapping) 96 { 97 int root; 96 static SHFLROOT vbsfMappingGetRootFromIndex(SHFLROOT iMapping) 97 { 98 unsigned root; 99 98 100 for (root = 0; root < RT_ELEMENTS(aIndexFromRoot); root++) 99 101 { … … 104 106 } 105 107 106 return ~0;108 return SHFL_ROOT_NIL; 107 109 } 108 110 109 111 static MAPPING *vbsfMappingGetByName (PRTUTF16 utf16Name, SHFLROOT *pRoot) 110 112 { 111 inti;112 113 for (i=0; i<SHFL_MAX_MAPPINGS;i++)113 unsigned i; 114 115 for (i=0; i<SHFL_MAX_MAPPINGS; i++) 114 116 { 115 117 if (FolderMapping[i].fValid == true) … … 119 121 SHFLROOT root = vbsfMappingGetRootFromIndex(i); 120 122 121 if (root != ~0)123 if (root != SHFL_ROOT_NIL) 122 124 { 123 125 if (pRoot) … … 138 140 } 139 141 140 static void vbsfRootHandleAdd( intiMapping)141 { 142 introot;142 static void vbsfRootHandleAdd(SHFLROOT iMapping) 143 { 144 unsigned root; 143 145 144 146 for (root = 0; root < RT_ELEMENTS(aIndexFromRoot); root++) 145 147 { 146 if (aIndexFromRoot[root] == ~0)148 if (aIndexFromRoot[root] == SHFL_ROOT_NIL) 147 149 { 148 150 aIndexFromRoot[root] = iMapping; … … 152 154 153 155 AssertFailed(); 154 return; 155 } 156 157 static void vbsfRootHandleRemove(int iMapping) 158 { 159 int root; 156 } 157 158 static void vbsfRootHandleRemove(SHFLROOT iMapping) 159 { 160 unsigned root; 160 161 161 162 for (root = 0; root < RT_ELEMENTS(aIndexFromRoot); root++) … … 163 164 if (aIndexFromRoot[root] == iMapping) 164 165 { 165 aIndexFromRoot[root] = ~0;166 aIndexFromRoot[root] = SHFL_ROOT_NIL; 166 167 return; 167 168 } … … 169 170 170 171 AssertFailed(); 171 return;172 172 } 173 173 … … 181 181 int vbsfMappingsAdd (PSHFLSTRING pFolderName, PSHFLSTRING pMapName, uint32_t fWritable) 182 182 { 183 inti;183 unsigned i; 184 184 185 185 Assert(pFolderName && pMapName); … … 188 188 189 189 /* check for duplicates */ 190 for (i=0; i<SHFL_MAX_MAPPINGS;i++)190 for (i=0; i<SHFL_MAX_MAPPINGS; i++) 191 191 { 192 192 if (FolderMapping[i].fValid == true) … … 200 200 } 201 201 202 for (i=0; i<SHFL_MAX_MAPPINGS;i++)202 for (i=0; i<SHFL_MAX_MAPPINGS; i++) 203 203 { 204 204 if (FolderMapping[i].fValid == false) … … 261 261 int vbsfMappingsRemove (PSHFLSTRING pMapName) 262 262 { 263 inti;263 unsigned i; 264 264 265 265 Assert(pMapName); 266 266 267 267 Log(("vbsfMappingsRemove %ls\n", pMapName->String.ucs2)); 268 for (i=0; i<SHFL_MAX_MAPPINGS;i++)268 for (i=0; i<SHFL_MAX_MAPPINGS; i++) 269 269 { 270 270 if (FolderMapping[i].fValid == true)
Note:
See TracChangeset
for help on using the changeset viewer.