Changeset 65962 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Mar 7, 2017 10:13:17 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py
r65953 r65962 500 500 Raises BadValue if invalid value. 501 501 """ 502 if len(sValue) == 0:502 if not sValue: 503 503 raise TestType.BadValue('empty value'); 504 504 … … 1149 1149 Returns number of errors. 1150 1150 """ 1151 if len(self.asErrors) > 0:1151 if self.asErrors: 1152 1152 sys.stderr.write(u''.join(self.asErrors)); 1153 1153 return len(self.asErrors); … … 1177 1177 asWords = sStats.split('_'); 1178 1178 oInstr.sMnemonic = asWords[0].lower(); 1179 if len(asWords) > 1 and len(oInstr.aoOperands) == 0:1179 if len(asWords) > 1 and not oInstr.aoOperands: 1180 1180 for sType in asWords[1:]: 1181 1181 if sType in g_kdOpTypes: … … 1248 1248 # Derive encoding from operands. 1249 1249 if oInstr.sEncoding is None: 1250 if len(oInstr.aoOperands) == 0:1250 if not oInstr.aoOperands: 1251 1251 oInstr.sEncoding = 'fixed'; 1252 1252 elif oInstr.aoOperands[0].usesModRM(): … … 1259 1259 # Apply default map and then add the instruction to all it's groups. 1260 1260 # 1261 if len(oInstr.aoMaps) == 0:1261 if not oInstr.aoMaps: 1262 1262 oInstr.aoMaps = [ self.oDefaultMap, ]; 1263 1263 for oMap in oInstr.aoMaps: … … 1324 1324 def ensureInstructionForOpTag(self, iTagLine): 1325 1325 """ Ensure there is an instruction for the op-tag being parsed. """ 1326 if len(self.aoCurInstrs) == 0:1326 if not self.aoCurInstrs: 1327 1327 self.addInstruction(self.iCommentLine + iTagLine); 1328 1328 for oInstr in self.aoCurInstrs: … … 1340 1340 asRet = []; 1341 1341 for asLines in aasSections: 1342 if len(asLines) > 0:1342 if asLines: 1343 1343 asRet.append(' '.join([sLine.strip() for sLine in asLines])); 1344 1344 return asRet; … … 1356 1356 sRet = ''; 1357 1357 for iSection, asLines in enumerate(aasSections): 1358 if len(asLines) > 0:1358 if asLines: 1359 1359 if iSection > 0: 1360 1360 sRet += sSectionSep; … … 1378 1378 # Flatten and validate the value. 1379 1379 sBrief = self.flattenAllSections(aasSections); 1380 if len(sBrief) == 0:1380 if not sBrief: 1381 1381 return self.errorComment(iTagLine, '%s: value required' % (sTag,)); 1382 1382 if sBrief[-1] != '.': … … 1405 1405 """ 1406 1406 oInstr = self.ensureInstructionForOpTag(iTagLine); 1407 if len(aasSections) > 0:1407 if aasSections: 1408 1408 oInstr.asDescSections.extend(self.flattenSections(aasSections)); 1409 1409 return True; … … 1498 1498 sFlattened = self.flattenAllSections(aasSections, sLineSep = ',', sSectionSep = ','); 1499 1499 asMaps = sFlattened.split(','); 1500 if len(asMaps) == 0:1500 if not asMaps: 1501 1501 return self.errorComment(iTagLine, '%s: value required' % (sTag,)); 1502 1502 for sMap in asMaps: … … 1742 1742 if len(asWords) != 1: 1743 1743 self.errorComment(iTagLine, '%s: expected exactly one value: %s' % (sTag, asWords,)); 1744 if len(asWords) == 0:1744 if not asWords: 1745 1745 return False; 1746 1746 sDisEnum = asWords[0]; … … 1911 1911 # 1912 1912 sFlatSection = self.flattenAllSections([asSectionLines,]); 1913 if len(sFlatSection) == 0:1913 if not sFlatSection: 1914 1914 self.errorComment(iTagLine, '%s: missing value' % ( sTag,)); 1915 1915 continue; … … 2118 2118 asLines[iLine] = sLine.lstrip().lstrip('*').lstrip(); 2119 2119 2120 while len(asLines) > 0 and len(asLines[0]) == 0:2120 while asLines and not asLines[0]: 2121 2121 self.iCommentLine += 1; 2122 2122 asLines.pop(0); 2123 2123 2124 while len(asLines) > 0 and len(asLines[-1]) == 0:2124 while asLines and not asLines[-1]: 2125 2125 asLines.pop(len(asLines) - 1); 2126 2126 … … 2142 2142 for iLine, sLine in enumerate(asLines): 2143 2143 if not sLine.startswith('@'): 2144 if len(sLine) > 0:2144 if sLine: 2145 2145 asCurSection.append(sLine); 2146 elif len(asCurSection) != 0:2146 elif asCurSection: 2147 2147 asCurSection = []; 2148 2148 aasSections.append(asCurSection); … … 2189 2189 # Don't allow default text in blocks containing @op*. 2190 2190 # 2191 if cOpTags > 0 and len(sFlatDefault) > 0:2191 if cOpTags > 0 and sFlatDefault: 2192 2192 self.errorComment(0, 'Untagged comment text is not allowed with @op*: %s' % (sFlatDefault,)); 2193 2193 … … 2287 2287 2288 2288 # Apply to the last instruction only for now. 2289 if len(self.aoCurInstrs) == 0:2289 if not self.aoCurInstrs: 2290 2290 self.addInstruction(); 2291 2291 oInstr = self.aoCurInstrs[-1]; … … 2404 2404 sFunction = asArgs[1]; 2405 2405 2406 if len(self.aoCurInstrs) == 0:2406 if not self.aoCurInstrs: 2407 2407 self.addInstruction(); 2408 2408 for oInstr in self.aoCurInstrs:
Note:
See TracChangeset
for help on using the changeset viewer.