feat: Update deps to support esp-idf v6.0#109
Conversation
|
⚡ Static analysis result ⚡ 🔴 cppcheck found 33 issues! Click here to see details.esp-box-emu/components/jpeg/include/jpeg.hpp Lines 106 to 111 in 5a74c4b !Line: 106 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/jpeg/include/jpeg.hpp Lines 101 to 106 in 5a74c4b !Line: 101 - style: Parameter 'pDraw' can be declared as pointer to const. However it seems that 'on_data_decode' is a callback function, if 'pDraw' is declared with const you might also need to cast function pointer(s). [constParameterCallback]
!Line: 38 - note: You might need to cast the function pointer here
!Line: 101 - note: Parameter 'pDraw' can be declared as pointer to constesp-box-emu/components/sms/src/sms.cpp Lines 227 to 232 in 5a74c4b !Line: 227 - warning: inconclusive: If resource allocation fails, then there is a possible null pointer dereference: f [nullPointerOutOfResources]
!Line: 225 - note: Assuming allocation function fails
!Line: 225 - note: Assignment 'f=fopen(save_path.data(),"rb")', assigned value is 0
!Line: 227 - note: Null pointer dereferenceesp-box-emu/components/sms/src/sms.cpp Lines 235 to 240 in 5a74c4b !Line: 235 - warning: inconclusive: If resource allocation fails, then there is a possible null pointer dereference: f [nullPointerOutOfResources]
!Line: 233 - note: Assuming allocation function fails
!Line: 233 - note: Assignment 'f=fopen(save_path.data(),"wb")', assigned value is 0
!Line: 235 - note: Null pointer dereferenceesp-box-emu/components/sms/src/sms.cpp Lines 203 to 208 in 5a74c4b !Line: 203 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/msx/src/msx.cpp Lines 405 to 410 in 5a74c4b !Line: 405 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/msx/src/msx.cpp Lines 541 to 546 in 5a74c4b !Line: 541 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/nes/src/video_audio.cpp Lines 50 to 55 in 5a74c4b !Line: 50 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/nes/src/video_audio.cpp Lines 160 to 165 in 5a74c4b !Line: 160 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/genesis/src/genesis.cpp Lines 336 to 341 in 5a74c4b !Line: 336 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/genesis/src/genesis.cpp Lines 382 to 387 in 5a74c4b !Line: 382 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/genesis/src/genesis.cpp Lines 72 to 77 in 5a74c4b !Line: 72 - portability: Casting non-zero decimal integer literal to pointer. [intToPointerCast]
esp-box-emu/components/genesis/src/genesis.cpp Lines 77 to 82 in 5a74c4b !Line: 77 - portability: Casting non-zero decimal integer literal to pointer. [intToPointerCast]
esp-box-emu/components/doom/src/doom.cpp Lines 247 to 252 in 5a74c4b !Line: 247 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/doom/src/doom.cpp Lines 390 to 395 in 5a74c4b !Line: 390 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/doom/src/doom.cpp Lines 639 to 644 in 5a74c4b !Line: 639 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/doom/src/doom.cpp Lines 643 to 648 in 5a74c4b !Line: 643 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/pool_allocator/src/pool_allocator.c Lines 32 to 37 in 5a74c4b !Line: 32 - portability: '(void*)memory_pool' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer]
esp-box-emu/components/gbc/src/gameboy.cpp Lines 197 to 202 in 5a74c4b !Line: 197 - warning: inconclusive: If resource allocation fails, then there is a possible null pointer dereference: f [nullPointerOutOfResources]
!Line: 195 - note: Assuming allocation function fails
!Line: 195 - note: Assignment 'f=fopen(save_path.data(),"rb")', assigned value is 0
!Line: 197 - note: Null pointer dereferenceesp-box-emu/components/gbc/src/gameboy.cpp Lines 209 to 214 in 5a74c4b !Line: 209 - warning: inconclusive: If resource allocation fails, then there is a possible null pointer dereference: f [nullPointerOutOfResources]
!Line: 207 - note: Assuming allocation function fails
!Line: 207 - note: Assignment 'f=fopen(save_path.data(),"wb")', assigned value is 0
!Line: 209 - note: Null pointer dereferenceesp-box-emu/components/gbc/src/gameboy.cpp Lines 68 to 73 in 5a74c4b !Line: 68 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/gbc/src/gameboy.cpp Lines 118 to 123 in 5a74c4b !Line: 118 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/gbc/src/gameboy.cpp Lines 135 to 140 in 5a74c4b !Line: 135 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/gbc/src/gameboy.cpp Lines 213 to 218 in 5a74c4b !Line: 213 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/box-emu/example/main/box_emu_example.cpp Lines 166 to 171 in 5a74c4b !Line: 166 - error: Subtracting pointers that point to different objects [subtractPointers]
!Line: 158 - note: Variable declared here.
!Line: 166 - note: Array decayed to pointer here.
!Line: 157 - note: Variable declared here.
!Line: 166 - note: Array decayed to pointer here.
!Line: 166 - note: Subtracting pointers that point to different objectsesp-box-emu/components/box-emu/src/box-emu.cpp Lines 777 to 782 in 5a74c4b !Line: 777 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/box-emu/src/box-emu.cpp Lines 800 to 805 in 5a74c4b !Line: 800 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/box-emu/src/box-emu.cpp Lines 819 to 824 in 5a74c4b !Line: 819 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/box-emu/src/box-emu.cpp Lines 854 to 859 in 5a74c4b !Line: 854 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/box-emu/src/box-emu.cpp Lines 880 to 885 in 5a74c4b !Line: 880 - warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]
esp-box-emu/components/box-emu/example/main/box_emu_example.cpp Lines 157 to 162 in 5a74c4b !Line: 157 - information: Unmatched suppression: syntaxError [unmatchedSuppression]
esp-box-emu/components/box-emu/example/main/box_emu_example.cpp Lines 158 to 163 in 5a74c4b !Line: 158 - information: Unmatched suppression: syntaxError [unmatchedSuppression]
esp-box-emu/components/box-emu/example/main/box_emu_example.cpp Lines 166 to 171 in 5a74c4b !Line: 166 - information: Unmatched suppression: comparePointers [unmatchedSuppression]
|
There was a problem hiding this comment.
Pull request overview
This PR updates several emulator components and build settings to compile cleanly against newer ESP-IDF / toolchain behavior (esp-idf v6.0 per PR title), primarily by tightening C/C++ standards flags, adjusting warning handling, and updating a few code paths to match updated headers/struct layouts.
Changes:
- Add per-language compile options (e.g.,
-std=gnu17) and targeted warning/error suppressions across multiple components’CMakeLists.txt. - Modernize/adjust C code for stricter compilation (e.g.,
stdbool.h, explicit(void)prototypes, cheat handler refactor). - Update a few runtime settings/initializations (USB FAT mount config, audio sample rates, MSX
Imagestruct initialization).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| components/sms/CMakeLists.txt | Adds C-only gnu17 and additional warning controls for esp-idf/toolchain changes. |
| components/pool_allocator/src/pool_allocator.c | Adjusts pointer range checking logic in pool_contains. |
| components/nes/src/nes.cpp | Makes NES audio sample rate explicit (no functional change vs 44100/2). |
| components/nes/nofrendo/noftypes.h | Switches custom bool typedef to <stdbool.h>. |
| components/nes/CMakeLists.txt | Adds C-only gnu17 and warning controls. |
| components/msx/src/msx.cpp | Extends Image designated initializer to include additional fields. |
| components/msx/CMakeLists.txt | Applies -Wno-register only for C++ compilation units. |
| components/gbc/src/gameboy.cpp | Changes Game Boy audio sample rate constant. |
| components/gbc/CMakeLists.txt | Restricts -Wno-discarded-qualifiers to C sources. |
| components/doom/prboom/m_cheat.h | Tightens cheat handler function pointer type to void (*)(void). |
| components/doom/prboom/m_cheat.c | Refactors cheat argument passing to use globals and updates prototypes/calls. |
| components/doom/CMakeLists.txt | Adds C-only gnu17 and relaxes some warnings-as-errors. |
| components/box-emu/src/box-emu.cpp | Adds .use_one_fat = true to FAT mount config for USB MSC. |
| components/box-emu/include/box-emu.hpp | Comments out a HAL header include in favor of esp_private/usb_phy.h. |
| components/box-emu/idf_component.yml | Adjusts quoting style and adds espressif/usb dependency. |
| int pool_contains(const void* ptr) { | ||
| return (ptr >= memory_pool && ptr < memory_pool + memory_pool_size); | ||
| return (ptr >= (void*)memory_pool && ptr < (void*)memory_pool + memory_pool_size); | ||
| } |
| static const size_t GAMEBOY_SCREEN_WIDTH = 160; | ||
| static const size_t GAMEBOY_SCREEN_HEIGHT = 144; | ||
| static const int GAMEBOY_AUDIO_SAMPLE_RATE = 32000; | ||
| static const int GAMEBOY_AUDIO_SAMPLE_RATE = 32768; |
|
|
||
| #include <hal/usb_phy_types.h> | ||
| // #include <hal/usb_phy_types.h> | ||
| #include <esp_private/usb_phy.h> |
| espp/task: '>=1.0' | ||
| espp/timer: '>=1.0' | ||
| espp/serialization: '>=1.0' | ||
| espressif/usb: '*' |
ESP-IDF Size Report for 'Esp Box Emu'
FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available. |
No description provided.