Changeset 36914 for trunk/ppStats/src/ppStatsFromMetadataStats.c
- Timestamp:
- Jun 19, 2014, 3:22:46 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ppStats/src/ppStatsFromMetadataStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStats/src/ppStatsFromMetadataStats.c
r23989 r36914 1 1 # include "ppStatsInternal.h" 2 3 static void computeBitwiseOr(ppStatsEntry *entry); 2 4 3 5 // calculate the stats for the non-constant entries (already calculated) … … 11 13 // XXX skip or warn on missing stats? 12 14 if (!entry->vector) continue; 15 16 if (!strcasecmp (entry->statistic, "bitwiseor")) { 17 computeBitwiseOr(entry); 18 continue; 19 } 13 20 14 21 psStatsOptions option; … … 68 75 return true; 69 76 } 77 78 static void computeBitwiseOr(ppStatsEntry *entry) 79 { 80 psU64 result = 0; 81 psVector *vector = entry->vector; 82 for (int j = 0; j < vector->n; j++) { 83 // XXX: should we handle other types 84 if (entry->type == PS_DATA_U64) { 85 result |= vector->data.U64[j]; 86 } else if (entry->type == PS_DATA_U32) { 87 result |= vector->data.U32[j]; 88 } else { 89 return; 90 } 91 } 92 93 if (entry->type == PS_DATA_U64) { 94 entry->value = psMetadataItemAllocU64(entry->keyword, entry->statistic, result); 95 } else { 96 entry->value = psMetadataItemAllocU32(entry->keyword, entry->statistic, result); 97 } 98 99 return; 100 } 101
Note:
See TracChangeset
for help on using the changeset viewer.
