Repository navigation
🚀 Comprehensive C++20 Modernization and Safety Improvements - #190
Merged
Merged
Conversation
- Add configurable scheduled restart functionality with user prompts - Users can set restart time in System Variables (hour/minute, -1 to disable) - Smart dialog system with restart/postpone/auto-restart options - 5-minute timeout for automatic restart if no user response - 1-hour postpone functionality with daily reset counters - Complete state persistence and settings integration - Add automatic vt_data download on startup - Downloads latest vt_data from ViewTouch update servers on every startup - Dual URL support with fallback (HTTP and HTTPS) - Comprehensive error handling and logging - Improve embossed text rendering readability - Replace color-distorting red tinting with balanced luminance adjustments - Use proportional brightness (60% shadow, 40% highlight boost) - Maintain original color hue and saturation for better readability - Apply consistently across all embossed text rendering - Update settings system to version 98 for new restart configuration
- Replace system(VIEWTOUCH_RESTART) with RestartSystem() call - Prevents freezing when user clicks 'Restart Now' button - Uses proven fork/exec mechanism instead of potentially missing script - RestartSystem() is the same mechanism used by existing restart functionality
## Major Code Modernization (Breaking Ground for Modern C++) ### Memory Safety Revolution - Upgraded RemotePrinter & System classes to use std::unique_ptr - Replaced 280+ raw pointer instances with smart pointer management - Converted CharQueue to use std::vector instead of raw arrays - Eliminated manual memory cleanup - RAII now handles everything ### String Safety & STL Modernization - Replaced all sprintf calls with bounds-checked snprintf - Converted C-style arrays to std::array/std::vector throughout - MediaList class now uses std::string instead of char arrays - Enhanced string handling with proper size validation ### New Infrastructure Created - string_utils.hh/cc: Modern string utilities with Unicode support - error_handler.hh/cc: Unified error handling framework with logging - Thread-safe error management with callback system - Template-based type-safe formatting system ### Build System & Standards - Upgraded from C++17 to C++20 standard - Enhanced compiler warnings: -Wextra, -Wconversion, -Wnull-dereference - Integrated new modules into CMake build system - All changes maintain full backward compatibility ### Performance & Safety Enhancements - Added const references to function parameters - Enhanced null pointer safety with smart pointers - Better bounds checking and validation throughout - Optimized memory usage patterns This modernization significantly improves code safety, maintainability, and performance while preserving all existing functionality.
- Changed CI workflow from C++17 to C++20 to match our modernization - Removed redundant C++20 entries in include section - All 8 build jobs now consistently use C++20 standard - Resolves CI build failures after C++20 modernization commit Fixes GitHub Actions build failures: https://github.com/No0ne558/viewtouchFork/actions/runs/17321710658
Template functions in headers need all dependencies available at compile time. The format() template uses std::snprintf but was missing the <cstdio> include, causing CI compilation failures when templates were instantiated. This resolves CI build failures in: https://github.com/No0ne558/viewtouchFork/actions/runs/17321954376 Confirmed working locally with all compilers.
The build system defines -DDEBUG macro for Debug builds, which was conflicting with our Severity::DEBUG enum value, causing compilation failures in CI. Fixed by: - Renamed Severity::DEBUG to Severity::VT_DEBUG in enum definition - Updated all references in error_handler.cc to use VT_DEBUG - Maintained backward compatibility by keeping string conversion as 'DEBUG' This resolves CI compilation errors across all compiler configurations: https://github.com/No0ne558/viewtouchFork/actions/runs/17321954376 Root cause: Macro expansion turned 'DEBUG = 0,' into invalid enum syntax. Solution: Use VT_ prefix to avoid system macro conflicts.
Member
|
I'm astounded, appreciative, and speechless, Ariel. Everyone who uses and relies on ViewTouch certainly shares my gratitude and my respect for you and for all that you have done here. For the past forty years, people have been asking me what will become of ViewTouch if 'something happens' to me. I think the answer to that is now quite reassuringly clear. Ariel and I are making big plans for what comes next. I feel the way Michael Faraday must have felt when he and James Clerk Maxwell met and began their extraordinary, collaborative friendship. |
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
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.
📋 Summary
This pull request modernizes the ViewTouch codebase, upgrading from C++17 → C++20 with major improvements in memory safety, string handling, and build system configuration.
The changes maintain full backward compatibility while providing a future-ready foundation.
🎯 Key Achievements
🔧 Technical Changes
🔒 Memory Safety
📝 String Safety & Modern STL Usage
🆕 New Infrastructure
🛠 Build System & Standards
📂 Files Modified
Core Infrastructure
Memory Safety
Build & CI
🔒 Safety & Compatibility
🧪 Testing & Validation
Local
CI
📈 Performance Impact
🔄 Migration Path
Immediate Benefits
Future Opportunities
🏆 Quality Metrics
🤝 Review Notes
Areas to Focus
Recommended Tests
🎉 Conclusion
This PR is a major modernization milestone for ViewTouch:
Ready for review & merge! 🚀