Skip to content

Commit

Permalink
Fix handling of negative WPILOG timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Sep 20, 2024
1 parent c6b191c commit 9301f4b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
6 changes: 1 addition & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,5 @@
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"css.lint.vendorPrefix": "ignore",
"files.associations": {
"cstring": "c",
"string.h": "c"
}
"css.lint.vendorPrefix": "ignore"
}
7 changes: 0 additions & 7 deletions src/hub/dataSources/wpilog/indexer/wpilogIndexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ int64_t readVarInt(void* buffer, int offset, int length) {
int multiplier = 1;
for (int i = 0; i < length; i++) {
uint8_t byte = *(uint8_t*)(buffer + offset + i);
if (i == 7) {
// Last byte, apply sign
if ((byte & (1 << 7))) {
value *= -1;
}
byte &= ~(1 << 7);
}
value += (int64_t)byte << (8 * i);
}
return value;
Expand Down

0 comments on commit 9301f4b

Please sign in to comment.