Skip to content

stream: improved support for large tag files - #921

Open
ourairquality wants to merge 1 commit into
rtklibexplorer:mainfrom
ourairquality:large-tag-files-win32
Open

stream: improved support for large tag files#921
ourairquality wants to merge 1 commit into
rtklibexplorer:mainfrom
ourairquality:large-tag-files-win32

Conversation

@ourairquality

Copy link
Copy Markdown

There was already 8 byte tag file support and this was expected to work for some builds, but windows in particilar is a special case.

@ourairquality
ourairquality force-pushed the large-tag-files-win32 branch 2 times, most recently from 75ed149 to 42d8695 Compare August 5, 2026 11:41
@rtklibexplorer

Copy link
Copy Markdown
Owner

Suggested simpler option from AI:

This achieves the same result with less surface area — two small wrapper functions (xftell/xfseek) instead of duplicating the platform split at each of the six call sites. A few other things it picks up along the way:

WIN32 vs _WIN32: the new guards here use _WIN32, but the rest of stream.c (and its own header comment: * options : -DWIN32 use WIN32 API) consistently uses WIN32 without the underscore. _WIN32 is auto-defined by any Windows compiler so this will work in practice, but it's inconsistent with the file's established convention and introduces a second, parallel "is this Windows" check.
Two format-string mismatches: nr=%zd should be %zu since nr is size_t (unsigned), not ssize_t. And fpos=%ld with a (long long) cast is also mismatched — %ld expects long, which is only 32-bit on Windows even though the cast is long long; fixed to %lld to match.

Patch
stream_large_tag_files_vs_main.patch
attached, applies cleanly to current main. Happy to push it myself if that's easier than you pulling it in.

@ourairquality
ourairquality force-pushed the large-tag-files-win32 branch from 42d8695 to ae6380c Compare August 28, 2026 07:46
@ourairquality

Copy link
Copy Markdown
Author

Can abstract it that way, updated.

@rtklibexplorer

Copy link
Copy Markdown
Owner

Thanks for updating, AI still had a couple minor issues:

  1. Compile-breaker on Windows: file->fpos_n = ftello(file->fp); in the tag-parsing block still calls ftello() directly instead of xftell() — the other three calls in that same block were converted, this one was missed. ftello() isn't available on MSVC, so this would fail to build on Windows.
  2. readfile()'s trace (nr=%zd) — nr is size_t, should be %zu. Minor, but from the earlier round of feedback.

There was already 8 byte tag file support and this was expected to
work for some builds, but windows in particilar is a special case.
@ourairquality
ourairquality force-pushed the large-tag-files-win32 branch from ae6380c to 0122539 Compare August 29, 2026 06:47
@ourairquality

Copy link
Copy Markdown
Author

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants