- Timestamp:
- Sep 24, 2008 7:28:21 AM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Performance.cpp
r12400 r12678 463 463 } 464 464 465 /* The following method was borrowed from VMM/STAM.cpp */ 466 bool Filter::patternMatch(const char *pszPat, const char *pszName) 467 { 465 /* The following method was borrowed from VMM/STAM.cpp and modified to handle 466 * the special case of trailing colon in the pattern. 467 */ 468 bool Filter::patternMatch(const char *pszPat, const char *pszName, 469 bool fSeenColon) 470 { 471 bool seenColon = fSeenColon; 468 472 /* ASSUMES ASCII */ 469 473 for (;;) … … 473 477 { 474 478 default: 479 /* Handle a special case, the mask terminating with a colon */ 480 if (chPat == ':') 481 { 482 if (!seenColon && !*(pszPat + 1)) 483 return !*pszName; 484 seenColon = true; 485 } 475 486 if (*pszName != chPat) 476 487 return false; … … 482 493 /* nothing */; 483 494 495 /* Handle a special case, the mask terminating with a colon */ 496 if (chPat == ':') 497 { 498 if (!seenColon && !*(pszPat + 1)) 499 return !strchr(pszName, ':'); 500 seenColon = true; 501 } 484 502 for (;;) 485 503 { … … 487 505 if ( ch == chPat 488 506 && ( !chPat 489 || patternMatch(pszPat + 1, pszName )))507 || patternMatch(pszPat + 1, pszName, seenColon))) 490 508 return true; 491 509 if (!ch) -
trunk/src/VBox/Main/darwin/PerformanceDarwin.cpp
r12400 r12678 149 149 return RTErrConvertFromDarwin(rc); 150 150 } 151 else if ( nb < sizeof(*tinfo))151 else if ((unsigned int)nb < sizeof(*tinfo)) 152 152 { 153 153 Log(("proc_pidinfo() -> too few bytes %d", nb)); -
trunk/src/VBox/Main/include/Performance.h
r12546 r12678 376 376 Filter(ComSafeArrayIn(INPTR BSTR, metricNames), 377 377 ComSafeArrayIn(IUnknown * , objects)); 378 static bool patternMatch(const char *pszPat, const char *pszName); 378 static bool patternMatch(const char *pszPat, const char *pszName, 379 bool fSeenColon = false); 379 380 bool match(const ComPtr<IUnknown> object, const std::string &name) const; 380 381 private:
Note:
See TracChangeset
for help on using the changeset viewer.