-
Notifications
You must be signed in to change notification settings - Fork 54
Merge dev into master #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… params, fix assignment bug, annotate fallthrough, avoid hidden overloads, and bracket empty bodies
- Replace all NULL with nullptr in zone module (zone.hh, zone_object.hh, zone_object.cc) - Replace NULL with nullptr in term_view.hh - Fix reserved identifier _ZONE_OBJECT_HH → ZONE_OBJECT_HH - Fix reserved identifier _TERM_VIEW_HH → TERM_VIEW_HH - Addresses modernize-use-nullptr and bugprone-reserved-identifier checks All tests passing (40/40). Build clean.
- Replaced NULL with nullptr in all header files and implementation files - Replaced deprecated bzero() calls with memset() in socket.cc - Build clean, 39/40 tests passing (log test pre-existing failure)
…d potential undefined value access
- Replace incorrect (value + 0.5) cast patterns with lround() - Affects 7 lines in fee calculation and tax calculation logic - Use static_cast<int> for clarity - Add #include <cmath> header - Fixes bugprone-incorrect-roundings clang-tidy warnings - Build clean, 39/40 tests passing
…et substitution, rounding fixes, and test status (39/40)
…y: modernize-use-override)
…odernize-use-override)
…-tidy: modernize-use-override
…ame() (clang-tidy: modernize-use-override)
…dernize-use-override)
…remove erroneous override on ValidateCommand
…status (12-21-2025)
…e tests read logs immediately
Replaced NULL with nullptr across 123 files throughout the codebase to improve type safety and C++11+ compliance. Scope: - zone/ directory: 58 files modernized - main/ directory: 30 files modernized (1,217 NULL occurrences) - term/ directory: 8 files modernized (106 NULL occurrences) - src/ directory: 24 files modernized (7 NULL occurrences) - loader/ and cdu/: 2 files modernized - Fixed form_zone.hh header guard mismatch Methodology: - Applied clang-tidy with modernize-use-nullptr check - Used -fix and -fix-errors flags for automated refactoring - Manual fixes for edge cases in headers and complex expressions Verification: - All 40/40 unit tests passing - Build successful with no errors - Zero NULL literals remaining in actual code Benefits: - Type-safe null pointer constant (no implicit conversions) - Better overload resolution in template contexts - Clearer intent in modern C++ code - Full C++11/14/17/20 compliance
Applied three high-value modernizations to improve code quality: 1. modernize-use-using (3 fixes) - Converted typedef to using aliases in manager.hh - Modern C++11 syntax for function pointer types 2. modernize-macro-to-enum (6 fixes) - Converted VERSION macros to constexpr constants - Affects: account, check, customer, labor, sales, tips - Benefits: type safety, proper scoping, debugger-friendly 3. modernize-use-nodiscard (auto-applied across codebase) - Added [[nodiscard]] to functions with important return values - Prevents accidental ignoring of IsEmpty(), Count(), etc. - Applied to: time_info.hh, utility.hh, vt_logger.hh, terminal.hh Verification: - All 40/40 tests passing - Build successful with no errors - 15 files modified, 81 insertions(+), 81 deletions(-)
Applied additional clang-tidy modernizations (auto, headers, void args, range-for, braced init, default member init, raw string) across core modules and documented in changelog. Build and tests: 40/40 passing.
Added comprehensive documentation for the development branch, including guidelines for contributors, build instructions, and issue reporting.
…ately Fixed bug where Sales Item List button type was showing both the list of items and the selected item's configuration simultaneously. Root Cause: ListFormZone::Render() was unconditionally calling FormZone::Render() which displayed form fields even when showing the list view. Solution: - Modified ListFormZone::Render() to conditionally call FormZone::Render() only when show_list is false (form view) - Modified ListFormZone::Touch() to not load form fields when selecting items from the list - Modified ListFormZone::Signal() to load form fields when switching from list to form view via 'change view' signal Result: List view shows only items; form view shows only configuration fields; switching between views requires explicit 'change view' signal. This fix brings ListFormZone in line with the pattern established in HardwareZone and affects all ListFormZone-based zones (ItemListZone, etc.). Files modified: - zone/form_zone.cc (ListFormZone::Render, Touch, Signal methods) - docs/changelog.md
…std::format - Converted ~450+ snprintf/sprintf calls to C++23 std::format using format_to_buffer() - Added src/utils/cpp23_utils.hh library with format_to_buffer, to_underlying, Result<T> - Modernized 60+ files across main/, zone/, src/, term/, loader/, cdu/ - Benefits: type safety, memory safety, readability, maintainability, zero overhead - All builds passing with 0 errors Known Issues: - Some child pages not inheriting parent page buttons correctly - Requires further investigation in page hierarchy handling
- Removed erroneous default case that forced parent_id = 0 for unhandled page types - Restores inheritance for PAGE_SYSTEM, PAGE_TEMPLATE, PAGE_CHECKS, PAGE_KITCHEN_VID, PAGE_KITCHEN_VID2, PAGE_BAR1, PAGE_BAR2 - Matches master branch behavior where unhandled types retain initialized parent_id - Fixes pages not showing inherited zones from parent pages
- Add __has_include detection for <format> and <expected> headers - Provide fallback for std::to_underlying() using static_cast - Conditionally compile std::expected types when available - Add compile-time error if std::format unavailable - Fixes Clang 18 build failures in CI (requires C++20+ stdlib with std::format)
- Change std: [20] to std: [23] in linux-simple-builds.yml - Required due to C++23 modernization using std::format extensively - Matches CMakeLists.txt default standard and local development
- Only test with g++-14 which has full C++23 stdlib (std::format, etc.) - Older compilers lack std::format even with -std=c++23 flag - Change #error to #warning for better diagnostics when std::format missing - Documents minimum compiler requirements in workflow comments
- Keep only g++-14 in the include section - Previous commit only removed from matrix but include re-added them - Now truly restricts CI to GCC 14+ only
- Fixed double-triggering when using touchscreen by changing ListFormZone handlers to use LayoutZone::Touch instead of FormZone::Touch - Fixed ListField click detection offset from .6 to 1 and boundary to match visual button area - Resolves issues in Tender Settings and all form zones with list fields
- Fixed double-triggering in ListFormZone by calling LayoutZone::Touch instead of FormZone::Touch - Fixed ListField click area boundaries to match visual button size - Redesigned Order Comment dialog with 6-row QWERTY keyboard layout - Added visible text entry box with absolute positioning - Implemented text display updates showing typed characters in RED - Added proper background clearing to prevent artifacting - Adjusted text positioning for better centering Work in progress: Still polishing the dialog keyboard implementation
- Redesigned keyboard with cleaner, more professional appearance - Increased text entry box height to 80px for better visibility - Repositioned entry box directly below title with optimal spacing - Fine-tuned text baseline positioning for perfect vertical centering - Changed entry box to IMAGE_LITE_WOOD with FRAME_INSET for cleaner look - Improved button spacing (6px gaps) and heights (85px) for better touch targets - Text displays in bold black (FONT_TIMES_34B) with high contrast - Removed unused variables from Render method - Entry box now properly contains all typed text with clear visibility
Complete OrderCommentDialog redesign with modern layout
- Add test_time_operations.cc with TimeInfo class tests * Time arithmetic operations (seconds, minutes, days, weeks, months, years) * Comparison operators and date ordering * Business logic scenarios (shift scheduling) * Operator overloads and edge cases - Add test_error_handler.cc with error management tests * ErrorInfo construction and severity levels * Error categories (9 types: GENERAL, SYSTEM, NETWORK, etc.) * Context tracking (file, line, function, error code) * Real-world error scenarios - Add test_sales_tax_calculations.cc with 43 test cases * US tax calculations, Canadian GST/PST/HST/QST * European VAT, discounts, coupons, modifiers * Quantity pricing and rounding - Fix floating-point comparison precision issues * Apply Catch::Approx() to all float equality checks * Fix RAII scoping issue in test_memory_modernization.cc - Update CMakeLists.txt to include new test files Test suite now contains 80 test cases with 568 assertions (100% passing)
Fixes segmentation fault (SIGSEGV) when saving employee records in the User Edit Zone. The crash occurred during form field iteration when the field pointer became NULL. Root Cause: - Loop condition checked 'f != nullptr' but immediately dereferenced f->next without revalidation on the first line of the loop body - This caused a segfault when f was NULL at loop entry or became NULL during iteration Changes: - Add explicit NULL check before dereferencing f->next in job info loop - Add early validation for user pointer and FieldList() return value - Add error logging with ReportError() for easier debugging - Return error code 1 instead of continuing with NULL pointers Crash Stack Trace Reference: TextField::Get(int&) <- UserEditZone::SaveRecord() Signal: SIGSEGV at zone/user_edit_zone.cc line 440 Tested: Compiles successfully, prevents crash on employee save operation
- Fixed SIGSEGV when saving employee records caused by NULL/dangling user pointers - Added user pointer validation before SaveRecord calls in Signal() and Update() - Enhanced SaveRecord field iteration with proper null checks and early breaks - Added dangling pointer detection to catch freed memory access - Improved error logging for better debugging Root causes: 1. SaveRecord called without validating user pointer when toggling Active/Inactive 2. SaveRecord called without validation during job filter updates 3. Field pointer advanced without null checks in job info iteration loop Testing: Validated with AddressSanitizer in Debug build Fixes: User Edit button type save crashes
Fix User Edit Zone Crashes and Add Comprehensive Test Coverage
Object Pool System: - Add src/core/object_pool.hh with thread-safe ObjectPool<T> template - Add PooledObject<T> RAII wrapper for automatic return to pool - Add BufferPool<Size> for fixed-size char buffer pooling - Configurable max pool size (default 64 objects) Thread Pool & Async I/O: - Add src/core/thread_pool.hh with ThreadPool for async operations - Add WriteBehindBuffer for deferred writes - Add CloseAsync() for non-blocking printer operations - Add 5-second socket timeouts to prevent hangs Memory Management Improvements: - Convert Report* to std::unique_ptr<Report> in 8 zone files - Add O(1) Count() caching for DList/SList (was O(n)) - Add lazy texture loading with LRU cache in term_view - Reduce CharQueue default size from 2MB to 256KB - Add RemoveAndDelete() helpers for linked lists - Add RAII for KeyValueInputFile/KeyValueOutputFile Quick Fixes: - Cache term->GetSettings() pointer in hot paths - Fix socket leaks in socket.cc and loader_main.cc Target: Raspberry Pi CM5 with 2GB RAM optimization Tests: 83/83 passing
The lazy texture loading optimization conflicted with the static tile cache in Layer::Rectangle(), causing buttons to incorrectly show highlighted state. - Add PreloadAllTextures() function to load all textures at startup - Call PreloadAllTextures() after ResetView() during initialization - Ensures consistent Pixmap values before any rendering occurs
The static cache optimization in Layer::Rectangle() was fundamentally broken - static variables persisted across all rendering calls, causing stale cache values to be used when different buttons needed different textures. - Remove static current_tile, current_origin_x, current_origin_y cache - Each Rectangle() call now properly sets XSetTile and XSetTSOrigin - Ensures correct texture rendering for all button states
Fix button highlighting bugs and optimize memory for Raspberry Pi CM5
- Remove 5-item increment limit, allow unlimited increases up to 10,000 - Redesign keypad with phone-style layout (1-2-3, 4-5-6, etc.) - Larger entry field (200x50) with bigger font, centered at top - Immediate redraw for responsive input - Remove dialog title for cleaner interface - Start entry field blank for new quantity input Files: zone/order_zone.cc, zone/dialog_zone.cc, docs/changelog.md
UI: Modernize quantity entry keypad
- Cache font and text metrics to avoid recomputation every frame - Eliminate full-screen fill on every animation frame - Add selective erasure of previous text position - Reduce CPU/GPU load during screen saver animation Files: term/term_view.cc, docs/changelog.md
Performance: Optimize screen saver drawing efficiency
Member
|
A whole lot of warnings during compile have vanished ! There are hardly any now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title: Merge dev branch into master - C++23 Modernization, UI Improvements, and Bug Fixes
Description:
This pull request merges the latest developments from the
devbranch intomaster, incorporating significant code modernization, UI enhancements, performance optimizations, and bug fixes. The changes span approximately the last 88 commits, focusing on transitioning to C++23 standards, improving code quality through clang-tidy compliance, enhancing user interface components, and removing deprecated subsystems.Summary of Changes
std::formatfor string formatting,nullptrusage,std::arrayfor fixed-size buffers, and extensive enum conversions from legacy macros.overridespecifiers throughout the codebase.Detailed Commit Breakdown
C++23 Modernization and Code Quality Improvements
UI and UX Enhancements
Performance Optimizations
Bug Fixes
Testing
CI and Build Updates
Documentation Updates
Feature Removals
Merge Commits
Testing Notes
Breaking Changes
Checklist