Skip to content

Refactor VFS file operations for improved readability and consistency - #60

Merged
dogo merged 1 commit into
masterfrom
refactor/vfsFile
Sep 8, 2024
Merged

Refactor VFS file operations for improved readability and consistency#60
dogo merged 1 commit into
masterfrom
refactor/vfsFile

Conversation

@dogo

@dogo dogo commented Sep 7, 2024

Copy link
Copy Markdown
Owner

Description

This PR refactors the VFS file operations to improve code readability, maintainability, and ensure consistent behavior across file operations. Key changes include:

  • Refactored core file operations:

    • Simplified vfsFileOpen, vfsFileClose, vfsFileRead, vfsFileWrite, vfsFileSeek, and vfsFileTell.
    • Ensured proper handling of file modes (read, write, read/write) and resource cleanup.
  • Memory-based fallbacks:

    • Integrated vfsMemGetc, vfsMemPutc, vfsMemGets, and vfsMemPuts as fallbacks for standard I/O functions.
  • Improved EOF handling:

    • Added clear EOF flag management after read and seek operations.
  • Code cleanup:

    • Reduced redundancy, used consistent return types, and streamlined function logic.

Impact

These changes enhance the overall structure and behavior of the VFS system, making it easier to maintain and extend. No changes in functionality, just internal improvements.

- Refactored open, close, read, write, seek, and tell functions.
- Streamlined memory-based fallbacks for getc, putc, gets, and puts.
- Enhanced EOF handling and code readability.
@dogo
dogo merged commit 1439bf8 into master Sep 8, 2024
@dogo
dogo deleted the refactor/vfsFile branch September 8, 2024 10:10
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.

1 participant