From 949ebb83f8b08315f2e6265ab2ea47f33c28efa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 3 Jun 2026 23:12:12 +0100 Subject: [PATCH 01/18] Moving to C23 and C++23 - Update toolchain and build config files. - Migrate code to use new versions and keywords. # Conflicts: # nf.props --- src/CLR/Include/nanoCLR_Headers.h | 12 -- .../Network/Enc28j60/enc28j60_lwip.cpp | 2 +- ...System_Net_Security_CertificateManager.cpp | 4 +- ...t_native_System_Net_Security_SslNative.cpp | 2 +- src/HAL/nanoHAL_SystemInformation.cpp | 4 +- src/PAL/AsyncProcCall/AsyncCompletions.cpp | 2 +- src/PAL/AsyncProcCall/AsyncContinuations.cpp | 2 +- src/PAL/AsyncProcCall/Async_stubs.cpp | 2 +- src/PAL/BlockStorage/nanoPAL_BlockStorage.c | 2 +- src/PAL/COM/sockets/Sockets_debugger.cpp | 22 +-- src/PAL/COM/sockets/sockets_lwip.cpp | 8 +- src/PAL/COM/sockets/ssl/ssl_stubs.cpp | 12 +- src/PAL/Events/nanoPAL_Events_driver.cpp | 2 +- src/PAL/FileSystem/nanoPAL_FileSystem.cpp | 20 +-- .../FileSystem/nanoPAL_FileSystem_stubs.cpp | 4 +- src/PAL/Include/nanoPAL_FileSystem.h | 10 +- src/PAL/Include/nanoPAL_Sockets.h | 4 +- src/PAL/Lwip/lwIP_Sockets.cpp | 4 +- ..._filesystem_System_IO_NativeFileStream.cpp | 2 +- ...f_sys_io_filesystem_System_IO_NativeIO.cpp | 4 +- .../Graphics/Core/Support/Jpeg/Jpeg.cpp | 2 +- .../Core/Support/Jpeg/jbytearraydatasrc.c | 6 +- .../Graphics/Core/Support/Jpeg/jcapimin.c | 4 +- .../Graphics/Core/Support/Jpeg/jcapistd.c | 5 +- .../Graphics/Core/Support/Jpeg/jccoefct.c | 22 +-- .../Graphics/Core/Support/Jpeg/jchuff.c | 81 +++++---- .../Graphics/Core/Support/Jpeg/jchuff.h | 3 +- .../Graphics/Core/Support/Jpeg/jcinit.c | 3 +- .../Graphics/Core/Support/Jpeg/jcmainct.c | 17 +- .../Graphics/Core/Support/Jpeg/jcmarker.c | 17 +- .../Graphics/Core/Support/Jpeg/jcmaster.c | 30 ++-- .../Graphics/Core/Support/Jpeg/jcomapi.c | 5 +- .../Graphics/Core/Support/Jpeg/jconfig.h | 7 - .../Graphics/Core/Support/Jpeg/jcparam.c | 35 ++-- .../Graphics/Core/Support/Jpeg/jcphuff.c | 37 ++-- .../Graphics/Core/Support/Jpeg/jcprepct.c | 3 +- .../Graphics/Core/Support/Jpeg/jcsample.c | 13 +- .../Graphics/Core/Support/Jpeg/jctrans.c | 9 +- .../Graphics/Core/Support/Jpeg/jdapimin.c | 35 ++-- .../Graphics/Core/Support/Jpeg/jdapistd.c | 23 ++- .../Graphics/Core/Support/Jpeg/jdcoefct.c | 29 ++- .../Graphics/Core/Support/Jpeg/jdcolor.c | 3 +- .../Graphics/Core/Support/Jpeg/jdhuff.c | 49 +++--- .../Graphics/Core/Support/Jpeg/jdhuff.h | 5 +- .../Graphics/Core/Support/Jpeg/jdinput.c | 25 ++- .../Graphics/Core/Support/Jpeg/jdmainct.c | 14 +- .../Graphics/Core/Support/Jpeg/jdmarker.c | 166 +++++++++--------- .../Graphics/Core/Support/Jpeg/jdmaster.c | 44 ++--- .../Graphics/Core/Support/Jpeg/jdmerge.c | 10 +- .../Graphics/Core/Support/Jpeg/jdphuff.c | 72 ++++---- .../Graphics/Core/Support/Jpeg/jdpostct.c | 2 +- .../Graphics/Core/Support/Jpeg/jdsample.c | 12 +- .../Graphics/Core/Support/Jpeg/jdtrans.c | 2 +- .../Graphics/Core/Support/Jpeg/jerror.c | 6 +- .../Graphics/Core/Support/Jpeg/jmemmgr.c | 48 ++--- .../Core/Support/Jpeg/jmemnanoclr.cpp | 5 - .../Graphics/Core/Support/Jpeg/jmorecfg.h | 19 -- .../Graphics/Core/Support/Jpeg/jpegint.h | 45 +++-- .../Graphics/Core/Support/Jpeg/jpeglib.h | 93 +++++----- .../Graphics/Core/Support/Jpeg/jquant1.c | 19 +- .../Graphics/Core/Support/Jpeg/jquant2.c | 23 ++- .../Graphics/Core/Support/Jpeg/transupp.h | 4 +- .../Graphics/Displays/ILI9341_240x320_SPI.cpp | 2 +- .../Graphics/Displays/ILI9341_XXXxYYY_SPI.cpp | 2 +- .../Graphics/Displays/ILI9342_320x240_SPI.cpp | 2 +- .../Graphics/Displays/ILI9488_480x320_SPI.cpp | 2 +- .../Graphics/Displays/SSD1306_128x64.cpp | 2 +- .../Graphics/Displays/SSD1331_94x64_SPI.cpp | 2 +- .../Graphics/Displays/ST7735S_SPI.cpp | 2 +- .../Graphics/Displays/ST7789V_240x320_SPI.cpp | 2 +- .../TouchPanel/Core/Gestures.cpp | 4 +- .../TouchPanel/Core/TouchPanel.cpp | 4 +- .../TouchPanel/Devices/STMPE811QTR_I2C.cpp | 2 +- .../TouchPanel/Devices/XPT2046.cpp | 2 +- .../TouchPanel/Devices/ft6x06_I2C.cpp | 2 +- .../ChibiOS/ORGPAL_PALTHREE/target_littlefs.c | 6 +- targets/ChibiOS/ORGPAL_PALX/target_littlefs.c | 6 +- targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp | 8 +- targets/ChibiOS/_FatFs/fatfs_syscall.c | 2 +- .../targetHAL_ConfigurationManager.cpp | 6 +- .../ChibiOS/_littlefs/littlefs_FS_Driver.cpp | 12 +- ...noFramework_Device_OneWire_OneWireHost.cpp | 4 +- .../os/hal/ports/STM32/LLD/CRCv1/crc_lld.c | 2 +- .../os/hal/ports/STM32/LLD/RNGv1/rng_lld.c | 2 +- .../os/hal/src/stm32_fsmc/hal_stm32_fsmc.c | 2 +- .../hal/src/stm32_onewire/hal_stm32_onewire.c | 74 ++++---- targets/ESP32/_FatFs/fatfs_FS_Driver.cpp | 8 +- .../targetHAL_ConfigurationManager.cpp | 2 +- .../ESP32/_littlefs/littlefs_FS_Driver.cpp | 8 +- ...noFramework_Device_OneWire_OneWireHost.cpp | 4 +- .../targetHAL_ConfigurationManager.cpp | 6 +- .../TI_SimpleLink/_common/easylink/EasyLink.c | 2 +- targets/TI_SimpleLink/_include/targetHAL.h | 3 - targets/ThreadX/ChibiOS/osal.h | 7 - .../targetHAL_ConfigurationManager.cpp | 10 +- .../wifi/inventek/ISM43362_sockets.cpp | 4 +- .../wifi/inventek/sockets_ISM43362.cpp | 8 +- .../drivers/wifi/inventek/ssl_ISM43362.cpp | 2 +- .../targetHAL_ConfigurationManager.cpp | 6 +- .../targetHAL_ConfigurationManager.cpp | 6 +- targets/ThreadX/_common/NetX/netx_sockets.cpp | 4 +- targets/ThreadX/_common/NetX/sockets_netx.cpp | 8 +- .../netcore/littlefs/littlefs_FS_Driver.cpp | 8 +- .../nanoFramework.nanoCLR/CLRStartup.cpp | 2 +- .../netcore/nanoFramework.nanoCLR/dllmain.cpp | 2 +- targets/posix/nanoCLR/CLRStartup.cpp | 2 +- targets/win32/nanoCLR/CLRStartup.cpp | 2 +- .../win32/nanoCLR/PAL/ConfigHelper_stubs.cpp | 8 +- .../nanoCLR/PAL/blockstorageList_stubs.cpp | 18 +- targets/win32/nanoCLR/Various.cpp | 2 +- targets/win32/nanoCLR/targetPAL_Events.cpp | 4 +- 111 files changed, 695 insertions(+), 771 deletions(-) diff --git a/src/CLR/Include/nanoCLR_Headers.h b/src/CLR/Include/nanoCLR_Headers.h index 4dd5627ecb..e76819b86d 100644 --- a/src/CLR/Include/nanoCLR_Headers.h +++ b/src/CLR/Include/nanoCLR_Headers.h @@ -16,16 +16,4 @@ #include #include -// Constants for configuration options - -// Generic 'FALSE' preprocessor boolean constant -#if !defined(FALSE) -#define FALSE 0 -#endif - -// Generic 'TRUE' preprocessor boolean constant -#if !defined(TRUE) -#define TRUE 1 -#endif - #endif // NANOCLR_HEADERS_H diff --git a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp index a0f90f1819..be3acc2b1f 100644 --- a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp +++ b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp @@ -928,7 +928,7 @@ bool enc28j60_lwip_setup_device(struct netif *pNetIF) ENC28J60_ECON1, (uint8_t)(1 << ENC28J60_ECON1_RXEN_BIT)); - return TRUE; + return true; } void enc28j60_lwip_destroy_device() diff --git a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Security_CertificateManager.cpp b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Security_CertificateManager.cpp index fad2c19d73..81c5661eb4 100644 --- a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Security_CertificateManager.cpp +++ b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Security_CertificateManager.cpp @@ -53,7 +53,7 @@ HRESULT Library_sys_net_native_System_Net_Security_CertificateManager:: 0, certificateSize, 0, - true) != TRUE) + true) != true) { NANOCLR_SET_AND_LEAVE(CLR_E_FAIL); } @@ -70,7 +70,7 @@ HRESULT Library_sys_net_native_System_Net_Security_CertificateManager:: } // reach here, we should be OK - stack.SetResult_Boolean(TRUE); + stack.SetResult_Boolean(true); NANOCLR_CLEANUP(); diff --git a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Security_SslNative.cpp b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Security_SslNative.cpp index 256177d366..982710c4fe 100644 --- a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Security_SslNative.cpp +++ b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Security_SslNative.cpp @@ -223,7 +223,7 @@ HRESULT Library_sys_net_native_System_Net_Security_SslNative::ExitSecureContext_ CLR_INT32 sslContext = stack.Arg0().NumericByRef().s4; - int result = SSL_ExitContext(sslContext) == TRUE ? 0 : -1; + int result = SSL_ExitContext(sslContext) == true ? 0 : -1; stack.SetResult_I4(result); diff --git a/src/HAL/nanoHAL_SystemInformation.cpp b/src/HAL/nanoHAL_SystemInformation.cpp index 9bef7e27c2..9786ab1afd 100644 --- a/src/HAL/nanoHAL_SystemInformation.cpp +++ b/src/HAL/nanoHAL_SystemInformation.cpp @@ -44,7 +44,7 @@ bool GetHalSystemInfo(HalSystemInfo &systemInfo) (char *)&systemInfo.m_OemSerialNumbers.system_serial_number, sizeof(systemInfo.m_OemSerialNumbers.system_serial_number)); - return TRUE; + return true; #endif } @@ -62,7 +62,7 @@ bool Target_GetReleaseInfo(NFReleaseInfo &releaseInfo) hal_strlen_s(TARGETNAMESTRING), PLATFORMNAMESTRING, hal_strlen_s(PLATFORMNAMESTRING)); - return TRUE; // alternatively, return false if you didn't initialize the releaseInfo structure. + return true; // alternatively, return false if you didn't initialize the releaseInfo structure. } bool DebuggerIsConnected() diff --git a/src/PAL/AsyncProcCall/AsyncCompletions.cpp b/src/PAL/AsyncProcCall/AsyncCompletions.cpp index 4806bcec9a..c9e258ca74 100644 --- a/src/PAL/AsyncProcCall/AsyncCompletions.cpp +++ b/src/PAL/AsyncProcCall/AsyncCompletions.cpp @@ -242,7 +242,7 @@ void HAL_COMPLETION::Uninitialize() GLOBAL_LOCK(); - while (TRUE) + while (true) { ptr = (HAL_COMPLETION *)g_HAL_Completion_List.ExtractFirstNode(); diff --git a/src/PAL/AsyncProcCall/AsyncContinuations.cpp b/src/PAL/AsyncProcCall/AsyncContinuations.cpp index df7fe6f1f1..20edc3602b 100644 --- a/src/PAL/AsyncProcCall/AsyncContinuations.cpp +++ b/src/PAL/AsyncProcCall/AsyncContinuations.cpp @@ -94,7 +94,7 @@ void HAL_CONTINUATION::Uninitialize() HAL_CONTINUATION *ptr; - while (TRUE) + while (true) { ptr = (HAL_CONTINUATION *)g_HAL_Continuation_List.ExtractFirstNode(); diff --git a/src/PAL/AsyncProcCall/Async_stubs.cpp b/src/PAL/AsyncProcCall/Async_stubs.cpp index dc60423d3d..0c57e5d173 100644 --- a/src/PAL/AsyncProcCall/Async_stubs.cpp +++ b/src/PAL/AsyncProcCall/Async_stubs.cpp @@ -40,7 +40,7 @@ __nfweak void HAL_CONTINUATION::Abort () __nfweak bool HAL_CONTINUATION::Dequeue_And_Execute() { NATIVE_PROFILE_PAL_ASYNC_PROC_CALL(); - return TRUE; + return true; } __nfweak bool HAL_CONTINUATION::IsLinked() diff --git a/src/PAL/BlockStorage/nanoPAL_BlockStorage.c b/src/PAL/BlockStorage/nanoPAL_BlockStorage.c index 87da1fb1ba..dafa01c08b 100644 --- a/src/PAL/BlockStorage/nanoPAL_BlockStorage.c +++ b/src/PAL/BlockStorage/nanoPAL_BlockStorage.c @@ -452,7 +452,7 @@ bool BlockStorageStream_Read(BlockStorageStream *stream, unsigned char **buffer, { // TODO FIXME // need to check implementation of this call to get pointers to stream continuation - // if(!NextStream()) return FALSE; + // if(!NextStream()) return false; } if ((stream->CurrentIndex + readLen) > stream->Length) diff --git a/src/PAL/COM/sockets/Sockets_debugger.cpp b/src/PAL/COM/sockets/Sockets_debugger.cpp index af1e9767ad..7866e80835 100644 --- a/src/PAL/COM/sockets/Sockets_debugger.cpp +++ b/src/PAL/COM/sockets/Sockets_debugger.cpp @@ -48,7 +48,7 @@ bool SOCKETS_Flush(int32_t ComPortNum) NATIVE_PROFILE_PAL_COM(); // Events_WaitForEvents(0, 2); - return TRUE; + return true; } bool SOCKETS_UpgradeToSsl( @@ -84,7 +84,7 @@ void Sockets_LWIP_Driver::Debugger_Initialize() g_Sockets_LWIP_Driver.m_usingSSL = FALSE; - s_initializedDbg = TRUE; + s_initializedDbg = true; } } @@ -120,13 +120,13 @@ bool Sockets_LWIP_Driver::InitializeDbgListener(int ComPortNum) return FALSE; if (g_Sockets_LWIP_Driver.m_SocketDebugListener != SOCK_SOCKET_ERROR) - return TRUE; + return true; s_DebuggerTimeoutCompletion.InitializeForUserMode(OnDebuggerTimeout); //-- debug api socket --// - g_Sockets_LWIP_Driver.m_SocketDebugListener = Socket(SOCK_AF_INET, SOCK_SOCK_STREAM, SOCK_IPPROTO_TCP, TRUE); + g_Sockets_LWIP_Driver.m_SocketDebugListener = Socket(SOCK_AF_INET, SOCK_SOCK_STREAM, SOCK_IPPROTO_TCP, true); SOCKET_CHECK_RESULT(g_Sockets_LWIP_Driver.m_SocketDebugListener); memset(&sockAddr, 0, sizeof(sockAddr)); @@ -195,7 +195,7 @@ bool Sockets_LWIP_Driver::UninitializeDbgListener(int ComPortNum) g_Sockets_LWIP_Driver.m_SocketDebugListener = SOCK_SOCKET_ERROR; } - return TRUE; + return true; } //----------------------------------------------------------------------------- @@ -313,7 +313,7 @@ int Sockets_LWIP_Driver::Read(int ComPortNum, char *Data, size_t size) // we always perform an accept so that we handle pending connections // if we already are connected and the debug stream socket is still active, then we immediately close // the pending connection - sock = Accept(g_Sockets_LWIP_Driver.m_SocketDebugListener, &addr, &len, TRUE); + sock = Accept(g_Sockets_LWIP_Driver.m_SocketDebugListener, &addr, &len, true); if (SOCK_SOCKET_ERROR != sock) { @@ -444,7 +444,7 @@ bool Sockets_LWIP_Driver::UpgradeToSsl( if (g_Sockets_LWIP_Driver.m_stateDebugSocket == DbgSock_Connected) { if (g_Sockets_LWIP_Driver.m_usingSSL) - return TRUE; + return true; // TLS only and Verify=Required --> only verify the server if (SSL_ClientInit( @@ -476,7 +476,7 @@ bool Sockets_LWIP_Driver::UpgradeToSsl( } else { - g_Sockets_LWIP_Driver.m_usingSSL = TRUE; + g_Sockets_LWIP_Driver.m_usingSSL = true; } return ret == 0; @@ -501,7 +501,7 @@ bool Sockets_LWIP_Driver::InitializeMulticastDiscovery() int nonblocking = 1; if (g_Sockets_LWIP_Driver.s_discoveryInitialized) - return TRUE; + return true; MulticastResponseContinuation.InitializeCallback(MulticastDiscoveryRespond, NULL); @@ -536,7 +536,7 @@ bool Sockets_LWIP_Driver::InitializeMulticastDiscovery() SOCKET_CHECK_RESULT( SOCK_bind(g_Sockets_LWIP_Driver.m_multicastSocket, (const SOCK_sockaddr *)&dummyPtr, sizeof(sockAddr))); - g_Sockets_LWIP_Driver.s_discoveryInitialized = TRUE; + g_Sockets_LWIP_Driver.s_discoveryInitialized = true; SOCKET_CLEANUP() @@ -616,7 +616,7 @@ void Sockets_LWIP_Driver::MulticastDiscoveryRespond(void *arg) { if (0 == memcmp(&data[idx], c_Signature, sigLen)) { - fFound = TRUE; + fFound = true; break; } idx++; diff --git a/src/PAL/COM/sockets/sockets_lwip.cpp b/src/PAL/COM/sockets/sockets_lwip.cpp index 27b073aa19..b1503bd885 100644 --- a/src/PAL/COM/sockets/sockets_lwip.cpp +++ b/src/PAL/COM/sockets/sockets_lwip.cpp @@ -363,7 +363,7 @@ SOCK_SOCKET Sockets_LWIP_Driver::Accept(SOCK_SOCKET socket, struct SOCK_sockaddr if (ret != SOCK_SOCKET_ERROR) { - RegisterSocket(ret, TRUE, fDebug); + RegisterSocket(ret, true, fDebug); } return ret; @@ -429,7 +429,7 @@ bool Sockets_LWIP_Driver::Initialize() SSL_Initialize(); - s_initialized = TRUE; + s_initialized = true; } SOCKET_CHECK_EXIT_bool(); @@ -446,14 +446,14 @@ __nfweak void Sockets_LWIP_Driver::Debugger_Uninitialize() bool Sockets_LWIP_Driver::Uninitialize() { NATIVE_PROFILE_PAL_COM(); - bool ret = TRUE; + bool ret = true; if (s_initialized) { Debugger_Abort(); // close all connections (including debugger sockets) - CloseConnections(TRUE); + CloseConnections(true); SSL_Uninitialize(); diff --git a/src/PAL/COM/sockets/ssl/ssl_stubs.cpp b/src/PAL/COM/sockets/ssl/ssl_stubs.cpp index 795ee85847..7f0fbf31e9 100644 --- a/src/PAL/COM/sockets/ssl/ssl_stubs.cpp +++ b/src/PAL/COM/sockets/ssl/ssl_stubs.cpp @@ -17,7 +17,7 @@ __nfweak bool SSL_Initialize() __nfweak bool SSL_Uninitialize() { NATIVE_PROFILE_PAL_COM(); - return TRUE; + return true; } __nfweak bool SSL_ServerInit( @@ -45,7 +45,7 @@ __nfweak bool SSL_ServerInit( NATIVE_PROFILE_PAL_COM(); - return TRUE; + return true; } __nfweak bool SSL_ClientInit( @@ -73,7 +73,7 @@ __nfweak bool SSL_ClientInit( NATIVE_PROFILE_PAL_COM(); - return TRUE; + return true; } __nfweak bool SSL_AddCertificateAuthority(int contextHandle, const char *certificate, int certLength) @@ -84,7 +84,7 @@ __nfweak bool SSL_AddCertificateAuthority(int contextHandle, const char *certifi NATIVE_PROFILE_PAL_COM(); - return TRUE; + return true; } __nfweak bool SSL_ExitContext(int contextHandle) @@ -93,7 +93,7 @@ __nfweak bool SSL_ExitContext(int contextHandle) NATIVE_PROFILE_PAL_COM(); - return TRUE; + return true; } __nfweak int SSL_Accept(SOCK_SOCKET socket, int contextHandle) @@ -156,7 +156,7 @@ __nfweak bool SSL_ParseCertificate(const char *certificate, size_t certLength, X NATIVE_PROFILE_PAL_COM(); - return TRUE; + return true; } __nfweak int SSL_DecodePrivateKey( diff --git a/src/PAL/Events/nanoPAL_Events_driver.cpp b/src/PAL/Events/nanoPAL_Events_driver.cpp index 993c7ef3ab..364dcf0bc3 100644 --- a/src/PAL/Events/nanoPAL_Events_driver.cpp +++ b/src/PAL/Events/nanoPAL_Events_driver.cpp @@ -15,7 +15,7 @@ HRESULT PalEventDriver::Initialize() if (!g_palEventDriver.s_initialized) { g_palEventDriver.listenerList.Initialize(); - PalEventDriver::s_initialized = TRUE; + PalEventDriver::s_initialized = true; } return S_OK; diff --git a/src/PAL/FileSystem/nanoPAL_FileSystem.cpp b/src/PAL/FileSystem/nanoPAL_FileSystem.cpp index 44575c1173..537bf27a00 100644 --- a/src/PAL/FileSystem/nanoPAL_FileSystem.cpp +++ b/src/PAL/FileSystem/nanoPAL_FileSystem.cpp @@ -89,14 +89,14 @@ bool FS_MountVolume(const char *rootName, uint32_t deviceFlags, const char *file streamDriver, fsDriver, volumeId, - (fsDriver) ? TRUE : FALSE)) + (fsDriver) ? true : FALSE)) { // Now we can notify managed code PostManagedEvent(EVENT_STORAGE, EVENT_SUBCATEGORY_MEDIAINSERT, 0, (uint32_t)volume->m_volumeId.volumeId); // done here - return TRUE; + return true; } else { @@ -114,7 +114,7 @@ void FS_UnmountVolume(const char *rootName) if (volume) { // Let FS uninitialize now for this volume. Note this happens before managed stack is informed - FileSystemVolumeList::RemoveVolume(volume, TRUE); + FileSystemVolumeList::RemoveVolume(volume, true); // Move the volume into the zombie list rather than free up the memory so all the subsequent Close() from opened // handles will complete and/or fail properly @@ -159,7 +159,7 @@ bool FileSystemVolumeList::InitializeVolumes() return FALSE; } - bool success = TRUE; + bool success = true; while (volume->Next()) { @@ -182,7 +182,7 @@ bool FileSystemVolumeList::InitializeVolumes() bool FileSystemVolumeList::UninitializeVolumes() { - bool success = TRUE; + bool success = true; FileSystemVolume *volume = s_volumeList.FirstNode(); FileSystemVolume *curVolume; @@ -210,7 +210,7 @@ bool FileSystemVolumeList::AddVolume( uint32_t volumeId, bool init) { - bool success = TRUE; + bool success = true; if (!fsv) { @@ -237,7 +237,7 @@ bool FileSystemVolumeList::AddVolume( // if the name is already taken, there is no need to add the volume if (nameOK == false) { - return TRUE; + return true; } // initialize the members of the FileSystemVolume @@ -265,7 +265,7 @@ bool FileSystemVolumeList::AddVolume( if (success) { s_volumeList.LinkAtBack(fsv); - return TRUE; + return true; } return FALSE; @@ -282,7 +282,7 @@ bool FileSystemVolumeList::RemoveVolume(FileSystemVolume *fsv, bool uninit) fsv->UninitializeVolume(); } - return TRUE; + return true; } return FALSE; @@ -379,7 +379,7 @@ bool FileSystemVolumeList::Contains(FileSystemVolume *fsv) { if (volume == fsv) { - return TRUE; + return true; } volume = FileSystemVolumeList::GetNextVolume(*volume); diff --git a/src/PAL/FileSystem/nanoPAL_FileSystem_stubs.cpp b/src/PAL/FileSystem/nanoPAL_FileSystem_stubs.cpp index 5a6e995a49..d322cf2ecf 100644 --- a/src/PAL/FileSystem/nanoPAL_FileSystem_stubs.cpp +++ b/src/PAL/FileSystem/nanoPAL_FileSystem_stubs.cpp @@ -20,10 +20,10 @@ __nfweak void FileSystemVolumeList::Initialize() __nfweak bool FileSystemVolumeList::InitializeVolumes() { - return TRUE; + return true; } __nfweak bool FileSystemVolumeList::UninitializeVolumes() { - return TRUE; + return true; } diff --git a/src/PAL/Include/nanoPAL_FileSystem.h b/src/PAL/Include/nanoPAL_FileSystem.h index d49b6638f7..22a0560e4d 100644 --- a/src/PAL/Include/nanoPAL_FileSystem.h +++ b/src/PAL/Include/nanoPAL_FileSystem.h @@ -219,7 +219,7 @@ extern "C" { if (!m_streamDriver || !(m_streamDriver->InitializeVolume)) { - return FALSE; + return false; } return m_streamDriver->InitializeVolume(&m_volumeId, m_rootName); @@ -230,7 +230,7 @@ extern "C" // it's we don't have valid stream driver, do nothing if (!m_streamDriver || !(m_streamDriver->UninitializeVolume)) { - return TRUE; + return true; } return m_streamDriver->UninitializeVolume(&m_volumeId); @@ -431,7 +431,7 @@ extern "C" if (!m_streamDriver || !(m_streamDriver->DriverDetails)) { // invalid streamDriver, or invalid DriverDetails pointer - return FALSE; + return false; } details = m_streamDriver->DriverDetails(&m_volumeId); @@ -454,10 +454,10 @@ extern "C" // if the stream can seek AND write, SetLength is required (details->canSeek && details->canWrite && (!(m_streamDriver->SetLength)))) { - return FALSE; + return false; } - return TRUE; + return true; } bool ValidateFind() diff --git a/src/PAL/Include/nanoPAL_Sockets.h b/src/PAL/Include/nanoPAL_Sockets.h index f72604f612..4e4bc5dff8 100644 --- a/src/PAL/Include/nanoPAL_Sockets.h +++ b/src/PAL/Include/nanoPAL_Sockets.h @@ -26,8 +26,8 @@ typedef struct _DATE_TIME_INFO /* interpret the absolute */ /* time meaning of the */ /* above values. */ - unsigned int dlsTime; /* boolean; daylight savings time is in effect */ - int tzOffset; /* signed int; difference in seconds imposed by timezone (from GMT) */ + bool dlsTime; /* boolean; daylight savings time is in effect */ + int tzOffset; /* signed int; difference in seconds imposed by timezone (from GMT) */ } DATE_TIME_INFO; typedef struct _X509CertData diff --git a/src/PAL/Lwip/lwIP_Sockets.cpp b/src/PAL/Lwip/lwIP_Sockets.cpp index 74c3b3f816..a0cd50e4c5 100644 --- a/src/PAL/Lwip/lwIP_Sockets.cpp +++ b/src/PAL/Lwip/lwIP_Sockets.cpp @@ -285,7 +285,7 @@ bool LWIP_SOCKETS_Driver::InitializeInterfaceIndex( } #endif - return TRUE; + return true; } return FALSE; @@ -365,7 +365,7 @@ bool LWIP_SOCKETS_Driver::Uninitialize() nanoHAL_Network_Uninitialize(); - return TRUE; + return true; } extern void debug_printf(const char *format, ...); diff --git a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeFileStream.cpp b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeFileStream.cpp index 2ccf6657b8..f8d5f68b43 100644 --- a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeFileStream.cpp +++ b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeFileStream.cpp @@ -38,7 +38,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_NativeFileStream::Read___I4__SZAR NATIVE_PROFILE_CLR_IO(); NANOCLR_HEADER(); - NANOCLR_SET_AND_LEAVE(ReadWriteHelper(stack, TRUE)); + NANOCLR_SET_AND_LEAVE(ReadWriteHelper(stack, true)); NANOCLR_NOCLEANUP(); } diff --git a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeIO.cpp b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeIO.cpp index 6caf02d21a..e8abde448d 100644 --- a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeIO.cpp +++ b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeIO.cpp @@ -145,7 +145,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_NativeIO::Format___STATIC__VOID__ if (!hbFileSystemName) { - needInitialize = TRUE; + needInitialize = true; NANOCLR_SET_AND_LEAVE(driver->Format("", parameters)); } @@ -162,7 +162,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_NativeIO::Format___STATIC__VOID__ } // From this point on, even if we fail, we should try to re-initialize before returning - needInitialize = TRUE; + needInitialize = true; driver->m_fsDriver = g_AvailableFSInterfaces[i].fsDriver; driver->m_streamDriver = g_AvailableFSInterfaces[i].streamDriver; diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/Jpeg.cpp b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/Jpeg.cpp index c1d6ef9a0a..9372519d48 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/Jpeg.cpp +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/Jpeg.cpp @@ -70,7 +70,7 @@ HRESULT CLR_GFX_Bitmap::CreateInstanceJpeg(CLR_RT_HeapBlock &ref, const CLR_UINT // Create the decompression engine jpeg_create_decompress(&cinfo); jpeg_byte_array_src(&cinfo, (CLR_UINT8 *)data, size); - jpeg_read_header(&cinfo, TRUE); + jpeg_read_header(&cinfo, true); // Set output to 16bit 5-6-5 RGB format // We can add support for other bit-depth in the future diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jbytearraydatasrc.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jbytearraydatasrc.c index 5b870247fa..df97bdbb17 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jbytearraydatasrc.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jbytearraydatasrc.c @@ -28,7 +28,7 @@ init_source(j_decompress_ptr cinfo) } #pragma GCC diagnostic pop -METHODDEF(boolean) +METHODDEF(bool) fill_input_buffer(j_decompress_ptr cinfo) { // since the initial buffer contains all the data that we have, @@ -46,7 +46,7 @@ fill_input_buffer(j_decompress_ptr cinfo) src->pub.next_input_byte = src->buffer; src->pub.bytes_in_buffer = 2; - return TRUE; + return true; } // Keeping the library's original implementation @@ -63,7 +63,7 @@ skip_input_data(j_decompress_ptr cinfo, long num_bytes) while (num_bytes > (long)src->pub.bytes_in_buffer) { num_bytes -= (long)src->pub.bytes_in_buffer; (void)fill_input_buffer(cinfo); - /* note we assume that fill_input_buffer will never return FALSE, + /* note we assume that fill_input_buffer will never return false, * so suspension need not be handled. */ } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c index 00f38fc890..5caf915c6d 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c @@ -56,7 +56,7 @@ jpeg_CreateCompress(j_compress_ptr cinfo, int version, CLR_INT32 structsize) cinfo->err = err; cinfo->client_data = client_data; } - cinfo->is_decompressor = FALSE; + cinfo->is_decompressor = false; /* Initialize a memory manager instance for this object */ jinit_memory_mgr((j_common_ptr)cinfo); @@ -114,7 +114,7 @@ jpeg_abort_compress(j_compress_ptr cinfo) * jcparam.o would be linked whether the application used it or not. */ GLOBAL(void) -jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress) +jpeg_suppress_tables(j_compress_ptr cinfo, bool suppress) { int i; JQUANT_TBL* qtbl; diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c index e1037eea88..52be8b24d9 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c @@ -40,13 +40,13 @@ */ GLOBAL(void) -jpeg_start_compress(j_compress_ptr cinfo, boolean write_all_tables) +jpeg_start_compress(j_compress_ptr cinfo, bool write_all_tables) { if (cinfo->global_state != CSTATE_START) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); if (write_all_tables) - jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */ + jpeg_suppress_tables(cinfo, false); /* mark all tables to be written */ /* (Re)initialize error mgr and destination modules */ (*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo); @@ -160,4 +160,3 @@ jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data, cinfo->next_scanline += lines_per_iMCU_row; return lines_per_iMCU_row; } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c index 0283c5794d..a50c7af254 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c @@ -62,12 +62,12 @@ typedef struct { typedef my_coef_controller* my_coef_ptr; /* Forward declarations */ -METHODDEF(boolean) compress_data +METHODDEF(bool) compress_data JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); #ifdef FULL_COEF_BUFFER_SUPPORTED -METHODDEF(boolean) compress_first_pass +METHODDEF(bool) compress_first_pass JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); -METHODDEF(boolean) compress_output +METHODDEF(bool) compress_output JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); #endif @@ -139,7 +139,7 @@ start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode) * NB: input_buf contains a plane for each component in image, * which we index according to the component's SOF position. */ -METHODDEF(boolean) +METHODDEF(bool) compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf) { my_coef_ptr coef = (my_coef_ptr)cinfo->coef; @@ -206,7 +206,7 @@ compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf) /* Suspension forced; update state counters and exit */ coef->MCU_vert_offset = yoffset; coef->mcu_ctr = MCU_col_num; - return FALSE; + return false; } } /* Completed an MCU row, but perhaps not an iMCU row */ @@ -215,7 +215,7 @@ compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf) /* Completed the iMCU row, advance counters for next one */ coef->iMCU_row_num++; start_iMCU_row(cinfo); - return TRUE; + return true; } #ifdef FULL_COEF_BUFFER_SUPPORTED @@ -240,7 +240,7 @@ compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf) * the entropy encoder during this first pass; be careful about looking * at the scan-dependent variables (MCU dimensions, etc). */ -METHODDEF(boolean) +METHODDEF(bool) compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf) { my_coef_ptr coef = (my_coef_ptr)cinfo->coef; @@ -336,7 +336,7 @@ compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf) */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" -METHODDEF(boolean) +METHODDEF(bool) compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) { my_coef_ptr coef = (my_coef_ptr)cinfo->coef; @@ -381,7 +381,7 @@ compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) /* Suspension forced; update state counters and exit */ coef->MCU_vert_offset = yoffset; coef->mcu_ctr = MCU_col_num; - return FALSE; + return false; } } /* Completed an MCU row, but perhaps not an iMCU row */ @@ -390,7 +390,7 @@ compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) /* Completed the iMCU row, advance counters for next one */ coef->iMCU_row_num++; start_iMCU_row(cinfo); - return TRUE; + return true; } #pragma GCC diagnostic pop @@ -401,7 +401,7 @@ compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) */ GLOBAL(void) -jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer) +jinit_c_coef_controller(j_compress_ptr cinfo, bool need_full_buffer) { my_coef_ptr coef; diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c index 5caaea7a52..6ece8d00f4 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c @@ -91,11 +91,11 @@ typedef struct { /* Forward declarations */ -METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo, +METHODDEF(bool) encode_mcu_huff JPP((j_compress_ptr cinfo, JBLOCKROW* MCU_data)); METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); #ifdef ENTROPY_OPT_SUPPORTED -METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo, +METHODDEF(bool) encode_mcu_gather JPP((j_compress_ptr cinfo, JBLOCKROW* MCU_data)); METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); #endif @@ -108,7 +108,7 @@ METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); */ METHODDEF(void) -start_pass_huff(j_compress_ptr cinfo, boolean gather_statistics) +start_pass_huff(j_compress_ptr cinfo, bool gather_statistics) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; int ci, dctbl, actbl; @@ -183,7 +183,7 @@ start_pass_huff(j_compress_ptr cinfo, boolean gather_statistics) */ GLOBAL(void) -jpeg_make_c_derived_tbl(j_compress_ptr cinfo, boolean isDC, int tblno, +jpeg_make_c_derived_tbl(j_compress_ptr cinfo, bool isDC, int tblno, c_derived_tbl** pdtbl) { JHUFF_TBL* htbl; @@ -281,18 +281,18 @@ jpeg_make_c_derived_tbl(j_compress_ptr cinfo, boolean isDC, int tblno, { action; } } -LOCAL(boolean) +LOCAL(bool) dump_buffer(working_state* state) -/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ +/* Empty the output buffer; return true if successful, FALSE if must suspend */ { struct jpeg_destination_mgr* dest = state->cinfo->dest; if (!(*dest->empty_output_buffer) (state->cinfo)) - return FALSE; + return false; /* After a successful buffer dump, must reset buffer pointers */ state->next_output_byte = dest->next_output_byte; state->free_in_buffer = dest->free_in_buffer; - return TRUE; + return true; } @@ -305,9 +305,9 @@ dump_buffer(working_state* state) */ INLINE -LOCAL(boolean) +LOCAL(bool) emit_bits(working_state* state, unsigned int code, int size) -/* Emit some bits; return TRUE if successful, FALSE if must suspend */ +/* Emit some bits; return true if successful, FALSE if must suspend */ { /* This routine is heavily used, so it's worth coding tightly. */ register CLR_INT32 put_buffer = (CLR_INT32)code; @@ -328,9 +328,9 @@ emit_bits(working_state* state, unsigned int code, int size) while (put_bits >= 8) { int c = (int)((put_buffer >> 16) & 0xFF); - emit_byte(state, c, return FALSE); + emit_byte(state, c, return false); if (c == 0xFF) {/* need to stuff a zero byte? */ - emit_byte(state, 0, return FALSE); + emit_byte(state, 0, return false); } put_buffer <<= 8; put_bits -= 8; @@ -339,24 +339,24 @@ emit_bits(working_state* state, unsigned int code, int size) state->cur.put_buffer = put_buffer; /* update state variables */ state->cur.put_bits = put_bits; - return TRUE; + return true; } -LOCAL(boolean) +LOCAL(bool) flush_bits(working_state* state) { if (!emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ - return FALSE; + return false; state->cur.put_buffer = 0;/* and reset bit-buffer to empty */ state->cur.put_bits = 0; - return TRUE; + return true; } /* Encode a single block's worth of coefficients */ -LOCAL(boolean) +LOCAL(bool) encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, c_derived_tbl* dctbl, c_derived_tbl* actbl) { @@ -389,13 +389,13 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, /* Emit the Huffman-coded symbol for the number of bits */ if (!emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) - return FALSE; + return false; /* Emit that number of bits of the value, if positive, */ /* or the complement of its magnitude, if negative. */ if (nbits)/* emit_bits rejects calls with size 0 */ if (!emit_bits(state, (unsigned int)temp2, nbits)) - return FALSE; + return false; /* Encode the AC coefficients per section F.1.2.2 */ @@ -409,7 +409,7 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, /* if run length > 15, must emit special run-length-16 codes (0xF0) */ while (r > 15) { if (!emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0])) - return FALSE; + return false; r -= 16; } @@ -431,12 +431,12 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, /* Emit Huffman symbol for run length / number of bits */ i = (r << 4) + nbits; if (!emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i])) - return FALSE; + return false; /* Emit that number of bits of the value, if positive, */ /* or the complement of its magnitude, if negative. */ if (!emit_bits(state, (unsigned int)temp2, nbits)) - return FALSE; + return false; r = 0; } @@ -445,9 +445,9 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, /* If the last coef(s) were zero, emit an end-of-block code */ if (r > 0) if (!emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0])) - return FALSE; + return false; - return TRUE; + return true; } @@ -455,16 +455,16 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, * Emit a restart marker & resynchronize predictions. */ -LOCAL(boolean) +LOCAL(bool) emit_restart(working_state* state, int restart_num) { int ci; if (!flush_bits(state)) - return FALSE; + return false; - emit_byte(state, 0xFF, return FALSE); - emit_byte(state, JPEG_RST0 + restart_num, return FALSE); + emit_byte(state, 0xFF, return false); + emit_byte(state, JPEG_RST0 + restart_num, return false); /* Re-initialize DC predictions to 0 */ for (ci = 0; ci < state->cinfo->comps_in_scan; ci++) @@ -472,7 +472,7 @@ emit_restart(working_state* state, int restart_num) /* The restart counter is not updated until we successfully write the MCU. */ - return TRUE; + return true; } @@ -480,7 +480,7 @@ emit_restart(working_state* state, int restart_num) * Encode and output one MCU's worth of Huffman-compressed coefficients. */ -METHODDEF(boolean) +METHODDEF(bool) encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW* MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; @@ -498,7 +498,7 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW* MCU_data) if (cinfo->restart_interval) { if (entropy->restarts_to_go == 0) if (!emit_restart(&state, entropy->next_restart_num)) - return FALSE; + return false; } /* Encode the MCU data blocks */ @@ -509,7 +509,7 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW* MCU_data) MCU_data[blkn][0], state.cur.last_dc_val[ci], entropy->dc_derived_tbls[compptr->dc_tbl_no], entropy->ac_derived_tbls[compptr->ac_tbl_no])) - return FALSE; + return false; /* Update last_dc_val */ state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; } @@ -529,7 +529,7 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW* MCU_data) entropy->restarts_to_go--; } - return TRUE; + return true; } @@ -650,7 +650,7 @@ htest_one_block(j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, * No data is actually output, so no suspension return is possible. */ -METHODDEF(boolean) +METHODDEF(bool) encode_mcu_gather(j_compress_ptr cinfo, JBLOCKROW* MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; @@ -678,7 +678,7 @@ encode_mcu_gather(j_compress_ptr cinfo, JBLOCKROW* MCU_data) entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; } - return TRUE; + return true; } @@ -843,7 +843,7 @@ jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[]) } /* Set sent_table FALSE so updated table will be written to JPEG file. */ - htbl->sent_table = FALSE; + htbl->sent_table = false; } @@ -858,8 +858,8 @@ finish_pass_gather(j_compress_ptr cinfo) int ci, dctbl, actbl; jpeg_component_info* compptr; JHUFF_TBL** htblptr; - boolean did_dc[NUM_HUFF_TBLS]; - boolean did_ac[NUM_HUFF_TBLS]; + bool did_dc[NUM_HUFF_TBLS]; + bool did_ac[NUM_HUFF_TBLS]; /* It's important not to apply jpeg_gen_optimal_table more than once * per table, because it clobbers the input frequency counts! @@ -876,14 +876,14 @@ finish_pass_gather(j_compress_ptr cinfo) if (*htblptr == NULL) *htblptr = jpeg_alloc_huff_table((j_common_ptr)cinfo); jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]); - did_dc[dctbl] = TRUE; + did_dc[dctbl] = true; } if (!did_ac[actbl]) { htblptr = &cinfo->ac_huff_tbl_ptrs[actbl]; if (*htblptr == NULL) *htblptr = jpeg_alloc_huff_table((j_common_ptr)cinfo); jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]); - did_ac[actbl] = TRUE; + did_ac[actbl] = true; } } } @@ -916,4 +916,3 @@ jinit_huff_encoder(j_compress_ptr cinfo) #endif } } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.h b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.h index 7a58866be1..b70551264a 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.h +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.h @@ -45,10 +45,9 @@ typedef struct { /* Expand a Huffman table definition into the derived format */ EXTERN(void) jpeg_make_c_derived_tbl -JPP((j_compress_ptr cinfo, boolean isDC, int tblno, +JPP((j_compress_ptr cinfo, bool isDC, int tblno, c_derived_tbl** pdtbl)); /* Generate an optimal table definition given the specified counts */ EXTERN(void) jpeg_gen_optimal_table JPP((j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[])); - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c index 75baa3f5f2..4776ad2409 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c @@ -64,7 +64,7 @@ jinit_compress_master(j_compress_ptr cinfo) /* Need a full-image coefficient buffer in any multi-pass mode. */ jinit_c_coef_controller(cinfo, - (boolean)(cinfo->num_scans > 1 || cinfo->optimize_coding)); + (bool)(cinfo->num_scans > 1 || cinfo->optimize_coding)); jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); jinit_marker_writer(cinfo); @@ -78,4 +78,3 @@ jinit_compress_master(j_compress_ptr cinfo) */ (*cinfo->marker->write_file_header) (cinfo); } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmainct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmainct.c index a4c82dd39b..52f5511f24 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmainct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmainct.c @@ -35,7 +35,7 @@ typedef struct { JDIMENSION cur_iMCU_row; /* number of current iMCU row */ JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */ - boolean suspended; /* remember if we suspended output */ + bool suspended; /* remember if we suspended output */ J_BUF_MODE pass_mode; /* current operating mode */ /* If using just a strip buffer, this points to the entire set of buffers @@ -82,7 +82,7 @@ start_pass_main(j_compress_ptr cinfo, J_BUF_MODE pass_mode) main1->cur_iMCU_row = 0; /* initialize counters */ main1->rowgroup_ctr = 0; - main1->suspended = FALSE; + main1->suspended = false; main1->pass_mode = pass_mode; /* save mode for use by process_data */ switch (pass_mode) { @@ -148,7 +148,7 @@ process_data_simple_main(j_compress_ptr cinfo, */ if (!main1->suspended) { (*in_row_ctr)--; - main1->suspended = TRUE; + main1->suspended = true; } return; } @@ -157,7 +157,7 @@ process_data_simple_main(j_compress_ptr cinfo, */ if (main1->suspended) { (*in_row_ctr)++; - main1->suspended = FALSE; + main1->suspended = false; } main1->rowgroup_ctr = 0; main1->cur_iMCU_row++; @@ -180,7 +180,7 @@ process_data_buffer_main(j_compress_ptr cinfo, my_main_ptr main = (my_main_ptr)cinfo->main; int ci; jpeg_component_info* compptr; - boolean writing = (main->pass_mode != JBUF_CRANK_DEST); + bool writing = (main->pass_mode != JBUF_CRANK_DEST); while (main->cur_iMCU_row < cinfo->total_iMCU_rows) { /* Realign the virtual buffers if at the start of an iMCU row. */ @@ -222,7 +222,7 @@ process_data_buffer_main(j_compress_ptr cinfo, */ if (!main->suspended) { (*in_row_ctr)--; - main->suspended = TRUE; + main->suspended = true; } return; } @@ -231,7 +231,7 @@ process_data_buffer_main(j_compress_ptr cinfo, */ if (main->suspended) { (*in_row_ctr)++; - main->suspended = FALSE; + main->suspended = false; } } @@ -249,7 +249,7 @@ process_data_buffer_main(j_compress_ptr cinfo, */ GLOBAL(void) -jinit_c_main_controller(j_compress_ptr cinfo, boolean need_full_buffer) +jinit_c_main_controller(j_compress_ptr cinfo, bool need_full_buffer) { //my_main_ptr main; my_main_ptr main1; @@ -300,4 +300,3 @@ jinit_c_main_controller(j_compress_ptr cinfo, boolean need_full_buffer) } } } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c index 2471c6c924..267d609f17 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c @@ -178,7 +178,7 @@ emit_dqt(j_compress_ptr cinfo, int index) emit_byte(cinfo, (int)(qval & 0xFF)); } - qtbl->sent_table = TRUE; + qtbl->sent_table = true; } return prec; @@ -186,7 +186,7 @@ emit_dqt(j_compress_ptr cinfo, int index) LOCAL(void) -emit_dht(j_compress_ptr cinfo, int index, boolean is_ac) +emit_dht(j_compress_ptr cinfo, int index, bool is_ac) /* Emit a DHT marker */ { JHUFF_TBL* htbl; @@ -219,7 +219,7 @@ emit_dht(j_compress_ptr cinfo, int index, boolean is_ac) for (i = 0; i < length; i++) emit_byte(cinfo, htbl->huffval[i]); - htbl->sent_table = TRUE; + htbl->sent_table = true; } } @@ -505,7 +505,7 @@ METHODDEF(void) write_frame_header(j_compress_ptr cinfo) { int ci, prec; - boolean is_baseline; + bool is_baseline; jpeg_component_info* compptr; /* Emit DQT for each quantization table. @@ -523,17 +523,17 @@ write_frame_header(j_compress_ptr cinfo) */ if (cinfo->arith_code || cinfo->progressive_mode || cinfo->data_precision != 8) { - is_baseline = FALSE; + is_baseline = false; } else { - is_baseline = TRUE; + is_baseline = true; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1) - is_baseline = FALSE; + is_baseline = false; } if (prec && is_baseline) { - is_baseline = FALSE; + is_baseline = false; /* If it's baseline except for quantizer size, warn the user */ TRACEMS(cinfo, 0, JTRC_16BIT_TABLES); } @@ -678,4 +678,3 @@ jinit_marker_writer(j_compress_ptr cinfo) /* Initialize private state */ marker->last_restart_interval = 0; } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmaster.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmaster.c index 8345fa2102..d9ce200134 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmaster.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmaster.c @@ -127,7 +127,7 @@ initial_setup(j_compress_ptr cinfo) jdiv_round_up((long)cinfo->image_height * (long)compptr->v_samp_factor, (long)cinfo->max_v_samp_factor); /* Mark component needed (this flag isn't actually used for compression) */ - compptr->component_needed = TRUE; + compptr->component_needed = true; } /* Compute number of fully interleaved MCU rows (number of times that @@ -150,7 +150,7 @@ validate_script(j_compress_ptr cinfo) const jpeg_scan_info* scanptr; int scanno, ncomps, ci, coefi, thisi; int Ss, Se, Ah, Al; - boolean component_sent[MAX_COMPONENTS]; + bool component_sent[MAX_COMPONENTS]; #ifdef C_PROGRESSIVE_SUPPORTED int* last_bitpos_ptr; int last_bitpos[MAX_COMPONENTS][DCTSIZE2]; @@ -166,7 +166,7 @@ validate_script(j_compress_ptr cinfo) scanptr = cinfo->scan_info; if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2 - 1) { #ifdef C_PROGRESSIVE_SUPPORTED - cinfo->progressive_mode = TRUE; + cinfo->progressive_mode = true; last_bitpos_ptr = &last_bitpos[0][0]; for (ci = 0; ci < cinfo->num_components; ci++) for (coefi = 0; coefi < DCTSIZE2; coefi++) @@ -176,9 +176,9 @@ validate_script(j_compress_ptr cinfo) #endif } else { - cinfo->progressive_mode = FALSE; + cinfo->progressive_mode = false; for (ci = 0; ci < cinfo->num_components; ci++) - component_sent[ci] = FALSE; + component_sent[ci] = false; } for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) { @@ -253,7 +253,7 @@ validate_script(j_compress_ptr cinfo) thisi = scanptr->component_index[ci]; if (component_sent[thisi]) ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); - component_sent[thisi] = TRUE; + component_sent[thisi] = true; } } } @@ -447,11 +447,11 @@ prepare_for_pass(j_compress_ptr cinfo) (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); if (cinfo->optimize_coding) { /* No immediate data output; postpone writing frame/scan headers */ - master->pub.call_pass_startup = FALSE; + master->pub.call_pass_startup = false; } else { /* Will write frame/scan headers at first jpeg_write_scanlines call */ - master->pub.call_pass_startup = TRUE; + master->pub.call_pass_startup = true; } break; #ifdef ENTROPY_OPT_SUPPORTED @@ -462,7 +462,7 @@ prepare_for_pass(j_compress_ptr cinfo) if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) { (*cinfo->entropy->start_pass) (cinfo, TRUE); (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST); - master->pub.call_pass_startup = FALSE; + master->pub.call_pass_startup = false; break; } /* Special case: Huffman DC refinement scans need no Huffman table @@ -485,7 +485,7 @@ prepare_for_pass(j_compress_ptr cinfo) if (master->scan_number == 0) (*cinfo->marker->write_frame_header) (cinfo); (*cinfo->marker->write_scan_header) (cinfo); - master->pub.call_pass_startup = FALSE; + master->pub.call_pass_startup = false; break; default: ERREXIT(cinfo, JERR_NOT_COMPILED); @@ -516,7 +516,7 @@ prepare_for_pass(j_compress_ptr cinfo) METHODDEF(void) pass_startup(j_compress_ptr cinfo) { - cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */ + cinfo->master->call_pass_startup = false; /* reset flag so call only once */ (*cinfo->marker->write_frame_header) (cinfo); (*cinfo->marker->write_scan_header) (cinfo); @@ -568,7 +568,7 @@ finish_pass_master(j_compress_ptr cinfo) */ GLOBAL(void) -jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only) +jinit_c_master_control(j_compress_ptr cinfo, bool transcode_only) { my_master_ptr master; @@ -579,7 +579,7 @@ jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only) master->pub.prepare_for_pass = prepare_for_pass; master->pub.pass_startup = pass_startup; master->pub.finish_pass = finish_pass_master; - master->pub.is_last_pass = FALSE; + master->pub.is_last_pass = false; /* Validate parameters, determine derived values */ initial_setup(cinfo); @@ -592,12 +592,12 @@ jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only) #endif } else { - cinfo->progressive_mode = FALSE; + cinfo->progressive_mode = false; cinfo->num_scans = 1; } if (cinfo->progressive_mode) /* TEMPORARY HACK ??? */ - cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */ + cinfo->optimize_coding = true; /* assume default tables no good for progressive mode */ /* Initialize my private state */ if (transcode_only) { diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcomapi.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcomapi.c index 4fd42dc240..86fab94fa0 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcomapi.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcomapi.c @@ -95,7 +95,7 @@ jpeg_alloc_quant_table(j_common_ptr cinfo) tbl = (JQUANT_TBL*) (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL)); - tbl->sent_table = FALSE;/* make sure this is false in any new table */ + tbl->sent_table = false;/* make sure this is false in any new table */ return tbl; } @@ -107,7 +107,6 @@ jpeg_alloc_huff_table(j_common_ptr cinfo) tbl = (JHUFF_TBL*) (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL)); - tbl->sent_table = FALSE;/* make sure this is false in any new table */ + tbl->sent_table = false;/* make sure this is false in any new table */ return tbl; } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jconfig.h b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jconfig.h index 99aa448b11..5137ef4afd 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jconfig.h +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jconfig.h @@ -12,13 +12,6 @@ #undef FAR #endif - /* boolean is defined in rpcndr.h, we can't define it the same way here - (unsigned char) because a == b is passed as an argument to a function - declared as taking a boolean, and MSVC treats this as warnable (hence - errorable)! The hack is to hide the IJG definition. */ -#define boolean jpeg_boolean - // - #define HAVE_PROTOTYPES #define HAVE_UNSIGNED_CHAR #define HAVE_UNSIGNED_SHORT diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c index 1c50d61d2e..639544f028 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c @@ -33,7 +33,7 @@ GLOBAL(void) jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl, const unsigned int* basic_table, - int scale_factor, boolean force_baseline) + int scale_factor, bool force_baseline) /* Define a quantization table equal to the basic_table times * a scale factor (given as a percentage). * If force_baseline is TRUE, the computed quantization table entries @@ -67,13 +67,13 @@ jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl, } /* Initialize sent_table FALSE so table will be written to JPEG file. */ - (*qtblptr)->sent_table = FALSE; + (*qtblptr)->sent_table = false; } GLOBAL(void) jpeg_set_linear_quality(j_compress_ptr cinfo, int scale_factor, - boolean force_baseline) + bool force_baseline) /* Set or change the 'quality' (quantization) setting, using default tables * and a straight percentage-scaling quality scale. In most cases it's better * to use jpeg_set_quality (below); this entry point is provided for @@ -140,7 +140,7 @@ jpeg_quality_scaling(int quality) GLOBAL(void) -jpeg_set_quality(j_compress_ptr cinfo, int quality, boolean force_baseline) +jpeg_set_quality(j_compress_ptr cinfo, int quality, bool force_baseline) /* Set or change the 'quality' (quantization) setting, using default tables. * This is the standard quality-adjusting entry point for typical user * interfaces; only those who want detailed control over quantization tables @@ -185,7 +185,7 @@ add_huff_table(j_compress_ptr cinfo, MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(CLR_UINT8)); /* Initialize sent_table FALSE so table will be written to JPEG file. */ - (*htblptr)->sent_table = FALSE; + (*htblptr)->sent_table = false; } @@ -313,23 +313,23 @@ jpeg_set_defaults(j_compress_ptr cinfo) cinfo->num_scans = 0; /* Expect normal source image, not raw downsampled data */ - cinfo->raw_data_in = FALSE; + cinfo->raw_data_in = false; /* Use Huffman coding, not arithmetic coding, by default */ - cinfo->arith_code = FALSE; + cinfo->arith_code = false; /* By default, don't do extra passes to optimize entropy coding */ - cinfo->optimize_coding = FALSE; + cinfo->optimize_coding = false; /* The standard Huffman tables are only valid for 8-bit data precision. * If the precision is higher, force optimization on so that usable * tables will be computed. This test can be removed if default tables * are supplied that are valid for the desired precision. */ if (cinfo->data_precision > 8) - cinfo->optimize_coding = TRUE; + cinfo->optimize_coding = true; /* By default, use the simpler non-cosited sampling alignment */ - cinfo->CCIR601_sampling = FALSE; + cinfo->CCIR601_sampling = false; /* No input smoothing */ cinfo->smoothing_factor = 0; @@ -426,25 +426,25 @@ jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace) cinfo->jpeg_color_space = colorspace; - cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */ - cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */ + cinfo->write_JFIF_header = false; /* No marker for non-JFIF colorspaces */ + cinfo->write_Adobe_marker = false; /* write no Adobe marker by default */ switch (colorspace) { case JCS_GRAYSCALE: - cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->write_JFIF_header = true; /* Write a JFIF marker */ cinfo->num_components = 1; /* JFIF specifies component ID 1 */ SET_COMP(0, 1, 1, 1, 0, 0, 0); break; case JCS_RGB: - cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */ + cinfo->write_Adobe_marker = true; /* write Adobe marker to flag RGB */ cinfo->num_components = 3; SET_COMP(0, 0x52 /* 'R' */, 1, 1, 0, 0, 0); SET_COMP(1, 0x47 /* 'G' */, 1, 1, 0, 0, 0); SET_COMP(2, 0x42 /* 'B' */, 1, 1, 0, 0, 0); break; case JCS_YCbCr: - cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->write_JFIF_header = true; /* Write a JFIF marker */ cinfo->num_components = 3; /* JFIF specifies component IDs 1,2,3 */ /* We default to 2x2 subsamples of chrominance */ @@ -453,7 +453,7 @@ jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace) SET_COMP(2, 3, 1, 1, 1, 1, 1); break; case JCS_CMYK: - cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */ + cinfo->write_Adobe_marker = true; /* write Adobe marker to flag CMYK */ cinfo->num_components = 4; SET_COMP(0, 0x43 /* 'C' */, 1, 1, 0, 0, 0); SET_COMP(1, 0x4D /* 'M' */, 1, 1, 0, 0, 0); @@ -461,7 +461,7 @@ jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace) SET_COMP(3, 0x4B /* 'K' */, 1, 1, 0, 0, 0); break; case JCS_YCCK: - cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */ + cinfo->write_Adobe_marker = true; /* write Adobe marker to flag YCCK */ cinfo->num_components = 4; SET_COMP(0, 1, 2, 2, 0, 0, 0); SET_COMP(1, 2, 1, 1, 1, 1, 1); @@ -626,4 +626,3 @@ jpeg_simple_progression(j_compress_ptr cinfo) } #endif /* C_PROGRESSIVE_SUPPORTED */ - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcphuff.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcphuff.c index bb28e4af21..aa2f6a8df2 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcphuff.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcphuff.c @@ -31,7 +31,7 @@ typedef struct { struct jpeg_entropy_encoder pub; /* public fields */ /* Mode flag: TRUE for optimization, FALSE for actual data output */ - boolean gather_statistics; + bool gather_statistics; /* Bit-level coding status. * next_output_byte/free_in_buffer are local copies of cinfo->dest fields. @@ -92,13 +92,13 @@ typedef phuff_entropy_encoder* phuff_entropy_ptr; #endif /* Forward declarations */ -METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo, +METHODDEF(bool) encode_mcu_DC_first JPP((j_compress_ptr cinfo, JBLOCKROW* MCU_data)); -METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo, +METHODDEF(bool) encode_mcu_AC_first JPP((j_compress_ptr cinfo, JBLOCKROW* MCU_data)); -METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo, +METHODDEF(bool) encode_mcu_DC_refine JPP((j_compress_ptr cinfo, JBLOCKROW* MCU_data)); -METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo, +METHODDEF(bool) encode_mcu_AC_refine JPP((j_compress_ptr cinfo, JBLOCKROW* MCU_data)); METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo)); METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo)); @@ -109,10 +109,10 @@ METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo)); */ METHODDEF(void) -start_pass_phuff(j_compress_ptr cinfo, boolean gather_statistics) +start_pass_phuff(j_compress_ptr cinfo, bool gather_statistics) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; - boolean is_DC_band; + bool is_DC_band; int ci, tbl; jpeg_component_info* compptr; @@ -383,7 +383,7 @@ emit_restart(phuff_entropy_ptr entropy, int restart_num) * or first pass of successive approximation). */ -METHODDEF(boolean) +METHODDEF(bool) encode_mcu_DC_first(j_compress_ptr cinfo, JBLOCKROW* MCU_data) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -461,7 +461,7 @@ encode_mcu_DC_first(j_compress_ptr cinfo, JBLOCKROW* MCU_data) entropy->restarts_to_go--; } - return TRUE; + return true; } @@ -470,7 +470,7 @@ encode_mcu_DC_first(j_compress_ptr cinfo, JBLOCKROW* MCU_data) * or first pass of successive approximation). */ -METHODDEF(boolean) +METHODDEF(bool) encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW* MCU_data) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -568,7 +568,7 @@ encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW* MCU_data) entropy->restarts_to_go--; } - return TRUE; + return true; } @@ -578,7 +578,7 @@ encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW* MCU_data) * is not very clear on the point. */ -METHODDEF(boolean) +METHODDEF(bool) encode_mcu_DC_refine(j_compress_ptr cinfo, JBLOCKROW* MCU_data) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -617,7 +617,7 @@ encode_mcu_DC_refine(j_compress_ptr cinfo, JBLOCKROW* MCU_data) entropy->restarts_to_go--; } - return TRUE; + return true; } @@ -625,7 +625,7 @@ encode_mcu_DC_refine(j_compress_ptr cinfo, JBLOCKROW* MCU_data) * MCU encoding for AC successive approximation refinement scan. */ -METHODDEF(boolean) +METHODDEF(bool) encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW* MCU_data) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -745,7 +745,7 @@ encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW* MCU_data) entropy->restarts_to_go--; } - return TRUE; + return true; } @@ -778,11 +778,11 @@ METHODDEF(void) finish_pass_gather_phuff(j_compress_ptr cinfo) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; - boolean is_DC_band; + bool is_DC_band; int ci, tbl; jpeg_component_info* compptr; JHUFF_TBL** htblptr; - boolean did[NUM_HUFF_TBLS]; + bool did[NUM_HUFF_TBLS]; /* Flush out buffered data (all we care about is counting the EOB symbol) */ emit_eobrun(entropy); @@ -812,7 +812,7 @@ finish_pass_gather_phuff(j_compress_ptr cinfo) if (*htblptr == NULL) *htblptr = jpeg_alloc_huff_table((j_common_ptr)cinfo); jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]); - did[tbl] = TRUE; + did[tbl] = true; } } } @@ -843,4 +843,3 @@ jinit_phuff_encoder(j_compress_ptr cinfo) } #endif /* C_PROGRESSIVE_SUPPORTED */ - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcprepct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcprepct.c index babae30fa1..d284162b6b 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcprepct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcprepct.c @@ -323,7 +323,7 @@ create_context_buffer(j_compress_ptr cinfo) */ GLOBAL(void) -jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer) +jinit_c_prep_controller(j_compress_ptr cinfo, bool need_full_buffer) { my_prep_ptr prep; int ci; @@ -364,4 +364,3 @@ jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer) } } } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcsample.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcsample.c index 7fef61c7dc..7842216b2f 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcsample.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcsample.c @@ -741,7 +741,7 @@ jinit_downsampler(j_compress_ptr cinfo) my_downsample_ptr downsample; int ci; jpeg_component_info* compptr; - boolean smoothok = TRUE; + bool smoothok = true; downsample = (my_downsample_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, @@ -749,7 +749,7 @@ jinit_downsampler(j_compress_ptr cinfo) cinfo->downsample = (struct jpeg_downsampler*) downsample; downsample->pub.start_pass = start_pass_downsample; downsample->pub.downsample = sep_downsample; - downsample->pub.need_context_rows = FALSE; + downsample->pub.need_context_rows = false; if (cinfo->CCIR601_sampling) ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); @@ -762,7 +762,7 @@ jinit_downsampler(j_compress_ptr cinfo) #ifdef INPUT_SMOOTHING_SUPPORTED if (cinfo->smoothing_factor) { downsample->methods[ci] = fullsize_smooth_downsample; - downsample->pub.need_context_rows = TRUE; + downsample->pub.need_context_rows = true; } else #endif @@ -770,7 +770,7 @@ jinit_downsampler(j_compress_ptr cinfo) } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && compptr->v_samp_factor == cinfo->max_v_samp_factor) { - smoothok = FALSE; + smoothok = false; downsample->methods[ci] = h2v1_downsample; } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && @@ -778,7 +778,7 @@ jinit_downsampler(j_compress_ptr cinfo) #ifdef INPUT_SMOOTHING_SUPPORTED if (cinfo->smoothing_factor) { downsample->methods[ci] = h2v2_smooth_downsample; - downsample->pub.need_context_rows = TRUE; + downsample->pub.need_context_rows = true; } else #endif @@ -786,7 +786,7 @@ jinit_downsampler(j_compress_ptr cinfo) } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { - smoothok = FALSE; + smoothok = false; downsample->methods[ci] = int_downsample; } else @@ -798,4 +798,3 @@ jinit_downsampler(j_compress_ptr cinfo) TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL); #endif } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c index 423e0bf9c0..b460406752 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c @@ -105,7 +105,7 @@ jpeg_copy_critical_parameters(j_decompress_ptr srcinfo, MEMCOPY((*qtblptr)->quantval, srcinfo->quant_tbl_ptrs[tblno]->quantval, SIZEOF((*qtblptr)->quantval)); - (*qtblptr)->sent_table = FALSE; + (*qtblptr)->sent_table = false; } } /* Copy the source's per-component info. @@ -290,7 +290,7 @@ start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode) */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" -METHODDEF(boolean) +METHODDEF(bool) compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) { my_coef_ptr coef = (my_coef_ptr)cinfo->coef; @@ -355,7 +355,7 @@ compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) /* Suspension forced; update state counters and exit */ coef->MCU_vert_offset = yoffset; coef->mcu_ctr = MCU_col_num; - return FALSE; + return false; } } /* Completed an MCU row, but perhaps not an iMCU row */ @@ -364,7 +364,7 @@ compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) /* Completed the iMCU row, advance counters for next one */ coef->iMCU_row_num++; start_iMCU_row(cinfo); - return TRUE; + return true; } #pragma GCC diagnostic pop @@ -404,4 +404,3 @@ transencode_coef_controller(j_compress_ptr cinfo, coef->dummy_buffer[i] = buffer + i; } } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdapimin.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdapimin.c index 8c911a469f..7102a198ed 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdapimin.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdapimin.c @@ -57,7 +57,7 @@ jpeg_CreateDecompress(j_decompress_ptr cinfo, int version, CLR_INT32 structsize) cinfo->err = err; cinfo->client_data = client_data; } - cinfo->is_decompressor = TRUE; + cinfo->is_decompressor = true; /* Initialize a memory manager instance for this object */ jinit_memory_mgr((j_common_ptr)cinfo); @@ -196,25 +196,25 @@ default_decompress_parms(j_decompress_ptr cinfo) cinfo->scale_num = 1; /* 1:1 scaling */ cinfo->scale_denom = 1; cinfo->output_gamma = 1.0; - cinfo->buffered_image = FALSE; - cinfo->raw_data_out = FALSE; + cinfo->buffered_image = false; + cinfo->raw_data_out = false; cinfo->dct_method = JDCT_DEFAULT; - cinfo->do_fancy_upsampling = TRUE; - cinfo->do_block_smoothing = TRUE; - cinfo->quantize_colors = FALSE; + cinfo->do_fancy_upsampling = true; + cinfo->do_block_smoothing = true; + cinfo->quantize_colors = false; /* We set these in case application only sets quantize_colors. */ cinfo->dither_mode = JDITHER_FS; #ifdef QUANT_2PASS_SUPPORTED - cinfo->two_pass_quantize = TRUE; + cinfo->two_pass_quantize = true; #else - cinfo->two_pass_quantize = FALSE; + cinfo->two_pass_quantize = false; #endif cinfo->desired_number_of_colors = 256; cinfo->colormap = NULL; /* Initialize for no mode change in buffered-image mode. */ - cinfo->enable_1pass_quant = FALSE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; + cinfo->enable_1pass_quant = false; + cinfo->enable_external_quant = false; + cinfo->enable_2pass_quant = false; } @@ -246,7 +246,7 @@ default_decompress_parms(j_decompress_ptr cinfo) */ GLOBAL(int) -jpeg_read_header(j_decompress_ptr cinfo, boolean require_image) +jpeg_read_header(j_decompress_ptr cinfo, bool require_image) { int retcode; @@ -338,7 +338,7 @@ jpeg_consume_input(j_decompress_ptr cinfo) * Have we finished reading the input file? */ -GLOBAL(boolean) +GLOBAL(bool) jpeg_input_complete(j_decompress_ptr cinfo) { /* Check for valid jpeg object */ @@ -353,7 +353,7 @@ jpeg_input_complete(j_decompress_ptr cinfo) * Is there more than one scan? */ -GLOBAL(boolean) +GLOBAL(bool) jpeg_has_multiple_scans(j_decompress_ptr cinfo) { /* Only valid after jpeg_read_header completes */ @@ -373,7 +373,7 @@ jpeg_has_multiple_scans(j_decompress_ptr cinfo) * a suspending data source is used. */ -GLOBAL(boolean) +GLOBAL(bool) jpeg_finish_decompress(j_decompress_ptr cinfo) { if ((cinfo->global_state == DSTATE_SCANNING || @@ -395,12 +395,11 @@ jpeg_finish_decompress(j_decompress_ptr cinfo) /* Read until EOI */ while (!cinfo->inputctl->eoi_reached) { if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) - return FALSE; /* Suspend, come back later */ + return false; /* Suspend, come back later */ } /* Do final cleanup */ (*cinfo->src->term_source) (cinfo); /* We can use jpeg_abort to release memory and reset global_state */ jpeg_abort((j_common_ptr)cinfo); - return TRUE; + return true; } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdapistd.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdapistd.c index b8253ebae2..1eba248dee 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdapistd.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdapistd.c @@ -26,7 +26,7 @@ /* Forward declarations */ -LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo)); +LOCAL(bool) output_pass_setup JPP((j_decompress_ptr cinfo)); /* @@ -40,7 +40,7 @@ LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo)); * a suspending data source is used. */ -GLOBAL(boolean) +GLOBAL(bool) jpeg_start_decompress(j_decompress_ptr cinfo) { if (cinfo->global_state == DSTATE_READY) { @@ -49,7 +49,7 @@ jpeg_start_decompress(j_decompress_ptr cinfo) if (cinfo->buffered_image) { /* No more work here; expecting jpeg_start_output next */ cinfo->global_state = DSTATE_BUFIMAGE; - return TRUE; + return true; } cinfo->global_state = DSTATE_PRELOAD; } @@ -65,7 +65,7 @@ jpeg_start_decompress(j_decompress_ptr cinfo) /* Absorb some more input */ retcode = (*cinfo->inputctl->consume_input) (cinfo); if (retcode == JPEG_SUSPENDED) - return FALSE; + return false; if (retcode == JPEG_REACHED_EOI) break; /* Advance progress counter if appropriate */ @@ -98,7 +98,7 @@ jpeg_start_decompress(j_decompress_ptr cinfo) * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN. */ -LOCAL(boolean) +LOCAL(bool) output_pass_setup(j_decompress_ptr cinfo) { if (cinfo->global_state != DSTATE_PRESCAN) { @@ -124,7 +124,7 @@ output_pass_setup(j_decompress_ptr cinfo) (*cinfo->main->process_data) (cinfo, (JSAMPARRAY)NULL, &cinfo->output_scanline, (JDIMENSION)0); if (cinfo->output_scanline == last_scanline) - return FALSE; /* No progress made, must suspend */ + return false; /* No progress made, must suspend */ } /* Finish up dummy pass, and set up for another one */ (*cinfo->master->finish_output_pass) (cinfo); @@ -138,7 +138,7 @@ output_pass_setup(j_decompress_ptr cinfo) * jpeg_read_scanlines or jpeg_read_raw_data. */ cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING; - return TRUE; + return true; } @@ -231,7 +231,7 @@ jpeg_read_raw_data(j_decompress_ptr cinfo, JSAMPIMAGE data, * Initialize for an output pass in buffered-image mode. */ -GLOBAL(boolean) +GLOBAL(bool) jpeg_start_output(j_decompress_ptr cinfo, int scan_number) { if (cinfo->global_state != DSTATE_BUFIMAGE && @@ -256,7 +256,7 @@ jpeg_start_output(j_decompress_ptr cinfo, int scan_number) * a suspending data source is used. */ -GLOBAL(boolean) +GLOBAL(bool) jpeg_finish_output(j_decompress_ptr cinfo) { if ((cinfo->global_state == DSTATE_SCANNING || @@ -274,11 +274,10 @@ jpeg_finish_output(j_decompress_ptr cinfo) while (cinfo->input_scan_number <= cinfo->output_scan_number && !cinfo->inputctl->eoi_reached) { if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) - return FALSE; /* Suspend, come back later */ + return false; /* Suspend, come back later */ } cinfo->global_state = DSTATE_BUFIMAGE; - return TRUE; + return true; } #endif /* D_MULTISCAN_FILES_SUPPORTED */ - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcoefct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcoefct.c index d6f7e8e510..9185ce44af 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcoefct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcoefct.c @@ -75,7 +75,7 @@ METHODDEF(int) decompress_data JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); #endif #ifdef BLOCK_SMOOTHING_SUPPORTED -LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo)); +LOCAL(bool) smoothing_ok JPP((j_decompress_ptr cinfo)); METHODDEF(int) decompress_smooth_data JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); #endif @@ -410,11 +410,11 @@ decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf) * more accurately than they really are. */ -LOCAL(boolean) +LOCAL(bool) smoothing_ok(j_decompress_ptr cinfo) { my_coef_ptr coef = (my_coef_ptr)cinfo->coef; - boolean smoothing_useful = FALSE; + bool smoothing_useful = false; int ci, coefi; jpeg_component_info* compptr; JQUANT_TBL* qtable; @@ -422,7 +422,7 @@ smoothing_ok(j_decompress_ptr cinfo) int* coef_bits_latch; if (!cinfo->progressive_mode || cinfo->coef_bits == NULL) - return FALSE; + return false; /* Allocate latch area if not already done */ if (coef->coef_bits_latch == NULL) @@ -436,7 +436,7 @@ smoothing_ok(j_decompress_ptr cinfo) ci++, compptr++) { /* All components' quantization values must already be latched. */ if ((qtable = compptr->quant_table) == NULL) - return FALSE; + return false; /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */ if (qtable->quantval[0] == 0 || qtable->quantval[Q01_POS] == 0 || @@ -444,16 +444,16 @@ smoothing_ok(j_decompress_ptr cinfo) qtable->quantval[Q20_POS] == 0 || qtable->quantval[Q11_POS] == 0 || qtable->quantval[Q02_POS] == 0) - return FALSE; + return false; /* DC values must be at least partly known for all components. */ coef_bits = cinfo->coef_bits[ci]; if (coef_bits[0] < 0) - return FALSE; + return false; /* Block smoothing is helpful if some AC coefficients remain inaccurate. */ for (coefi = 1; coefi <= 5; coefi++) { coef_bits_latch[coefi] = coef_bits[coefi]; if (coef_bits[coefi] != 0) - smoothing_useful = TRUE; + smoothing_useful = true; } coef_bits_latch += SAVED_COEFS; } @@ -479,7 +479,7 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf) JDIMENSION output_col; jpeg_component_info* compptr; inverse_DCT_method_ptr inverse_DCT; - boolean first_row, last_row; + bool first_row, last_row; JBLOCK workspace; int* coef_bits; JQUANT_TBL* quanttbl; @@ -514,14 +514,14 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf) if (cinfo->output_iMCU_row < last_iMCU_row) { block_rows = compptr->v_samp_factor; access_rows = block_rows * 2; /* this and next iMCU row */ - last_row = FALSE; + last_row = false; } else { /* NB: can't use last_row_height here; it is input-side-dependent! */ block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor); if (block_rows == 0) block_rows = compptr->v_samp_factor; access_rows = block_rows; /* this iMCU row only */ - last_row = TRUE; + last_row = true; } /* Align the virtual buffer for this component. */ if (cinfo->output_iMCU_row > 0) { @@ -531,13 +531,13 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf) (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor, (JDIMENSION)access_rows, FALSE); buffer += compptr->v_samp_factor; /* point to current iMCU row */ - first_row = FALSE; + first_row = false; } else { buffer = (*cinfo->mem->access_virt_barray) ((j_common_ptr)cinfo, coef->whole_image[ci], (JDIMENSION)0, (JDIMENSION)access_rows, FALSE); - first_row = TRUE; + first_row = true; } /* Fetch component-dependent info */ coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS); @@ -689,7 +689,7 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf) */ GLOBAL(void) -jinit_d_coef_controller(j_decompress_ptr cinfo, boolean need_full_buffer) +jinit_d_coef_controller(j_decompress_ptr cinfo, bool need_full_buffer) { my_coef_ptr coef; @@ -751,4 +751,3 @@ jinit_d_coef_controller(j_decompress_ptr cinfo, boolean need_full_buffer) coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */ } } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcolor.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcolor.c index bf97334ed5..5b20228442 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcolor.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcolor.c @@ -824,7 +824,7 @@ jinit_color_deconverter(j_decompress_ptr cinfo) cconvert->pub.color_convert = grayscale_convert; /* For color->grayscale conversion, only the Y (0) component is needed */ for (ci = 1; ci < cinfo->num_components; ci++) - cinfo->comp_info[ci].component_needed = FALSE; + cinfo->comp_info[ci].component_needed = false; } else ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); @@ -911,4 +911,3 @@ jinit_color_deconverter(j_decompress_ptr cinfo) else cinfo->output_components = cinfo->out_color_components; } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdhuff.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdhuff.c index dc0ff409e9..ffaafc2d55 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdhuff.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdhuff.c @@ -76,8 +76,8 @@ typedef struct { d_derived_tbl* dc_cur_tbls[D_MAX_BLOCKS_IN_MCU]; d_derived_tbl* ac_cur_tbls[D_MAX_BLOCKS_IN_MCU]; /* Whether we care about the DC and AC coefficient values for each block */ - boolean dc_needed[D_MAX_BLOCKS_IN_MCU]; - boolean ac_needed[D_MAX_BLOCKS_IN_MCU]; + bool dc_needed[D_MAX_BLOCKS_IN_MCU]; + bool ac_needed[D_MAX_BLOCKS_IN_MCU]; } huff_entropy_decoder; typedef huff_entropy_decoder* huff_entropy_ptr; @@ -125,19 +125,19 @@ start_pass_huff_decoder(j_decompress_ptr cinfo) entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no]; /* Decide whether we really care about the coefficient values */ if (compptr->component_needed) { - entropy->dc_needed[blkn] = TRUE; + entropy->dc_needed[blkn] = true; /* we don't need the ACs if producing a 1/8th-size image */ entropy->ac_needed[blkn] = (compptr->DCT_scaled_size > 1); } else { - entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE; + entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = false; } } /* Initialize bitread state variables */ entropy->bitstate.bits_left = 0; entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ - entropy->pub.insufficient_data = FALSE; + entropy->pub.insufficient_data = false; /* Initialize restart counter */ entropy->restarts_to_go = cinfo->restart_interval; @@ -152,7 +152,7 @@ start_pass_huff_decoder(j_decompress_ptr cinfo) */ GLOBAL(void) -jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC, int tblno, +jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, bool isDC, int tblno, d_derived_tbl** pdtbl) { JHUFF_TBL* htbl; @@ -294,7 +294,7 @@ jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC, int tblno, #endif -GLOBAL(boolean) +GLOBAL(bool) jpeg_fill_bit_buffer(bitread_working_state* state, register bit_buf_type get_buffer, register int bits_left, int nbits) @@ -316,7 +316,7 @@ jpeg_fill_bit_buffer(bitread_working_state* state, /* Attempt to read a byte */ if (bytes_in_buffer == 0) { if (!(*cinfo->src->fill_input_buffer) (cinfo)) - return FALSE; + return false; next_input_byte = cinfo->src->next_input_byte; bytes_in_buffer = cinfo->src->bytes_in_buffer; } @@ -333,7 +333,7 @@ jpeg_fill_bit_buffer(bitread_working_state* state, do { if (bytes_in_buffer == 0) { if (!(*cinfo->src->fill_input_buffer) (cinfo)) - return FALSE; + return false; next_input_byte = cinfo->src->next_input_byte; bytes_in_buffer = cinfo->src->bytes_in_buffer; } @@ -379,7 +379,7 @@ jpeg_fill_bit_buffer(bitread_working_state* state, */ if (!cinfo->entropy->insufficient_data) { WARNMS(cinfo, JWRN_HIT_MARKER); - cinfo->entropy->insufficient_data = TRUE; + cinfo->entropy->insufficient_data = true; } /* Fill the buffer with zero bits */ get_buffer <<= MIN_GET_BITS - bits_left; @@ -393,7 +393,7 @@ jpeg_fill_bit_buffer(bitread_working_state* state, state->get_buffer = get_buffer; state->bits_left = bits_left; - return TRUE; + return true; } @@ -480,7 +480,7 @@ static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ * Returns FALSE if must suspend. */ -LOCAL(boolean) +LOCAL(bool) process_restart(j_decompress_ptr cinfo) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; @@ -493,7 +493,7 @@ process_restart(j_decompress_ptr cinfo) /* Advance past the RSTn marker */ if (!(*cinfo->marker->read_restart_marker) (cinfo)) - return FALSE; + return false; /* Re-initialize DC predictions to 0 */ for (ci = 0; ci < cinfo->comps_in_scan; ci++) @@ -508,9 +508,9 @@ process_restart(j_decompress_ptr cinfo) * leaving the flag set. */ if (cinfo->unread_marker == 0) - entropy->pub.insufficient_data = FALSE; + entropy->pub.insufficient_data = false; - return TRUE; + return true; } @@ -529,7 +529,7 @@ process_restart(j_decompress_ptr cinfo) * this module, since we'll just re-assign them on the next call.) */ -METHODDEF(boolean) +METHODDEF(bool) decode_mcu(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; @@ -541,7 +541,7 @@ decode_mcu(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) if (cinfo->restart_interval) { if (entropy->restarts_to_go == 0) if (!process_restart(cinfo)) - return FALSE; + return false; } /* If we've run out of data, just leave the MCU set to zeroes. @@ -564,9 +564,9 @@ decode_mcu(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Decode a single block's worth of coefficients */ /* Section F.2.2.1: decode the DC coefficient difference */ - HUFF_DECODE(s, br_state, dctbl, return FALSE, label1); + HUFF_DECODE(s, br_state, dctbl, return false, label1); if (s) { - CHECK_BIT_BUFFER(br_state, s, return FALSE); + CHECK_BIT_BUFFER(br_state, s, return false); r = GET_BITS(s); s = HUFF_EXTEND(r, s); } @@ -585,14 +585,14 @@ decode_mcu(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Section F.2.2.2: decode the AC coefficients */ /* Since zeroes are skipped, output area must be cleared beforehand */ for (k = 1; k < DCTSIZE2; k++) { - HUFF_DECODE(s, br_state, actbl, return FALSE, label2); + HUFF_DECODE(s, br_state, actbl, return false, label2); r = s >> 4; s &= 15; if (s) { k += r; - CHECK_BIT_BUFFER(br_state, s, return FALSE); + CHECK_BIT_BUFFER(br_state, s, return false); r = GET_BITS(s); s = HUFF_EXTEND(r, s); /* Output coefficient in natural (dezigzagged) order. @@ -614,14 +614,14 @@ decode_mcu(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Section F.2.2.2: decode the AC coefficients */ /* In this path we just discard the values */ for (k = 1; k < DCTSIZE2; k++) { - HUFF_DECODE(s, br_state, actbl, return FALSE, label3); + HUFF_DECODE(s, br_state, actbl, return false, label3); r = s >> 4; s &= 15; if (s) { k += r; - CHECK_BIT_BUFFER(br_state, s, return FALSE); + CHECK_BIT_BUFFER(br_state, s, return false); DROP_BITS(s); } else { @@ -642,7 +642,7 @@ decode_mcu(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Account for restart interval (no-op if not using restarts) */ entropy->restarts_to_go--; - return TRUE; + return true; } @@ -668,4 +668,3 @@ jinit_huff_decoder(j_decompress_ptr cinfo) entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; } } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdhuff.h b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdhuff.h index fa63923f08..923a494e0d 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdhuff.h +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdhuff.h @@ -54,7 +54,7 @@ typedef struct { /* Expand a Huffman table definition into the derived format */ EXTERN(void) jpeg_make_d_derived_tbl -JPP((j_decompress_ptr cinfo, boolean isDC, int tblno, +JPP((j_decompress_ptr cinfo, bool isDC, int tblno, d_derived_tbl** pdtbl)); @@ -158,7 +158,7 @@ typedef struct { /* Bitreading working state within an MCU */ (bits_left -= (nbits)) /* Load up the bit buffer to a depth of at least nbits */ -EXTERN(boolean) jpeg_fill_bit_buffer +EXTERN(bool) jpeg_fill_bit_buffer JPP((bitread_working_state* state, register bit_buf_type get_buffer, register int bits_left, int nbits)); @@ -206,4 +206,3 @@ slowlabel: \ EXTERN(int) jpeg_huff_decode JPP((bitread_working_state* state, register bit_buf_type get_buffer, register int bits_left, d_derived_tbl* htbl, int min_bits)); - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdinput.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdinput.c index ecd2606983..547d657c7d 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdinput.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdinput.c @@ -33,7 +33,7 @@ typedef struct { struct jpeg_input_controller pub; /* public fields */ - boolean inheaders; /* TRUE until first SOS is reached */ + bool inheaders; /* TRUE until first SOS is reached */ } my_input_controller; typedef my_input_controller* my_inputctl_ptr; @@ -111,7 +111,7 @@ initial_setup(j_decompress_ptr cinfo) jdiv_round_up((long)cinfo->image_height * (long)compptr->v_samp_factor, (long)cinfo->max_v_samp_factor); /* Mark component needed, until color conversion says otherwise */ - compptr->component_needed = TRUE; + compptr->component_needed = true; /* Mark no quantization table yet saved for component */ compptr->quant_table = NULL; } @@ -123,9 +123,9 @@ initial_setup(j_decompress_ptr cinfo) /* Decide whether file contains multiple scans */ if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode) - cinfo->inputctl->has_multiple_scans = TRUE; + cinfo->inputctl->has_multiple_scans = true; else - cinfo->inputctl->has_multiple_scans = FALSE; + cinfo->inputctl->has_multiple_scans = false; } @@ -312,7 +312,7 @@ consume_markers(j_decompress_ptr cinfo) case JPEG_REACHED_SOS: /* Found SOS */ if (inputctl->inheaders) { /* 1st SOS */ initial_setup(cinfo); - inputctl->inheaders = FALSE; + inputctl->inheaders = false; /* Note: start_input_pass must be called by jdmaster.c * before any more input can be consumed. jdapimin.c is * responsible for enforcing this sequencing. @@ -325,7 +325,7 @@ consume_markers(j_decompress_ptr cinfo) } break; case JPEG_REACHED_EOI: /* Found EOI */ - inputctl->pub.eoi_reached = TRUE; + inputctl->pub.eoi_reached = true; if (inputctl->inheaders) { /* Tables-only datastream, apparently */ if (cinfo->marker->saw_SOF) ERREXIT(cinfo, JERR_SOF_NO_SOS); @@ -356,9 +356,9 @@ reset_input_controller(j_decompress_ptr cinfo) my_inputctl_ptr inputctl = (my_inputctl_ptr)cinfo->inputctl; inputctl->pub.consume_input = consume_markers; - inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ - inputctl->pub.eoi_reached = FALSE; - inputctl->inheaders = TRUE; + inputctl->pub.has_multiple_scans = false; /* "unknown" would be better */ + inputctl->pub.eoi_reached = false; + inputctl->inheaders = true; /* Reset other modules */ (*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo); (*cinfo->marker->reset_marker_reader) (cinfo); @@ -390,8 +390,7 @@ jinit_input_controller(j_decompress_ptr cinfo) /* Initialize state: can't use reset_input_controller since we don't * want to try to reset other modules yet. */ - inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ - inputctl->pub.eoi_reached = FALSE; - inputctl->inheaders = TRUE; + inputctl->pub.has_multiple_scans = false; /* "unknown" would be better */ + inputctl->pub.eoi_reached = false; + inputctl->inheaders = true; } - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmainct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmainct.c index 6de4a9c53c..10482321cf 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmainct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmainct.c @@ -123,7 +123,7 @@ typedef struct { /* Pointer to allocated workspace (M or M+2 row groups). */ JSAMPARRAY buffer[MAX_COMPONENTS]; - boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ + bool buffer_full; /* Have we gotten an iMCU row from decoder? */ JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ /* Remaining fields are only used in the context case. */ @@ -332,7 +332,7 @@ start_pass_main(j_decompress_ptr cinfo, J_BUF_MODE pass_mode) /* Simple case with no context needed */ main1->pub.process_data = process_data_simple_main; } - main1->buffer_full = FALSE; /* Mark buffer empty */ + main1->buffer_full = false; /* Mark buffer empty */ main1->rowgroup_ctr = 0; break; #ifdef QUANT_2PASS_SUPPORTED @@ -366,7 +366,7 @@ process_data_simple_main(j_decompress_ptr cinfo, if (!main1->buffer_full) { if (!(*cinfo->coef->decompress_data) (cinfo, main1->buffer)) return; /* suspension forced, can do nothing more */ - main1->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + main1->buffer_full = true; /* OK, we have an iMCU row to work with */ } /* There are always min_DCT_scaled_size row groups in an iMCU row. */ @@ -383,7 +383,7 @@ process_data_simple_main(j_decompress_ptr cinfo, /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ if (main1->rowgroup_ctr >= rowgroups_avail) { - main1->buffer_full = FALSE; + main1->buffer_full = false; main1->rowgroup_ctr = 0; } } @@ -407,7 +407,7 @@ process_data_context_main(j_decompress_ptr cinfo, if (!(*cinfo->coef->decompress_data) (cinfo, main1->xbuffer[main1->whichptr])) return; /* suspension forced, can do nothing more */ - main1->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + main1->buffer_full = true; /* OK, we have an iMCU row to work with */ main1->iMCU_row_ctr++; /* count rows received */ } @@ -451,7 +451,7 @@ process_data_context_main(j_decompress_ptr cinfo, set_wraparound_pointers(cinfo); /* Prepare to load new iMCU row using other xbuffer list */ main1->whichptr ^= 1; /* 0=>1 or 1=>0 */ - main1->buffer_full = FALSE; + main1->buffer_full = false; /* Still need to process last row group of this iMCU row, */ /* which is saved at index M+1 of the other xbuffer */ main1->rowgroup_ctr = (JDIMENSION)(cinfo->min_DCT_scaled_size + 1); @@ -487,7 +487,7 @@ process_data_crank_post(j_decompress_ptr cinfo, */ GLOBAL(void) -jinit_d_main_controller(j_decompress_ptr cinfo, boolean need_full_buffer) +jinit_d_main_controller(j_decompress_ptr cinfo, bool need_full_buffer) { //my_main_ptr main; my_main_ptr main1; diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmarker.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmarker.c index e95de473f4..f33e13cef0 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmarker.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmarker.c @@ -149,7 +149,7 @@ typedef my_marker_reader * my_marker_ptr; } /* Read a byte into variable V. - * If must suspend, take the specified action (typically "return FALSE"). + * If must suspend, take the specified action (typically "return false"). */ #define INPUT_BYTE(cinfo,V,action) \ MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ @@ -174,9 +174,9 @@ typedef my_marker_reader * my_marker_ptr; * Entry condition: JPEG marker itself has been read and its code saved * in cinfo->unread_marker; input restart point is just after the marker. * - * Exit: if return TRUE, have read and processed any parameters, and have + * Exit: if return true, have read and processed any parameters, and have * updated the restart point to point after the parameters. - * If return FALSE, was forced to suspend before reaching end of + * If return false, was forced to suspend before reaching end of * marker parameters; restart point has not been moved. Same routine * will be called again after application supplies more input data. * @@ -199,7 +199,7 @@ typedef my_marker_reader * my_marker_ptr; */ -LOCAL(boolean) +LOCAL(bool) get_soi (j_decompress_ptr cinfo) /* Process an SOI marker */ { @@ -222,25 +222,25 @@ get_soi (j_decompress_ptr cinfo) /* Set initial assumptions for colorspace etc */ cinfo->jpeg_color_space = JCS_UNKNOWN; - cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */ + cinfo->CCIR601_sampling = false; /* Assume non-CCIR sampling??? */ - cinfo->saw_JFIF_marker = FALSE; + cinfo->saw_JFIF_marker = false; cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */ cinfo->JFIF_minor_version = 1; cinfo->density_unit = 0; cinfo->X_density = 1; cinfo->Y_density = 1; - cinfo->saw_Adobe_marker = FALSE; + cinfo->saw_Adobe_marker = false; cinfo->Adobe_transform = 0; - cinfo->marker->saw_SOI = TRUE; + cinfo->marker->saw_SOI = true; - return TRUE; + return true; } -LOCAL(boolean) -get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) +LOCAL(bool) +get_sof (j_decompress_ptr cinfo, bool is_prog, bool is_arith) /* Process a SOFn marker */ { CLR_INT32 length; @@ -251,12 +251,12 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) cinfo->progressive_mode = is_prog; cinfo->arith_code = is_arith; - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); - INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE); - INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE); - INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE); - INPUT_BYTE(cinfo, cinfo->num_components, return FALSE); + INPUT_BYTE(cinfo, cinfo->data_precision, return false); + INPUT_2BYTES(cinfo, cinfo->image_height, return false); + INPUT_2BYTES(cinfo, cinfo->image_width, return false); + INPUT_BYTE(cinfo, cinfo->num_components, return false); length -= 8; @@ -285,25 +285,25 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { compptr->component_index = ci; - INPUT_BYTE(cinfo, compptr->component_id, return FALSE); - INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, compptr->component_id, return false); + INPUT_BYTE(cinfo, c, return false); compptr->h_samp_factor = (c >> 4) & 15; compptr->v_samp_factor = (c ) & 15; - INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE); + INPUT_BYTE(cinfo, compptr->quant_tbl_no, return false); TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT, compptr->component_id, compptr->h_samp_factor, compptr->v_samp_factor, compptr->quant_tbl_no); } - cinfo->marker->saw_SOF = TRUE; + cinfo->marker->saw_SOF = true; INPUT_SYNC(cinfo); - return TRUE; + return true; } -LOCAL(boolean) +LOCAL(bool) get_sos (j_decompress_ptr cinfo) /* Process a SOS marker */ { @@ -315,9 +315,9 @@ get_sos (j_decompress_ptr cinfo) if (! cinfo->marker->saw_SOF) ERREXIT(cinfo, JERR_SOS_NO_SOF); - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); - INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */ + INPUT_BYTE(cinfo, n, return false); /* Number of components */ TRACEMS1(cinfo, 1, JTRC_SOS, n); @@ -329,8 +329,8 @@ get_sos (j_decompress_ptr cinfo) /* Collect the component-spec parameters */ for (i = 0; i < n; i++) { - INPUT_BYTE(cinfo, cc, return FALSE); - INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, cc, return false); + INPUT_BYTE(cinfo, c, return false); for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { @@ -351,11 +351,11 @@ get_sos (j_decompress_ptr cinfo) } /* Collect the additional scan parameters Ss, Se, Ah/Al. */ - INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c, return false); cinfo->Ss = c; - INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c, return false); cinfo->Se = c; - INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c, return false); cinfo->Ah = (c >> 4) & 15; cinfo->Al = (c ) & 15; @@ -369,13 +369,13 @@ get_sos (j_decompress_ptr cinfo) cinfo->input_scan_number++; INPUT_SYNC(cinfo); - return TRUE; + return true; } #ifdef D_ARITH_CODING_SUPPORTED -LOCAL(boolean) +LOCAL(bool) get_dac (j_decompress_ptr cinfo) /* Process a DAC marker */ { @@ -383,12 +383,12 @@ get_dac (j_decompress_ptr cinfo) int index, val; INPUT_VARS(cinfo); - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); length -= 2; while (length > 0) { - INPUT_BYTE(cinfo, index, return FALSE); - INPUT_BYTE(cinfo, val, return FALSE); + INPUT_BYTE(cinfo, index, return false); + INPUT_BYTE(cinfo, val, return false); length -= 2; @@ -411,7 +411,7 @@ get_dac (j_decompress_ptr cinfo) ERREXIT(cinfo, JERR_BAD_LENGTH); INPUT_SYNC(cinfo); - return TRUE; + return true; } #else /* ! D_ARITH_CODING_SUPPORTED */ @@ -421,7 +421,7 @@ get_dac (j_decompress_ptr cinfo) #endif /* D_ARITH_CODING_SUPPORTED */ -LOCAL(boolean) +LOCAL(bool) get_dht (j_decompress_ptr cinfo) /* Process a DHT marker */ { @@ -432,18 +432,18 @@ get_dht (j_decompress_ptr cinfo) JHUFF_TBL **htblptr; INPUT_VARS(cinfo); - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); length -= 2; while (length > 16) { - INPUT_BYTE(cinfo, index, return FALSE); + INPUT_BYTE(cinfo, index, return false); TRACEMS1(cinfo, 1, JTRC_DHT, index); bits[0] = 0; count = 0; for (i = 1; i <= 16; i++) { - INPUT_BYTE(cinfo, bits[i], return FALSE); + INPUT_BYTE(cinfo, bits[i], return false); count += bits[i]; } @@ -463,7 +463,7 @@ get_dht (j_decompress_ptr cinfo) ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); for (i = 0; i < count; i++) - INPUT_BYTE(cinfo, huffval[i], return FALSE); + INPUT_BYTE(cinfo, huffval[i], return false); length -= count; @@ -488,11 +488,11 @@ get_dht (j_decompress_ptr cinfo) ERREXIT(cinfo, JERR_BAD_LENGTH); INPUT_SYNC(cinfo); - return TRUE; + return true; } -LOCAL(boolean) +LOCAL(bool) get_dqt (j_decompress_ptr cinfo) /* Process a DQT marker */ { @@ -502,11 +502,11 @@ get_dqt (j_decompress_ptr cinfo) JQUANT_TBL *quant_ptr; INPUT_VARS(cinfo); - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); length -= 2; while (length > 0) { - INPUT_BYTE(cinfo, n, return FALSE); + INPUT_BYTE(cinfo, n, return false); prec = n >> 4; n &= 0x0F; @@ -521,9 +521,9 @@ get_dqt (j_decompress_ptr cinfo) for (i = 0; i < DCTSIZE2; i++) { if (prec) - INPUT_2BYTES(cinfo, tmp, return FALSE); + INPUT_2BYTES(cinfo, tmp, return false); else - INPUT_BYTE(cinfo, tmp, return FALSE); + INPUT_BYTE(cinfo, tmp, return false); /* We convert the zigzag-order table to natural array order. */ quant_ptr->quantval[jpeg_natural_order[i]] = (CLR_UINT16) tmp; } @@ -546,11 +546,11 @@ get_dqt (j_decompress_ptr cinfo) ERREXIT(cinfo, JERR_BAD_LENGTH); INPUT_SYNC(cinfo); - return TRUE; + return true; } -LOCAL(boolean) +LOCAL(bool) get_dri (j_decompress_ptr cinfo) /* Process a DRI marker */ { @@ -558,19 +558,19 @@ get_dri (j_decompress_ptr cinfo) unsigned int tmp; INPUT_VARS(cinfo); - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); if (length != 4) ERREXIT(cinfo, JERR_BAD_LENGTH); - INPUT_2BYTES(cinfo, tmp, return FALSE); + INPUT_2BYTES(cinfo, tmp, return false); TRACEMS1(cinfo, 1, JTRC_DRI, tmp); cinfo->restart_interval = tmp; INPUT_SYNC(cinfo); - return TRUE; + return true; } @@ -602,7 +602,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, GETJOCTET(data[3]) == 0x46 && GETJOCTET(data[4]) == 0) { /* Found JFIF APP0 marker: save info */ - cinfo->saw_JFIF_marker = TRUE; + cinfo->saw_JFIF_marker = true; cinfo->JFIF_major_version = GETJOCTET(data[5]); cinfo->JFIF_minor_version = GETJOCTET(data[6]); cinfo->density_unit = GETJOCTET(data[7]); @@ -683,7 +683,7 @@ examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data, flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]); transform = GETJOCTET(data[11]); TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform); - cinfo->saw_Adobe_marker = TRUE; + cinfo->saw_Adobe_marker = true; cinfo->Adobe_transform = (CLR_UINT8) transform; } else { /* Start of APP14 does not match "Adobe", or too short */ @@ -692,7 +692,7 @@ examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data, } -METHODDEF(boolean) +METHODDEF(bool) get_interesting_appn (j_decompress_ptr cinfo) /* Process an APP0 or APP14 marker without saving it */ { @@ -701,7 +701,7 @@ get_interesting_appn (j_decompress_ptr cinfo) unsigned int i, numtoread; INPUT_VARS(cinfo); - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); length -= 2; /* get the interesting part of the marker data */ @@ -712,7 +712,7 @@ get_interesting_appn (j_decompress_ptr cinfo) else numtoread = 0; for (i = 0; i < numtoread; i++) - INPUT_BYTE(cinfo, b[i], return FALSE); + INPUT_BYTE(cinfo, b[i], return false); length -= numtoread; /* process it */ @@ -734,13 +734,13 @@ get_interesting_appn (j_decompress_ptr cinfo) if (length > 0) (*cinfo->src->skip_input_data) (cinfo, (long) length); - return TRUE; + return true; } #ifdef SAVE_MARKERS_SUPPORTED -METHODDEF(boolean) +METHODDEF(bool) save_marker (j_decompress_ptr cinfo) /* Save an APPn or COM marker into the marker list */ { @@ -753,7 +753,7 @@ save_marker (j_decompress_ptr cinfo) if (cur_marker == NULL) { /* begin reading a marker */ - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); length -= 2; if (length >= 0) { /* watch out for bogus length word */ /* figure out how much we want to save */ @@ -797,7 +797,7 @@ save_marker (j_decompress_ptr cinfo) INPUT_SYNC(cinfo); /* move the restart point to here */ marker->bytes_read = bytes_read; /* If there's not at least one byte in buffer, suspend */ - MAKE_BYTE_AVAIL(cinfo, return FALSE); + MAKE_BYTE_AVAIL(cinfo, return false); /* Copy bytes with reasonable rapidity */ while (bytes_read < data_length && bytes_in_buffer > 0) { *data++ = *next_input_byte++; @@ -843,19 +843,19 @@ save_marker (j_decompress_ptr cinfo) if (length > 0) (*cinfo->src->skip_input_data) (cinfo, (long) length); - return TRUE; + return true; } #endif /* SAVE_MARKERS_SUPPORTED */ -METHODDEF(boolean) +METHODDEF(bool) skip_variable (j_decompress_ptr cinfo) /* Skip over an unknown or uninteresting variable-length marker */ { CLR_INT32 length; INPUT_VARS(cinfo); - INPUT_2BYTES(cinfo, length, return FALSE); + INPUT_2BYTES(cinfo, length, return false); length -= 2; TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); @@ -864,7 +864,7 @@ skip_variable (j_decompress_ptr cinfo) if (length > 0) (*cinfo->src->skip_input_data) (cinfo, (long) length); - return TRUE; + return true; } @@ -877,14 +877,14 @@ skip_variable (j_decompress_ptr cinfo) * but it will never be 0 or FF. */ -LOCAL(boolean) +LOCAL(bool) next_marker (j_decompress_ptr cinfo) { int c; INPUT_VARS(cinfo); for (;;) { - INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c, return false); /* Skip any non-FF bytes. * This may look a bit inefficient, but it will not occur in a valid file. * We sync after each discarded byte so that a suspending data source @@ -893,7 +893,7 @@ next_marker (j_decompress_ptr cinfo) while (c != 0xFF) { cinfo->marker->discarded_bytes++; INPUT_SYNC(cinfo); - INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c, return false); } /* This loop swallows any duplicate FF bytes. Extra FF bytes are legal as * pad bytes, so don't count them in discarded_bytes. We assume there @@ -901,7 +901,7 @@ next_marker (j_decompress_ptr cinfo) * data source's input buffer. */ do { - INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c, return false); } while (c == 0xFF); if (c != 0) break; /* found a valid marker, exit loop */ @@ -920,11 +920,11 @@ next_marker (j_decompress_ptr cinfo) cinfo->unread_marker = c; INPUT_SYNC(cinfo); - return TRUE; + return true; } -LOCAL(boolean) +LOCAL(bool) first_marker (j_decompress_ptr cinfo) /* Like next_marker, but used to obtain the initial SOI marker. */ /* For this marker, we do not allow preceding garbage or fill; otherwise, @@ -936,15 +936,15 @@ first_marker (j_decompress_ptr cinfo) int c, c2; INPUT_VARS(cinfo); - INPUT_BYTE(cinfo, c, return FALSE); - INPUT_BYTE(cinfo, c2, return FALSE); + INPUT_BYTE(cinfo, c, return false); + INPUT_BYTE(cinfo, c2, return false); if (c != 0xFF || c2 != (int) M_SOI) ERREXIT2(cinfo, JERR_NO_SOI, c, c2); cinfo->unread_marker = c2; INPUT_SYNC(cinfo); - return TRUE; + return true; } @@ -1116,14 +1116,14 @@ read_markers (j_decompress_ptr cinfo) * it holds a marker which the decoder will be unable to read past. */ -METHODDEF(boolean) +METHODDEF(bool) read_restart_marker (j_decompress_ptr cinfo) { /* Obtain a marker unless we already did. */ /* Note that next_marker will complain if it skips any data. */ if (cinfo->unread_marker == 0) { if (! next_marker(cinfo)) - return FALSE; + return false; } if (cinfo->unread_marker == @@ -1136,13 +1136,13 @@ read_restart_marker (j_decompress_ptr cinfo) /* Let the data source manager determine how to resync. */ if (! (*cinfo->src->resync_to_restart) (cinfo, cinfo->marker->next_restart_num)) - return FALSE; + return false; } /* Update next-restart state */ cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7; - return TRUE; + return true; } @@ -1195,7 +1195,7 @@ read_restart_marker (j_decompress_ptr cinfo) * any other marker would have to be bogus data in that case. */ -GLOBAL(boolean) +GLOBAL(bool) jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) { int marker = cinfo->unread_marker; @@ -1225,17 +1225,17 @@ jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) case 1: /* Discard marker and let entropy decoder resume processing. */ cinfo->unread_marker = 0; - return TRUE; + return true; case 2: /* Scan to the next marker, and repeat the decision loop. */ if (! next_marker(cinfo)) - return FALSE; + return false; marker = cinfo->unread_marker; break; case 3: /* Return without advancing past this marker. */ /* Entropy decoder will be forced to process an empty segment. */ - return TRUE; + return true; } } /* end loop */ } @@ -1253,8 +1253,8 @@ reset_marker_reader (j_decompress_ptr cinfo) cinfo->comp_info = NULL; /* until allocated by get_sof */ cinfo->input_scan_number = 0; /* no SOS seen yet */ cinfo->unread_marker = 0; /* no pending marker */ - marker->pub.saw_SOI = FALSE; /* set internal state too */ - marker->pub.saw_SOF = FALSE; + marker->pub.saw_SOI = false; /* set internal state too */ + marker->pub.saw_SOF = false; marker->pub.discarded_bytes = 0; marker->cur_marker = NULL; } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c index 9ca7af89ce..e9ab969c75 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c @@ -29,7 +29,7 @@ typedef struct { int pass_number; /* # of passes completed */ - boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ + bool using_merged_upsample; /* TRUE if using merged upsample/cconvert */ /* Saved references to initialized quantizer modules, * in case we need to switch modes. @@ -46,18 +46,18 @@ typedef my_decomp_master* my_master_ptr; * CRUCIAL: this must match the actual capabilities of jdmerge.c! */ -LOCAL(boolean) +LOCAL(bool) use_merged_upsample(j_decompress_ptr cinfo) { #ifdef UPSAMPLE_MERGING_SUPPORTED /* Merging is the equivalent of plain box-filter upsampling */ if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) - return FALSE; + return false; /* jdmerge.c only supports YCC=>RGB color conversion */ if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || cinfo->out_color_space != JCS_RGB || cinfo->out_color_components != RGB_PIXELSIZE) - return FALSE; + return false; /* and it only handles 2h1v or 2h2v sampling ratios */ if (cinfo->comp_info[0].h_samp_factor != 2 || cinfo->comp_info[1].h_samp_factor != 1 || @@ -65,16 +65,16 @@ use_merged_upsample(j_decompress_ptr cinfo) cinfo->comp_info[0].v_samp_factor > 2 || cinfo->comp_info[1].v_samp_factor != 1 || cinfo->comp_info[2].v_samp_factor != 1) - return FALSE; + return false; /* furthermore, it doesn't work if we've scaled the IDCTs differently */ if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size || cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size || cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size) - return FALSE; + return false; /* ??? also need to test for upsample-time rescaling, when & if supported */ - return TRUE; /* by golly, it'll work... */ + return true; /* by golly, it'll work... */ #else - return FALSE; + return false; #endif } @@ -297,7 +297,7 @@ LOCAL(void) master_selection(j_decompress_ptr cinfo) { my_master_ptr master = (my_master_ptr)cinfo->master; - boolean use_c_buffer; + bool use_c_buffer; long samplesperrow; JDIMENSION jd_samplesperrow; @@ -320,28 +320,28 @@ master_selection(j_decompress_ptr cinfo) master->quantizer_2pass = NULL; /* No mode changes if not using buffered-image mode. */ if (!cinfo->quantize_colors || !cinfo->buffered_image) { - cinfo->enable_1pass_quant = FALSE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; + cinfo->enable_1pass_quant = false; + cinfo->enable_external_quant = false; + cinfo->enable_2pass_quant = false; } if (cinfo->quantize_colors) { if (cinfo->raw_data_out) ERREXIT(cinfo, JERR_NOTIMPL); /* 2-pass quantizer only works in 3-component color space. */ if (cinfo->out_color_components != 3) { - cinfo->enable_1pass_quant = TRUE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; + cinfo->enable_1pass_quant = true; + cinfo->enable_external_quant = false; + cinfo->enable_2pass_quant = false; cinfo->colormap = NULL; } else if (cinfo->colormap != NULL) { - cinfo->enable_external_quant = TRUE; + cinfo->enable_external_quant = true; } else if (cinfo->two_pass_quantize) { - cinfo->enable_2pass_quant = TRUE; + cinfo->enable_2pass_quant = true; } else { - cinfo->enable_1pass_quant = TRUE; + cinfo->enable_1pass_quant = true; } if (cinfo->enable_1pass_quant) { @@ -458,7 +458,7 @@ prepare_for_output_pass(j_decompress_ptr cinfo) if (master->pub.is_dummy_pass) { #ifdef QUANT_2PASS_SUPPORTED /* Final pass of 2-pass quantization */ - master->pub.is_dummy_pass = FALSE; + master->pub.is_dummy_pass = false; (*cinfo->cquantize->start_pass) (cinfo, FALSE); (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); @@ -471,7 +471,7 @@ prepare_for_output_pass(j_decompress_ptr cinfo) /* Select new quantization method */ if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) { cinfo->cquantize = master->quantizer_2pass; - master->pub.is_dummy_pass = TRUE; + master->pub.is_dummy_pass = true; } else if (cinfo->enable_1pass_quant) { cinfo->cquantize = master->quantizer_1pass; @@ -545,7 +545,7 @@ jpeg_new_colormap(j_decompress_ptr cinfo) cinfo->cquantize = master->quantizer_2pass; /* Notify quantizer of colormap change */ (*cinfo->cquantize->new_color_map) (cinfo); - master->pub.is_dummy_pass = FALSE; /* just in case */ + master->pub.is_dummy_pass = false; /* just in case */ } else ERREXIT(cinfo, JERR_MODE_CHANGE); @@ -571,7 +571,7 @@ jinit_master_decompress(j_decompress_ptr cinfo) master->pub.prepare_for_output_pass = prepare_for_output_pass; master->pub.finish_output_pass = finish_output_pass; - master->pub.is_dummy_pass = FALSE; + master->pub.is_dummy_pass = false; master_selection(cinfo); } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmerge.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmerge.c index 538d26030d..0d921fc899 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmerge.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmerge.c @@ -85,7 +85,7 @@ typedef struct { * to discard the dummy last row if the image height is odd. */ JSAMPROW spare_row; - boolean spare_full; /* T if spare buffer is occupied */ + bool spare_full; /* T if spare buffer is occupied */ JDIMENSION out_row_width; /* samples per output row */ JDIMENSION rows_to_go; /* counts rows remaining in image */ @@ -152,7 +152,7 @@ start_pass_merged_upsample(j_decompress_ptr cinfo) my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; /* Mark the spare buffer empty */ - upsample->spare_full = FALSE; + upsample->spare_full = false; /* Initialize total-height counter for detecting bottom of image */ upsample->rows_to_go = cinfo->output_height; } @@ -182,7 +182,7 @@ merged_2v_upsample(j_decompress_ptr cinfo, jcopy_sample_rows(&upsample->spare_row, 0, output_buf + *out_row_ctr, 0, 1, upsample->out_row_width); num_rows = 1; - upsample->spare_full = FALSE; + upsample->spare_full = false; } else { /* Figure number of rows to return to caller. */ @@ -201,7 +201,7 @@ merged_2v_upsample(j_decompress_ptr cinfo, } else { work_ptrs[1] = upsample->spare_row; - upsample->spare_full = TRUE; + upsample->spare_full = true; } /* Now do the upsampling. */ (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs); @@ -905,7 +905,7 @@ jinit_merged_upsampler(j_decompress_ptr cinfo) SIZEOF(my_upsampler)); cinfo->upsample = (struct jpeg_upsampler*) upsample; upsample->pub.start_pass = start_pass_merged_upsample; - upsample->pub.need_context_rows = FALSE; + upsample->pub.need_context_rows = false; upsample->out_row_width = cinfo->output_width * cinfo->out_color_components; diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdphuff.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdphuff.c index 0877a79d8b..b19c859cdc 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdphuff.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdphuff.c @@ -80,13 +80,13 @@ typedef struct { typedef phuff_entropy_decoder* phuff_entropy_ptr; /* Forward declarations */ -METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo, +METHODDEF(bool) decode_mcu_DC_first JPP((j_decompress_ptr cinfo, JBLOCKROW* MCU_data)); -METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo, +METHODDEF(bool) decode_mcu_AC_first JPP((j_decompress_ptr cinfo, JBLOCKROW* MCU_data)); -METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo, +METHODDEF(bool) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo, JBLOCKROW* MCU_data)); -METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo, +METHODDEF(bool) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo, JBLOCKROW* MCU_data)); @@ -98,7 +98,7 @@ METHODDEF(void) start_pass_phuff_decoder(j_decompress_ptr cinfo) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; - boolean is_DC_band, bad; + bool is_DC_band, bad; int ci, coefi, tbl; int* coef_bit_ptr; jpeg_component_info* compptr; @@ -106,26 +106,26 @@ start_pass_phuff_decoder(j_decompress_ptr cinfo) is_DC_band = (cinfo->Ss == 0); /* Validate scan parameters */ - bad = FALSE; + bad = false; if (is_DC_band) { if (cinfo->Se != 0) - bad = TRUE; + bad = true; } else { /* need not check Ss/Se < 0 since they came from unsigned bytes */ if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2) - bad = TRUE; + bad = true; /* AC scans may have only one component */ if (cinfo->comps_in_scan != 1) - bad = TRUE; + bad = true; } if (cinfo->Ah != 0) { /* Successive approximation refinement scan: must have Al = Ah-1. */ if (cinfo->Al != cinfo->Ah - 1) - bad = TRUE; + bad = true; } if (cinfo->Al > 13) /* need not check for < 0 */ - bad = TRUE; + bad = true; /* Arguably the maximum Al value should be less than 13 for 8-bit precision, * but the spec doesn't say so, and we try to be liberal about what we * accept. Note: large Al values could result in out-of-range DC @@ -192,7 +192,7 @@ start_pass_phuff_decoder(j_decompress_ptr cinfo) /* Initialize bitread state variables */ entropy->bitstate.bits_left = 0; entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ - entropy->pub.insufficient_data = FALSE; + entropy->pub.insufficient_data = false; /* Initialize private state variables */ entropy->saved.EOBRUN = 0; @@ -242,7 +242,7 @@ static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ * Returns FALSE if must suspend. */ -LOCAL(boolean) +LOCAL(bool) process_restart(j_decompress_ptr cinfo) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -255,7 +255,7 @@ process_restart(j_decompress_ptr cinfo) /* Advance past the RSTn marker */ if (!(*cinfo->marker->read_restart_marker) (cinfo)) - return FALSE; + return false; /* Re-initialize DC predictions to 0 */ for (ci = 0; ci < cinfo->comps_in_scan; ci++) @@ -272,9 +272,9 @@ process_restart(j_decompress_ptr cinfo) * leaving the flag set. */ if (cinfo->unread_marker == 0) - entropy->pub.insufficient_data = FALSE; + entropy->pub.insufficient_data = false; - return TRUE; + return true; } @@ -288,7 +288,7 @@ process_restart(j_decompress_ptr cinfo) * The i'th block of the MCU is stored into the block pointed to by * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER. * - * We return FALSE if data source requested suspension. In that case no + * We return false if data source requested suspension. In that case no * changes have been made to permanent state. (Exception: some output * coefficients may already have been assigned. This is harmless for * spectral selection, since we'll just re-assign them on the next call. @@ -300,7 +300,7 @@ process_restart(j_decompress_ptr cinfo) * or first pass of successive approximation). */ -METHODDEF(boolean) +METHODDEF(bool) decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -317,7 +317,7 @@ decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) if (cinfo->restart_interval) { if (entropy->restarts_to_go == 0) if (!process_restart(cinfo)) - return FALSE; + return false; } /* If we've run out of data, just leave the MCU set to zeroes. @@ -340,9 +340,9 @@ decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Decode a single block's worth of coefficients */ /* Section F.2.2.1: decode the DC coefficient difference */ - HUFF_DECODE(s, br_state, tbl, return FALSE, label1); + HUFF_DECODE(s, br_state, tbl, return false, label1); if (s) { - CHECK_BIT_BUFFER(br_state, s, return FALSE); + CHECK_BIT_BUFFER(br_state, s, return false); r = GET_BITS(s); s = HUFF_EXTEND(r, s); } @@ -362,7 +362,7 @@ decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Account for restart interval (no-op if not using restarts) */ entropy->restarts_to_go--; - return TRUE; + return true; } @@ -371,7 +371,7 @@ decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) * or first pass of successive approximation). */ -METHODDEF(boolean) +METHODDEF(bool) decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -387,7 +387,7 @@ decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) if (cinfo->restart_interval) { if (entropy->restarts_to_go == 0) if (!process_restart(cinfo)) - return FALSE; + return false; } /* If we've run out of data, just leave the MCU set to zeroes. @@ -410,12 +410,12 @@ decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) tbl = entropy->ac_derived_tbl; for (k = cinfo->Ss; k <= Se; k++) { - HUFF_DECODE(s, br_state, tbl, return FALSE, label2); + HUFF_DECODE(s, br_state, tbl, return false, label2); r = s >> 4; s &= 15; if (s) { k += r; - CHECK_BIT_BUFFER(br_state, s, return FALSE); + CHECK_BIT_BUFFER(br_state, s, return false); r = GET_BITS(s); s = HUFF_EXTEND(r, s); /* Scale and output coefficient in natural (dezigzagged) order */ @@ -428,7 +428,7 @@ decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) else { /* EOBr, run length is 2^r + appended bits */ EOBRUN = 1 << r; if (r) { /* EOBr, r > 0 */ - CHECK_BIT_BUFFER(br_state, r, return FALSE); + CHECK_BIT_BUFFER(br_state, r, return false); r = GET_BITS(r); EOBRUN += r; } @@ -448,7 +448,7 @@ decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Account for restart interval (no-op if not using restarts) */ entropy->restarts_to_go--; - return TRUE; + return true; } @@ -458,7 +458,7 @@ decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) * is not very clear on the point. */ -METHODDEF(boolean) +METHODDEF(bool) decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -471,7 +471,7 @@ decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) if (cinfo->restart_interval) { if (entropy->restarts_to_go == 0) if (!process_restart(cinfo)) - return FALSE; + return false; } /* Not worth the cycles to check insufficient_data here, @@ -487,7 +487,7 @@ decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) block = MCU_data[blkn]; /* Encoded data is simply the next bit of the two's-complement DC value */ - CHECK_BIT_BUFFER(br_state, 1, return FALSE); + CHECK_BIT_BUFFER(br_state, 1, return false); if (GET_BITS(1)) (*block)[0] |= p1; /* Note: since we use |=, repeating the assignment later is safe */ @@ -499,7 +499,7 @@ decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Account for restart interval (no-op if not using restarts) */ entropy->restarts_to_go--; - return TRUE; + return true; } @@ -510,7 +510,7 @@ decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshift-negative-value" #endif -METHODDEF(boolean) +METHODDEF(bool) decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) { phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy; @@ -530,7 +530,7 @@ decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) if (cinfo->restart_interval) { if (entropy->restarts_to_go == 0) if (!process_restart(cinfo)) - return FALSE; + return false; } /* If we've run out of data, don't modify the MCU. @@ -647,14 +647,14 @@ decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW* MCU_data) /* Account for restart interval (no-op if not using restarts) */ entropy->restarts_to_go--; - return TRUE; + return true; undoit: /* Re-zero any output coefficients that we made newly nonzero */ while (num_newnz > 0) (*block)[newnz_pos[--num_newnz]] = 0; - return FALSE; + return false; } #if __GNUC__ > 6 #pragma GCC diagnostic pop diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdpostct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdpostct.c index d2ac4dece2..e112925f3d 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdpostct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdpostct.c @@ -254,7 +254,7 @@ post_process_2pass(j_decompress_ptr cinfo, */ GLOBAL(void) -jinit_d_post_controller(j_decompress_ptr cinfo, boolean need_full_buffer) +jinit_d_post_controller(j_decompress_ptr cinfo, bool need_full_buffer) { my_post_ptr post; diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdsample.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdsample.c index aca7f06d77..8ab1df9959 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdsample.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdsample.c @@ -1254,7 +1254,7 @@ jinit_upsampler(j_decompress_ptr cinfo) my_upsample_ptr upsample; int ci; jpeg_component_info* compptr; - boolean need_buffer, do_fancy; + bool need_buffer, do_fancy; int h_in_group, v_in_group, h_out_group, v_out_group; upsample = (my_upsample_ptr) @@ -1263,7 +1263,7 @@ jinit_upsampler(j_decompress_ptr cinfo) cinfo->upsample = (struct jpeg_upsampler*) upsample; upsample->pub.start_pass = start_pass_upsample; upsample->pub.upsample = sep_upsample; - upsample->pub.need_context_rows = FALSE; /* until we find out differently */ + upsample->pub.need_context_rows = false; /* until we find out differently */ if (cinfo->CCIR601_sampling) /* this isn't supported */ ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); @@ -1288,16 +1288,16 @@ jinit_upsampler(j_decompress_ptr cinfo) h_out_group = cinfo->max_h_samp_factor; v_out_group = cinfo->max_v_samp_factor; upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ - need_buffer = TRUE; + need_buffer = true; if (!compptr->component_needed) { /* Don't bother to upsample an uninteresting component. */ upsample->methods[ci] = noop_upsample; - need_buffer = FALSE; + need_buffer = false; } else if (h_in_group == h_out_group && v_in_group == v_out_group) { /* Fullsize components can be processed without any work. */ upsample->methods[ci] = fullsize_upsample; - need_buffer = FALSE; + need_buffer = false; } else if (h_in_group * 2 == h_out_group && v_in_group == v_out_group) { @@ -1312,7 +1312,7 @@ jinit_upsampler(j_decompress_ptr cinfo) /* Special cases for 2h2v upsampling */ if (do_fancy && compptr->downsampled_width > 2) { upsample->methods[ci] = h2v2_fancy_upsample; - upsample->pub.need_context_rows = TRUE; + upsample->pub.need_context_rows = true; } else upsample->methods[ci] = h2v2_upsample; diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c index fb9bd4aa37..f29908c3f7 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c @@ -102,7 +102,7 @@ LOCAL(void) transdecode_master_selection(j_decompress_ptr cinfo) { /* This is effectively a buffered-image operation. */ - cinfo->buffered_image = TRUE; + cinfo->buffered_image = true; /* Entropy decoding: either Huffman or arithmetic coding. */ if (cinfo->arith_code) { diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jerror.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jerror.c index 36d4dc0a66..727f916cac 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jerror.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jerror.c @@ -172,7 +172,7 @@ format_message(j_common_ptr cinfo, char* buffer) const char* msgtext = NULL; const char* msgptr; char ch; - boolean isstring; + bool isstring; /* Look up message string in proper table */ if (msg_code > 0 && msg_code <= err->last_jpeg_message) { @@ -191,11 +191,11 @@ format_message(j_common_ptr cinfo, char* buffer) } /* Check for string parameter, as indicated by %s in the message text */ - isstring = FALSE; + isstring = false; msgptr = msgtext; while ((ch = *msgptr++) != '\0') { if (ch == '%') { - if (*msgptr == 's') isstring = TRUE; + if (*msgptr == 's') isstring = true; break; } } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c index 6399e4fafd..f0b0f062b8 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c @@ -171,9 +171,9 @@ struct jvirt_sarray_control { JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ JDIMENSION cur_start_row; /* first logical row # in the buffer */ JDIMENSION first_undef_row; /* row # of first uninitialized row */ - boolean pre_zero; /* pre-zero mode requested? */ - boolean dirty; /* do current buffer contents need written? */ - boolean b_s_open; /* is backing-store data valid? */ + bool pre_zero; /* pre-zero mode requested? */ + bool dirty; /* do current buffer contents need written? */ + bool b_s_open; /* is backing-store data valid? */ jvirt_sarray_ptr next; /* link to next virtual sarray control block */ backing_store_info b_s_info; /* System-dependent control info */ }; @@ -187,9 +187,9 @@ struct jvirt_barray_control { JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ JDIMENSION cur_start_row; /* first logical row # in the buffer */ JDIMENSION first_undef_row; /* row # of first uninitialized row */ - boolean pre_zero; /* pre-zero mode requested? */ - boolean dirty; /* do current buffer contents need written? */ - boolean b_s_open; /* is backing-store data valid? */ + bool pre_zero; /* pre-zero mode requested? */ + bool dirty; /* do current buffer contents need written? */ + bool b_s_open; /* is backing-store data valid? */ jvirt_barray_ptr next; /* link to next virtual barray control block */ backing_store_info b_s_info; /* System-dependent control info */ }; @@ -537,7 +537,7 @@ alloc_barray(j_common_ptr cinfo, int pool_id, METHODDEF(jvirt_sarray_ptr) -request_virt_sarray(j_common_ptr cinfo, int pool_id, boolean pre_zero, +request_virt_sarray(j_common_ptr cinfo, int pool_id, bool pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess) /* Request a virtual 2-D sample array */ @@ -558,7 +558,7 @@ request_virt_sarray(j_common_ptr cinfo, int pool_id, boolean pre_zero, result->samplesperrow = samplesperrow; result->maxaccess = maxaccess; result->pre_zero = pre_zero; - result->b_s_open = FALSE; /* no associated backing-store object */ + result->b_s_open = false; /* no associated backing-store object */ result->next = mem->virt_sarray_list; /* add to list of virtual arrays */ mem->virt_sarray_list = result; @@ -567,7 +567,7 @@ request_virt_sarray(j_common_ptr cinfo, int pool_id, boolean pre_zero, METHODDEF(jvirt_barray_ptr) -request_virt_barray(j_common_ptr cinfo, int pool_id, boolean pre_zero, +request_virt_barray(j_common_ptr cinfo, int pool_id, bool pre_zero, JDIMENSION blocksperrow, JDIMENSION numrows, JDIMENSION maxaccess) /* Request a virtual 2-D coefficient-block array */ @@ -588,7 +588,7 @@ request_virt_barray(j_common_ptr cinfo, int pool_id, boolean pre_zero, result->blocksperrow = blocksperrow; result->maxaccess = maxaccess; result->pre_zero = pre_zero; - result->b_s_open = FALSE; /* no associated backing-store object */ + result->b_s_open = false; /* no associated backing-store object */ result->next = mem->virt_barray_list; /* add to list of virtual arrays */ mem->virt_barray_list = result; @@ -667,14 +667,14 @@ realize_virt_arrays(j_common_ptr cinfo) (long)sptr->rows_in_array * (long)sptr->samplesperrow * (long)SIZEOF(JSAMPLE)); - sptr->b_s_open = TRUE; + sptr->b_s_open = true; } sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE, sptr->samplesperrow, sptr->rows_in_mem); sptr->rowsperchunk = mem->last_rowsperchunk; sptr->cur_start_row = 0; sptr->first_undef_row = 0; - sptr->dirty = FALSE; + sptr->dirty = false; } } @@ -692,21 +692,21 @@ realize_virt_arrays(j_common_ptr cinfo) (long)bptr->rows_in_array * (long)bptr->blocksperrow * (long)SIZEOF(JBLOCK)); - bptr->b_s_open = TRUE; + bptr->b_s_open = true; } bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE, bptr->blocksperrow, bptr->rows_in_mem); bptr->rowsperchunk = mem->last_rowsperchunk; bptr->cur_start_row = 0; bptr->first_undef_row = 0; - bptr->dirty = FALSE; + bptr->dirty = false; } } } LOCAL(void) -do_sarray_io(j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing) +do_sarray_io(j_common_ptr cinfo, jvirt_sarray_ptr ptr, bool writing) /* Do backing store read or write of a virtual sample array */ { long bytesperrow, file_offset, byte_count, rows, thisrow, i; @@ -739,7 +739,7 @@ do_sarray_io(j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing) LOCAL(void) -do_barray_io(j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing) +do_barray_io(j_common_ptr cinfo, jvirt_barray_ptr ptr, bool writing) /* Do backing store read or write of a virtual coefficient-block array */ { long bytesperrow, file_offset, byte_count, rows, thisrow, i; @@ -774,7 +774,7 @@ do_barray_io(j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing) METHODDEF(JSAMPARRAY) access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, - boolean writable) + bool writable) /* Access the part of a virtual sample array starting at start_row */ /* and extending for num_rows rows. writable is true if */ /* caller intends to modify the accessed area. */ @@ -795,7 +795,7 @@ access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, /* Flush old buffer contents if necessary */ if (ptr->dirty) { do_sarray_io(cinfo, ptr, TRUE); - ptr->dirty = FALSE; + ptr->dirty = false; } /* Decide what part of virtual array to access. * Algorithm: if target address > current window, assume forward scan, @@ -853,7 +853,7 @@ access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, } /* Flag the buffer dirty if caller will write in it */ if (writable) - ptr->dirty = TRUE; + ptr->dirty = true; /* Return address of proper part of the buffer */ return ptr->mem_buffer + (start_row - ptr->cur_start_row); } @@ -862,7 +862,7 @@ access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, METHODDEF(JBLOCKARRAY) access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, - boolean writable) + bool writable) /* Access the part of a virtual block array starting at start_row */ /* and extending for num_rows rows. writable is true if */ /* caller intends to modify the accessed area. */ @@ -883,7 +883,7 @@ access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr, /* Flush old buffer contents if necessary */ if (ptr->dirty) { do_barray_io(cinfo, ptr, TRUE); - ptr->dirty = FALSE; + ptr->dirty = false; } /* Decide what part of virtual array to access. * Algorithm: if target address > current window, assume forward scan, @@ -941,7 +941,7 @@ access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr, } /* Flag the buffer dirty if caller will write in it */ if (writable) - ptr->dirty = TRUE; + ptr->dirty = true; /* Return address of proper part of the buffer */ return ptr->mem_buffer + (start_row - ptr->cur_start_row); } @@ -974,14 +974,14 @@ free_pool(j_common_ptr cinfo, int pool_id) for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { if (sptr->b_s_open) { /* there may be no backing store */ - sptr->b_s_open = FALSE; /* prevent recursive close if error */ + sptr->b_s_open = false; /* prevent recursive close if error */ (*sptr->b_s_info.close_backing_store) (cinfo, &sptr->b_s_info); } } mem->virt_sarray_list = NULL; for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { if (bptr->b_s_open) { /* there may be no backing store */ - bptr->b_s_open = FALSE; /* prevent recursive close if error */ + bptr->b_s_open = false; /* prevent recursive close if error */ (*bptr->b_s_info.close_backing_store) (cinfo, &bptr->b_s_info); } } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemnanoclr.cpp b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemnanoclr.cpp index 85fca186f8..b9f5dcf83b 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemnanoclr.cpp +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemnanoclr.cpp @@ -16,11 +16,6 @@ extern "C" #include "jpeglib.h" #include "jmemsys.h" - // elimnate error due to redefinition of these in the targetHAL.h -#undef TRUE -#undef FALSE -#undef NULL - } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmorecfg.h b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmorecfg.h index 9bf1ae5c91..266341a345 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmorecfg.h +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmorecfg.h @@ -230,25 +230,6 @@ typedef unsigned int JDIMENSION; #define FAR #endif - - /* - * On a few systems, type boolean and/or its values FALSE, TRUE may appear - * in standard header files. Or you may have conflicts with application- - * specific header files that you want to include together with these files. - * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. - */ - -#ifndef HAVE_BOOLEAN -typedef int boolean; -#endif -#ifndef FALSE /* in case these macros already exist */ -#define FALSE 0 /* values of boolean */ -#endif -#ifndef TRUE -#define TRUE 1 -#endif - - /* * The remaining options affect code selection within the JPEG library, * but they don't need to be visible to most applications using the library. diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jpegint.h b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jpegint.h index abc3371ed2..079c08fce8 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jpegint.h +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jpegint.h @@ -54,8 +54,8 @@ struct jpeg_comp_master { JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); /* State variables made visible to other modules */ - boolean call_pass_startup; /* True if pass_startup must be called */ - boolean is_last_pass; /* True during last pass */ + bool call_pass_startup; /* True if pass_startup must be called */ + bool is_last_pass; /* True during last pass */ }; /* Main buffer control (downsampled-data buffer) */ @@ -81,7 +81,7 @@ struct jpeg_c_prep_controller { /* Coefficient buffer control */ struct jpeg_c_coef_controller { JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(boolean, compress_data, (j_compress_ptr cinfo, + JMETHOD(bool, compress_data, (j_compress_ptr cinfo, JSAMPIMAGE input_buf)); }; @@ -101,7 +101,7 @@ struct jpeg_downsampler { JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)); - boolean need_context_rows; /* TRUE if need rows above & below */ + bool need_context_rows; /* TRUE if need rows above & below */ }; /* Forward DCT (also controls coefficient quantization) */ @@ -117,8 +117,8 @@ struct jpeg_forward_dct { /* Entropy encoding */ struct jpeg_entropy_encoder { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics)); - JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW* MCU_data)); + JMETHOD(void, start_pass, (j_compress_ptr cinfo, bool gather_statistics)); + JMETHOD(bool, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW* MCU_data)); JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); }; @@ -145,7 +145,7 @@ struct jpeg_decomp_master { JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo)); /* State variables made visible to other modules */ - boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ + bool is_dummy_pass; /* True during 1st pass for 2-pass quant */ }; /* Input control module */ @@ -156,8 +156,8 @@ struct jpeg_input_controller { JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo)); /* State variables made visible to other modules */ - boolean has_multiple_scans; /* True if file has multiple scans */ - boolean eoi_reached; /* True when EOI has been consumed */ + bool has_multiple_scans; /* True if file has multiple scans */ + bool eoi_reached; /* True when EOI has been consumed */ }; /* Main buffer control (downsampled-data buffer) */ @@ -206,8 +206,8 @@ struct jpeg_marker_reader { /* State of marker reader --- nominally internal, but applications * supplying COM or APPn handlers might like to know the state. */ - boolean saw_SOI; /* found SOI? */ - boolean saw_SOF; /* found SOF? */ + bool saw_SOI; /* found SOI? */ + bool saw_SOF; /* found SOF? */ int next_restart_num; /* next restart number expected (0-7) */ unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ }; @@ -215,12 +215,12 @@ struct jpeg_marker_reader { /* Entropy decoding */ struct jpeg_entropy_decoder { JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, + JMETHOD(bool, decode_mcu, (j_decompress_ptr cinfo, JBLOCKROW* MCU_data)); /* This is here to share code between baseline and progressive decoders; */ /* other modules probably should not use it */ - boolean insufficient_data; /* set TRUE after emitting warning */ + bool insufficient_data; /* set TRUE after emitting warning */ }; /* Inverse DCT (also performs dequantization) */ @@ -246,7 +246,7 @@ struct jpeg_upsampler { JDIMENSION* out_row_ctr, JDIMENSION out_rows_avail)); - boolean need_context_rows; /* TRUE if need rows above & below */ + bool need_context_rows; /* TRUE if need rows above & below */ }; /* Colorspace conversion */ @@ -259,7 +259,7 @@ struct jpeg_color_deconverter { /* Color quantization or color precision reduction */ struct jpeg_color_quantizer { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan)); + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, bool is_pre_scan)); JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)); @@ -340,13 +340,13 @@ struct jpeg_color_quantizer { /* Compression module initialization routines */ EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo, - boolean transcode_only)); + bool transcode_only)); EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); + bool need_full_buffer)); EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); + bool need_full_buffer)); EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo, - boolean need_full_buffer)); + bool need_full_buffer)); EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); @@ -356,11 +356,11 @@ EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); /* Decompression module initialization routines */ EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); + bool need_full_buffer)); EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); + bool need_full_buffer)); EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, - boolean need_full_buffer)); + bool need_full_buffer)); EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo)); @@ -397,4 +397,3 @@ struct jvirt_sarray_control { long dummy; }; struct jvirt_barray_control { long dummy; }; #endif #endif /* INCOMPLETE_TYPES_BROKEN */ - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jpeglib.h b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jpeglib.h index 0c0fbd17be..8c16e0065f 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jpeglib.h +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jpeglib.h @@ -98,7 +98,7 @@ typedef struct { * You could suppress output of a table by setting this to TRUE. * (See jpeg_suppress_tables for an example.) */ - boolean sent_table; /* TRUE when table has been output */ + bool sent_table; /* TRUE when table has been output */ } JQUANT_TBL; @@ -114,7 +114,7 @@ typedef struct { * You could suppress output of a table by setting this to TRUE. * (See jpeg_suppress_tables for an example.) */ - boolean sent_table; /* TRUE when table has been output */ + bool sent_table; /* TRUE when table has been output */ } JHUFF_TBL; @@ -164,7 +164,7 @@ typedef struct { * components will be ignored (eg grayscale output from YCbCr image), * we can skip most computations for the unused components. */ - boolean component_needed; /* do we need the value of this component? */ + bool component_needed; /* do we need the value of this component? */ /* These values are computed before starting a scan of the component. */ /* The decompressor output side may not use these variables. */ @@ -258,7 +258,7 @@ typedef enum { struct jpeg_memory_mgr * mem; /* Memory manager module */\ struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ void * client_data; /* Available for use by application */\ - boolean is_decompressor; /* So common code can tell which is which */\ + bool is_decompressor; /* So common code can tell which is which */\ int global_state /* For checking call sequence validity */ /* Routines that are to be used by both halves of the library are declared @@ -332,10 +332,10 @@ struct jpeg_compress_struct { * set num_scans and scan_info to point to an array of scan definitions. */ - boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + bool raw_data_in; /* TRUE=caller supplies downsampled data */ + bool arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + bool optimize_coding; /* TRUE=optimize entropy encoding parms */ + bool CCIR601_sampling; /* TRUE=first samples are cosited */ int smoothing_factor; /* 1..100, or 0 for no input smoothing */ J_DCT_METHOD dct_method; /* DCT algorithm selector */ @@ -349,7 +349,7 @@ struct jpeg_compress_struct { /* Parameters controlling emission of special markers. */ - boolean write_JFIF_header; /* should a JFIF marker be written? */ + bool write_JFIF_header; /* should a JFIF marker be written? */ CLR_UINT8 JFIF_major_version; /* What to write for the JFIF version number */ CLR_UINT8 JFIF_minor_version; /* These three values are not used by the JPEG code, merely copied */ @@ -359,7 +359,7 @@ struct jpeg_compress_struct { CLR_UINT8 density_unit; /* JFIF code for pixel size units */ CLR_UINT16 X_density; /* Horizontal pixel density */ CLR_UINT16 Y_density; /* Vertical pixel density */ - boolean write_Adobe_marker; /* should an Adobe marker be written? */ + bool write_Adobe_marker; /* should an Adobe marker be written? */ /* State variable: index of next scanline to be written to * jpeg_write_scanlines(). Application may use this to control its @@ -375,7 +375,7 @@ struct jpeg_compress_struct { /* * These fields are computed during compression startup */ - boolean progressive_mode; /* TRUE if scan script uses progressive mode */ + bool progressive_mode; /* TRUE if scan script uses progressive mode */ int max_h_samp_factor; /* largest h_samp_factor */ int max_v_samp_factor; /* largest v_samp_factor */ @@ -448,22 +448,22 @@ struct jpeg_decompress_struct { double output_gamma; /* image gamma wanted in output */ - boolean buffered_image; /* TRUE=multiple output passes */ - boolean raw_data_out; /* TRUE=downsampled data wanted */ + bool buffered_image; /* TRUE=multiple output passes */ + bool raw_data_out; /* TRUE=downsampled data wanted */ J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ + bool do_fancy_upsampling; /* TRUE=apply fancy upsampling */ + bool do_block_smoothing; /* TRUE=apply interblock smoothing */ - boolean quantize_colors; /* TRUE=colormapped output wanted */ + bool quantize_colors; /* TRUE=colormapped output wanted */ /* the following are ignored if not quantize_colors: */ J_DITHER_MODE dither_mode; /* type of color dithering to use */ - boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ + bool two_pass_quantize; /* TRUE=use two-pass color quantization */ int desired_number_of_colors; /* max # colors to use in created colormap */ /* these are significant only in buffered-image mode: */ - boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ - boolean enable_external_quant;/* enable future use of external colormap */ - boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ + bool enable_1pass_quant; /* enable future use of 1-pass quantizer */ + bool enable_external_quant;/* enable future use of external colormap */ + bool enable_2pass_quant; /* enable future use of 2-pass quantizer */ /* Description of actual output image that will be returned to application. * These fields are computed by jpeg_start_decompress(). @@ -555,8 +555,8 @@ struct jpeg_decompress_struct { jpeg_component_info * comp_info; /* comp_info[i] describes component that appears i'th in SOF */ - boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + bool progressive_mode; /* TRUE if SOFn specifies progressive mode */ + bool arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ CLR_UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ CLR_UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ @@ -567,17 +567,17 @@ struct jpeg_decompress_struct { /* These fields record data obtained from optional markers recognized by * the JPEG library. */ - boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ + bool saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ CLR_UINT8 JFIF_major_version; /* JFIF version number */ CLR_UINT8 JFIF_minor_version; CLR_UINT8 density_unit; /* JFIF code for pixel size units */ CLR_UINT16 X_density; /* Horizontal pixel density */ CLR_UINT16 Y_density; /* Vertical pixel density */ - boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ + bool saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ CLR_UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + bool CCIR601_sampling; /* TRUE=first samples are cosited */ /* Aside from the specific data retained from APPn markers known to the * library, the uninterpreted contents of any or all APPn and COM markers @@ -735,7 +735,7 @@ struct jpeg_destination_mgr { CLR_INT32 free_in_buffer; /* # of byte spaces remaining in buffer */ JMETHOD(void, init_destination, (j_compress_ptr cinfo)); - JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); + JMETHOD(bool, empty_output_buffer, (j_compress_ptr cinfo)); JMETHOD(void, term_destination, (j_compress_ptr cinfo)); }; @@ -747,9 +747,9 @@ struct jpeg_source_mgr { CLR_INT32 bytes_in_buffer; /* # of bytes remaining in buffer */ JMETHOD(void, init_source, (j_decompress_ptr cinfo)); - JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); + JMETHOD(bool, fill_input_buffer, (j_decompress_ptr cinfo)); JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); - JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); + JMETHOD(bool, resync_to_restart, (j_decompress_ptr cinfo, int desired)); JMETHOD(void, term_source, (j_decompress_ptr cinfo)); }; @@ -787,13 +787,13 @@ struct jpeg_memory_mgr { JDIMENSION numrows)); JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, int pool_id, - boolean pre_zero, + bool pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess)); JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, int pool_id, - boolean pre_zero, + bool pre_zero, JDIMENSION blocksperrow, JDIMENSION numrows, JDIMENSION maxaccess)); @@ -802,12 +802,12 @@ struct jpeg_memory_mgr { jvirt_sarray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, - boolean writable)); + bool writable)); JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, jvirt_barray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, - boolean writable)); + bool writable)); JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); JMETHOD(void, self_destruct, (j_common_ptr cinfo)); @@ -826,7 +826,7 @@ struct jpeg_memory_mgr { /* Routine signature for application-supplied marker processing methods. * Need not pass marker code since it is stored in cinfo->unread_marker. */ -typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); +typedef JMETHOD(bool, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); /* Declarations for routines called by application. @@ -939,24 +939,24 @@ EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, J_COLOR_SPACE colorspace)); EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, - boolean force_baseline)); + bool force_baseline)); EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, int scale_factor, - boolean force_baseline)); + bool force_baseline)); EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, - boolean force_baseline)); + bool force_baseline)); EXTERN(int) jpeg_quality_scaling JPP((int quality)); EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, - boolean suppress)); + bool suppress)); EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); /* Main entry points for compression */ EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, - boolean write_all_tables)); + bool write_all_tables)); EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines)); @@ -982,7 +982,7 @@ EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); /* Decompression startup: read start of JPEG datastream to see what's there */ EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, - boolean require_image)); + bool require_image)); /* Return value is one of: */ #define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ #define JPEG_HEADER_OK 1 /* Found valid image datastream */ @@ -994,11 +994,11 @@ EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, */ /* Main entry points for decompression */ -EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(bool) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines)); -EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(bool) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); /* Replaces jpeg_read_scanlines when reading raw downsampled data. */ EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, @@ -1006,11 +1006,11 @@ EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, JDIMENSION max_lines)); /* Additional entry points for buffered-image mode. */ -EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, +EXTERN(bool) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); +EXTERN(bool) jpeg_start_output JPP((j_decompress_ptr cinfo, int scan_number)); -EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); -EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); +EXTERN(bool) jpeg_finish_output JPP((j_decompress_ptr cinfo)); +EXTERN(bool) jpeg_input_complete JPP((j_decompress_ptr cinfo)); EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); /* Return value is one of: */ @@ -1059,7 +1059,7 @@ EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); /* Default restart-marker-resync procedure for use by data source modules */ -EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, +EXTERN(bool) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, int desired)); @@ -1119,4 +1119,3 @@ struct jpeg_color_quantizer { long dummy; }; #endif #endif /* JPEGLIB_H */ - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c index de7ac1bbff..1055da0ac8 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c @@ -157,7 +157,7 @@ typedef struct { * premultiplied as described above. Since colormap indexes must fit into * JSAMPLEs, the entries of this array will too. */ - boolean is_padded; /* is the colorindex padded for odither? */ + bool is_padded; /* is the colorindex padded for odither? */ int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */ @@ -167,7 +167,7 @@ typedef struct { /* Variables for Floyd-Steinberg dithering */ FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */ - boolean on_odd_row; /* flag to remember which row we are on */ + bool on_odd_row; /* flag to remember which row we are on */ } my_cquantizer; typedef my_cquantizer* my_cquantize_ptr; @@ -197,7 +197,7 @@ select_ncolors(j_decompress_ptr cinfo, int Ncolors[]) int nc = cinfo->out_color_components; /* number of color components */ int max_colors = cinfo->desired_number_of_colors; int total_colors, iroot, i, j; - boolean changed; + bool changed; long temp; static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE }; @@ -229,7 +229,7 @@ select_ncolors(j_decompress_ptr cinfo, int Ncolors[]) * In RGB colorspace, try to increment G first, then R, then B. */ do { - changed = FALSE; + changed = false; for (i = 0; i < nc; i++) { j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i); /* calculate new total_colors if Ncolors[j] is incremented */ @@ -239,7 +239,7 @@ select_ncolors(j_decompress_ptr cinfo, int Ncolors[]) break; /* won't fit, done with this pass */ Ncolors[j]++; /* OK, apply the increment */ total_colors = (int)temp; - changed = TRUE; + changed = true; } } while (changed); @@ -349,11 +349,11 @@ create_colorindex(j_decompress_ptr cinfo) */ if (cinfo->dither_mode == JDITHER_ORDERED) { pad = MAXJSAMPLE * 2; - cquantize->is_padded = TRUE; + cquantize->is_padded = true; } else { pad = 0; - cquantize->is_padded = FALSE; + cquantize->is_padded = false; } cquantize->colorindex = (*cinfo->mem->alloc_sarray) @@ -746,7 +746,7 @@ alloc_fs_workspace(j_decompress_ptr cinfo) */ METHODDEF(void) -start_pass_1_quant(j_decompress_ptr cinfo, boolean is_pre_scan) +start_pass_1_quant(j_decompress_ptr cinfo, bool is_pre_scan) { my_cquantize_ptr cquantize = (my_cquantize_ptr)cinfo->cquantize; CLR_INT32 arraysize; @@ -782,7 +782,7 @@ start_pass_1_quant(j_decompress_ptr cinfo, boolean is_pre_scan) break; case JDITHER_FS: cquantize->pub.color_quantize = quantize_fs_dither; - cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */ + cquantize->on_odd_row = false; /* initialize state for F-S dither */ /* Allocate Floyd-Steinberg workspace if didn't already. */ if (cquantize->fserrors[0] == NULL) alloc_fs_workspace(cinfo); @@ -862,4 +862,3 @@ jinit_1pass_quantizer(j_decompress_ptr cinfo) } #endif /* QUANT_1PASS_SUPPORTED */ - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant2.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant2.c index 6455df8cb8..334cf7df1a 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant2.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant2.c @@ -206,11 +206,11 @@ typedef struct { /* Variables for accumulating image statistics */ hist3d histogram; /* pointer to the histogram */ - boolean needs_zeroed; /* TRUE if next pass must zero histogram */ + bool needs_zeroed; /* TRUE if next pass must zero histogram */ /* Variables for Floyd-Steinberg dithering */ FSERRPTR fserrors; /* accumulated errors */ - boolean on_odd_row; /* flag to remember which row we are on */ + bool on_odd_row; /* flag to remember which row we are on */ int* error_limiter; /* table for clamping the applied error */ } my_cquantizer; @@ -997,14 +997,14 @@ pass2_fs_dither(j_decompress_ptr cinfo, dir = -1; dir3 = -3; errorptr = cquantize->fserrors + (width + 1) * 3; /* => entry after last column */ - cquantize->on_odd_row = FALSE; /* flip for next time */ + cquantize->on_odd_row = false; /* flip for next time */ } else { /* work left to right in this row */ dir = 1; dir3 = 3; errorptr = cquantize->fserrors; /* => entry before first real column */ - cquantize->on_odd_row = TRUE; /* flip for next time */ + cquantize->on_odd_row = true; /* flip for next time */ } /* Preset error values: no error propagated to first pixel from left */ cur0 = cur1 = cur2 = 0; @@ -1165,7 +1165,7 @@ finish_pass1(j_decompress_ptr cinfo) cinfo->colormap = cquantize->sv_colormap; select_colors(cinfo, cquantize->desired); /* Force next pass to zero the color index table */ - cquantize->needs_zeroed = TRUE; + cquantize->needs_zeroed = true; } @@ -1181,7 +1181,7 @@ finish_pass2(j_decompress_ptr cinfo) */ METHODDEF(void) -start_pass_2_quant(j_decompress_ptr cinfo, boolean is_pre_scan) +start_pass_2_quant(j_decompress_ptr cinfo, bool is_pre_scan) { my_cquantize_ptr cquantize = (my_cquantize_ptr)cinfo->cquantize; hist3d histogram = cquantize->histogram; @@ -1196,7 +1196,7 @@ start_pass_2_quant(j_decompress_ptr cinfo, boolean is_pre_scan) /* Set up method pointers */ cquantize->pub.color_quantize = prescan_quantize; cquantize->pub.finish_pass = finish_pass1; - cquantize->needs_zeroed = TRUE; /* Always zero histogram */ + cquantize->needs_zeroed = true; /* Always zero histogram */ } else { /* Set up method pointers */ @@ -1225,7 +1225,7 @@ start_pass_2_quant(j_decompress_ptr cinfo, boolean is_pre_scan) /* Make the error-limit table if we didn't already. */ if (cquantize->error_limiter == NULL) init_error_limit(cinfo); - cquantize->on_odd_row = FALSE; + cquantize->on_odd_row = false; } } @@ -1235,7 +1235,7 @@ start_pass_2_quant(j_decompress_ptr cinfo, boolean is_pre_scan) jzero_far((void FAR*) histogram[i], HIST_C1_ELEMS * HIST_C2_ELEMS * SIZEOF(histcell)); } - cquantize->needs_zeroed = FALSE; + cquantize->needs_zeroed = false; } } @@ -1250,7 +1250,7 @@ new_color_map_2_quant(j_decompress_ptr cinfo) my_cquantize_ptr cquantize = (my_cquantize_ptr)cinfo->cquantize; /* Reset the inverse color map */ - cquantize->needs_zeroed = TRUE; + cquantize->needs_zeroed = true; } @@ -1285,7 +1285,7 @@ jinit_2pass_quantizer(j_decompress_ptr cinfo) ((j_common_ptr)cinfo, JPOOL_IMAGE, HIST_C1_ELEMS * HIST_C2_ELEMS * SIZEOF(histcell)); } - cquantize->needs_zeroed = TRUE; /* histogram is garbage now */ + cquantize->needs_zeroed = true; /* histogram is garbage now */ /* Allocate storage for the completed colormap, if required. * We do this now since it is FAR storage and may affect @@ -1327,4 +1327,3 @@ jinit_2pass_quantizer(j_decompress_ptr cinfo) } #endif /* QUANT_2PASS_SUPPORTED */ - diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/transupp.h b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/transupp.h index adef8cefbd..ef78d8e555 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/transupp.h +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/transupp.h @@ -95,8 +95,8 @@ typedef enum { typedef struct { /* Options: set by caller */ JXFORM_CODE transform; /* image transform operator */ - boolean trim; /* if TRUE, trim partial MCUs as needed */ - boolean force_grayscale; /* if TRUE, convert color image to grayscale */ + bool trim; /* if TRUE, trim partial MCUs as needed */ + bool force_grayscale; /* if TRUE, convert color image to grayscale */ /* Internal workspace: caller should not touch these */ int num_components; /* # of components in workspace */ diff --git a/src/nanoFramework.Graphics/Graphics/Displays/ILI9341_240x320_SPI.cpp b/src/nanoFramework.Graphics/Graphics/Displays/ILI9341_240x320_SPI.cpp index 82b66593e7..dcd3af4789 100644 --- a/src/nanoFramework.Graphics/Graphics/Displays/ILI9341_240x320_SPI.cpp +++ b/src/nanoFramework.Graphics/Graphics/Displays/ILI9341_240x320_SPI.cpp @@ -256,7 +256,7 @@ bool DisplayDriver::Uninitialize() Clear(); // Anything else to Uninitialize? - return TRUE; + return true; } void DisplayDriver::PowerSave(PowerSaveState powerState) diff --git a/src/nanoFramework.Graphics/Graphics/Displays/ILI9341_XXXxYYY_SPI.cpp b/src/nanoFramework.Graphics/Graphics/Displays/ILI9341_XXXxYYY_SPI.cpp index 3e41b2692f..6c82c2b6c8 100644 --- a/src/nanoFramework.Graphics/Graphics/Displays/ILI9341_XXXxYYY_SPI.cpp +++ b/src/nanoFramework.Graphics/Graphics/Displays/ILI9341_XXXxYYY_SPI.cpp @@ -269,7 +269,7 @@ bool DisplayDriver::Uninitialize() Clear(); // Anything else to Uninitialize? - return TRUE; + return true; } void DisplayDriver::PowerSave(PowerSaveState powerState) diff --git a/src/nanoFramework.Graphics/Graphics/Displays/ILI9342_320x240_SPI.cpp b/src/nanoFramework.Graphics/Graphics/Displays/ILI9342_320x240_SPI.cpp index 38fa27a7da..8698b85ec1 100644 --- a/src/nanoFramework.Graphics/Graphics/Displays/ILI9342_320x240_SPI.cpp +++ b/src/nanoFramework.Graphics/Graphics/Displays/ILI9342_320x240_SPI.cpp @@ -204,7 +204,7 @@ bool DisplayDriver::Uninitialize() Clear(); // Anything else to Uninitialize? - return TRUE; + return true; } void DisplayDriver::PowerSave(PowerSaveState powerState) diff --git a/src/nanoFramework.Graphics/Graphics/Displays/ILI9488_480x320_SPI.cpp b/src/nanoFramework.Graphics/Graphics/Displays/ILI9488_480x320_SPI.cpp index c1a93634d0..11fc22edfb 100644 --- a/src/nanoFramework.Graphics/Graphics/Displays/ILI9488_480x320_SPI.cpp +++ b/src/nanoFramework.Graphics/Graphics/Displays/ILI9488_480x320_SPI.cpp @@ -208,7 +208,7 @@ bool DisplayDriver::Uninitialize() Clear(); // Anything else to Uninitialize? - return TRUE; + return true; } void DisplayDriver::PowerSave(PowerSaveState powerState) diff --git a/src/nanoFramework.Graphics/Graphics/Displays/SSD1306_128x64.cpp b/src/nanoFramework.Graphics/Graphics/Displays/SSD1306_128x64.cpp index 74130ba00e..ea79bce058 100644 --- a/src/nanoFramework.Graphics/Graphics/Displays/SSD1306_128x64.cpp +++ b/src/nanoFramework.Graphics/Graphics/Displays/SSD1306_128x64.cpp @@ -92,7 +92,7 @@ bool DisplayDriver::Uninitialize() { Clear(); // Anything else to Uninitialize? - return TRUE; + return true; } void DisplayDriver::PowerSave(PowerSaveState powerState) { diff --git a/src/nanoFramework.Graphics/Graphics/Displays/SSD1331_94x64_SPI.cpp b/src/nanoFramework.Graphics/Graphics/Displays/SSD1331_94x64_SPI.cpp index 635f5e0077..8988107486 100644 --- a/src/nanoFramework.Graphics/Graphics/Displays/SSD1331_94x64_SPI.cpp +++ b/src/nanoFramework.Graphics/Graphics/Displays/SSD1331_94x64_SPI.cpp @@ -199,7 +199,7 @@ bool DisplayDriver::Uninitialize() { Clear(); // Anything else to Uninitialize? - return TRUE; + return true; } void DisplayDriver::PowerSave(PowerSaveState powerState) diff --git a/src/nanoFramework.Graphics/Graphics/Displays/ST7735S_SPI.cpp b/src/nanoFramework.Graphics/Graphics/Displays/ST7735S_SPI.cpp index 9aa962e549..7869c8f795 100644 --- a/src/nanoFramework.Graphics/Graphics/Displays/ST7735S_SPI.cpp +++ b/src/nanoFramework.Graphics/Graphics/Displays/ST7735S_SPI.cpp @@ -208,7 +208,7 @@ bool DisplayDriver::Uninitialize() Clear(); // Anything else to Uninitialize? - return TRUE; + return true; } void DisplayDriver::PowerSave(PowerSaveState powerState) diff --git a/src/nanoFramework.Graphics/Graphics/Displays/ST7789V_240x320_SPI.cpp b/src/nanoFramework.Graphics/Graphics/Displays/ST7789V_240x320_SPI.cpp index fe563bb3a2..ac3dbed15f 100644 --- a/src/nanoFramework.Graphics/Graphics/Displays/ST7789V_240x320_SPI.cpp +++ b/src/nanoFramework.Graphics/Graphics/Displays/ST7789V_240x320_SPI.cpp @@ -186,7 +186,7 @@ bool DisplayDriver::Uninitialize() { Clear(); // Anything else to Uninitialize? - return TRUE; + return true; } void DisplayDriver::PowerSave(PowerSaveState powerState) { diff --git a/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp b/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp index 0ca7c808b1..1a71ff2f47 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp @@ -25,7 +25,7 @@ HRESULT GestureDriver::Initialize() m_gestureListener.m_palEventListener = EventListener; m_gestureListener.m_eventMask = PAL_EVENT_TOUCH | PAL_EVENT_MOUSE; PalEvent_Enlist(&m_gestureListener); - GestureDriver::s_initialized = TRUE; + GestureDriver::s_initialized = true; } return S_OK; } @@ -122,7 +122,7 @@ bool GestureDriver::ProcessPoint(CLR_UINT32 flags, CLR_UINT16 source, CLR_UINT16 m_startx = x; m_starty = y; - return TRUE; + return true; } CLR_INT16 dx = (CLR_INT16)x - (CLR_INT16)m_lastx; diff --git a/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp b/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp index 5009c65715..7ffa1c61d1 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp @@ -165,7 +165,7 @@ HRESULT TouchPanelDriver::GetDeviceCaps(unsigned int iIndex, void *lpOutput) return FALSE; } - return TRUE; + return true; } HRESULT TouchPanelDriver::ResetCalibration() @@ -852,5 +852,5 @@ bool TouchPanelDriver::CalibrationPointGet(TOUCH_PANEL_CALIBRATION_POINT *pTCP) return FALSE; } - return TRUE; + return true; } diff --git a/src/nanoFramework.Graphics/TouchPanel/Devices/STMPE811QTR_I2C.cpp b/src/nanoFramework.Graphics/TouchPanel/Devices/STMPE811QTR_I2C.cpp index f89c1214b2..43d62369f4 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Devices/STMPE811QTR_I2C.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Devices/STMPE811QTR_I2C.cpp @@ -74,7 +74,7 @@ bool TouchDevice::Enable(GPIO_INTERRUPT_SERVICE_ROUTINE touchIsrProc) } } */ - return TRUE; + return true; } bool TouchDevice::Disable() diff --git a/src/nanoFramework.Graphics/TouchPanel/Devices/XPT2046.cpp b/src/nanoFramework.Graphics/TouchPanel/Devices/XPT2046.cpp index 841786392b..4509ca57c0 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Devices/XPT2046.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Devices/XPT2046.cpp @@ -26,7 +26,7 @@ bool TouchDevice::Enable(GPIO_INTERRUPT_SERVICE_ROUTINE touchIsrProc) if (touchIsrProc == NULL) { }; - return TRUE; + return true; } bool TouchDevice::Disable() diff --git a/src/nanoFramework.Graphics/TouchPanel/Devices/ft6x06_I2C.cpp b/src/nanoFramework.Graphics/TouchPanel/Devices/ft6x06_I2C.cpp index 8cdc0ae929..144996002d 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Devices/ft6x06_I2C.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Devices/ft6x06_I2C.cpp @@ -68,7 +68,7 @@ bool TouchDevice::Enable(GPIO_INTERRUPT_SERVICE_ROUTINE touchIsrProc) g_TouchInterface.Write_Read(values, 2, 0); } } - return TRUE; + return true; } bool TouchDevice::Disable() diff --git a/targets/ChibiOS/ORGPAL_PALTHREE/target_littlefs.c b/targets/ChibiOS/ORGPAL_PALTHREE/target_littlefs.c index 08440fe074..c17fb35fb3 100644 --- a/targets/ChibiOS/ORGPAL_PALTHREE/target_littlefs.c +++ b/targets/ChibiOS/ORGPAL_PALTHREE/target_littlefs.c @@ -403,7 +403,7 @@ int32_t hal_lfs_prog_1( // target specific implementation of chip erase bool hal_lfs_erase_chip_1() { - return QSPI_Erase_Chip() == TRUE; + return QSPI_Erase_Chip() == true; } static bool QSPI_Erase_Chip() @@ -413,14 +413,14 @@ static bool QSPI_Erase_Chip() { if (QSPI_Erase_Block(i * W25Q128_SECTOR_SIZE) != QSPI_OK) { - return FALSE; + return false; } // reset watchdog Watchdog_Reset(); } - return TRUE; + return true; } static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi) diff --git a/targets/ChibiOS/ORGPAL_PALX/target_littlefs.c b/targets/ChibiOS/ORGPAL_PALX/target_littlefs.c index 67fedecc04..9ee56834de 100644 --- a/targets/ChibiOS/ORGPAL_PALX/target_littlefs.c +++ b/targets/ChibiOS/ORGPAL_PALX/target_littlefs.c @@ -115,7 +115,7 @@ int32_t hal_lfs_prog_0( // target specific implementation of chip erase bool hal_lfs_erase_chip_0() { - return QSPI_Erase_Chip() == TRUE; + return QSPI_Erase_Chip() == true; } static bool QSPI_Erase_Chip() @@ -125,14 +125,14 @@ static bool QSPI_Erase_Chip() { if (QSPI_Erase_Block(i * W25Q512_SECTOR_SIZE) != QSPI_OK) { - return FALSE; + return false; } // reset watchdog Watchdog_Reset(); } - return TRUE; + return true; } static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi) diff --git a/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp b/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp index a04406f40a..d3b6f1fb50 100644 --- a/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp +++ b/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp @@ -51,7 +51,7 @@ static void FreeFatFsByVolumeId(const VOLUME_ID *volumeId); bool FATFS_FS_Driver::LoadMedia(const void *driverInterface) { (void)driverInterface; - return TRUE; + return true; } STREAM_DRIVER_DETAILS *FATFS_FS_Driver::DriverDetails(const VOLUME_ID *volume) @@ -59,7 +59,7 @@ STREAM_DRIVER_DETAILS *FATFS_FS_Driver::DriverDetails(const VOLUME_ID *volume) (void)volume; static STREAM_DRIVER_DETAILS driverDetail = - {DRIVER_BUFFERED_IO, fatfs_inputBuffer, fatfs_outputBuffer, FF_MAX_SS, FF_MAX_SS, TRUE, TRUE, TRUE, 0, 0}; + {DRIVER_BUFFERED_IO, fatfs_inputBuffer, fatfs_outputBuffer, FF_MAX_SS, FF_MAX_SS, true, true, true, 0, 0}; return &driverDetail; } @@ -94,7 +94,7 @@ bool FATFS_FS_Driver::InitializeVolume(const VOLUME_ID *volume, const char *path // try mounting the volume if (f_mount(fs, path, 1) == FR_OK) { - return TRUE; + return true; } // something went wrong, unmount the volume... @@ -131,7 +131,7 @@ bool FATFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) // free assigned volume FreeFatFsByVolumeId(volume); - return TRUE; + return true; } HRESULT FATFS_FS_Driver::Format(const VOLUME_ID *volume, const char *volumeLabel, uint32_t parameters) diff --git a/targets/ChibiOS/_FatFs/fatfs_syscall.c b/targets/ChibiOS/_FatFs/fatfs_syscall.c index 9c10725484..e1389e3fea 100644 --- a/targets/ChibiOS/_FatFs/fatfs_syscall.c +++ b/targets/ChibiOS/_FatFs/fatfs_syscall.c @@ -66,7 +66,7 @@ int ff_mutex_create ( /* Returns 1:Function succeeded or 0:Could not create the ) { chSemObjectInit(&Mutex[vol], 1); - return TRUE; + return true; } diff --git a/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp b/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp index 5470b8d478..5c929df655 100644 --- a/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp @@ -260,7 +260,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( // copy the config block content to the pointer in the argument memcpy(configurationBlock, blockAddress, sizeOfBlock); - return TRUE; + return true; } // Stores the configuration block to the configuration flash sector @@ -684,7 +684,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock { #if defined(RP2040) || defined(RP2350) // RP2040 has 4KB erase sectors — need to erase all sectors in the config region - bool eraseOk = TRUE; + bool eraseOk = true; for (uint32_t eraseAddr = (uint32_t)&__nanoConfig_start__; eraseAddr < (uint32_t)&__nanoConfig_end__ && eraseOk; eraseAddr += 4096) @@ -692,7 +692,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock eraseOk = g_ConfigFlashDriver.EraseBlock(NULL, eraseAddr); } #else - bool eraseOk = (g_ConfigFlashDriver.EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == TRUE); + bool eraseOk = (g_ConfigFlashDriver.EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == true); #endif if (eraseOk) { diff --git a/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp b/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp index 90b8944ba0..ea72cfe92d 100644 --- a/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp +++ b/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp @@ -23,7 +23,7 @@ static int NormalizePath(const char *path, char *buffer, size_t bufferSize); bool LITTLEFS_FS_Driver::LoadMedia(const void *driverInterface) { (void)driverInterface; - return TRUE; + return true; } STREAM_DRIVER_DETAILS *LITTLEFS_FS_Driver::DriverDetails(const VOLUME_ID *volume) @@ -36,9 +36,9 @@ STREAM_DRIVER_DETAILS *LITTLEFS_FS_Driver::DriverDetails(const VOLUME_ID *volume lfs_outputBuffer, lfs_inputBufferSize, lfs_outputBufferSize, - TRUE, - TRUE, - TRUE, + true, + true, + true, 0, 0}; @@ -58,7 +58,7 @@ bool LITTLEFS_FS_Driver::InitializeVolume(const VOLUME_ID *volume, const char *p (void)path; // nothing to do here as the littlefs instances are already initialized at target boot - return TRUE; + return true; } bool LITTLEFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) @@ -66,7 +66,7 @@ bool LITTLEFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) (void)volume; // nothing to do here as the littlefs instances are already initialized at target boot - return TRUE; + return true; } HRESULT LITTLEFS_FS_Driver::Format(const VOLUME_ID *volume, const char *volumeLabel, uint32_t parameters) diff --git a/targets/ChibiOS/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ChibiOS/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index 14745133ae..c19bc1e6ae 100644 --- a/targets/ChibiOS/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ChibiOS/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -173,7 +173,7 @@ HRESULT Library_nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost::FindFir // get a pointer to the first element of the byte array serialNumberPointer = (uint8_t *)serialNumberField->GetFirstElement(); - oneWireSerialNum(serialNumberPointer, TRUE); + oneWireSerialNum(serialNumberPointer, true); } } @@ -265,7 +265,7 @@ HRESULT Library_nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost::FindNex // get a pointer to the first element of the byte array serialNumberPointer = (uint8_t *)serialNumberField->GetFirstElement(); - oneWireSerialNum(serialNumberPointer, TRUE); + oneWireSerialNum(serialNumberPointer, true); } } diff --git a/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c b/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c index 02246fa7a5..d3ca474846 100644 --- a/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c +++ b/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/CRCv1/crc_lld.c @@ -66,7 +66,7 @@ void crc_lld_start(const crcConfig *config) { // enable peripheral - rccEnableCRC(FALSE); + rccEnableCRC(false); #if (STM32_CRC_PROGRAMMABLE == TRUE) || defined(STM32F7XX) || defined(STM32L0XX) || defined(STM32H7XX) diff --git a/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c b/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c index 40b451c727..5d38411137 100644 --- a/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c +++ b/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c @@ -61,7 +61,7 @@ void rng_lld_init(void) void rng_lld_start() { - rccEnableRNG(FALSE) + rccEnableRNG(false); // Enables the RNG peripheral. __RNG_ENABLE(RNGD1); diff --git a/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_fsmc/hal_stm32_fsmc.c b/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_fsmc/hal_stm32_fsmc.c index 237615e717..89980947a4 100644 --- a/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_fsmc/hal_stm32_fsmc.c +++ b/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_fsmc/hal_stm32_fsmc.c @@ -96,7 +96,7 @@ void fsmc_start(FSMCDriver *fsmcp) #ifdef rccResetFSMC rccResetFSMC(); #endif - rccEnableFSMC(FALSE); + rccEnableFSMC(false); #if STM32_USE_FSMC_NAND nvicEnableVector(STM32_FSMC_NUMBER, STM32_FSMC_FSMC1_IRQ_PRIORITY); #endif diff --git a/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c b/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c index 47f1afe9dc..52134ecf04 100644 --- a/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c +++ b/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c @@ -397,24 +397,24 @@ uint8_t oneWireAccess(void) { if (sendpacket[i] != SerialNum[i - 1]) { - return FALSE; + return false; } } if (sendpacket[0] != MATCH_ROM) { // OWERROR(//OWERROR_WRITE_VERIFY_FAILED); - return FALSE; + return false; } else { - return TRUE; + return true; } } } // reset or match echo failed - return FALSE; + return false; } /******************************************************************************* @@ -458,7 +458,7 @@ uint8_t oneWireBlock(uint8_t doReset, uint8_t *tran_buf, uint8_t tran_len) if (tran_len > 160) { // error: BLOCK TOO BIG - return FALSE; + return false; } // check if need to do a owTouchReset first @@ -467,7 +467,7 @@ uint8_t oneWireBlock(uint8_t doReset, uint8_t *tran_buf, uint8_t tran_len) if (!oneWireTouchReset()) { // error: NO DEVICES ON NET - return FALSE; + return false; } } @@ -477,7 +477,7 @@ uint8_t oneWireBlock(uint8_t doReset, uint8_t *tran_buf, uint8_t tran_len) tran_buf[i] = oneWireTouchByte(tran_buf[i]); } - return TRUE; + return true; } /******************************************************************************* @@ -502,7 +502,7 @@ uint8_t oneWireWriteMemory(uint8_t *buf, uint32_t ln, uint32_t adr) return oneWireCopyScratchpad(ln, adr); // end function - return FALSE; + return false; } /******************************************************************************* @@ -541,12 +541,12 @@ uint8_t oneWireCopyScratchpad(uint32_t ln, uint32_t adr) if (oneWireBlock(FALSE, pbuf, 14)) { if ((pbuf[13] == 0x55) || (pbuf[13] == 0xAA)) - return TRUE; + return true; } } // end function - return FALSE; + return false; } /******************************************************************************* @@ -584,7 +584,7 @@ uint8_t oneWireWriteScratchpad(uint8_t *buf, uint32_t ln, uint32_t adr) // perform the block if (!oneWireBlock(FALSE, pbuf, ln + 3)) - return FALSE; + return false; // Now read back the scratch if (oneWireAccess()) @@ -601,30 +601,30 @@ uint8_t oneWireWriteScratchpad(uint8_t *buf, uint32_t ln, uint32_t adr) // perform the block if (!oneWireBlock(FALSE, pbuf, ln + 4)) - return FALSE; + return false; // read address 1 if (pbuf[1] != (adr & 0xFF)) - return FALSE; + return false; // read address 2 if (pbuf[2] != ((adr >> 8) & 0xFF)) - return FALSE; + return false; // read the offset if (pbuf[3] != ((adr + ln - 1) & 0x1F)) - return FALSE; + return false; // read and compare the contents for (i = 0; i < ln; i++) { if (pbuf[4 + i] != buf[i]) - return FALSE; + return false; } // success - return TRUE; + return true; } } // end function - return FALSE; + return false; } /******************************************************************************* @@ -687,16 +687,16 @@ uint8_t oneWireReadPage(uint32_t start_pg, uint8_t *finalbuf) } else { - return FALSE; + return false; } } else { - return FALSE; + return false; } // end function - return TRUE; + return true; } /******************************************************************************* @@ -742,7 +742,7 @@ uint8_t oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff) // select the device if (!oneWireAccess()) { - return FALSE; + return false; } // command, address, offset, password (except last byte) @@ -771,14 +771,14 @@ uint8_t oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff) // send block (check copy indication complete) if (!oneWireBlock(FALSE, (uint8_t *)raw_buf, (send_len - 1))) { - return FALSE; + return false; } } else { if (!oneWireBlock(FALSE, (uint8_t *)raw_buf, send_len)) { - return FALSE; + return false; } } @@ -800,14 +800,14 @@ uint8_t oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff) { if (!oneWireBlock(FALSE, (uint8_t *)buff, PAGE_LENGTH)) { - return FALSE; + return false; } } else { if (!oneWireBlock(FALSE, (uint8_t *)buff, PAGE_LENGTH_HYGRO)) { - return FALSE; + return false; } } // read the first CRC16 byte @@ -828,10 +828,10 @@ uint8_t oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff) // check lsByte of the CRC if ((lastcrc16 & 0xFF) != (~lsCRC16 & 0xFF)) { - return FALSE; + return false; } - return TRUE; + return true; } /******************************************************************************* @@ -858,7 +858,7 @@ bool oneWireFindFirst(bool doReset, bool alarmOnly) { // reset the search state LastDiscrepancy = 0; - LastDevice = FALSE; + LastDevice = false; LastFamilyDiscrepancy = 0; // Call Next and return it's return value; @@ -895,7 +895,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) uint8_t attempt = 0; uint8_t discrepMarker = 0; bool outBit = 0; - bool result = FALSE; + bool result = false; uint8_t lastcrc8 = 0; // clear serial number buffer for new search @@ -906,23 +906,23 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) { // reset the search LastDiscrepancy = 0; - LastDevice = FALSE; + LastDevice = false; LastFamilyDiscrepancy = 0; - return FALSE; + return false; } // check if reset bus was requested if (doReset) { // reset the 1-Wire bus - // if there is no presence pulse there is nothing to do here, return FALSE + // if there is no presence pulse there is nothing to do here, return false if (!oneWireTouchReset()) { // reset the search LastDiscrepancy = 0; LastFamilyDiscrepancy = 0; - return FALSE; + return false; } } @@ -942,12 +942,12 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) { attempt = 0; - if (oneWireTouchBit(TRUE) == 1) + if (oneWireTouchBit(true) == 1) { attempt = 2; } - if (oneWireTouchBit(TRUE) == 1) + if (oneWireTouchBit(true) == 1) { attempt |= 1; } @@ -1026,7 +1026,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) LastDevice = (LastDiscrepancy == 0); // search isn't completed there are more devices present in the bus - result = TRUE; + result = true; } return result; diff --git a/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp b/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp index 07b1465e77..e434c039b8 100644 --- a/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp +++ b/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp @@ -15,14 +15,14 @@ static int NormalizePath(const char *root, const char *path, char *buffer, size_ bool FATFS_FS_Driver::LoadMedia(const void *driverInterface) { (void)driverInterface; - return TRUE; + return true; } STREAM_DRIVER_DETAILS *FATFS_FS_Driver::DriverDetails(const VOLUME_ID *volume) { (void)volume; - static STREAM_DRIVER_DETAILS driverDetail = {DIRECT_IO, NULL, NULL, 0, 0, TRUE, TRUE, TRUE, 0, 0}; + static STREAM_DRIVER_DETAILS driverDetail = {DIRECT_IO, NULL, NULL, 0, 0, true, true, true, 0, 0}; return &driverDetail; } @@ -38,14 +38,14 @@ bool FATFS_FS_Driver::InitializeVolume(const VOLUME_ID *volume, const char *path { // nothing to do here as the mount API will take care of this - return TRUE; + return true; } bool FATFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) { // nothing to do here as the unmount API will take care of this - return TRUE; + return true; } HRESULT FATFS_FS_Driver::Format(const VOLUME_ID *volume, const char *volumeLabel, uint32_t parameters) diff --git a/targets/ESP32/_common/targetHAL_ConfigurationManager.cpp b/targets/ESP32/_common/targetHAL_ConfigurationManager.cpp index 311e423b2b..aa99ceb551 100644 --- a/targets/ESP32/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ESP32/_common/targetHAL_ConfigurationManager.cpp @@ -413,7 +413,7 @@ bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface *config, } // always good - return TRUE; + return true; } // diff --git a/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp b/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp index 7ce53c1432..bae9e292f1 100644 --- a/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp +++ b/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp @@ -15,14 +15,14 @@ static int NormalizePath(const char *root, const char *path, char *buffer, size_ bool LITTLEFS_FS_Driver::LoadMedia(const void *driverInterface) { (void)driverInterface; - return TRUE; + return true; } STREAM_DRIVER_DETAILS *LITTLEFS_FS_Driver::DriverDetails(const VOLUME_ID *volume) { (void)volume; - static STREAM_DRIVER_DETAILS driverDetail = {DIRECT_IO, NULL, NULL, 0, 0, TRUE, TRUE, TRUE, 0, 0}; + static STREAM_DRIVER_DETAILS driverDetail = {DIRECT_IO, NULL, NULL, 0, 0, true, true, true, 0, 0}; return &driverDetail; } @@ -38,14 +38,14 @@ bool LITTLEFS_FS_Driver::InitializeVolume(const VOLUME_ID *volume, const char *p { // nothing to do here as the mount API will take care of this - return TRUE; + return true; } bool LITTLEFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) { // nothing to do here as the unmount API will take care of this - return TRUE; + return true; } HRESULT LITTLEFS_FS_Driver::Format(const VOLUME_ID *volume, const char *volumeLabel, uint32_t parameters) diff --git a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index 5e21b0f248..93c3b9dd6c 100644 --- a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -305,12 +305,12 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) { attempt = 0; - if (oneWireTouchBit(TRUE) == 1) + if (oneWireTouchBit(true) == 1) { attempt = 2; } - if (oneWireTouchBit(TRUE) == 1) + if (oneWireTouchBit(true) == 1) { attempt |= 1; } diff --git a/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp b/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp index 5e13cd372b..9e1ce966f3 100644 --- a/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp @@ -166,7 +166,7 @@ bool ConfigurationManager_GetConfigurationBlock( // copy the config block content to the pointer in the argument memcpy(configurationBlock, blockAddress, sizeOfBlock); - return TRUE; + return true; } // Stores the configuration block to the configuration flash sector @@ -260,7 +260,7 @@ bool ConfigurationManager_StoreConfigurationBlock( storageAddress = (ByteAddress)&__nanoConfig_start__ + offset; // always enumerate the blocks again after storing it - requiresEnumeration = TRUE; + requiresEnumeration = true; // for save all the block size has to be provided, check that if (blockSize == 0) @@ -370,7 +370,7 @@ UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock( } // erase config sector - if (iMXRTFlexSPIDriver_EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == TRUE) + if (iMXRTFlexSPIDriver_EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == true) { // flash block is erased diff --git a/targets/TI_SimpleLink/_common/easylink/EasyLink.c b/targets/TI_SimpleLink/_common/easylink/EasyLink.c index e6d697f21e..e54d6038c4 100644 --- a/targets/TI_SimpleLink/_common/easylink/EasyLink.c +++ b/targets/TI_SimpleLink/_common/easylink/EasyLink.c @@ -1152,7 +1152,7 @@ EasyLink_Status EasyLink_init(EasyLink_Params *params) /* Create a clock instance to periodically flush all RF commands */ Clock_Params clkparams; Clock_Params_init(&clkparams); - clkparams.startFlag = FALSE; + clkparams.startFlag = false; clkparams.period = EASYLINK_ACTIVITY_PROFILING_PREEMPT_TIMEOUT; clkparams.arg = (xdc_UArg)rfHandle; EasyLink_activityClock = Clock_create((Clock_FuncPtr)activityPreemptCb, diff --git a/targets/TI_SimpleLink/_include/targetHAL.h b/targets/TI_SimpleLink/_include/targetHAL.h index 8ca721b842..9d2adee825 100644 --- a/targets/TI_SimpleLink/_include/targetHAL.h +++ b/targets/TI_SimpleLink/_include/targetHAL.h @@ -25,9 +25,6 @@ #define LPCSTR const char * -#define TRUE true -#define FALSE false - #if !defined(BUILD_RTM) #define HARD_BREAKPOINT() HARD_Breakpoint() diff --git a/targets/ThreadX/ChibiOS/osal.h b/targets/ThreadX/ChibiOS/osal.h index 74d48ef57e..eb7d017deb 100644 --- a/targets/ThreadX/ChibiOS/osal.h +++ b/targets/ThreadX/ChibiOS/osal.h @@ -25,13 +25,6 @@ * @name Common constants * @{ */ -#if !defined(FALSE) || defined(__DOXYGEN__) -#define FALSE 0 -#endif - -#if !defined(TRUE) || defined(__DOXYGEN__) -#define TRUE 1 -#endif #define OSAL_SUCCESS false #define OSAL_FAILED true diff --git a/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp index 24c0ce0cf6..8050301c1d 100644 --- a/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp @@ -190,7 +190,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( // copy the config block content to the pointer in the argument memcpy(configurationBlock, blockAddress, sizeOfBlock); - return TRUE; + return true; } // Stores the configuration block to the configuration flash sector @@ -396,7 +396,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( platform_free(configSectorCopy); // operation is successful (nothing to update) - return TRUE; + return true; } // get storage address from block address @@ -427,7 +427,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( platform_free(configSectorCopy); // operation is successful (nothing to update) - return TRUE; + return true; } // storage address from block address @@ -456,7 +456,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( platform_free(configSectorCopy); // operation is successful (nothing to update) - return TRUE; + return true; } // storage address from block address @@ -477,7 +477,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( } // erase config sector - if (MXCFlashDriver_EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == TRUE) + if (MXCFlashDriver_EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == true) { // flash block is erased diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp index 27629d888f..13e9310723 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp @@ -321,7 +321,7 @@ bool ISM43362_SOCKETS_Driver::Initialize() } } - return TRUE; + return true; } bool ISM43362_SOCKETS_Driver::Uninitialize() @@ -340,7 +340,7 @@ bool ISM43362_SOCKETS_Driver::Uninitialize() // FIXME tcpip_shutdown(); // tcpip_shutdown is MS method added to lwip tcpip.c - return TRUE; + return true; } extern void debug_printf(const char *format, ...); diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp index 01557b927d..8634ffc4a0 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp @@ -359,7 +359,7 @@ SOCK_SOCKET Sockets_ISM43362_Driver::Accept( if (ret != SOCK_SOCKET_ERROR) { - RegisterSocket(ret, TRUE, fDebug); + RegisterSocket(ret, true, fDebug); } return ret; @@ -425,7 +425,7 @@ bool Sockets_ISM43362_Driver::Initialize() SSL_Initialize(); - s_initialized = TRUE; + s_initialized = true; } SOCKET_CHECK_EXIT_bool(); @@ -442,14 +442,14 @@ __nfweak void Sockets_ISM43362_Driver::Debugger_Uninitialize() bool Sockets_ISM43362_Driver::Uninitialize() { NATIVE_PROFILE_PAL_COM(); - bool ret = TRUE; + bool ret = true; if (s_initialized) { Debugger_Abort(); // close all connections (including debugger sockets) - CloseConnections(TRUE); + CloseConnections(true); SSL_Uninitialize(); diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ssl_ISM43362.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ssl_ISM43362.cpp index c34be938f2..eb13d296e5 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ssl_ISM43362.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ssl_ISM43362.cpp @@ -53,7 +53,7 @@ bool ssl_add_cert_auth_internal(int contextHandle, const char *certificate, int (void)certLength; (void)certPassword; - // always return TRUE because we can't really add a certificate to the chain + // always return true because we can't really add a certificate to the chain return true; } diff --git a/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp index dedfa60549..95ba93bc66 100644 --- a/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp @@ -268,7 +268,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( // copy the config block content to the pointer in the argument memcpy(configurationBlock, blockAddress, sizeOfBlock); - return TRUE; + return true; } // Stores the configuration block to the configuration flash sector @@ -662,7 +662,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock } // erase config sector - if (STM32FlashDriver_EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == TRUE) + if (STM32FlashDriver_EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == true) { // flash block is erased @@ -740,7 +740,7 @@ __nfweak bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface WIFI_GetMAC_Address(config->MacAddress); #endif - return TRUE; + return true; #else diff --git a/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp index 51d0dd84aa..0d7422ff0b 100644 --- a/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp @@ -278,7 +278,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( // copy the config block content to the pointer in the argument memcpy(configurationBlock, blockAddress, sizeOfBlock); - return TRUE; + return true; } // Stores the configuration block to the configuration flash sector @@ -674,7 +674,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock } // // erase config sector - // if (STM32FlashDriver_EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == TRUE) + // if (STM32FlashDriver_EraseBlock(NULL, (uint32_t)&__nanoConfig_start__) == true) // { // // flash block is erased @@ -748,7 +748,7 @@ __nfweak bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface // WIFI_GetMAC_Address(config->MacAddress); // #endif - // return TRUE; + // return true; // #else diff --git a/targets/ThreadX/_common/NetX/netx_sockets.cpp b/targets/ThreadX/_common/NetX/netx_sockets.cpp index e8bfc875fb..dc01364792 100644 --- a/targets/ThreadX/_common/NetX/netx_sockets.cpp +++ b/targets/ThreadX/_common/NetX/netx_sockets.cpp @@ -261,7 +261,7 @@ bool NETX_SOCKETS_Driver::Initialize() } } - return TRUE; + return true; } bool NETX_SOCKETS_Driver::Uninitialize() @@ -282,7 +282,7 @@ bool NETX_SOCKETS_Driver::Uninitialize() // FIXME tcpip_shutdown(); // tcpip_shutdown is MS method added to lwip tcpip.c - return TRUE; + return true; } extern void debug_printf(const char *format, ...); diff --git a/targets/ThreadX/_common/NetX/sockets_netx.cpp b/targets/ThreadX/_common/NetX/sockets_netx.cpp index 1d4d2dd138..64e3713bde 100644 --- a/targets/ThreadX/_common/NetX/sockets_netx.cpp +++ b/targets/ThreadX/_common/NetX/sockets_netx.cpp @@ -350,7 +350,7 @@ SOCK_SOCKET Sockets_NETX_Driver::Accept(SOCK_SOCKET socket, struct SOCK_sockaddr if (ret != SOCK_SOCKET_ERROR) { - RegisterSocket(ret, TRUE, fDebug); + RegisterSocket(ret, true, fDebug); } return ret; @@ -416,7 +416,7 @@ bool Sockets_NETX_Driver::Initialize() SSL_Initialize(); - s_initialized = TRUE; + s_initialized = true; } SOCKET_CHECK_EXIT_bool(); @@ -433,14 +433,14 @@ __nfweak void Sockets_NETX_Driver::Debugger_Uninitialize() bool Sockets_NETX_Driver::Uninitialize() { NATIVE_PROFILE_PAL_COM(); - bool ret = TRUE; + bool ret = true; if (s_initialized) { Debugger_Abort(); // close all connections (including debugger sockets) - CloseConnections(TRUE); + CloseConnections(true); SSL_Uninitialize(); diff --git a/targets/netcore/littlefs/littlefs_FS_Driver.cpp b/targets/netcore/littlefs/littlefs_FS_Driver.cpp index b0e90d6cac..9aca04bdb4 100644 --- a/targets/netcore/littlefs/littlefs_FS_Driver.cpp +++ b/targets/netcore/littlefs/littlefs_FS_Driver.cpp @@ -14,14 +14,14 @@ static int NormalizePath(const char *path, char *buffer, size_t bufferSize); bool LITTLEFS_FS_Driver::LoadMedia(const void *driverInterface) { (void)driverInterface; - return TRUE; + return true; } STREAM_DRIVER_DETAILS *LITTLEFS_FS_Driver::DriverDetails(const VOLUME_ID *volume) { (void)volume; - static STREAM_DRIVER_DETAILS driverDetail = {SYSTEM_BUFFERED_IO, NULL, NULL, 0, 0, TRUE, TRUE, TRUE, 0, 0}; + static STREAM_DRIVER_DETAILS driverDetail = {SYSTEM_BUFFERED_IO, NULL, NULL, 0, 0, true, true, true, 0, 0}; return &driverDetail; } @@ -40,7 +40,7 @@ bool LITTLEFS_FS_Driver::InitializeVolume(const VOLUME_ID *volume, const char *p (void)path; // nothing to do here as the littlefs instances are already initialized at target boot - return TRUE; + return true; } bool LITTLEFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) @@ -48,7 +48,7 @@ bool LITTLEFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) (void)volume; // nothing to do here as the littlefs instances are already initialized at target boot - return TRUE; + return true; } HRESULT LITTLEFS_FS_Driver::Format(const VOLUME_ID *volume, const char *volumeLabel, uint32_t parameters) diff --git a/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp b/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp index 55fb51a808..bf48a60476 100644 --- a/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp +++ b/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp @@ -208,7 +208,7 @@ struct Settings CLR_RT_Memory::ZeroFill(headerBuffer, headerInBytes); } - while (TRUE) + while (true) { if (!BlockStorageStream_Read(&stream, &headerBuffer, headerInBytes)) break; diff --git a/targets/netcore/nanoFramework.nanoCLR/dllmain.cpp b/targets/netcore/nanoFramework.nanoCLR/dllmain.cpp index 19a7c5f048..7e435a684b 100644 --- a/targets/netcore/nanoFramework.nanoCLR/dllmain.cpp +++ b/targets/netcore/nanoFramework.nanoCLR/dllmain.cpp @@ -15,5 +15,5 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv case DLL_PROCESS_DETACH: break; } - return TRUE; + return true; } diff --git a/targets/posix/nanoCLR/CLRStartup.cpp b/targets/posix/nanoCLR/CLRStartup.cpp index b2ba06c982..04fd77f218 100644 --- a/targets/posix/nanoCLR/CLRStartup.cpp +++ b/targets/posix/nanoCLR/CLRStartup.cpp @@ -323,7 +323,7 @@ struct Settings CLR_RT_Memory::ZeroFill(headerBuffer, headerInBytes); } - while (TRUE) + while (true) { if (!BlockStorageStream_Read(&stream, &headerBuffer, headerInBytes)) break; diff --git a/targets/win32/nanoCLR/CLRStartup.cpp b/targets/win32/nanoCLR/CLRStartup.cpp index e18910303b..3f19426758 100644 --- a/targets/win32/nanoCLR/CLRStartup.cpp +++ b/targets/win32/nanoCLR/CLRStartup.cpp @@ -250,7 +250,7 @@ struct Settings : CLR_RT_ParseOptions CLR_RT_Memory::ZeroFill(headerBuffer, headerInBytes); } - while (TRUE) + while (true) { if (!BlockStorageStream_Read(&stream, &headerBuffer, headerInBytes)) break; diff --git a/targets/win32/nanoCLR/PAL/ConfigHelper_stubs.cpp b/targets/win32/nanoCLR/PAL/ConfigHelper_stubs.cpp index 55c74a90d5..56ac42496c 100644 --- a/targets/win32/nanoCLR/PAL/ConfigHelper_stubs.cpp +++ b/targets/win32/nanoCLR/PAL/ConfigHelper_stubs.cpp @@ -9,17 +9,17 @@ // bool HAL_CONFIG_BLOCK::IsGoodBlock() const //{ -// return TRUE; +// return true; //} // // bool HAL_CONFIG_BLOCK::IsGoodData() const //{ -// return TRUE; +// return true; //} // // bool HAL_CONFIG_BLOCK::IsGood() const //{ -// return TRUE; +// return true; //} // // const HAL_CONFIG_BLOCK* HAL_CONFIG_BLOCK::Next() const @@ -36,7 +36,7 @@ // // bool HAL_CONFIG_BLOCK::Prepare( const char* Name, void* Data, unsigned int Size ) //{ -// return TRUE; +// return true; //} // ////--// diff --git a/targets/win32/nanoCLR/PAL/blockstorageList_stubs.cpp b/targets/win32/nanoCLR/PAL/blockstorageList_stubs.cpp index c3d38cbbde..d171f73189 100644 --- a/targets/win32/nanoCLR/PAL/blockstorageList_stubs.cpp +++ b/targets/win32/nanoCLR/PAL/blockstorageList_stubs.cpp @@ -24,17 +24,17 @@ void BlockStorageList_Initialize() // // bool BlockStorageList::InitializeDevices() //{ -// return TRUE; +// return true; //} // // bool BlockStorageList::UnInitializeDevices() //{ -// return TRUE; +// return true; //} // // bool BlockStorageList::AddDevice( BlockStorageDevice* pBSD, IBlockStorageDevice* vtable, void* config, bool Init) //{ -// return TRUE; +// return true; //} bool BlockStorageList_AddDevice(BlockStorageDevice *pBSD, IBlockStorageDevice *vtable, void *config, bool init) { @@ -46,7 +46,7 @@ bool BlockStorageList_AddDevice(BlockStorageDevice *pBSD, IBlockStorageDevice *v // // bool BlockStorageList::RemoveDevice( BlockStorageDevice* pBSD, bool UnInit) //{ -// return TRUE; +// return true; //} // BlockStorageDevice* BlockStorageList::GetFirstDevice() @@ -110,27 +110,27 @@ bool BlockStorageList_FindDeviceForPhysicalAddress( // // bool BlockStorageStream::Seek( signed int offset, SeekOrigin origin ) //{ -// return TRUE; +// return true; //} // // bool BlockStorageStream::Erase( unsigned int length ) //{ -// return TRUE; +// return true; //} // // bool BlockStorageStream::Write( unsigned char* data , unsigned int length ) //{ -// return TRUE; +// return true; //} // // bool BlockStorageStream::ReadIntoBuffer( unsigned char* pBuffer, unsigned int length ) //{ -// return TRUE; +// return true; //} // // bool BlockStorageStream::Read( unsigned char** ppBuffer, unsigned int length ) //{ -// return TRUE; +// return true; //} // diff --git a/targets/win32/nanoCLR/Various.cpp b/targets/win32/nanoCLR/Various.cpp index d44b86c635..a144b1e5d7 100644 --- a/targets/win32/nanoCLR/Various.cpp +++ b/targets/win32/nanoCLR/Various.cpp @@ -269,7 +269,7 @@ void CPU_Reset() bool CPU_IsSoftRebootSupported() { - return TRUE; + return true; } void CPU_SetPowerMode(PowerLevel_type powerLevel) diff --git a/targets/win32/nanoCLR/targetPAL_Events.cpp b/targets/win32/nanoCLR/targetPAL_Events.cpp index c5fb7a6aaa..8ccb5cc734 100644 --- a/targets/win32/nanoCLR/targetPAL_Events.cpp +++ b/targets/win32/nanoCLR/targetPAL_Events.cpp @@ -60,7 +60,7 @@ bool Events_Initialize() EventsSemaphore.release(); - return TRUE; + return true; } bool Events_Uninitialize() @@ -71,7 +71,7 @@ bool Events_Uninitialize() EventsSemaphore.release(); - return TRUE; + return true; } void Events_Set(UINT32 Events) From c216b7ce4c75f92404cb49b40f05efcaddef53a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 3 Jun 2026 23:38:35 +0100 Subject: [PATCH 02/18] Fixes from code review --- src/PAL/FileSystem/nanoPAL_FileSystem.cpp | 4 ++-- src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PAL/FileSystem/nanoPAL_FileSystem.cpp b/src/PAL/FileSystem/nanoPAL_FileSystem.cpp index 537bf27a00..3924e4350e 100644 --- a/src/PAL/FileSystem/nanoPAL_FileSystem.cpp +++ b/src/PAL/FileSystem/nanoPAL_FileSystem.cpp @@ -89,7 +89,7 @@ bool FS_MountVolume(const char *rootName, uint32_t deviceFlags, const char *file streamDriver, fsDriver, volumeId, - (fsDriver) ? true : FALSE)) + (fsDriver) ? true : false)) { // Now we can notify managed code @@ -103,7 +103,7 @@ bool FS_MountVolume(const char *rootName, uint32_t deviceFlags, const char *file // if for some reason, AddVolume fails, there is not much that can be done platform_free(volume); - return FALSE; + return false; } } diff --git a/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp b/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp index 7ffa1c61d1..b650ef9c0b 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp @@ -165,7 +165,7 @@ HRESULT TouchPanelDriver::GetDeviceCaps(unsigned int iIndex, void *lpOutput) return FALSE; } - return true; + return S_OK; } HRESULT TouchPanelDriver::ResetCalibration() @@ -849,7 +849,7 @@ bool TouchPanelDriver::CalibrationPointGet(TOUCH_PANEL_CALIBRATION_POINT *pTCP) pTCP->CalibrationX = cDisplayWidth / 2; pTCP->CalibrationY = cDisplayHeight / 2; - return FALSE; + return false; } return true; From 6e10edcdf5f3d14590145ff3f33954a59b627b91 Mon Sep 17 00:00:00 2001 From: nfbot Date: Wed, 3 Jun 2026 22:41:38 +0000 Subject: [PATCH 03/18] Code style fixes Automated fixes for code style. --- src/PAL/AsyncProcCall/Async_stubs.cpp | 10 +- src/PAL/Events/nanoPAL_Events_driver.cpp | 6 +- src/PAL/Include/nanoPAL_Sockets.h | 4 +- .../Core/Support/Jpeg/jbytearraydatasrc.c | 44 +- .../Graphics/Core/Support/Jpeg/jcapimin.c | 95 ++--- .../Graphics/Core/Support/Jpeg/jcapistd.c | 66 +-- .../Graphics/Core/Support/Jpeg/jccoefct.c | 281 +++++++------ .../Graphics/Core/Support/Jpeg/jchuff.c | 388 ++++++++++-------- 8 files changed, 480 insertions(+), 414 deletions(-) diff --git a/src/PAL/AsyncProcCall/Async_stubs.cpp b/src/PAL/AsyncProcCall/Async_stubs.cpp index 0c57e5d173..a031c58e0b 100644 --- a/src/PAL/AsyncProcCall/Async_stubs.cpp +++ b/src/PAL/AsyncProcCall/Async_stubs.cpp @@ -19,7 +19,7 @@ __nfweak void HAL_CONTINUATION::Uninitialize() NATIVE_PROFILE_PAL_ASYNC_PROC_CALL(); } -__nfweak void HAL_CONTINUATION::InitializeCallback( HAL_CALLBACK_FPN entryPoint, void* argument ) +__nfweak void HAL_CONTINUATION::InitializeCallback(HAL_CALLBACK_FPN entryPoint, void *argument) { (void)entryPoint; (void)argument; @@ -32,7 +32,7 @@ __nfweak void HAL_CONTINUATION::Enqueue() NATIVE_PROFILE_PAL_ASYNC_PROC_CALL(); } -__nfweak void HAL_CONTINUATION::Abort () +__nfweak void HAL_CONTINUATION::Abort() { NATIVE_PROFILE_PAL_ASYNC_PROC_CALL(); } @@ -62,14 +62,14 @@ __nfweak void HAL_COMPLETION::Uninitialize() NATIVE_PROFILE_PAL_ASYNC_PROC_CALL(); } -__nfweak void HAL_COMPLETION::EnqueueTicks( uint64_t eventTimeTicks) +__nfweak void HAL_COMPLETION::EnqueueTicks(uint64_t eventTimeTicks) { (void)eventTimeTicks; NATIVE_PROFILE_PAL_ASYNC_PROC_CALL(); } -__nfweak void HAL_COMPLETION::EnqueueDelta( uint32_t uSecFromNow ) +__nfweak void HAL_COMPLETION::EnqueueDelta(uint32_t uSecFromNow) { (void)uSecFromNow; @@ -91,7 +91,7 @@ __nfweak void HAL_COMPLETION::DequeueAndExec() NATIVE_PROFILE_PAL_ASYNC_PROC_CALL(); } -__nfweak void HAL_COMPLETION::WaitForInterrupts( uint64_t expireTimeInSysTicks, uint32_t sleepLevel, uint64_t wakeEvents ) +__nfweak void HAL_COMPLETION::WaitForInterrupts(uint64_t expireTimeInSysTicks, uint32_t sleepLevel, uint64_t wakeEvents) { (void)expireTimeInSysTicks; (void)sleepLevel; diff --git a/src/PAL/Events/nanoPAL_Events_driver.cpp b/src/PAL/Events/nanoPAL_Events_driver.cpp index 364dcf0bc3..7f7db4be81 100644 --- a/src/PAL/Events/nanoPAL_Events_driver.cpp +++ b/src/PAL/Events/nanoPAL_Events_driver.cpp @@ -37,8 +37,8 @@ HRESULT PalEventDriver::Uninitialize() HRESULT PalEventDriver::PostEvent(uint32_t e, uint32_t param) { PalEventListener *listener = g_palEventDriver.listenerList.FirstNode(); - - while(listener->Next() != NULL) + + while (listener->Next() != NULL) { if (listener->m_eventMask & e) { @@ -51,7 +51,7 @@ HRESULT PalEventDriver::PostEvent(uint32_t e, uint32_t param) return S_OK; } -HRESULT PalEventDriver::EnlistListener(PalEventListener* listener) +HRESULT PalEventDriver::EnlistListener(PalEventListener *listener) { listener->Initialize(); g_palEventDriver.listenerList.LinkAtBack(listener); diff --git a/src/PAL/Include/nanoPAL_Sockets.h b/src/PAL/Include/nanoPAL_Sockets.h index 4e4bc5dff8..c176e1a1a3 100644 --- a/src/PAL/Include/nanoPAL_Sockets.h +++ b/src/PAL/Include/nanoPAL_Sockets.h @@ -26,8 +26,8 @@ typedef struct _DATE_TIME_INFO /* interpret the absolute */ /* time meaning of the */ /* above values. */ - bool dlsTime; /* boolean; daylight savings time is in effect */ - int tzOffset; /* signed int; difference in seconds imposed by timezone (from GMT) */ + bool dlsTime; /* boolean; daylight savings time is in effect */ + int tzOffset; /* signed int; difference in seconds imposed by timezone (from GMT) */ } DATE_TIME_INFO; typedef struct _X509CertData diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jbytearraydatasrc.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jbytearraydatasrc.c index df97bdbb17..b49c8f362a 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jbytearraydatasrc.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jbytearraydatasrc.c @@ -4,20 +4,20 @@ // See LICENSE file in the project root for full license information. // -// a byte array data source for the JPEG decoder implemented according to the structure of +// a byte array data source for the JPEG decoder implemented according to the structure of // jpeg_source_mgr - #include "jinclude.h" #include "jpeglib.h" #include "jerror.h" -typedef struct { - struct jpeg_source_mgr pub; // public fields - JOCTET buffer[2]; // EOI buffer (so we don't have to call allocate() ) +typedef struct +{ + struct jpeg_source_mgr pub; // public fields + JOCTET buffer[2]; // EOI buffer (so we don't have to call allocate() ) } my_source_mgr; -typedef my_source_mgr* my_src_ptr; +typedef my_source_mgr *my_src_ptr; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" @@ -31,7 +31,7 @@ init_source(j_decompress_ptr cinfo) METHODDEF(bool) fill_input_buffer(j_decompress_ptr cinfo) { - // since the initial buffer contains all the data that we have, + // since the initial buffer contains all the data that we have, // if this method is called, it means we're out of data already // so we make up fake data to keep the decoder alive @@ -49,23 +49,25 @@ fill_input_buffer(j_decompress_ptr cinfo) return true; } -// Keeping the library's original implementation +// Keeping the library's original implementation METHODDEF(void) skip_input_data(j_decompress_ptr cinfo, long num_bytes) { my_src_ptr src = (my_src_ptr)cinfo->src; /* Just a dumb implementation for now. Could use fseek() except - * it doesn't work on pipes. Not clear that being smart is worth - * any trouble anyway --- large skips are infrequent. - */ - if (num_bytes > 0) { - while (num_bytes > (long)src->pub.bytes_in_buffer) { + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) + { + while (num_bytes > (long)src->pub.bytes_in_buffer) + { num_bytes -= (long)src->pub.bytes_in_buffer; (void)fill_input_buffer(cinfo); /* note we assume that fill_input_buffer will never return false, - * so suspension need not be handled. - */ + * so suspension need not be handled. + */ } src->pub.next_input_byte += (CLR_INT32)num_bytes; src->pub.bytes_in_buffer -= (CLR_INT32)num_bytes; @@ -82,14 +84,16 @@ term_source(j_decompress_ptr cinfo) #pragma GCC diagnostic pop GLOBAL(void) -jpeg_byte_array_src(j_decompress_ptr cinfo, CLR_UINT8* source, CLR_INT32 size) +jpeg_byte_array_src(j_decompress_ptr cinfo, CLR_UINT8 *source, CLR_INT32 size) { my_src_ptr src; - if (cinfo->src == NULL) { // first time for this JPEG object? - cinfo->src = (struct jpeg_source_mgr*) - (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT, - SIZEOF(my_source_mgr)); + if (cinfo->src == NULL) + { // first time for this JPEG object? + cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)( + (j_common_ptr)cinfo, + JPOOL_PERMANENT, + SIZEOF(my_source_mgr)); } src = (my_src_ptr)cinfo->src; diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c index 5caf915c6d..4786c5a298 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c @@ -26,22 +26,21 @@ #include "jinclude.h" #include "jpeglib.h" - /* - * Initialization of a JPEG compression object. - * The error manager must already be set up (in case memory manager fails). - */ +/* + * Initialization of a JPEG compression object. + * The error manager must already be set up (in case memory manager fails). + */ GLOBAL(void) jpeg_CreateCompress(j_compress_ptr cinfo, int version, CLR_INT32 structsize) { int i; /* Guard against version mismatches between library and caller. */ - cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ if (version != JPEG_LIB_VERSION) ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); if (structsize != SIZEOF(struct jpeg_compress_struct)) - ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, - (int)SIZEOF(struct jpeg_compress_struct), (int)structsize); + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, (int)SIZEOF(struct jpeg_compress_struct), (int)structsize); /* For debugging purposes, we zero the whole master structure. * But the application has already set the err pointer, and may have set @@ -50,8 +49,8 @@ jpeg_CreateCompress(j_compress_ptr cinfo, int version, CLR_INT32 structsize) * complain here. */ { - struct jpeg_error_mgr* err = cinfo->err; - void* client_data = cinfo->client_data; /* ignore Purify complaint here */ + struct jpeg_error_mgr *err = cinfo->err; + void *client_data = cinfo->client_data; /* ignore Purify complaint here */ MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct)); cinfo->err = err; cinfo->client_data = client_data; @@ -70,14 +69,15 @@ jpeg_CreateCompress(j_compress_ptr cinfo, int version, CLR_INT32 structsize) for (i = 0; i < NUM_QUANT_TBLS; i++) cinfo->quant_tbl_ptrs[i] = NULL; - for (i = 0; i < NUM_HUFF_TBLS; i++) { + for (i = 0; i < NUM_HUFF_TBLS; i++) + { cinfo->dc_huff_tbl_ptrs[i] = NULL; cinfo->ac_huff_tbl_ptrs[i] = NULL; } cinfo->script_space = NULL; - cinfo->input_gamma = 1.0; /* in case application forgets */ + cinfo->input_gamma = 1.0; /* in case application forgets */ /* OK, I'm ready */ cinfo->global_state = CSTATE_START; @@ -117,15 +117,17 @@ GLOBAL(void) jpeg_suppress_tables(j_compress_ptr cinfo, bool suppress) { int i; - JQUANT_TBL* qtbl; - JHUFF_TBL* htbl; + JQUANT_TBL *qtbl; + JHUFF_TBL *htbl; - for (i = 0; i < NUM_QUANT_TBLS; i++) { + for (i = 0; i < NUM_QUANT_TBLS; i++) + { if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL) qtbl->sent_table = suppress; } - for (i = 0; i < NUM_HUFF_TBLS; i++) { + for (i = 0; i < NUM_HUFF_TBLS; i++) + { if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL) htbl->sent_table = suppress; if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL) @@ -144,35 +146,38 @@ jpeg_finish_compress(j_compress_ptr cinfo) { JDIMENSION iMCU_row; - if (cinfo->global_state == CSTATE_SCANNING || - cinfo->global_state == CSTATE_RAW_OK) { + if (cinfo->global_state == CSTATE_SCANNING || cinfo->global_state == CSTATE_RAW_OK) + { /* Terminate first pass */ if (cinfo->next_scanline < cinfo->image_height) ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); - (*cinfo->master->finish_pass) (cinfo); + (*cinfo->master->finish_pass)(cinfo); } else if (cinfo->global_state != CSTATE_WRCOEFS) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); /* Perform any remaining passes */ - while (!cinfo->master->is_last_pass) { - (*cinfo->master->prepare_for_pass) (cinfo); - for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) { - if (cinfo->progress != NULL) { + while (!cinfo->master->is_last_pass) + { + (*cinfo->master->prepare_for_pass)(cinfo); + for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) + { + if (cinfo->progress != NULL) + { cinfo->progress->pass_counter = (long)iMCU_row; cinfo->progress->pass_limit = (long)cinfo->total_iMCU_rows; - (*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo); + (*cinfo->progress->progress_monitor)((j_common_ptr)cinfo); } /* We bypass the main controller and invoke coef controller directly; * all work is being done from the coefficient buffer. */ - if (!(*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE)NULL)) + if (!(*cinfo->coef->compress_data)(cinfo, (JSAMPIMAGE)NULL)) ERREXIT(cinfo, JERR_CANT_SUSPEND); } - (*cinfo->master->finish_pass) (cinfo); + (*cinfo->master->finish_pass)(cinfo); } /* Write EOI, do final cleanup */ - (*cinfo->marker->write_file_trailer) (cinfo); - (*cinfo->dest->term_destination) (cinfo); + (*cinfo->marker->write_file_trailer)(cinfo); + (*cinfo->dest->term_destination)(cinfo); /* We can use jpeg_abort to release memory and reset global_state */ jpeg_abort((j_common_ptr)cinfo); } @@ -184,21 +189,19 @@ jpeg_finish_compress(j_compress_ptr cinfo) * first call to jpeg_write_scanlines() or jpeg_write_raw_data(). */ GLOBAL(void) -jpeg_write_marker(j_compress_ptr cinfo, int marker, - const JOCTET* dataptr, unsigned int datalen) +jpeg_write_marker(j_compress_ptr cinfo, int marker, const JOCTET *dataptr, unsigned int datalen) { JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val)); - if (cinfo->next_scanline != 0 || - (cinfo->global_state != CSTATE_SCANNING && - cinfo->global_state != CSTATE_RAW_OK && - cinfo->global_state != CSTATE_WRCOEFS)) + if (cinfo->next_scanline != 0 || (cinfo->global_state != CSTATE_SCANNING && cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); - write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */ - while (datalen--) { - (*write_marker_byte) (cinfo, *dataptr); + (*cinfo->marker->write_marker_header)(cinfo, marker, datalen); + write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */ + while (datalen--) + { + (*write_marker_byte)(cinfo, *dataptr); dataptr++; } } @@ -207,19 +210,17 @@ jpeg_write_marker(j_compress_ptr cinfo, int marker, GLOBAL(void) jpeg_write_m_header(j_compress_ptr cinfo, int marker, unsigned int datalen) { - if (cinfo->next_scanline != 0 || - (cinfo->global_state != CSTATE_SCANNING && - cinfo->global_state != CSTATE_RAW_OK && - cinfo->global_state != CSTATE_WRCOEFS)) + if (cinfo->next_scanline != 0 || (cinfo->global_state != CSTATE_SCANNING && cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); + (*cinfo->marker->write_marker_header)(cinfo, marker, datalen); } GLOBAL(void) jpeg_write_m_byte(j_compress_ptr cinfo, int val) { - (*cinfo->marker->write_marker_byte) (cinfo, val); + (*cinfo->marker->write_marker_byte)(cinfo, val); } /* @@ -249,14 +250,14 @@ jpeg_write_tables(j_compress_ptr cinfo) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); /* (Re)initialize error mgr and destination modules */ - (*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo); - (*cinfo->dest->init_destination) (cinfo); + (*cinfo->err->reset_error_mgr)((j_common_ptr)cinfo); + (*cinfo->dest->init_destination)(cinfo); /* Initialize the marker writer ... bit of a crock to do it here. */ jinit_marker_writer(cinfo); /* Write them tables! */ - (*cinfo->marker->write_tables_only) (cinfo); + (*cinfo->marker->write_tables_only)(cinfo); /* And clean up. */ - (*cinfo->dest->term_destination) (cinfo); + (*cinfo->dest->term_destination)(cinfo); /* * In library releases up through v6a, we called jpeg_abort() here to free * any working memory allocated by the destination manager and marker diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c index 52be8b24d9..3349018486 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c @@ -24,20 +24,20 @@ #include "jinclude.h" #include "jpeglib.h" - /* - * Compression initialization. - * Before calling this, all parameters and a data destination must be set up. - * - * We require a write_all_tables parameter as a failsafe check when writing - * multiple datastreams from the same compression object. Since prior runs - * will have left all the tables marked sent_table=TRUE, a subsequent run - * would emit an abbreviated stream (no tables) by default. This may be what - * is wanted, but for safety's sake it should not be the default behavior: - * programmers should have to make a deliberate choice to emit abbreviated - * images. Therefore the documentation and examples should encourage people - * to pass write_all_tables=TRUE; then it will take active thought to do the - * wrong thing. - */ +/* + * Compression initialization. + * Before calling this, all parameters and a data destination must be set up. + * + * We require a write_all_tables parameter as a failsafe check when writing + * multiple datastreams from the same compression object. Since prior runs + * will have left all the tables marked sent_table=TRUE, a subsequent run + * would emit an abbreviated stream (no tables) by default. This may be what + * is wanted, but for safety's sake it should not be the default behavior: + * programmers should have to make a deliberate choice to emit abbreviated + * images. Therefore the documentation and examples should encourage people + * to pass write_all_tables=TRUE; then it will take active thought to do the + * wrong thing. + */ GLOBAL(void) jpeg_start_compress(j_compress_ptr cinfo, bool write_all_tables) @@ -46,15 +46,15 @@ jpeg_start_compress(j_compress_ptr cinfo, bool write_all_tables) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); if (write_all_tables) - jpeg_suppress_tables(cinfo, false); /* mark all tables to be written */ + jpeg_suppress_tables(cinfo, false); /* mark all tables to be written */ - /* (Re)initialize error mgr and destination modules */ - (*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo); - (*cinfo->dest->init_destination) (cinfo); + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr)((j_common_ptr)cinfo); + (*cinfo->dest->init_destination)(cinfo); /* Perform master selection of active modules */ jinit_compress_master(cinfo); /* Set up for the first pass */ - (*cinfo->master->prepare_for_pass) (cinfo); + (*cinfo->master->prepare_for_pass)(cinfo); /* Ready for application to drive first pass through jpeg_write_scanlines * or jpeg_write_raw_data. */ @@ -77,8 +77,7 @@ jpeg_start_compress(j_compress_ptr cinfo, bool write_all_tables) * when using a multiple-scanline buffer. */ GLOBAL(JDIMENSION) -jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines, - JDIMENSION num_lines) +jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines) { JDIMENSION row_ctr, rows_left; @@ -88,10 +87,11 @@ jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines, WARNMS(cinfo, JWRN_TOO_MUCH_DATA); /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { + if (cinfo->progress != NULL) + { cinfo->progress->pass_counter = (long)cinfo->next_scanline; cinfo->progress->pass_limit = (long)cinfo->image_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo); + (*cinfo->progress->progress_monitor)((j_common_ptr)cinfo); } /* Give master control module another chance if this is first call to @@ -100,7 +100,7 @@ jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines, * jpeg_start_compress and jpeg_write_scanlines. */ if (cinfo->master->call_pass_startup) - (*cinfo->master->pass_startup) (cinfo); + (*cinfo->master->pass_startup)(cinfo); /* Ignore any extra scanlines at bottom of image. */ rows_left = cinfo->image_height - cinfo->next_scanline; @@ -108,7 +108,7 @@ jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines, num_lines = rows_left; row_ctr = 0; - (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); + (*cinfo->main->process_data)(cinfo, scanlines, &row_ctr, num_lines); cinfo->next_scanline += row_ctr; return row_ctr; } @@ -118,23 +118,24 @@ jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines, * Processes exactly one iMCU row per call, unless suspended. */ GLOBAL(JDIMENSION) -jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data, - JDIMENSION num_lines) +jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data, JDIMENSION num_lines) { JDIMENSION lines_per_iMCU_row; if (cinfo->global_state != CSTATE_RAW_OK) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - if (cinfo->next_scanline >= cinfo->image_height) { + if (cinfo->next_scanline >= cinfo->image_height) + { WARNMS(cinfo, JWRN_TOO_MUCH_DATA); return 0; } /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { + if (cinfo->progress != NULL) + { cinfo->progress->pass_counter = (long)cinfo->next_scanline; cinfo->progress->pass_limit = (long)cinfo->image_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo); + (*cinfo->progress->progress_monitor)((j_common_ptr)cinfo); } /* Give master control module another chance if this is first call to @@ -143,7 +144,7 @@ jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data, * jpeg_start_compress and jpeg_write_raw_data. */ if (cinfo->master->call_pass_startup) - (*cinfo->master->pass_startup) (cinfo); + (*cinfo->master->pass_startup)(cinfo); /* Verify that at least one iMCU row has been passed. */ lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE; @@ -151,7 +152,8 @@ jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data, ERREXIT(cinfo, JERR_BUFFER_SIZE); /* Directly compress the row. */ - if (!(*cinfo->coef->compress_data) (cinfo, data)) { + if (!(*cinfo->coef->compress_data)(cinfo, data)) + { /* If compressor did not consume the whole row, suspend processing. */ return 0; } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c index a50c7af254..3923422555 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c @@ -20,12 +20,11 @@ #include "jinclude.h" #include "jpeglib.h" - - /* We use a full-image coefficient buffer when doing Huffman optimization, - * and also for writing multiple-scan JPEG files. In all cases, the DCT - * step is run during the first pass, and subsequent passes need only read - * the buffered coefficients. - */ +/* We use a full-image coefficient buffer when doing Huffman optimization, + * and also for writing multiple-scan JPEG files. In all cases, the DCT + * step is run during the first pass, and subsequent passes need only read + * the buffered coefficients. + */ #ifdef ENTROPY_OPT_SUPPORTED #define FULL_COEF_BUFFER_SUPPORTED #else @@ -34,15 +33,15 @@ #endif #endif - - /* Private buffer controller object */ -typedef struct { +/* Private buffer controller object */ +typedef struct +{ struct jpeg_c_coef_controller pub; /* public fields */ - JDIMENSION iMCU_row_num; /* iMCU row # within image */ - JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ - int MCU_vert_offset; /* counts MCU rows within iMCU row */ - int MCU_rows_per_iMCU_row; /* number of such rows needed */ + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ /* For single-pass compression, it's sufficient to buffer just one MCU * (although this may prove a bit slow in practice). We allocate a @@ -59,16 +58,13 @@ typedef struct { jvirt_barray_ptr whole_image[MAX_COMPONENTS]; } my_coef_controller; -typedef my_coef_controller* my_coef_ptr; +typedef my_coef_controller *my_coef_ptr; /* Forward declarations */ -METHODDEF(bool) compress_data -JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(bool) compress_data JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); #ifdef FULL_COEF_BUFFER_SUPPORTED -METHODDEF(bool) compress_first_pass -JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); -METHODDEF(bool) compress_output -JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(bool) compress_first_pass JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(bool) compress_output JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); #endif LOCAL(void) @@ -81,10 +77,12 @@ start_iMCU_row(j_compress_ptr cinfo) * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. * But at the bottom of the image, process only what's left. */ - if (cinfo->comps_in_scan > 1) { + if (cinfo->comps_in_scan > 1) + { coef->MCU_rows_per_iMCU_row = 1; } - else { + else + { if (coef->iMCU_row_num < (cinfo->total_iMCU_rows - 1)) coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; else @@ -106,27 +104,28 @@ start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode) coef->iMCU_row_num = 0; start_iMCU_row(cinfo); - switch (pass_mode) { - case JBUF_PASS_THRU: - if (coef->whole_image[0] != NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - coef->pub.compress_data = compress_data; - break; + switch (pass_mode) + { + case JBUF_PASS_THRU: + if (coef->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + coef->pub.compress_data = compress_data; + break; #ifdef FULL_COEF_BUFFER_SUPPORTED - case JBUF_SAVE_AND_PASS: - if (coef->whole_image[0] == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - coef->pub.compress_data = compress_first_pass; - break; - case JBUF_CRANK_DEST: - if (coef->whole_image[0] == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - coef->pub.compress_data = compress_output; - break; + case JBUF_SAVE_AND_PASS: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + coef->pub.compress_data = compress_first_pass; + break; + case JBUF_CRANK_DEST: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + coef->pub.compress_data = compress_output; + break; #endif - default: - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - break; + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; } } @@ -143,18 +142,18 @@ METHODDEF(bool) compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf) { my_coef_ptr coef = (my_coef_ptr)cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION MCU_col_num; /* index of current MCU within row */ JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; int blkn, bi, ci, yindex, yoffset, blockcnt; JDIMENSION ypos, xpos; - jpeg_component_info* compptr; + jpeg_component_info *compptr; /* Loop to write as much as one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col; - MCU_col_num++) { + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; yoffset++) + { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col; MCU_col_num++) + { /* Determine where data comes from in input_buf and do the DCT thing. * Each call on forward_DCT processes a horizontal row of DCT blocks * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks @@ -165,33 +164,42 @@ compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf) * block's DC value. (Thanks to Thomas Kinsman for this idea.) */ blkn = 0; - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + { compptr = cinfo->cur_comp_info[ci]; - blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width - : compptr->last_col_width; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width : compptr->last_col_width; xpos = MCU_col_num * compptr->MCU_sample_width; ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */ - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - if (coef->iMCU_row_num < last_iMCU_row || - yoffset + yindex < compptr->last_row_height) { - (*cinfo->fdct->forward_DCT) (cinfo, compptr, + for (yindex = 0; yindex < compptr->MCU_height; yindex++) + { + if (coef->iMCU_row_num < last_iMCU_row || yoffset + yindex < compptr->last_row_height) + { + (*cinfo->fdct->forward_DCT)( + cinfo, + compptr, input_buf[compptr->component_index], coef->MCU_buffer[blkn], - ypos, xpos, (JDIMENSION)blockcnt); - if (blockcnt < compptr->MCU_width) { + ypos, + xpos, + (JDIMENSION)blockcnt); + if (blockcnt < compptr->MCU_width) + { /* Create some dummy blocks at the right edge of the image. */ - jzero_far((void FAR*) coef->MCU_buffer[blkn + blockcnt], + jzero_far( + (void FAR *)coef->MCU_buffer[blkn + blockcnt], (compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK)); - for (bi = blockcnt; bi < compptr->MCU_width; bi++) { + for (bi = blockcnt; bi < compptr->MCU_width; bi++) + { coef->MCU_buffer[blkn + bi][0][0] = coef->MCU_buffer[blkn + bi - 1][0][0]; } } } - else { + else + { /* Create a row of dummy blocks at the bottom of the image. */ - jzero_far((void FAR*) coef->MCU_buffer[blkn], - compptr->MCU_width * SIZEOF(JBLOCK)); - for (bi = 0; bi < compptr->MCU_width; bi++) { + jzero_far((void FAR *)coef->MCU_buffer[blkn], compptr->MCU_width * SIZEOF(JBLOCK)); + for (bi = 0; bi < compptr->MCU_width; bi++) + { coef->MCU_buffer[blkn + bi][0][0] = coef->MCU_buffer[blkn - 1][0][0]; } } @@ -202,7 +210,8 @@ compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf) /* Try to write the MCU. In event of a suspension failure, we will * re-DCT the MCU on restart (a bit inefficient, could be fixed...) */ - if (!(*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) { + if (!(*cinfo->entropy->encode_mcu)(cinfo, coef->MCU_buffer)) + { /* Suspension forced; update state counters and exit */ coef->MCU_vert_offset = yoffset; coef->mcu_ctr = MCU_col_num; @@ -248,24 +257,28 @@ compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf) JDIMENSION blocks_across, MCUs_across, MCUindex; int bi, ci, h_samp_factor, block_row, block_rows, ndummy; JCOEF lastDC; - jpeg_component_info* compptr; + jpeg_component_info *compptr; JBLOCKARRAY buffer; JBLOCKROW thisblockrow, lastblockrow; - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) + { /* Align the virtual buffer for this component. */ - buffer = (*cinfo->mem->access_virt_barray) - ((j_common_ptr)cinfo, coef->whole_image[ci], - coef->iMCU_row_num * compptr->v_samp_factor, - (JDIMENSION)compptr->v_samp_factor, TRUE); + buffer = (*cinfo->mem->access_virt_barray)( + (j_common_ptr)cinfo, + coef->whole_image[ci], + coef->iMCU_row_num * compptr->v_samp_factor, + (JDIMENSION)compptr->v_samp_factor, + TRUE); /* Count non-dummy DCT block rows in this iMCU row. */ if (coef->iMCU_row_num < last_iMCU_row) block_rows = compptr->v_samp_factor; - else { + else + { /* NB: can't use last_row_height here, since may not be set! */ block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor); - if (block_rows == 0) block_rows = compptr->v_samp_factor; + if (block_rows == 0) + block_rows = compptr->v_samp_factor; } blocks_across = compptr->width_in_blocks; h_samp_factor = compptr->h_samp_factor; @@ -276,18 +289,25 @@ compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf) /* Perform DCT for all non-dummy blocks in this iMCU row. Each call * on forward_DCT processes a complete horizontal row of DCT blocks. */ - for (block_row = 0; block_row < block_rows; block_row++) { + for (block_row = 0; block_row < block_rows; block_row++) + { thisblockrow = buffer[block_row]; - (*cinfo->fdct->forward_DCT) (cinfo, compptr, - input_buf[ci], thisblockrow, + (*cinfo->fdct->forward_DCT)( + cinfo, + compptr, + input_buf[ci], + thisblockrow, (JDIMENSION)(block_row * DCTSIZE), - (JDIMENSION)0, blocks_across); - if (ndummy > 0) { + (JDIMENSION)0, + blocks_across); + if (ndummy > 0) + { /* Create dummy blocks at the right edge of the image. */ thisblockrow += blocks_across; /* => first dummy block */ - jzero_far((void FAR*) thisblockrow, ndummy * SIZEOF(JBLOCK)); + jzero_far((void FAR *)thisblockrow, ndummy * SIZEOF(JBLOCK)); lastDC = thisblockrow[-1][0]; - for (bi = 0; bi < ndummy; bi++) { + for (bi = 0; bi < ndummy; bi++) + { thisblockrow[bi][0] = lastDC; } } @@ -297,18 +317,20 @@ compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf) * of the dummy blocks to match the last real block's DC value. * This squeezes a few more bytes out of the resulting file... */ - if (coef->iMCU_row_num == last_iMCU_row) { - blocks_across += ndummy; /* include lower right corner */ + if (coef->iMCU_row_num == last_iMCU_row) + { + blocks_across += ndummy; /* include lower right corner */ MCUs_across = blocks_across / h_samp_factor; - for (block_row = block_rows; block_row < compptr->v_samp_factor; - block_row++) { + for (block_row = block_rows; block_row < compptr->v_samp_factor; block_row++) + { thisblockrow = buffer[block_row]; lastblockrow = buffer[block_row - 1]; - jzero_far((void FAR*) thisblockrow, - (CLR_INT32)(blocks_across * SIZEOF(JBLOCK))); - for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) { + jzero_far((void FAR *)thisblockrow, (CLR_INT32)(blocks_across * SIZEOF(JBLOCK))); + for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) + { lastDC = lastblockrow[h_samp_factor - 1][0]; - for (bi = 0; bi < h_samp_factor; bi++) { + for (bi = 0; bi < h_samp_factor; bi++) + { thisblockrow[bi][0] = lastDC; } thisblockrow += h_samp_factor; /* advance to next MCU in row */ @@ -321,7 +343,7 @@ compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf) * A suspension return will result in redoing all the work above next time. */ - /* Emit data to the entropy encoder, sharing code with subsequent passes */ + /* Emit data to the entropy encoder, sharing code with subsequent passes */ return compress_output(cinfo, input_buf); } @@ -340,44 +362,51 @@ METHODDEF(bool) compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) { my_coef_ptr coef = (my_coef_ptr)cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION MCU_col_num; /* index of current MCU within row */ int blkn, ci, xindex, yindex, yoffset; JDIMENSION start_col; JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; JBLOCKROW buffer_ptr; - jpeg_component_info* compptr; + jpeg_component_info *compptr; /* Align the virtual buffers for the components used in this scan. * NB: during first pass, this is safe only because the buffers will * already be aligned properly, so jmemmgr.c won't need to do any I/O. */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + { compptr = cinfo->cur_comp_info[ci]; - buffer[ci] = (*cinfo->mem->access_virt_barray) - ((j_common_ptr)cinfo, coef->whole_image[compptr->component_index], - coef->iMCU_row_num * compptr->v_samp_factor, - (JDIMENSION)compptr->v_samp_factor, FALSE); + buffer[ci] = (*cinfo->mem->access_virt_barray)( + (j_common_ptr)cinfo, + coef->whole_image[compptr->component_index], + coef->iMCU_row_num * compptr->v_samp_factor, + (JDIMENSION)compptr->v_samp_factor, + FALSE); } /* Loop to process one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; - MCU_col_num++) { + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; yoffset++) + { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; MCU_col_num++) + { /* Construct list of pointers to DCT blocks belonging to this MCU */ - blkn = 0; /* index of current DCT block within MCU */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + { compptr = cinfo->cur_comp_info[ci]; start_col = MCU_col_num * compptr->MCU_width; - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + for (yindex = 0; yindex < compptr->MCU_height; yindex++) + { buffer_ptr = buffer[ci][yindex + yoffset] + start_col; - for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + for (xindex = 0; xindex < compptr->MCU_width; xindex++) + { coef->MCU_buffer[blkn++] = buffer_ptr++; } } } /* Try to write the MCU. */ - if (!(*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) { + if (!(*cinfo->entropy->encode_mcu)(cinfo, coef->MCU_buffer)) + { /* Suspension forced; update state counters and exit */ coef->MCU_vert_offset = yoffset; coef->mcu_ctr = MCU_col_num; @@ -405,43 +434,45 @@ jinit_c_coef_controller(j_compress_ptr cinfo, bool need_full_buffer) { my_coef_ptr coef; - coef = (my_coef_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, - SIZEOF(my_coef_controller)); - cinfo->coef = (struct jpeg_c_coef_controller*) coef; + coef = (my_coef_ptr)(*cinfo->mem->alloc_small)((j_common_ptr)cinfo, JPOOL_IMAGE, SIZEOF(my_coef_controller)); + cinfo->coef = (struct jpeg_c_coef_controller *)coef; coef->pub.start_pass = start_pass_coef; /* Create the coefficient buffer. */ - if (need_full_buffer) { + if (need_full_buffer) + { #ifdef FULL_COEF_BUFFER_SUPPORTED /* Allocate a full-image virtual array for each component, */ /* padded to a multiple of samp_factor DCT blocks in each direction. */ int ci; - jpeg_component_info* compptr; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) - ((j_common_ptr)cinfo, JPOOL_IMAGE, FALSE, - (JDIMENSION)jround_up((long)compptr->width_in_blocks, - (long)compptr->h_samp_factor), - (JDIMENSION)jround_up((long)compptr->height_in_blocks, - (long)compptr->v_samp_factor), - (JDIMENSION)compptr->v_samp_factor); + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) + { + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)( + (j_common_ptr)cinfo, + JPOOL_IMAGE, + FALSE, + (JDIMENSION)jround_up((long)compptr->width_in_blocks, (long)compptr->h_samp_factor), + (JDIMENSION)jround_up((long)compptr->height_in_blocks, (long)compptr->v_samp_factor), + (JDIMENSION)compptr->v_samp_factor); } #else ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); #endif } - else { + else + { /* We only need a single-MCU buffer. */ JBLOCKROW buffer; int i; - buffer = (JBLOCKROW) - (*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE, - C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); - for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) { + buffer = (JBLOCKROW)(*cinfo->mem->alloc_large)( + (j_common_ptr)cinfo, + JPOOL_IMAGE, + C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) + { coef->MCU_buffer[i] = buffer + i; } coef->whole_image[0] = NULL; /* flag for no virtual arrays */ diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c index 6ece8d00f4..bb9f29ef89 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c @@ -23,17 +23,18 @@ #define JPEG_INTERNALS #include "jinclude.h" #include "jpeglib.h" -#include "jchuff.h"/* Declarations shared with jcphuff.c */ +#include "jchuff.h" /* Declarations shared with jcphuff.c */ - /* Expanded entropy encoder object for Huffman encoding. - * - * The savable_state subrecord contains fields that change within an MCU, - * but must not be updated permanently until we complete the MCU. - */ +/* Expanded entropy encoder object for Huffman encoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ -typedef struct { - CLR_INT32 put_buffer;/* current bit-accumulation buffer */ - int put_bits;/* # of bits now in it */ +typedef struct +{ + CLR_INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ } savable_state; @@ -43,64 +44,61 @@ typedef struct { */ #ifndef NO_STRUCT_ASSIGN -#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#define ASSIGN_STATE(dest, src) ((dest) = (src)) #else #if MAX_COMPS_IN_SCAN == 4 -#define ASSIGN_STATE(dest,src) \ -((dest).put_buffer = (src).put_buffer, \ - (dest).put_bits = (src).put_bits, \ - (dest).last_dc_val[0] = (src).last_dc_val[0], \ - (dest).last_dc_val[1] = (src).last_dc_val[1], \ - (dest).last_dc_val[2] = (src).last_dc_val[2], \ - (dest).last_dc_val[3] = (src).last_dc_val[3]) +#define ASSIGN_STATE(dest, src) \ + ((dest).put_buffer = (src).put_buffer, \ + (dest).put_bits = (src).put_bits, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) #endif #endif - -typedef struct { +typedef struct +{ struct jpeg_entropy_encoder pub; /* public fields */ - savable_state saved;/* Bit buffer & DC state at start of MCU */ + savable_state saved; /* Bit buffer & DC state at start of MCU */ /* These fields are NOT loaded into local working state. */ - unsigned int restarts_to_go;/* MCUs left in this restart interval */ - int next_restart_num;/* next restart number to write (0-7) */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ /* Pointers to derived tables (these workspaces have image lifespan) */ - c_derived_tbl* dc_derived_tbls[NUM_HUFF_TBLS]; - c_derived_tbl* ac_derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl *dc_derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl *ac_derived_tbls[NUM_HUFF_TBLS]; -#ifdef ENTROPY_OPT_SUPPORTED/* Statistics tables for optimization */ - long* dc_count_ptrs[NUM_HUFF_TBLS]; - long* ac_count_ptrs[NUM_HUFF_TBLS]; +#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ + long *dc_count_ptrs[NUM_HUFF_TBLS]; + long *ac_count_ptrs[NUM_HUFF_TBLS]; #endif } huff_entropy_encoder; -typedef huff_entropy_encoder* huff_entropy_ptr; +typedef huff_entropy_encoder *huff_entropy_ptr; /* Working state while writing an MCU. * This struct contains all the fields that are needed by subroutines. */ -typedef struct { - JOCTET* next_output_byte;/* => next byte to write in buffer */ - CLR_INT32 free_in_buffer;/* # of byte spaces remaining in buffer */ - savable_state cur;/* Current bit buffer & DC state */ - j_compress_ptr cinfo;/* dump_buffer needs access to this */ +typedef struct +{ + JOCTET *next_output_byte; /* => next byte to write in buffer */ + CLR_INT32 free_in_buffer; /* # of byte spaces remaining in buffer */ + savable_state cur; /* Current bit buffer & DC state */ + j_compress_ptr cinfo; /* dump_buffer needs access to this */ } working_state; - /* Forward declarations */ -METHODDEF(bool) encode_mcu_huff JPP((j_compress_ptr cinfo, - JBLOCKROW* MCU_data)); +METHODDEF(bool) encode_mcu_huff JPP((j_compress_ptr cinfo, JBLOCKROW *MCU_data)); METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); #ifdef ENTROPY_OPT_SUPPORTED -METHODDEF(bool) encode_mcu_gather JPP((j_compress_ptr cinfo, - JBLOCKROW* MCU_data)); +METHODDEF(bool) encode_mcu_gather JPP((j_compress_ptr cinfo, JBLOCKROW *MCU_data)); METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); #endif - /* * Initialize for a Huffman-compressed scan. * If gather_statistics is TRUE, we do not output anything during the scan, @@ -112,9 +110,10 @@ start_pass_huff(j_compress_ptr cinfo, bool gather_statistics) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; int ci, dctbl, actbl; - jpeg_component_info* compptr; + jpeg_component_info *compptr; - if (gather_statistics) { + if (gather_statistics) + { #ifdef ENTROPY_OPT_SUPPORTED entropy->pub.encode_mcu = encode_mcu_gather; entropy->pub.finish_pass = finish_pass_gather; @@ -122,16 +121,19 @@ start_pass_huff(j_compress_ptr cinfo, bool gather_statistics) ERREXIT(cinfo, JERR_NOT_COMPILED); #endif } - else { + else + { entropy->pub.encode_mcu = encode_mcu_huff; entropy->pub.finish_pass = finish_pass_huff; } - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + { compptr = cinfo->cur_comp_info[ci]; dctbl = compptr->dc_tbl_no; actbl = compptr->ac_tbl_no; - if (gather_statistics) { + if (gather_statistics) + { #ifdef ENTROPY_OPT_SUPPORTED /* Check for invalid table indexes */ /* (make_c_derived_tbl does this in the other path) */ @@ -142,24 +144,21 @@ start_pass_huff(j_compress_ptr cinfo, bool gather_statistics) /* Allocate and zero the statistics tables */ /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ if (entropy->dc_count_ptrs[dctbl] == NULL) - entropy->dc_count_ptrs[dctbl] = (long*) - (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, - 257 * SIZEOF(long)); + entropy->dc_count_ptrs[dctbl] = + (long *)(*cinfo->mem->alloc_small)((j_common_ptr)cinfo, JPOOL_IMAGE, 257 * SIZEOF(long)); MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long)); if (entropy->ac_count_ptrs[actbl] == NULL) - entropy->ac_count_ptrs[actbl] = (long*) - (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, - 257 * SIZEOF(long)); + entropy->ac_count_ptrs[actbl] = + (long *)(*cinfo->mem->alloc_small)((j_common_ptr)cinfo, JPOOL_IMAGE, 257 * SIZEOF(long)); MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long)); #endif } - else { + else + { /* Compute derived values for Huffman tables */ /* We may do this more than once for a table, but it's not expensive */ - jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, - &entropy->dc_derived_tbls[dctbl]); - jpeg_make_c_derived_tbl(cinfo, FALSE, actbl, - &entropy->ac_derived_tbls[actbl]); + jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, &entropy->dc_derived_tbls[dctbl]); + jpeg_make_c_derived_tbl(cinfo, FALSE, actbl, &entropy->ac_derived_tbls[actbl]); } /* Initialize DC predictions to 0 */ entropy->saved.last_dc_val[ci] = 0; @@ -174,7 +173,6 @@ start_pass_huff(j_compress_ptr cinfo, bool gather_statistics) entropy->next_restart_num = 0; } - /* * Compute the derived values for a Huffman table. * This routine also performs some validation checks on the table. @@ -183,11 +181,10 @@ start_pass_huff(j_compress_ptr cinfo, bool gather_statistics) */ GLOBAL(void) -jpeg_make_c_derived_tbl(j_compress_ptr cinfo, bool isDC, int tblno, - c_derived_tbl** pdtbl) +jpeg_make_c_derived_tbl(j_compress_ptr cinfo, bool isDC, int tblno, c_derived_tbl **pdtbl) { - JHUFF_TBL* htbl; - c_derived_tbl* dtbl; + JHUFF_TBL *htbl; + c_derived_tbl *dtbl; int p, i, l, lastp, si, maxsymbol; char huffsize[257]; unsigned int huffcode[257]; @@ -197,27 +194,25 @@ jpeg_make_c_derived_tbl(j_compress_ptr cinfo, bool isDC, int tblno, * paralleling the order of the symbols themselves in htbl->huffval[]. */ - /* Find the input Huffman table */ + /* Find the input Huffman table */ if (tblno < 0 || tblno >= NUM_HUFF_TBLS) ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); - htbl = - isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + htbl = isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; if (htbl == NULL) ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); /* Allocate a workspace if we haven't already done so. */ if (*pdtbl == NULL) - *pdtbl = (c_derived_tbl*) - (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, - SIZEOF(c_derived_tbl)); + *pdtbl = (c_derived_tbl *)(*cinfo->mem->alloc_small)((j_common_ptr)cinfo, JPOOL_IMAGE, SIZEOF(c_derived_tbl)); dtbl = *pdtbl; /* Figure C.1: make table of Huffman code length for each symbol */ p = 0; - for (l = 1; l <= 16; l++) { + for (l = 1; l <= 16; l++) + { i = (int)htbl->bits[l]; - if (i < 0 || p + i > 256)/* protect against table overrun */ + if (i < 0 || p + i > 256) /* protect against table overrun */ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); while (i--) huffsize[p++] = (char)l; @@ -231,8 +226,10 @@ jpeg_make_c_derived_tbl(j_compress_ptr cinfo, bool isDC, int tblno, code = 0; si = huffsize[0]; p = 0; - while (huffsize[p]) { - while (((int)huffsize[p]) == si) { + while (huffsize[p]) + { + while (((int)huffsize[p]) == si) + { huffcode[p++] = code; code++; } @@ -261,7 +258,8 @@ jpeg_make_c_derived_tbl(j_compress_ptr cinfo, bool isDC, int tblno, */ maxsymbol = isDC ? 15 : 255; - for (p = 0; p < lastp; p++) { + for (p = 0; p < lastp; p++) + { i = htbl->huffval[p]; if (i < 0 || i > maxsymbol || dtbl->ehufsi[i]) ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); @@ -270,24 +268,26 @@ jpeg_make_c_derived_tbl(j_compress_ptr cinfo, bool isDC, int tblno, } } - /* Outputting bytes to the file */ /* Emit a byte, taking 'action' if must suspend. */ -#define emit_byte(state,val,action) \ -{ *(state)->next_output_byte++ = (JOCTET) (val); \ - if (--(state)->free_in_buffer == 0) \ - if (! dump_buffer(state)) \ - { action; } } - +#define emit_byte(state, val, action) \ + { \ + *(state)->next_output_byte++ = (JOCTET)(val); \ + if (--(state)->free_in_buffer == 0) \ + if (!dump_buffer(state)) \ + { \ + action; \ + } \ + } LOCAL(bool) -dump_buffer(working_state* state) +dump_buffer(working_state *state) /* Empty the output buffer; return true if successful, FALSE if must suspend */ { - struct jpeg_destination_mgr* dest = state->cinfo->dest; + struct jpeg_destination_mgr *dest = state->cinfo->dest; - if (!(*dest->empty_output_buffer) (state->cinfo)) + if (!(*dest->empty_output_buffer)(state->cinfo)) return false; /* After a successful buffer dump, must reset buffer pointers */ state->next_output_byte = dest->next_output_byte; @@ -295,7 +295,6 @@ dump_buffer(working_state* state) return true; } - /* Outputting bits to the file */ /* Only the right 24 bits of put_buffer are used; the valid bits are @@ -306,7 +305,7 @@ dump_buffer(working_state* state) INLINE LOCAL(bool) -emit_bits(working_state* state, unsigned int code, int size) +emit_bits(working_state *state, unsigned int code, int size) /* Emit some bits; return true if successful, FALSE if must suspend */ { /* This routine is heavily used, so it's worth coding tightly. */ @@ -319,17 +318,19 @@ emit_bits(working_state* state, unsigned int code, int size) put_buffer &= (((CLR_INT32)1) << size) - 1; /* mask off any extra bits in code */ - put_bits += size;/* new number of bits in buffer */ + put_bits += size; /* new number of bits in buffer */ put_buffer <<= 24 - put_bits; /* align incoming bits */ put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */ - while (put_bits >= 8) { + while (put_bits >= 8) + { int c = (int)((put_buffer >> 16) & 0xFF); emit_byte(state, c, return false); - if (c == 0xFF) {/* need to stuff a zero byte? */ + if (c == 0xFF) + { /* need to stuff a zero byte? */ emit_byte(state, 0, return false); } put_buffer <<= 8; @@ -342,23 +343,20 @@ emit_bits(working_state* state, unsigned int code, int size) return true; } - LOCAL(bool) -flush_bits(working_state* state) +flush_bits(working_state *state) { if (!emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ return false; - state->cur.put_buffer = 0;/* and reset bit-buffer to empty */ + state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ state->cur.put_bits = 0; return true; } - /* Encode a single block's worth of coefficients */ LOCAL(bool) -encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, - c_derived_tbl* dctbl, c_derived_tbl* actbl) +encode_one_block(working_state *state, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { register int temp, temp2; register int nbits; @@ -368,8 +366,9 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, temp = temp2 = block[0] - last_dc_val; - if (temp < 0) { - temp = -temp;/* temp is abs value of input */ + if (temp < 0) + { + temp = -temp; /* temp is abs value of input */ /* For a negative input, want temp2 = bitwise complement of abs(input) */ /* This code assumes we are on a two's complement machine */ temp2--; @@ -377,7 +376,8 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, /* Find the number of bits needed for the magnitude of the coefficient */ nbits = 0; - while (temp) { + while (temp) + { nbits++; temp >>= 1; } @@ -393,35 +393,40 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, /* Emit that number of bits of the value, if positive, */ /* or the complement of its magnitude, if negative. */ - if (nbits)/* emit_bits rejects calls with size 0 */ + if (nbits) /* emit_bits rejects calls with size 0 */ if (!emit_bits(state, (unsigned int)temp2, nbits)) return false; /* Encode the AC coefficients per section F.1.2.2 */ - r = 0;/* r = run length of zeros */ + r = 0; /* r = run length of zeros */ - for (k = 1; k < DCTSIZE2; k++) { - if ((temp = block[jpeg_natural_order[k]]) == 0) { + for (k = 1; k < DCTSIZE2; k++) + { + if ((temp = block[jpeg_natural_order[k]]) == 0) + { r++; } - else { + else + { /* if run length > 15, must emit special run-length-16 codes (0xF0) */ - while (r > 15) { + while (r > 15) + { if (!emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0])) return false; r -= 16; } temp2 = temp; - if (temp < 0) { - temp = -temp;/* temp is abs value of input */ + if (temp < 0) + { + temp = -temp; /* temp is abs value of input */ /* This code assumes we are on a two's complement machine */ temp2--; } /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 1;/* there must be at least one 1 bit */ + nbits = 1; /* there must be at least one 1 bit */ while ((temp >>= 1)) nbits++; /* Check for out-of-range coefficient values */ @@ -450,13 +455,12 @@ encode_one_block(working_state* state, JCOEFPTR block, int last_dc_val, return true; } - /* * Emit a restart marker & resynchronize predictions. */ LOCAL(bool) -emit_restart(working_state* state, int restart_num) +emit_restart(working_state *state, int restart_num) { int ci; @@ -475,18 +479,17 @@ emit_restart(working_state* state, int restart_num) return true; } - /* * Encode and output one MCU's worth of Huffman-compressed coefficients. */ METHODDEF(bool) -encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW* MCU_data) +encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW *MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; working_state state; int blkn, ci; - jpeg_component_info* compptr; + jpeg_component_info *compptr; /* Load up working state */ state.next_output_byte = cinfo->dest->next_output_byte; @@ -495,20 +498,24 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW* MCU_data) state.cinfo = cinfo; /* Emit restart marker if needed */ - if (cinfo->restart_interval) { + if (cinfo->restart_interval) + { if (entropy->restarts_to_go == 0) if (!emit_restart(&state, entropy->next_restart_num)) return false; } /* Encode the MCU data blocks */ - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) + { ci = cinfo->MCU_membership[blkn]; compptr = cinfo->cur_comp_info[ci]; - if (!encode_one_block(&state, - MCU_data[blkn][0], state.cur.last_dc_val[ci], - entropy->dc_derived_tbls[compptr->dc_tbl_no], - entropy->ac_derived_tbls[compptr->ac_tbl_no])) + if (!encode_one_block( + &state, + MCU_data[blkn][0], + state.cur.last_dc_val[ci], + entropy->dc_derived_tbls[compptr->dc_tbl_no], + entropy->ac_derived_tbls[compptr->ac_tbl_no])) return false; /* Update last_dc_val */ state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; @@ -520,8 +527,10 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW* MCU_data) ASSIGN_STATE(entropy->saved, state.cur); /* Update restart-interval state too */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) { + if (cinfo->restart_interval) + { + if (entropy->restarts_to_go == 0) + { entropy->restarts_to_go = cinfo->restart_interval; entropy->next_restart_num++; entropy->next_restart_num &= 7; @@ -532,7 +541,6 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW* MCU_data) return true; } - /* * Finish up at the end of a Huffman-compressed scan. */ @@ -559,7 +567,6 @@ finish_pass_huff(j_compress_ptr cinfo) ASSIGN_STATE(entropy->saved, state.cur); } - /* * Huffman coding optimization. * @@ -573,12 +580,10 @@ finish_pass_huff(j_compress_ptr cinfo) #ifdef ENTROPY_OPT_SUPPORTED - - /* Process a single block's worth of coefficients */ +/* Process a single block's worth of coefficients */ LOCAL(void) -htest_one_block(j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, - long dc_counts[], long ac_counts[]) +htest_one_block(j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, long dc_counts[], long ac_counts[]) { register int temp; register int nbits; @@ -592,7 +597,8 @@ htest_one_block(j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, /* Find the number of bits needed for the magnitude of the coefficient */ nbits = 0; - while (temp) { + while (temp) + { nbits++; temp >>= 1; } @@ -607,15 +613,19 @@ htest_one_block(j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, /* Encode the AC coefficients per section F.1.2.2 */ - r = 0;/* r = run length of zeros */ + r = 0; /* r = run length of zeros */ - for (k = 1; k < DCTSIZE2; k++) { - if ((temp = block[jpeg_natural_order[k]]) == 0) { + for (k = 1; k < DCTSIZE2; k++) + { + if ((temp = block[jpeg_natural_order[k]]) == 0) + { r++; } - else { + else + { /* if run length > 15, must emit special run-length-16 codes (0xF0) */ - while (r > 15) { + while (r > 15) + { ac_counts[0xF0]++; r -= 16; } @@ -625,7 +635,7 @@ htest_one_block(j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, temp = -temp; /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 1;/* there must be at least one 1 bit */ + nbits = 1; /* there must be at least one 1 bit */ while ((temp >>= 1)) nbits++; /* Check for out-of-range coefficient values */ @@ -644,22 +654,23 @@ htest_one_block(j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, ac_counts[0]++; } - /* * Trial-encode one MCU's worth of Huffman-compressed coefficients. * No data is actually output, so no suspension return is possible. */ METHODDEF(bool) -encode_mcu_gather(j_compress_ptr cinfo, JBLOCKROW* MCU_data) +encode_mcu_gather(j_compress_ptr cinfo, JBLOCKROW *MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; int blkn, ci; - jpeg_component_info* compptr; + jpeg_component_info *compptr; /* Take care of restart intervals if needed */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) { + if (cinfo->restart_interval) + { + if (entropy->restarts_to_go == 0) + { /* Re-initialize DC predictions to 0 */ for (ci = 0; ci < cinfo->comps_in_scan; ci++) entropy->saved.last_dc_val[ci] = 0; @@ -669,10 +680,14 @@ encode_mcu_gather(j_compress_ptr cinfo, JBLOCKROW* MCU_data) entropy->restarts_to_go--; } - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) + { ci = cinfo->MCU_membership[blkn]; compptr = cinfo->cur_comp_info[ci]; - htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci], + htest_one_block( + cinfo, + MCU_data[blkn][0], + entropy->saved.last_dc_val[ci], entropy->dc_count_ptrs[compptr->dc_tbl_no], entropy->ac_count_ptrs[compptr->ac_tbl_no]); entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; @@ -681,7 +696,6 @@ encode_mcu_gather(j_compress_ptr cinfo, JBLOCKROW* MCU_data) return true; } - /* * Generate the best Huffman code table for the given counts, fill htbl. * Note this is also used by jcphuff.c. @@ -711,12 +725,12 @@ encode_mcu_gather(j_compress_ptr cinfo, JBLOCKROW* MCU_data) */ GLOBAL(void) -jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[]) +jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[]) { -#define MAX_CLEN 32/* assumed maximum initial code length */ - CLR_UINT8 bits[MAX_CLEN + 1];/* bits[k] = # of symbols with code length k */ - int codesize[257];/* codesize[k] = code length of symbol k */ - int others[257];/* next symbol in current branch of tree */ +#define MAX_CLEN 32 /* assumed maximum initial code length */ + CLR_UINT8 bits[MAX_CLEN + 1]; /* bits[k] = # of symbols with code length k */ + int codesize[257]; /* codesize[k] = code length of symbol k */ + int others[257]; /* next symbol in current branch of tree */ int c1, c2; int p, i, j; long v; @@ -726,23 +740,26 @@ jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[]) MEMZERO(bits, SIZEOF(bits)); MEMZERO(codesize, SIZEOF(codesize)); for (i = 0; i < 257; i++) - others[i] = -1;/* init links to empty */ + others[i] = -1; /* init links to empty */ - freq[256] = 1;/* make sure 256 has a nonzero count */ + freq[256] = 1; /* make sure 256 has a nonzero count */ /* Including the pseudo-symbol 256 in the Huffman procedure guarantees * that no real symbol is given code-value of all ones, because 256 * will be placed last in the largest codeword category. */ - /* Huffman's basic algorithm to assign optimal code lengths to symbols */ + /* Huffman's basic algorithm to assign optimal code lengths to symbols */ - for (;;) { + for (;;) + { /* Find the smallest nonzero frequency, set c1 = its symbol */ /* In case of ties, take the larger symbol number */ c1 = -1; v = 1000000000L; - for (i = 0; i <= 256; i++) { - if (freq[i] && freq[i] <= v) { + for (i = 0; i <= 256; i++) + { + if (freq[i] && freq[i] <= v) + { v = freq[i]; c1 = i; } @@ -752,8 +769,10 @@ jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[]) /* In case of ties, take the larger symbol number */ c2 = -1; v = 1000000000L; - for (i = 0; i <= 256; i++) { - if (freq[i] && freq[i] <= v && i != c1) { + for (i = 0; i <= 256; i++) + { + if (freq[i] && freq[i] <= v && i != c1) + { v = freq[i]; c2 = i; } @@ -769,24 +788,28 @@ jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[]) /* Increment the codesize of everything in c1's tree branch */ codesize[c1]++; - while (others[c1] >= 0) { + while (others[c1] >= 0) + { c1 = others[c1]; codesize[c1]++; } - others[c1] = c2;/* chain c2 onto c1's tree branch */ + others[c1] = c2; /* chain c2 onto c1's tree branch */ /* Increment the codesize of everything in c2's tree branch */ codesize[c2]++; - while (others[c2] >= 0) { + while (others[c2] >= 0) + { c2 = others[c2]; codesize[c2]++; } } /* Now count the number of symbols of each code length */ - for (i = 0; i <= 256; i++) { - if (codesize[i]) { + for (i = 0; i <= 256; i++) + { + if (codesize[i]) + { /* The JPEG standard seems to think that this can't happen, */ /* but I'm paranoid... */ if (codesize[i] > MAX_CLEN) @@ -807,21 +830,23 @@ jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[]) * one bit longer. */ - for (i = MAX_CLEN; i > 16; i--) { - while (bits[i] > 0) { - j = i - 2;/* find length of new prefix to be used */ + for (i = MAX_CLEN; i > 16; i--) + { + while (bits[i] > 0) + { + j = i - 2; /* find length of new prefix to be used */ while (bits[j] == 0) j--; - bits[i] -= 2;/* remove two symbols */ - bits[i - 1]++;/* one goes in this length */ - bits[j + 1] += 2;/* two new symbols in this length */ - bits[j]--;/* symbol of this length is now a prefix */ + bits[i] -= 2; /* remove two symbols */ + bits[i - 1]++; /* one goes in this length */ + bits[j + 1] += 2; /* two new symbols in this length */ + bits[j]--; /* symbol of this length is now a prefix */ } } /* Remove the count for the pseudo-symbol 256 from the largest codelength */ - while (bits[i] == 0)/* find largest codelength still in use */ + while (bits[i] == 0) /* find largest codelength still in use */ i--; bits[i]--; @@ -833,9 +858,12 @@ jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[]) * changes made above, but the JPEG spec seems to think this works. */ p = 0; - for (i = 1; i <= MAX_CLEN; i++) { - for (j = 0; j <= 255; j++) { - if (codesize[j] == i) { + for (i = 1; i <= MAX_CLEN; i++) + { + for (j = 0; j <= 255; j++) + { + if (codesize[j] == i) + { htbl->huffval[p] = (CLR_UINT8)j; p++; } @@ -846,7 +874,6 @@ jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL* htbl, long freq[]) htbl->sent_table = false; } - /* * Finish up a statistics-gathering pass and create the new Huffman tables. */ @@ -856,8 +883,8 @@ finish_pass_gather(j_compress_ptr cinfo) { huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; int ci, dctbl, actbl; - jpeg_component_info* compptr; - JHUFF_TBL** htblptr; + jpeg_component_info *compptr; + JHUFF_TBL **htblptr; bool did_dc[NUM_HUFF_TBLS]; bool did_ac[NUM_HUFF_TBLS]; @@ -867,18 +894,21 @@ finish_pass_gather(j_compress_ptr cinfo) MEMZERO(did_dc, SIZEOF(did_dc)); MEMZERO(did_ac, SIZEOF(did_ac)); - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + { compptr = cinfo->cur_comp_info[ci]; dctbl = compptr->dc_tbl_no; actbl = compptr->ac_tbl_no; - if (!did_dc[dctbl]) { + if (!did_dc[dctbl]) + { htblptr = &cinfo->dc_huff_tbl_ptrs[dctbl]; if (*htblptr == NULL) *htblptr = jpeg_alloc_huff_table((j_common_ptr)cinfo); jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]); did_dc[dctbl] = true; } - if (!did_ac[actbl]) { + if (!did_ac[actbl]) + { htblptr = &cinfo->ac_huff_tbl_ptrs[actbl]; if (*htblptr == NULL) *htblptr = jpeg_alloc_huff_table((j_common_ptr)cinfo); @@ -888,10 +918,8 @@ finish_pass_gather(j_compress_ptr cinfo) } } - #endif /* ENTROPY_OPT_SUPPORTED */ - /* * Module initialization routine for Huffman entropy encoding. */ @@ -902,14 +930,14 @@ jinit_huff_encoder(j_compress_ptr cinfo) huff_entropy_ptr entropy; int i; - entropy = (huff_entropy_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, - SIZEOF(huff_entropy_encoder)); - cinfo->entropy = (struct jpeg_entropy_encoder*) entropy; + entropy = + (huff_entropy_ptr)(*cinfo->mem->alloc_small)((j_common_ptr)cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_encoder)); + cinfo->entropy = (struct jpeg_entropy_encoder *)entropy; entropy->pub.start_pass = start_pass_huff; /* Mark tables unallocated */ - for (i = 0; i < NUM_HUFF_TBLS; i++) { + for (i = 0; i < NUM_HUFF_TBLS; i++) + { entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; #ifdef ENTROPY_OPT_SUPPORTED entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; From 0479daac9cf58cf7b4c708c8625d0dd2e5de8a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 4 Jun 2026 00:04:31 +0100 Subject: [PATCH 04/18] POSIX now builds using C23 and C++23 --- targets/posix/nanoCLR/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/posix/nanoCLR/CMakeLists.txt b/targets/posix/nanoCLR/CMakeLists.txt index 7c4036d911..26e245c2da 100644 --- a/targets/posix/nanoCLR/CMakeLists.txt +++ b/targets/posix/nanoCLR/CMakeLists.txt @@ -228,7 +228,7 @@ list(APPEND NANOCLR_POSIX_SOURCES # .NET nanoclr global tool via P/Invoke. add_library(nanoFramework.nanoCLR SHARED ${NANOCLR_POSIX_SOURCES}) -target_compile_features(nanoFramework.nanoCLR PRIVATE cxx_std_20) +target_compile_features(nanoFramework.nanoCLR PRIVATE c_std_23 cxx_std_23) target_include_directories( nanoFramework.nanoCLR @@ -318,7 +318,7 @@ set_target_properties( # ─── Thin test harness (links against the shared library) ──────────────────── if(NANO_POSIX_ENABLE_SMOKE) add_executable(nanoFramework.nanoCLR.test main.cpp) -target_compile_features(nanoFramework.nanoCLR.test PRIVATE cxx_std_20) +target_compile_features(nanoFramework.nanoCLR.test PRIVATE c_std_23 cxx_std_23) target_link_libraries(nanoFramework.nanoCLR.test PRIVATE nanoFramework.nanoCLR) target_include_directories( nanoFramework.nanoCLR.test From 1b9cb00789549891544492c58f4974cfc81a2780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 4 Jun 2026 00:17:50 +0100 Subject: [PATCH 05/18] More bool keyword migrations --- src/CLR/Diagnostics/Diagnostics_stub.cpp | 4 ++-- .../Network/Enc28j60/enc28j60_lwip_driver.cpp | 2 +- src/HAL/nanoHAL_SystemInformation.cpp | 2 +- src/PAL/COM/sockets/Sockets_debugger.cpp | 12 +++++----- .../ssl/MbedTLS/ssl_generic_init_internal.cpp | 2 +- src/PAL/COM/sockets/ssl/ssl_stubs.cpp | 2 +- src/PAL/FileSystem/nanoPAL_FileSystem.cpp | 14 +++++------ src/PAL/Lwip/lwIP_Sockets.cpp | 2 +- .../TouchPanel/Core/Gestures.cpp | 4 ++-- .../TouchPanel/Core/TouchPanel.cpp | 4 ++-- targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp | 8 +++---- .../targetHAL_ConfigurationManager.cpp | 22 ++++++++--------- targets/ESP32/_FatFs/fatfs_FS_Driver.cpp | 2 +- .../ESP32/_littlefs/littlefs_FS_Driver.cpp | 2 +- ...noFramework_Device_OneWire_OneWireHost.cpp | 4 ++-- .../targetHAL_ConfigurationManager.cpp | 18 +++++++------- .../targetHAL_ConfigurationManager.cpp | 18 +++++++------- .../wifi/inventek/ISM43362_sockets.cpp | 4 ++-- .../targetHAL_ConfigurationManager.cpp | 24 +++++++++---------- .../targetHAL_ConfigurationManager.cpp | 24 +++++++++---------- ...noFramework_Device_OneWire_OneWireHost.cpp | 4 ++-- targets/ThreadX/_common/NetX/netx_sockets.cpp | 2 +- .../Target_BlockStorage.cpp | 2 +- .../win32/Include/TargetPAL_BlockStorage.h | 4 ++-- .../win32/nanoCLR/PAL/COMDirector_stubs.cpp | 6 ++--- .../win32/nanoCLR/PAL/ConfigHelper_stubs.cpp | 10 ++++---- .../nanoCLR/PAL/blockstorageList_stubs.cpp | 16 ++++++------- 27 files changed, 109 insertions(+), 109 deletions(-) diff --git a/src/CLR/Diagnostics/Diagnostics_stub.cpp b/src/CLR/Diagnostics/Diagnostics_stub.cpp index 40a2bfe6b3..f83e9c7f8f 100644 --- a/src/CLR/Diagnostics/Diagnostics_stub.cpp +++ b/src/CLR/Diagnostics/Diagnostics_stub.cpp @@ -35,7 +35,7 @@ __nfweak bool CLR_SafeSprintfV(char *&szBuffer, size_t &iBuffer, const char *for NATIVE_PROFILE_CLR_DIAGNOSTICS(); - return FALSE; + return false; } __nfweak bool CLR_SafeSprintf(char *&szBuffer, size_t &iBuffer, const char *format, ...) @@ -46,7 +46,7 @@ __nfweak bool CLR_SafeSprintf(char *&szBuffer, size_t &iBuffer, const char *form NATIVE_PROFILE_CLR_DIAGNOSTICS(); - return FALSE; + return false; } //--// diff --git a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp index f133d400c2..6bcb4d2fbd 100644 --- a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp +++ b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp @@ -206,7 +206,7 @@ bool enc28j60_Network_Interface_Close(int index, HAL_Configuration_NetworkInterf { NATIVE_PROFILE_HAL_DRIVERS_ETHERNET(); if (pConfig->SpecificConfigId >= ARRAYSIZE(g_ENC28J60_LWIP_Config.DeviceConfigs)) - return FALSE; + return false; return g_ENC28J60_LWIP_Driver.Close(&g_ENC28J60_LWIP_Config.DeviceConfigs[pConfig->SpecificConfigId], index); } diff --git a/src/HAL/nanoHAL_SystemInformation.cpp b/src/HAL/nanoHAL_SystemInformation.cpp index 9786ab1afd..3279b9f4ff 100644 --- a/src/HAL/nanoHAL_SystemInformation.cpp +++ b/src/HAL/nanoHAL_SystemInformation.cpp @@ -14,7 +14,7 @@ bool GetHalSystemInfo(HalSystemInfo &systemInfo) { #if defined(HAL_REDUCESIZE) // No config update. - return FALSE; + return false; #else // NFReleaseInfo: diff --git a/src/PAL/COM/sockets/Sockets_debugger.cpp b/src/PAL/COM/sockets/Sockets_debugger.cpp index 7866e80835..726b68e574 100644 --- a/src/PAL/COM/sockets/Sockets_debugger.cpp +++ b/src/PAL/COM/sockets/Sockets_debugger.cpp @@ -117,7 +117,7 @@ bool Sockets_LWIP_Driver::InitializeDbgListener(int ComPortNum) Debugger_Initialize(); if (ComPortNum != ConvertCOM_SockPort(COM_SOCKET_DBG)) - return FALSE; + return false; if (g_Sockets_LWIP_Driver.m_SocketDebugListener != SOCK_SOCKET_ERROR) return true; @@ -182,7 +182,7 @@ bool Sockets_LWIP_Driver::UninitializeDbgListener(int ComPortNum) NATIVE_PROFILE_PAL_COM(); if (ComPortNum != ConvertCOM_SockPort(COM_SOCKET_DBG)) - return FALSE; + return false; g_Sockets_LWIP_Driver.m_stateDebugSocket = DbgSock_Uninitialized; @@ -416,16 +416,16 @@ void Sockets_LWIP_Driver::OnDebuggerTimeout(void *arg) bool Sockets_LWIP_Driver::IsUsingSsl(int ComPortNum) { if (ComPortNum != ConvertCOM_SockPort(COM_SOCKET_DBG)) - return FALSE; + return false; if (g_Sockets_LWIP_Driver.m_stateDebugSocket == DbgSock_Uninitialized) - return FALSE; + return false; if (g_Sockets_LWIP_Driver.m_stateDebugSocket == DbgSock_Connected) { return g_Sockets_LWIP_Driver.m_usingSSL; } - return FALSE; + return false; } bool Sockets_LWIP_Driver::UpgradeToSsl( @@ -483,7 +483,7 @@ bool Sockets_LWIP_Driver::UpgradeToSsl( } } - return FALSE; + return false; } //----------------------------------------------------------------------------- diff --git a/src/PAL/COM/sockets/ssl/MbedTLS/ssl_generic_init_internal.cpp b/src/PAL/COM/sockets/ssl/MbedTLS/ssl_generic_init_internal.cpp index 47d6a34ea9..f2a6e7e833 100644 --- a/src/PAL/COM/sockets/ssl/MbedTLS/ssl_generic_init_internal.cpp +++ b/src/PAL/COM/sockets/ssl/MbedTLS/ssl_generic_init_internal.cpp @@ -49,7 +49,7 @@ bool ssl_generic_init_internal( if (sslContexIndex == -1) { - return FALSE; + return false; } // create and init MbedTLS nanoFramework context diff --git a/src/PAL/COM/sockets/ssl/ssl_stubs.cpp b/src/PAL/COM/sockets/ssl/ssl_stubs.cpp index 7f0fbf31e9..cbd4a873e9 100644 --- a/src/PAL/COM/sockets/ssl/ssl_stubs.cpp +++ b/src/PAL/COM/sockets/ssl/ssl_stubs.cpp @@ -11,7 +11,7 @@ __nfweak bool SSL_Initialize() { NATIVE_PROFILE_PAL_COM(); - return FALSE; + return false; } __nfweak bool SSL_Uninitialize() diff --git a/src/PAL/FileSystem/nanoPAL_FileSystem.cpp b/src/PAL/FileSystem/nanoPAL_FileSystem.cpp index 3924e4350e..3e3205f7d2 100644 --- a/src/PAL/FileSystem/nanoPAL_FileSystem.cpp +++ b/src/PAL/FileSystem/nanoPAL_FileSystem.cpp @@ -22,7 +22,7 @@ bool FS_MountVolume(const char *rootName, uint32_t deviceFlags, const char *file if (!rootName) { - return FALSE; + return false; } //--// @@ -76,7 +76,7 @@ bool FS_MountVolume(const char *rootName, uint32_t deviceFlags, const char *file // sanity check if (!volume) { - return FALSE; + return false; } // initialize content to 0 @@ -156,7 +156,7 @@ bool FileSystemVolumeList::InitializeVolumes() #if defined(PLATFORM_ARM) debug_printf("There are no file system volume to initialize"); #endif - return FALSE; + return false; } bool success = true; @@ -214,7 +214,7 @@ bool FileSystemVolumeList::AddVolume( if (!fsv) { - return FALSE; + return false; } FileSystemVolume *current; @@ -268,7 +268,7 @@ bool FileSystemVolumeList::AddVolume( return true; } - return FALSE; + return false; } bool FileSystemVolumeList::RemoveVolume(FileSystemVolume *fsv, bool uninit) @@ -285,7 +285,7 @@ bool FileSystemVolumeList::RemoveVolume(FileSystemVolume *fsv, bool uninit) return true; } - return FALSE; + return false; } FileSystemVolume *FileSystemVolumeList::GetFirstVolume() @@ -385,5 +385,5 @@ bool FileSystemVolumeList::Contains(FileSystemVolume *fsv) volume = FileSystemVolumeList::GetNextVolume(*volume); } - return FALSE; + return false; } diff --git a/src/PAL/Lwip/lwIP_Sockets.cpp b/src/PAL/Lwip/lwIP_Sockets.cpp index a0cd50e4c5..6cbeb158a9 100644 --- a/src/PAL/Lwip/lwIP_Sockets.cpp +++ b/src/PAL/Lwip/lwIP_Sockets.cpp @@ -288,7 +288,7 @@ bool LWIP_SOCKETS_Driver::InitializeInterfaceIndex( return true; } - return FALSE; + return false; } bool LWIP_SOCKETS_Driver::Initialize() diff --git a/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp b/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp index 1a71ff2f47..802c239ef3 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp @@ -98,7 +98,7 @@ bool GestureDriver::ProcessPoint(CLR_UINT32 flags, CLR_UINT16 source, CLR_UINT16 if (source == 0) {} // Avoid unused paramter , not used as ported, maybe in future? if (time == 0) {} // Avoid unused paramter , not used as ported, maybe in future? - if (!GestureDriver::s_initialized) return FALSE; + if (!GestureDriver::s_initialized) return false; m_index = (flags >> 16); @@ -109,7 +109,7 @@ bool GestureDriver::ProcessPoint(CLR_UINT32 flags, CLR_UINT16 source, CLR_UINT16 { PostManagedEvent(EVENT_GESTURE, gesture, 0, ((CLR_UINT32)m_startx << 16) | m_starty); } - return FALSE; + return false; } if (x == TouchPointLocationFlags_ContactDown) return true; diff --git a/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp b/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp index b650ef9c0b..ff03c34f6b 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp @@ -133,7 +133,7 @@ HRESULT TouchPanelDriver::GetDeviceCaps(unsigned int iIndex, void *lpOutput) { if (lpOutput == NULL) { - return FALSE; + return false; } switch (iIndex) @@ -162,7 +162,7 @@ HRESULT TouchPanelDriver::GetDeviceCaps(unsigned int iIndex, void *lpOutput) return (g_TouchPanelDriver.CalibrationPointGet((TOUCH_PANEL_CALIBRATION_POINT *)lpOutput)); default: - return FALSE; + return false; } return S_OK; diff --git a/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp b/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp index d3b6f1fb50..ae37b648e1 100644 --- a/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp +++ b/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp @@ -88,7 +88,7 @@ bool FATFS_FS_Driver::InitializeVolume(const VOLUME_ID *volume, const char *path if (fs == NULL) { - return FALSE; + return false; } // try mounting the volume @@ -103,7 +103,7 @@ bool FATFS_FS_Driver::InitializeVolume(const VOLUME_ID *volume, const char *path // ... and free the volume FreeFatFsByVolumeId(volume); - return FALSE; + return false; } bool FATFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) @@ -116,7 +116,7 @@ bool FATFS_FS_Driver::UnInitializeVolume(const VOLUME_ID *volume) // sanity check if (volumeIndex < 0) { - return FALSE; + return false; } // need to converto to string @@ -227,7 +227,7 @@ HRESULT FATFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volumeLab // if (fs == NULL) // { - // return FALSE; + // return false; // } // memcpy(volumeLabel, fatFS.lfnbuf, volumeLabelLen); diff --git a/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp b/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp index 5c929df655..09a373aeb5 100644 --- a/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp @@ -216,7 +216,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.Wireless80211Configs->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.Wireless80211Configs->Count) { - return FALSE; + return false; } // set block size @@ -230,7 +230,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.CertificateStore->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.CertificateStore->Count) { - return FALSE; + return false; } // get block address @@ -246,7 +246,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.DeviceCertificates->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.DeviceCertificates->Count) { - return FALSE; + return false; } // get block address @@ -296,7 +296,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // the requested config block is beyond the available count if ((configurationIndex + 1) > g_TargetConfiguration.NetworkInterfaceConfigs->Count) { - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -330,7 +330,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( else if (g_TargetConfiguration.Wireless80211Configs->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.Wireless80211Configs->Count) { - return FALSE; + return false; } else { @@ -378,14 +378,14 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( if (((uint32_t)&__nanoConfig_end__ - storageAddress) < blockSize) { // not enough room - return FALSE; + return false; } // now check if memory is erase, so the block can be stored if (!g_ConfigFlashDriver.IsBlockErased(NULL, storageAddress, blockSize)) { // memory not erased, can't store - return FALSE; + return false; } } @@ -428,14 +428,14 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( if (((uint32_t)&__nanoConfig_end__ - storageAddress) < blockSize) { // not enough room - return FALSE; + return false; } // now check if memory is erase, so the block can be stored if (!g_ConfigFlashDriver.IsBlockErased(NULL, storageAddress, blockSize)) { // memory not erased, can't store - return FALSE; + return false; } } @@ -458,7 +458,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // for save all the block size has to be provided, check that if (blockSize == 0) { - return FALSE; + return false; } } @@ -760,7 +760,7 @@ __nfweak bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface (void)configurationIndex; // can't create a "default" network config because we are lacking definition of a MAC address - return FALSE; + return false; } // default implementation diff --git a/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp b/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp index e434c039b8..6f7752c629 100644 --- a/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp +++ b/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp @@ -142,7 +142,7 @@ HRESULT FATFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volumeLab // if (fs == NULL) // { - // return FALSE; + // return false; // } // memcpy(volumeLabel, fatFS.lfnbuf, volumeLabelLen); diff --git a/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp b/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp index bae9e292f1..31fdaa390d 100644 --- a/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp +++ b/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp @@ -142,7 +142,7 @@ HRESULT LITTLEFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volume // if (fs == NULL) // { - // return FALSE; + // return false; // } // memcpy(volumeLabel, fatFS.lfnbuf, volumeLabelLen); diff --git a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index 93c3b9dd6c..5a1ea58d0a 100644 --- a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -272,7 +272,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) LastDevice = FALSE; LastFamilyDiscrepancy = 0; - return FALSE; + return false; } // check if reset bus was requested @@ -285,7 +285,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) // reset the search LastDiscrepancy = 0; LastFamilyDiscrepancy = 0; - return FALSE; + return false; } } diff --git a/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp b/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp index 9e1ce966f3..df60e2dfba 100644 --- a/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp @@ -115,14 +115,14 @@ bool ConfigurationManager_GetConfigurationBlock( // there is no network config block, init one with default settings if (!InitialiseNetworkDefaultConfig(NULL, 0)) { - return FALSE; + return false; } } else { if ((configurationIndex + 1) > g_TargetConfiguration.NetworkInterfaceConfigs->Count) { - return FALSE; + return false; } } @@ -137,7 +137,7 @@ bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.Wireless80211Configs->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.Wireless80211Configs->Count) { - return FALSE; + return false; } // set block size @@ -151,7 +151,7 @@ bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.CertificateStore->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.CertificateStore->Count) { - return FALSE; + return false; } // get block address @@ -191,7 +191,7 @@ bool ConfigurationManager_StoreConfigurationBlock( { // there is no room for this block, or there are no blocks stored at all // failing the operation - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -213,7 +213,7 @@ bool ConfigurationManager_StoreConfigurationBlock( { // there is no room for this block, or there are no blocks stored at all // failing the operation - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -235,7 +235,7 @@ bool ConfigurationManager_StoreConfigurationBlock( { // there is no room for this block, or there are no blocks stored at all // failing the operation - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -265,7 +265,7 @@ bool ConfigurationManager_StoreConfigurationBlock( // for save all the block size has to be provided, check that if (blockSize == 0) { - return FALSE; + return false; } } @@ -418,7 +418,7 @@ bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface *pconfig, (void)configurationIndex; // can't create a "default" network config because we are lacking definition of a MAC address - return FALSE; + return false; } // default implementation diff --git a/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp index 8050301c1d..90f60dfdeb 100644 --- a/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp @@ -161,7 +161,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.Wireless80211Configs->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.Wireless80211Configs->Count) { - return FALSE; + return false; } // set block size @@ -175,7 +175,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.CertificateStore->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.CertificateStore->Count) { - return FALSE; + return false; } // get block address @@ -226,7 +226,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // the requested config block is beyond the available count if ((configurationIndex + 1) > g_TargetConfiguration.NetworkInterfaceConfigs->Count) { - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -250,7 +250,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( { // there is no room for this block, or there are no blocks stored at all // failing the operation - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -295,14 +295,14 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( if (((uint32_t)&__nanoConfig_end__ - storageAddress) < blockSize) { // not enough room - return FALSE; + return false; } // now check if memory is erase, so the block can be stored if (!MXCFlashDriver_IsBlockErased(NULL, storageAddress, blockSize)) { // memory not erased, can't store - return FALSE; + return false; } } @@ -325,7 +325,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // for save all the block size has to be provided, check that if (blockSize == 0) { - return FALSE; + return false; } } @@ -473,7 +473,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( // free memory first platform_free(configSectorCopy); - return FALSE; + return false; } // erase config sector @@ -524,7 +524,7 @@ __nfweak bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface (void)configurationIndex; // can't create a "default" network config because we are lacking definition of a MAC address - return FALSE; + return false; } // default implementation diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp index 13e9310723..1913b53fc5 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp @@ -271,7 +271,7 @@ bool ISM43362_SOCKETS_Driver::Initialize() // sanity check if (networkConfiguration.StartupAddressMode == 0) { - return FALSE; + return false; } // Bind and Open the Ethernet driver @@ -292,7 +292,7 @@ bool ISM43362_SOCKETS_Driver::Initialize() (NetworkInterface_UpdateOperation_Dhcp | NetworkInterface_UpdateOperation_Dns), &networkConfiguration) != S_OK) { - return FALSE; + return false; } // TODO NETWORK diff --git a/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp index 95ba93bc66..207f7c9ba2 100644 --- a/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp @@ -223,7 +223,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.Wireless80211Configs->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.Wireless80211Configs->Count) { - return FALSE; + return false; } // set block size @@ -237,7 +237,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.CertificateStore->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.CertificateStore->Count) { - return FALSE; + return false; } // get block address @@ -253,7 +253,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.DeviceCertificates->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.DeviceCertificates->Count) { - return FALSE; + return false; } // get block address @@ -304,7 +304,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // the requested config block is beyond the available count if ((configurationIndex + 1) > g_TargetConfiguration.NetworkInterfaceConfigs->Count) { - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -346,7 +346,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // the requested config block is beyond the available count if ((configurationIndex + 1) > g_TargetConfiguration.Wireless80211Configs->Count) { - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -365,7 +365,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( #else // no support for WIFI in this STM32 build - return FALSE; + return false; #endif } else if (configuration == DeviceConfigurationOption_X509CaRootBundle) @@ -398,14 +398,14 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( if (((uint32_t)&__nanoConfig_end__ - storageAddress) < blockSize) { // not enough room - return FALSE; + return false; } // now check if memory is erase, so the block can be stored if (!STM32FlashDriver_IsBlockErased(NULL, storageAddress, blockSize)) { // memory not erased, can't store - return FALSE; + return false; } } @@ -448,14 +448,14 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( if (((uint32_t)&__nanoConfig_end__ - storageAddress) < blockSize) { // not enough room - return FALSE; + return false; } // now check if memory is erase, so the block can be stored if (!STM32FlashDriver_IsBlockErased(NULL, storageAddress, blockSize)) { // memory not erased, can't store - return FALSE; + return false; } } @@ -478,7 +478,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // for save all the block size has to be provided, check that if (blockSize == 0) { - return FALSE; + return false; } } @@ -748,7 +748,7 @@ __nfweak bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface // can't create a "default" network config because we are lacking definition of a MAC address - return FALSE; + return false; #endif } diff --git a/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp index 0d7422ff0b..588033c72c 100644 --- a/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp @@ -233,7 +233,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.Wireless80211Configs->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.Wireless80211Configs->Count) { - return FALSE; + return false; } // set block size @@ -247,7 +247,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.CertificateStore->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.CertificateStore->Count) { - return FALSE; + return false; } // get block address @@ -263,7 +263,7 @@ __nfweak bool ConfigurationManager_GetConfigurationBlock( if (g_TargetConfiguration.DeviceCertificates->Count == 0 || (configurationIndex + 1) > g_TargetConfiguration.DeviceCertificates->Count) { - return FALSE; + return false; } // get block address @@ -314,7 +314,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // the requested config block is beyond the available count if ((configurationIndex + 1) > g_TargetConfiguration.NetworkInterfaceConfigs->Count) { - return FALSE; + return false; } // set storage address from block address, plus the requested offset @@ -356,7 +356,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // // the requested config block is beyond the available count // if ((configurationIndex + 1) > g_TargetConfiguration.Wireless80211Configs->Count) // { - // return FALSE; + // return false; // } // // set storage address from block address, plus the requested offset @@ -376,7 +376,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // #else // // no support for WIFI in this STM32 build - // return FALSE; + // return false; // #endif } else if (configuration == DeviceConfigurationOption_X509CaRootBundle) @@ -409,14 +409,14 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( if (((uint32_t)&__nanoConfig_end__ - storageAddress) < blockSize) { // not enough room - return FALSE; + return false; } // // now check if memory is erase, so the block can be stored // if (!STM32FlashDriver_IsBlockErased(NULL, storageAddress, blockSize)) // { // // memory not erased, can't store - // return FALSE; + // return false; // } } @@ -459,14 +459,14 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( if (((uint32_t)&__nanoConfig_end__ - storageAddress) < blockSize) { // not enough room - return FALSE; + return false; } // // now check if memory is erase, so the block can be stored // if (!STM32FlashDriver_IsBlockErased(NULL, storageAddress, blockSize)) // { // // memory not erased, can't store - // return FALSE; + // return false; // } } @@ -489,7 +489,7 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( // for save all the block size has to be provided, check that if (blockSize == 0) { - return FALSE; + return false; } } @@ -756,7 +756,7 @@ __nfweak bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface // can't create a "default" network config because we are lacking definition of a MAC address - return FALSE; + return false; // #endif } diff --git a/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index fd79ba0737..324fa2a56a 100644 --- a/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -246,7 +246,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) LastDevice = FALSE; LastFamilyDiscrepancy = 0; - return FALSE; + return false; } // check if reset bus was requested @@ -259,7 +259,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) // reset the search LastDiscrepancy = 0; LastFamilyDiscrepancy = 0; - return FALSE; + return false; } } diff --git a/targets/ThreadX/_common/NetX/netx_sockets.cpp b/targets/ThreadX/_common/NetX/netx_sockets.cpp index dc01364792..a17f89f96a 100644 --- a/targets/ThreadX/_common/NetX/netx_sockets.cpp +++ b/targets/ThreadX/_common/NetX/netx_sockets.cpp @@ -214,7 +214,7 @@ bool NETX_SOCKETS_Driver::Initialize() // sanity check if (networkConfiguration.StartupAddressMode == 0) { - return FALSE; + return false; } // Bind and Open the Ethernet driver diff --git a/targets/netcore/nanoFramework.nanoCLR/Target_BlockStorage.cpp b/targets/netcore/nanoFramework.nanoCLR/Target_BlockStorage.cpp index c9a7cd1b62..39d551880e 100644 --- a/targets/netcore/nanoFramework.nanoCLR/Target_BlockStorage.cpp +++ b/targets/netcore/nanoFramework.nanoCLR/Target_BlockStorage.cpp @@ -466,7 +466,7 @@ bool BlockStorageStream_Read(BlockStorageStream *stream, unsigned char **buffer, { // TODO FIXME // need to check implementation of this call to get pointers to stream continuation - // if(!NextStream()) return FALSE; + // if(!NextStream()) return false; } if ((stream->CurrentIndex + readLen) > stream->Length) diff --git a/targets/win32/Include/TargetPAL_BlockStorage.h b/targets/win32/Include/TargetPAL_BlockStorage.h index 4ed9ce6e48..cf999b454d 100644 --- a/targets/win32/Include/TargetPAL_BlockStorage.h +++ b/targets/win32/Include/TargetPAL_BlockStorage.h @@ -94,10 +94,10 @@ // BlockType == BlockRange_BLOCKTYPE_RESERVED || // BlockType == BlockRange_BLOCKTYPE_DIRTYBIT) // { -// return FALSE; +// return false; // } -// return TRUE; +// return true; // } // bool IsReserved() const { return ((RangeType & BlockRange_RESERVED) == BlockRange_RESERVED); } diff --git a/targets/win32/nanoCLR/PAL/COMDirector_stubs.cpp b/targets/win32/nanoCLR/PAL/COMDirector_stubs.cpp index 582f6d6e4d..0030145a62 100644 --- a/targets/win32/nanoCLR/PAL/COMDirector_stubs.cpp +++ b/targets/win32/nanoCLR/PAL/COMDirector_stubs.cpp @@ -51,19 +51,19 @@ __nfweak bool DebuggerPort_Flush(COM_HANDLE ComPortNum) __nfweak bool DebuggerPort_IsSslSupported(COM_HANDLE ComPortNum) { NATIVE_PROFILE_PAL_COM(); - return FALSE; + return false; } __nfweak bool DebuggerPort_UpgradeToSsl(COM_HANDLE ComPortNum, unsigned int flags) { NATIVE_PROFILE_PAL_COM(); - return FALSE; + return false; } __nfweak bool DebuggerPort_IsUsingSsl(COM_HANDLE ComPortNum) { NATIVE_PROFILE_PAL_COM(); - return FALSE; + return false; } ////////////////////////////////////////////////////////////////////////////////// diff --git a/targets/win32/nanoCLR/PAL/ConfigHelper_stubs.cpp b/targets/win32/nanoCLR/PAL/ConfigHelper_stubs.cpp index 56ac42496c..cedb0a3916 100644 --- a/targets/win32/nanoCLR/PAL/ConfigHelper_stubs.cpp +++ b/targets/win32/nanoCLR/PAL/ConfigHelper_stubs.cpp @@ -50,29 +50,29 @@ // // bool HAL_CONFIG_BLOCK::GetConfigSectorAddress(HAL_CONFIG_BLOCK_STORAGE_DATA& blData) //{ -// return FALSE; +// return false; //} // // bool HAL_CONFIG_BLOCK::CompactBlock(HAL_CONFIG_BLOCK_STORAGE_DATA& blData, const ConfigurationSector* cfgStatic, // const HAL_CONFIG_BLOCK* cfgEnd) //{ -// return FALSE; +// return false; //} // // // bool HAL_CONFIG_BLOCK::UpdateBlock( const HAL_CONFIG_BLOCK_STORAGE_DATA &blData, const void* pAddress, const // HAL_CONFIG_BLOCK *Header, void* Data, size_t Length, const void* LastConfigAddress, bool isChipRO ) //{ -// return FALSE; +// return false; //} // // bool HAL_CONFIG_BLOCK::UpdateBlockWithName( const char* Name, void* Data, size_t Length, bool isChipRO ) //{ -// return FALSE; +// return false; //} // bool GetHalSystemInfo(HalSystemInfo &systemInfo) { - return FALSE; + return false; } diff --git a/targets/win32/nanoCLR/PAL/blockstorageList_stubs.cpp b/targets/win32/nanoCLR/PAL/blockstorageList_stubs.cpp index d171f73189..f2716c3c6a 100644 --- a/targets/win32/nanoCLR/PAL/blockstorageList_stubs.cpp +++ b/targets/win32/nanoCLR/PAL/blockstorageList_stubs.cpp @@ -72,7 +72,7 @@ unsigned int BlockStorageList_GetNumDevices() // ByteAddress &SectAddress) //{ // *pBSD = NULL; -// return FALSE; +// return false; //} bool BlockStorageList_FindDeviceForPhysicalAddress( BlockStorageDevice **pBSD, @@ -84,12 +84,12 @@ bool BlockStorageList_FindDeviceForPhysicalAddress( // bool BlockStorageStream::Initialize(unsigned int blockUsage) //{ -// return FALSE; +// return false; //} // // bool BlockStorageStream::Initialize(unsigned int usage, BlockStorageDevice* pDevice) //{ -// return FALSE; +// return false; //} // // @@ -100,12 +100,12 @@ bool BlockStorageList_FindDeviceForPhysicalAddress( // // bool BlockStorageStream::PrevStream() //{ -// return FALSE; +// return false; //} // // bool BlockStorageStream::NextStream() //{ -// return FALSE; +// return false; //} // // bool BlockStorageStream::Seek( signed int offset, SeekOrigin origin ) @@ -145,19 +145,19 @@ bool BlockStorageList_FindDeviceForPhysicalAddress( // bool DeviceBlockInfo::FindRegionFromAddress(ByteAddress Address, unsigned int &BlockRegionIndex, unsigned int // &BlockRangeIndex ) const //{ -// return FALSE; +// return false; //} // // bool DeviceBlockInfo::FindNextUsageBlock(unsigned int BlockUsage, ByteAddress &Address, unsigned int // &BlockRegionIndex, unsigned int &BlockRangeIndex ) const //{ -// return FALSE; +// return false; //} // // bool DeviceBlockInfo::FindForBlockUsage(unsigned int BlockUsage, ByteAddress &Address, unsigned int // &BlockRegionIndex, unsigned int &BlockRangeIndex ) const //{ -// return FALSE; +// return false; //} //--// From d1e65aec9d27cf529ddb2030b5fe94365ed9e3e2 Mon Sep 17 00:00:00 2001 From: nfbot Date: Wed, 3 Jun 2026 23:24:58 +0000 Subject: [PATCH 06/18] Code style fixes Automated fixes for code style. --- src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp index 6bcb4d2fbd..a1a1ebda11 100644 --- a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp +++ b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp @@ -5,7 +5,7 @@ // #include -//#include "net_decl_lwip.h" +// #include "net_decl_lwip.h" #include "enc28j60_lwip.h" extern "C" From 4612ec175e72d27ea55485c7fb596bc814249ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 4 Jun 2026 00:40:07 +0100 Subject: [PATCH 07/18] Fix definition and config of NANOCLR_GRAPHICS --- src/HAL/Include/nanoHAL_Graphics.h | 2 +- ...ystem_resourcemanager_System_Resources_ResourceManager.cpp | 4 ++-- targets/ChibiOS/_nanoCLR/targetHAL.cpp | 2 +- targets/ChibiOS/_nanoCLR/target_platform.h.in | 2 +- targets/ESP32/_nanoCLR/target_platform.h.in | 2 +- targets/FreeRTOS/NXP/_nanoCLR/target_platform.h.in | 2 +- targets/TI_SimpleLink/_nanoCLR/target_platform.h.in | 2 +- targets/ThreadX/Maxim/_nanoCLR/targetHAL.cpp | 4 ++-- targets/ThreadX/Maxim/_nanoCLR/target_platform.h.in | 2 +- targets/ThreadX/MicroBit/_nanoCLR/target_platform.h.in | 2 +- targets/ThreadX/Nordic/_nanoCLR/target_platform.h.in | 2 +- targets/ThreadX/RaspberryPi/_nanoCLR/target_platform.h.in | 2 +- targets/ThreadX/ST/_nanoCLR/targetHAL.cpp | 4 ++-- targets/ThreadX/ST/_nanoCLR/target_platform.h.in | 2 +- targets/ThreadX/SiliconLabs/_nanoCLR/targetHAL.cpp | 4 ++-- targets/ThreadX/SiliconLabs/_nanoCLR/target_platform.h.in | 2 +- targets/posix/Include/target_platform.h | 1 + targets/win32/Include/target_platform.h | 2 ++ 18 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/HAL/Include/nanoHAL_Graphics.h b/src/HAL/Include/nanoHAL_Graphics.h index 4970503bf1..5a8e247f81 100644 --- a/src/HAL/Include/nanoHAL_Graphics.h +++ b/src/HAL/Include/nanoHAL_Graphics.h @@ -8,7 +8,7 @@ #include -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS #include "Display.h" #include "DisplayInterface.h" #include "TouchDevice.h" diff --git a/src/nanoFramework.ResourceManager/nf_system_resourcemanager_System_Resources_ResourceManager.cpp b/src/nanoFramework.ResourceManager/nf_system_resourcemanager_System_Resources_ResourceManager.cpp index cc5acf4677..3e07ffc845 100644 --- a/src/nanoFramework.ResourceManager/nf_system_resourcemanager_System_Resources_ResourceManager.cpp +++ b/src/nanoFramework.ResourceManager/nf_system_resourcemanager_System_Resources_ResourceManager.cpp @@ -7,7 +7,7 @@ #include "nf_system_resourcemanager.h" #include -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS #include "Graphics.h" #endif @@ -65,7 +65,7 @@ HRESULT Library_nf_system_resourcemanager_System_Resources_ResourceManager::GetO } break; -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS case CLR_RECORD_RESOURCE::RESOURCE_Bitmap: { diff --git a/targets/ChibiOS/_nanoCLR/targetHAL.cpp b/targets/ChibiOS/_nanoCLR/targetHAL.cpp index c54146e5b8..9ca2298fe1 100644 --- a/targets/ChibiOS/_nanoCLR/targetHAL.cpp +++ b/targets/ChibiOS/_nanoCLR/targetHAL.cpp @@ -144,7 +144,7 @@ void nanoHAL_Initialize() #endif -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS DisplayInterfaceConfig config; // not used for DSI display g_DisplayInterface.Initialize(config); g_DisplayDriver.Initialize(); diff --git a/targets/ChibiOS/_nanoCLR/target_platform.h.in b/targets/ChibiOS/_nanoCLR/target_platform.h.in index 2066d61699..3782b0267c 100644 --- a/targets/ChibiOS/_nanoCLR/target_platform.h.in +++ b/targets/ChibiOS/_nanoCLR/target_platform.h.in @@ -11,7 +11,7 @@ #ifndef TARGET_PLATFORM_H #define TARGET_PLATFORM_H -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS #define NF_FEATURE_USE_LITTLEFS @NF_FEATURE_USE_LITTLEFS_OPTION@ #define HAL_USE_RTC @HAL_USE_RTC_OPTION@ diff --git a/targets/ESP32/_nanoCLR/target_platform.h.in b/targets/ESP32/_nanoCLR/target_platform.h.in index 39dca5f784..da50b16494 100644 --- a/targets/ESP32/_nanoCLR/target_platform.h.in +++ b/targets/ESP32/_nanoCLR/target_platform.h.in @@ -8,7 +8,7 @@ #include "esp32_ethernet_options.h" -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS #define ESP32_RESERVE_SPIRAM_IDF_ALLOCATION_BYTES @ESP32_RESERVE_SPIRAM_IDF_ALLOCATION_BYTES@ #define ESP32_RESERVE_IRAM_IDF_ALLOCATION_KB @ESP32_RESERVE_IRAM_IDF_ALLOCATION_KB@ #define HAL_USE_SPI @HAL_USE_SPI_OPTION@ diff --git a/targets/FreeRTOS/NXP/_nanoCLR/target_platform.h.in b/targets/FreeRTOS/NXP/_nanoCLR/target_platform.h.in index eb49072902..530e6a7457 100644 --- a/targets/FreeRTOS/NXP/_nanoCLR/target_platform.h.in +++ b/targets/FreeRTOS/NXP/_nanoCLR/target_platform.h.in @@ -11,7 +11,7 @@ #ifndef TARGET_PLATFORM_H #define TARGET_PLATFORM_H -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS // set preference to enable (or not) the RTC subsystem #define NXP_USE_RTC @HAL_USE_RTC_OPTION@ diff --git a/targets/TI_SimpleLink/_nanoCLR/target_platform.h.in b/targets/TI_SimpleLink/_nanoCLR/target_platform.h.in index 1fd40f0ce2..e9e50319c1 100644 --- a/targets/TI_SimpleLink/_nanoCLR/target_platform.h.in +++ b/targets/TI_SimpleLink/_nanoCLR/target_platform.h.in @@ -11,7 +11,7 @@ #ifndef TARGET_PLATFORM_H #define TARGET_PLATFORM_H -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS #define HAL_USE_SPI @HAL_USE_SPI_OPTION@ #define SL_APP_SNTP @NF_NETWORKING_SNTP@ diff --git a/targets/ThreadX/Maxim/_nanoCLR/targetHAL.cpp b/targets/ThreadX/Maxim/_nanoCLR/targetHAL.cpp index e0f857fd3a..88f86ce2e4 100644 --- a/targets/ThreadX/Maxim/_nanoCLR/targetHAL.cpp +++ b/targets/ThreadX/Maxim/_nanoCLR/targetHAL.cpp @@ -69,7 +69,7 @@ void nanoHAL_Initialize() ::HeapLocation(heapStart, heapSize); memset(heapStart, 0, heapSize); -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS g_GraphicsMemoryHeap.Initialize(); #endif @@ -145,7 +145,7 @@ void nanoHAL_Initialize() #endif -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS DisplayInterfaceConfig config; // not used for DSI display g_DisplayInterface.Initialize(config); g_DisplayDriver.Initialize(); diff --git a/targets/ThreadX/Maxim/_nanoCLR/target_platform.h.in b/targets/ThreadX/Maxim/_nanoCLR/target_platform.h.in index a2b50e1e3b..208d21c368 100644 --- a/targets/ThreadX/Maxim/_nanoCLR/target_platform.h.in +++ b/targets/ThreadX/Maxim/_nanoCLR/target_platform.h.in @@ -12,7 +12,7 @@ #ifndef _TARGET_PLATFORM_H_ #define _TARGET_PLATFORM_H_ -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS #define NF_FEATURE_USE_LITTLEFS @NF_FEATURE_USE_LITTLEFS_OPTION@ #define HAL_USE_RTC @HAL_USE_RTC_OPTION@ #define HAL_USE_GPIO @HAL_USE_GPIO_OPTION@ diff --git a/targets/ThreadX/MicroBit/_nanoCLR/target_platform.h.in b/targets/ThreadX/MicroBit/_nanoCLR/target_platform.h.in index ba3f8083ce..18cf33e0df 100644 --- a/targets/ThreadX/MicroBit/_nanoCLR/target_platform.h.in +++ b/targets/ThreadX/MicroBit/_nanoCLR/target_platform.h.in @@ -11,7 +11,7 @@ #ifndef TARGET_PLATFORM_H #define TARGET_PLATFORM_H -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS #define HAL_USE_RTC @HAL_USE_RTC_OPTION@ diff --git a/targets/ThreadX/Nordic/_nanoCLR/target_platform.h.in b/targets/ThreadX/Nordic/_nanoCLR/target_platform.h.in index ba3f8083ce..18cf33e0df 100644 --- a/targets/ThreadX/Nordic/_nanoCLR/target_platform.h.in +++ b/targets/ThreadX/Nordic/_nanoCLR/target_platform.h.in @@ -11,7 +11,7 @@ #ifndef TARGET_PLATFORM_H #define TARGET_PLATFORM_H -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS #define HAL_USE_RTC @HAL_USE_RTC_OPTION@ diff --git a/targets/ThreadX/RaspberryPi/_nanoCLR/target_platform.h.in b/targets/ThreadX/RaspberryPi/_nanoCLR/target_platform.h.in index f9287bb499..85faf8036a 100644 --- a/targets/ThreadX/RaspberryPi/_nanoCLR/target_platform.h.in +++ b/targets/ThreadX/RaspberryPi/_nanoCLR/target_platform.h.in @@ -11,7 +11,7 @@ #ifndef TARGET_PLATFORM_H #define TARGET_PLATFORM_H -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS @ +#cmakedefine01 NANOCLR_GRAPHICS #define NF_FEATURE_USE_LITTLEFS @NF_FEATURE_USE_LITTLEFS_OPTION@ #define HAL_USE_RTC @HAL_USE_RTC_OPTION @ diff --git a/targets/ThreadX/ST/_nanoCLR/targetHAL.cpp b/targets/ThreadX/ST/_nanoCLR/targetHAL.cpp index f50cbf05cb..bb3bf7b739 100644 --- a/targets/ThreadX/ST/_nanoCLR/targetHAL.cpp +++ b/targets/ThreadX/ST/_nanoCLR/targetHAL.cpp @@ -67,7 +67,7 @@ void nanoHAL_Initialize() ::HeapLocation(heapStart, heapSize); memset(heapStart, 0, heapSize); -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS g_GraphicsMemoryHeap.Initialize(); #endif @@ -141,7 +141,7 @@ void nanoHAL_Initialize() #endif -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS DisplayInterfaceConfig config; // not used for DSI display g_DisplayInterface.Initialize(config); g_DisplayDriver.Initialize(); diff --git a/targets/ThreadX/ST/_nanoCLR/target_platform.h.in b/targets/ThreadX/ST/_nanoCLR/target_platform.h.in index 3be449b40c..61e35ae714 100644 --- a/targets/ThreadX/ST/_nanoCLR/target_platform.h.in +++ b/targets/ThreadX/ST/_nanoCLR/target_platform.h.in @@ -11,7 +11,7 @@ #ifndef TARGET_PLATFORM_H #define TARGET_PLATFORM_H -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS #define NF_FEATURE_USE_LITTLEFS @NF_FEATURE_USE_LITTLEFS_OPTION@ #define HAL_USE_RTC @HAL_USE_RTC_OPTION@ diff --git a/targets/ThreadX/SiliconLabs/_nanoCLR/targetHAL.cpp b/targets/ThreadX/SiliconLabs/_nanoCLR/targetHAL.cpp index 46ee4bd956..36a3c8caec 100644 --- a/targets/ThreadX/SiliconLabs/_nanoCLR/targetHAL.cpp +++ b/targets/ThreadX/SiliconLabs/_nanoCLR/targetHAL.cpp @@ -95,7 +95,7 @@ void nanoHAL_Initialize() ::HeapLocation(heapStart, heapSize); memset(heapStart, 0, heapSize); -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS g_GraphicsMemoryHeap.Initialize(); #endif @@ -183,7 +183,7 @@ void nanoHAL_Initialize() Usart5_PAL = {0}; #endif -#if (NANOCLR_GRAPHICS == TRUE) +#if NANOCLR_GRAPHICS DisplayInterfaceConfig config; // not used for DSI display g_DisplayInterface.Initialize(config); g_DisplayDriver.Initialize(); diff --git a/targets/ThreadX/SiliconLabs/_nanoCLR/target_platform.h.in b/targets/ThreadX/SiliconLabs/_nanoCLR/target_platform.h.in index 45c39d895a..c023afa29a 100644 --- a/targets/ThreadX/SiliconLabs/_nanoCLR/target_platform.h.in +++ b/targets/ThreadX/SiliconLabs/_nanoCLR/target_platform.h.in @@ -13,7 +13,7 @@ #include -#define NANOCLR_GRAPHICS @NANOCLR_GRAPHICS@ +#cmakedefine01 NANOCLR_GRAPHICS #define NF_FEATURE_USE_LITTLEFS @NF_FEATURE_USE_LITTLEFS_OPTION@ #define HAL_USE_RTC @HAL_USE_RTC_OPTION@ diff --git a/targets/posix/Include/target_platform.h b/targets/posix/Include/target_platform.h index e52b19afb2..671747f5d3 100644 --- a/targets/posix/Include/target_platform.h +++ b/targets/posix/Include/target_platform.h @@ -8,5 +8,6 @@ // and from bare-metal PLATFORM_ARM / PLATFORM_ESP32. All other POSIX-gate checks // in the CLR headers key off this symbol. #define PLATFORM_POSIX_HOST 1 +#define NANOCLR_GRAPHICS 0 #endif // TARGET_PLATFORM_H diff --git a/targets/win32/Include/target_platform.h b/targets/win32/Include/target_platform.h index 2eecb314c6..b250bf0f92 100644 --- a/targets/win32/Include/target_platform.h +++ b/targets/win32/Include/target_platform.h @@ -6,4 +6,6 @@ #ifndef TARGET_PLATFORM_H #define TARGET_PLATFORM_H +#define NANOCLR_GRAPHICS 0 + #endif // TARGET_PLATFORM_H From cb73b491fab956af9fe9385f8e034458351d0c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 4 Jun 2026 08:53:20 +0100 Subject: [PATCH 08/18] More migrations --- src/CLR/Core/CLR_RT_HeapBlock_Array.cpp | 2 +- .../Network/Enc28j60/enc28j60_lwip.cpp | 2 +- ...native_System_Net_Sockets_NativeSocket.cpp | 2 +- src/PAL/COM/sockets/Sockets_debugger.cpp | 4 +-- src/PAL/COM/sockets/sockets_lwip.cpp | 8 ++--- src/PAL/Lwip/lwIP_Sockets.cpp | 2 +- .../Graphics/Core/Support/Jpeg/jcapimin.c | 2 +- .../Graphics/Core/Support/Jpeg/jccoefct.c | 4 +-- .../Graphics/Core/Support/Jpeg/jcmarker.c | 12 +++---- .../Graphics/Core/Support/Jpeg/jcmaster.c | 4 +-- .../Graphics/Core/Support/Jpeg/jcparam.c | 2 +- .../Graphics/Core/Support/Jpeg/jctrans.c | 4 +-- .../Graphics/Core/Support/Jpeg/jdcoefct.c | 8 ++--- .../Graphics/Core/Support/Jpeg/jdmaster.c | 2 +- .../Graphics/Core/Support/Jpeg/jdpostct.c | 6 ++-- .../Graphics/Core/Support/Jpeg/jdtrans.c | 2 +- .../Graphics/Core/Support/Jpeg/jmemmgr.c | 8 ++--- .../Graphics/Core/Support/Jpeg/jquant1.c | 2 +- .../Graphics/Core/Support/Jpeg/transupp.c | 31 +++++++++---------- .../ORGPAL_PALTHREE/target_FileSystem.cpp | 4 +-- .../ChibiOS/ORGPAL_PALX/target_FileSystem.cpp | 2 +- .../RP_PICO_RP2040/target_FileSystem.cpp | 2 +- .../RP_PICO_W_RP2040/target_FileSystem.cpp | 2 +- targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp | 4 +-- .../ChibiOS/_littlefs/littlefs_FS_Driver.cpp | 4 +-- targets/ChibiOS/_nanoCLR/nanoCRT.cpp | 10 +++--- .../ports/STM32/LLD/ONEWIREv1/onewire_lld.c | 12 +++---- targets/ESP32/ESP32/target_FileSystem.cpp | 2 +- targets/ESP32/ESP32_C3/target_FileSystem.cpp | 2 +- targets/ESP32/ESP32_C5/target_FileSystem.cpp | 2 +- targets/ESP32/ESP32_C6/target_FileSystem.cpp | 2 +- targets/ESP32/ESP32_C61/target_FileSystem.cpp | 2 +- targets/ESP32/ESP32_H2/target_FileSystem.cpp | 2 +- targets/ESP32/ESP32_P4/target_FileSystem.cpp | 2 +- targets/ESP32/ESP32_S2/target_FileSystem.cpp | 2 +- targets/ESP32/ESP32_S3/target_FileSystem.cpp | 2 +- targets/ESP32/_FatFs/fatfs_FS_Driver.cpp | 4 +-- .../ESP32/_littlefs/littlefs_FS_Driver.cpp | 4 +-- targets/ESP32/_nanoCLR/nanoCRT.cpp | 10 +++--- ...noFramework_Device_OneWire_OneWireHost.cpp | 4 +-- .../NXP_MIMXRT1060_EVK/target_FileSystem.cpp | 4 +-- targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp | 10 +++--- .../_common/sockets_simplelink.cpp | 2 +- targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp | 10 +++--- .../wifi/inventek/ISM43362_sockets.cpp | 2 +- .../wifi/inventek/sockets_ISM43362.cpp | 8 ++--- ...noFramework_Device_OneWire_OneWireHost.cpp | 4 +-- targets/ThreadX/_common/NetX/netx_sockets.cpp | 2 +- targets/ThreadX/_common/NetX/sockets_netx.cpp | 8 ++--- targets/ThreadX/_common/nanoCLR/nanoCRT.cpp | 10 +++--- .../netcore/littlefs/littlefs_FS_Driver.cpp | 6 ++-- .../nanoFramework.nanoCLR/CLRStartup.cpp | 2 +- .../target_FileSystem.cpp | 2 +- targets/win32/nanoCLR/CLRStartup.cpp | 2 +- targets/win32/nanoCLR/Various.cpp | 2 +- targets/win32/nanoCLR/targetPAL_Events.cpp | 2 +- 56 files changed, 131 insertions(+), 132 deletions(-) diff --git a/src/CLR/Core/CLR_RT_HeapBlock_Array.cpp b/src/CLR/Core/CLR_RT_HeapBlock_Array.cpp index 1c53239e64..15dd7d9537 100644 --- a/src/CLR/Core/CLR_RT_HeapBlock_Array.cpp +++ b/src/CLR/Core/CLR_RT_HeapBlock_Array.cpp @@ -329,7 +329,7 @@ HRESULT CLR_RT_HeapBlock_Array::Copy( dataDst + length * sizeElem > arrayDst->GetFirstElement() + arrayDst->m_numOfElements * sizeElem) { #ifdef DEBUG - _ASSERTE(FALSE); + _ASSERTE(false; #endif NANOCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE); diff --git a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp index be3acc2b1f..5d0dfe2704 100644 --- a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp +++ b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp @@ -540,7 +540,7 @@ err_t enc28j60_lwip_xmit(struct netif *pNetIF, struct pbuf *pPBuf) if (length > ETHERSIZE) // (ETHERSIZE+4)) { debug_printf("xmit - length is too large, truncated \r\n"); - ASSERT(FALSE); + ASSERT(false; length = ETHERSIZE; // ETHERSIZE+4; /* what a terriable hack! */ } diff --git a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp index 41f5f82232..9d1c4d833f 100644 --- a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp +++ b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp @@ -489,7 +489,7 @@ CLR_INT32 Library_sys_net_native_System_Net_Sockets_NativeSocket::Helper__Select writefds = &fds; break; default: - _ASSERTE(FALSE); + _ASSERTE(false; // fall through case 2: exceptfds = &fds; diff --git a/src/PAL/COM/sockets/Sockets_debugger.cpp b/src/PAL/COM/sockets/Sockets_debugger.cpp index 726b68e574..b38353db96 100644 --- a/src/PAL/COM/sockets/Sockets_debugger.cpp +++ b/src/PAL/COM/sockets/Sockets_debugger.cpp @@ -512,7 +512,7 @@ bool Sockets_LWIP_Driver::InitializeMulticastDiscovery() sockAddr.sin_addr.S_un.S_addr = SOCK_htonl(SOCK_INADDR_ANY); // UDP socket is easier in our scenario because it isn't session based - g_Sockets_LWIP_Driver.m_multicastSocket = Socket(SOCK_AF_INET, SOCK_SOCK_DGRAM, SOCK_IPPROTO_UDP, FALSE); + g_Sockets_LWIP_Driver.m_multicastSocket = Socket(SOCK_AF_INET, SOCK_SOCK_DGRAM, SOCK_IPPROTO_UDP, false; SOCKET_CHECK_RESULT(g_Sockets_LWIP_Driver.m_multicastSocket); // set sock option for multicast @@ -640,7 +640,7 @@ void Sockets_LWIP_Driver::MulticastDiscoveryRespond(void *arg) // info.macAddressLen = current.macAddressLen; // memcpy( &info.macAddressBuffer[0], ¤t.macAddressBuffer[0], current.macAddressLen ); - sock = Socket(SOCK_AF_INET, SOCK_SOCK_DGRAM, SOCK_IPPROTO_UDP, FALSE); + sock = Socket(SOCK_AF_INET, SOCK_SOCK_DGRAM, SOCK_IPPROTO_UDP, false; SOCKET_CHECK_RESULT(sock); memset(&sockAddr, 0, sizeof(sockAddr)); diff --git a/src/PAL/COM/sockets/sockets_lwip.cpp b/src/PAL/COM/sockets/sockets_lwip.cpp index b1503bd885..a2a7db6208 100644 --- a/src/PAL/COM/sockets/sockets_lwip.cpp +++ b/src/PAL/COM/sockets/sockets_lwip.cpp @@ -13,7 +13,7 @@ Sockets_LWIP_Driver g_Sockets_LWIP_Driver; SOCK_SOCKET SOCK_socket(int family, int type, int protocol) { NATIVE_PROFILE_PAL_COM(); - return Sockets_LWIP_Driver::Socket(family, type, protocol, FALSE); + return Sockets_LWIP_Driver::Socket(family, type, protocol, false; } int SOCK_bind(SOCK_SOCKET socket, const struct SOCK_sockaddr *address, int addressLen) { @@ -48,7 +48,7 @@ int SOCK_listen(SOCK_SOCKET socket, int backlog) SOCK_SOCKET SOCK_accept(SOCK_SOCKET socket, struct SOCK_sockaddr *address, int *addressLen) { NATIVE_PROFILE_PAL_COM(); - return Sockets_LWIP_Driver::Accept(socket, address, addressLen, FALSE); + return Sockets_LWIP_Driver::Accept(socket, address, addressLen, false; } int SOCK_shutdown(SOCK_SOCKET socket, int how) { @@ -141,7 +141,7 @@ bool Network_Uninitialize() void SOCKETS_CloseConnections() { NATIVE_PROFILE_PAL_COM(); - Sockets_LWIP_Driver::CloseConnections(FALSE); + Sockets_LWIP_Driver::CloseConnections(false; } HRESULT SOCK_CONFIGURATION_LoadAdapterConfiguration(HAL_Configuration_NetworkInterface *config, uint32_t interfaceIndex) @@ -485,7 +485,7 @@ void Sockets_LWIP_Driver::RegisterSocket(SOCK_SOCKET sock, bool selectable, bool NATIVE_PROFILE_PAL_COM(); if (sock == SOCK_SOCKET_ERROR) { - ASSERT(FALSE); + ASSERT(false; return; } diff --git a/src/PAL/Lwip/lwIP_Sockets.cpp b/src/PAL/Lwip/lwIP_Sockets.cpp index 6cbeb158a9..f2ac1f998f 100644 --- a/src/PAL/Lwip/lwIP_Sockets.cpp +++ b/src/PAL/Lwip/lwIP_Sockets.cpp @@ -336,7 +336,7 @@ bool LWIP_SOCKETS_Driver::Initialize() if (interfaceNumber == SOCK_SOCKET_ERROR) { g_LWIP_SOCKETS_Driver.m_interfaces[i].m_interfaceNumber = -1; - DEBUG_HANDLE_SOCKET_ERROR("Network init", FALSE); + DEBUG_HANDLE_SOCKET_ERROR("Network init", false; continue; } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c index 4786c5a298..d568f3a62c 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapimin.c @@ -235,7 +235,7 @@ jpeg_write_m_byte(j_compress_ptr cinfo, int val) * set destination to table file * jpeg_write_tables(cinfo); * set destination to image file - * jpeg_start_compress(cinfo, FALSE); + * jpeg_start_compress(cinfo, false; * write data... * jpeg_finish_compress(cinfo); * diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c index 3923422555..b6b698df81 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c @@ -269,7 +269,7 @@ compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf) coef->whole_image[ci], coef->iMCU_row_num * compptr->v_samp_factor, (JDIMENSION)compptr->v_samp_factor, - TRUE); + true; /* Count non-dummy DCT block rows in this iMCU row. */ if (coef->iMCU_row_num < last_iMCU_row) block_rows = compptr->v_samp_factor; @@ -381,7 +381,7 @@ compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) coef->whole_image[compptr->component_index], coef->iMCU_row_num * compptr->v_samp_factor, (JDIMENSION)compptr->v_samp_factor, - FALSE); + false; } /* Loop to process one whole iMCU row */ diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c index 267d609f17..bcbbd4f709 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c @@ -584,16 +584,16 @@ write_scan_header(j_compress_ptr cinfo) /* Progressive mode: only DC or only AC tables are used in one scan */ if (cinfo->Ss == 0) { if (cinfo->Ah == 0) /* DC needs no table for refinement scan */ - emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + emit_dht(cinfo, compptr->dc_tbl_no, false; } else { - emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + emit_dht(cinfo, compptr->ac_tbl_no, true; } } else { /* Sequential mode: need both DC and AC tables */ - emit_dht(cinfo, compptr->dc_tbl_no, FALSE); - emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + emit_dht(cinfo, compptr->dc_tbl_no, false; + emit_dht(cinfo, compptr->ac_tbl_no, true; } } } @@ -643,9 +643,9 @@ write_tables_only(j_compress_ptr cinfo) if (!cinfo->arith_code) { for (i = 0; i < NUM_HUFF_TBLS; i++) { if (cinfo->dc_huff_tbl_ptrs[i] != NULL) - emit_dht(cinfo, i, FALSE); + emit_dht(cinfo, i, false; if (cinfo->ac_huff_tbl_ptrs[i] != NULL) - emit_dht(cinfo, i, TRUE); + emit_dht(cinfo, i, true; } } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmaster.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmaster.c index d9ce200134..189060c5ab 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmaster.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmaster.c @@ -460,7 +460,7 @@ prepare_for_pass(j_compress_ptr cinfo) select_scan_parameters(cinfo); per_scan_setup(cinfo); if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) { - (*cinfo->entropy->start_pass) (cinfo, TRUE); + (*cinfo->entropy->start_pass) (cinfo, true; (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST); master->pub.call_pass_startup = false; break; @@ -479,7 +479,7 @@ prepare_for_pass(j_compress_ptr cinfo) select_scan_parameters(cinfo); per_scan_setup(cinfo); } - (*cinfo->entropy->start_pass) (cinfo, FALSE); + (*cinfo->entropy->start_pass) (cinfo, false; (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST); /* We emit frame/scan headers now */ if (master->scan_number == 0) diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c index 639544f028..09bec0927e 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c @@ -297,7 +297,7 @@ jpeg_set_defaults(j_compress_ptr cinfo) cinfo->data_precision = BITS_IN_JSAMPLE; /* Set up two quantization tables using default quality of 75 */ - jpeg_set_quality(cinfo, 75, TRUE); + jpeg_set_quality(cinfo, 75, true; /* Set up two Huffman tables */ std_huff_tables(cinfo); diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c index b460406752..d327f10d31 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c @@ -46,7 +46,7 @@ jpeg_write_coefficients(j_compress_ptr cinfo, jvirt_barray_ptr* coef_arrays) if (cinfo->global_state != CSTATE_START) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); /* Mark all tables to be written */ - jpeg_suppress_tables(cinfo, FALSE); + jpeg_suppress_tables(cinfo, false; /* (Re)initialize error mgr and destination modules */ (*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo); (*cinfo->dest->init_destination) (cinfo); @@ -310,7 +310,7 @@ compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) buffer[ci] = (*cinfo->mem->access_virt_barray) ((j_common_ptr)cinfo, coef->whole_image[compptr->component_index], coef->iMCU_row_num * compptr->v_samp_factor, - (JDIMENSION)compptr->v_samp_factor, FALSE); + (JDIMENSION)compptr->v_samp_factor, false; } /* Loop to process one whole iMCU row */ diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcoefct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcoefct.c index 9185ce44af..51ae7394ac 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcoefct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdcoefct.c @@ -266,7 +266,7 @@ consume_data(j_decompress_ptr cinfo) buffer[ci] = (*cinfo->mem->access_virt_barray) ((j_common_ptr)cinfo, coef->whole_image[compptr->component_index], cinfo->input_iMCU_row * compptr->v_samp_factor, - (JDIMENSION)compptr->v_samp_factor, TRUE); + (JDIMENSION)compptr->v_samp_factor, true; /* Note: entropy decoder expects buffer to be zeroed, * but this is handled automatically by the memory manager * because we requested a pre-zeroed array. @@ -352,7 +352,7 @@ decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf) buffer = (*cinfo->mem->access_virt_barray) ((j_common_ptr)cinfo, coef->whole_image[ci], cinfo->output_iMCU_row * compptr->v_samp_factor, - (JDIMENSION)compptr->v_samp_factor, FALSE); + (JDIMENSION)compptr->v_samp_factor, false; /* Count non-dummy DCT block rows in this iMCU row. */ if (cinfo->output_iMCU_row < last_iMCU_row) block_rows = compptr->v_samp_factor; @@ -529,14 +529,14 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf) buffer = (*cinfo->mem->access_virt_barray) ((j_common_ptr)cinfo, coef->whole_image[ci], (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor, - (JDIMENSION)access_rows, FALSE); + (JDIMENSION)access_rows, false; buffer += compptr->v_samp_factor; /* point to current iMCU row */ first_row = false; } else { buffer = (*cinfo->mem->access_virt_barray) ((j_common_ptr)cinfo, coef->whole_image[ci], - (JDIMENSION)0, (JDIMENSION)access_rows, FALSE); + (JDIMENSION)0, (JDIMENSION)access_rows, false; first_row = true; } /* Fetch component-dependent info */ diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c index e9ab969c75..e58fa33129 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c @@ -459,7 +459,7 @@ prepare_for_output_pass(j_decompress_ptr cinfo) #ifdef QUANT_2PASS_SUPPORTED /* Final pass of 2-pass quantization */ master->pub.is_dummy_pass = false; - (*cinfo->cquantize->start_pass) (cinfo, FALSE); + (*cinfo->cquantize->start_pass) (cinfo, false; (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); #else diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdpostct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdpostct.c index e112925f3d..5b28f14ef2 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdpostct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdpostct.c @@ -92,7 +92,7 @@ start_pass_dpost(j_decompress_ptr cinfo, J_BUF_MODE pass_mode) if (post->buffer == NULL) { post->buffer = (*cinfo->mem->access_virt_sarray) ((j_common_ptr)cinfo, post->whole_image, - (JDIMENSION)0, post->strip_height, TRUE); + (JDIMENSION)0, post->strip_height, true; } } else { @@ -175,7 +175,7 @@ post_process_prepass(j_decompress_ptr cinfo, if (post->next_row == 0) { post->buffer = (*cinfo->mem->access_virt_sarray) ((j_common_ptr)cinfo, post->whole_image, - post->starting_row, post->strip_height, TRUE); + post->starting_row, post->strip_height, true; } /* Upsample some data (up to a strip height's worth). */ @@ -219,7 +219,7 @@ post_process_2pass(j_decompress_ptr cinfo, if (post->next_row == 0) { post->buffer = (*cinfo->mem->access_virt_sarray) ((j_common_ptr)cinfo, post->whole_image, - post->starting_row, post->strip_height, FALSE); + post->starting_row, post->strip_height, false; } /* Determine number of rows to emit. */ diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c index f29908c3f7..38918a8629 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c @@ -121,7 +121,7 @@ transdecode_master_selection(j_decompress_ptr cinfo) } /* Always get a full-image coefficient buffer. */ - jinit_d_coef_controller(cinfo, TRUE); + jinit_d_coef_controller(cinfo, true; /* We can now tell the memory manager to allocate virtual arrays. */ (*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo); diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c index f0b0f062b8..14ad97d77e 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c @@ -794,7 +794,7 @@ access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, ERREXIT(cinfo, JERR_VIRTUAL_BUG); /* Flush old buffer contents if necessary */ if (ptr->dirty) { - do_sarray_io(cinfo, ptr, TRUE); + do_sarray_io(cinfo, ptr, true; ptr->dirty = false; } /* Decide what part of virtual array to access. @@ -820,7 +820,7 @@ access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, * During the initial write pass, we will do no actual read * because the selected part is all undefined. */ - do_sarray_io(cinfo, ptr, FALSE); + do_sarray_io(cinfo, ptr, false; } /* Ensure the accessed part of the array is defined; prezero if needed. * To improve locality of access, we only prezero the part of the array @@ -882,7 +882,7 @@ access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr, ERREXIT(cinfo, JERR_VIRTUAL_BUG); /* Flush old buffer contents if necessary */ if (ptr->dirty) { - do_barray_io(cinfo, ptr, TRUE); + do_barray_io(cinfo, ptr, true; ptr->dirty = false; } /* Decide what part of virtual array to access. @@ -908,7 +908,7 @@ access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr, * During the initial write pass, we will do no actual read * because the selected part is all undefined. */ - do_barray_io(cinfo, ptr, FALSE); + do_barray_io(cinfo, ptr, false; } /* Ensure the accessed part of the array is defined; prezero if needed. * To improve locality of access, we only prezero the part of the array diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c index 1055da0ac8..4c820e2101 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c @@ -717,7 +717,7 @@ quantize_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf, */ errorptr[0] = (FSERROR)bpreverr; /* unload prev err into array */ } - cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE); + cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : true; } } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/transupp.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/transupp.c index 68ec13ce8a..b22bcf5d64 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/transupp.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/transupp.c @@ -99,7 +99,7 @@ do_flip_h(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, blk_y += compptr->v_samp_factor) { buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], blk_y, - (JDIMENSION)compptr->v_samp_factor, TRUE); + (JDIMENSION)compptr->v_samp_factor, true; for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) { ptr1 = buffer[offset_y][blk_x]; @@ -151,19 +151,19 @@ do_flip_v(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, dst_blk_y += compptr->v_samp_factor) { dst_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, dst_coef_arrays[ci], dst_blk_y, - (JDIMENSION)compptr->v_samp_factor, TRUE); + (JDIMENSION)compptr->v_samp_factor, true; if (dst_blk_y < comp_height) { /* Row is within the mirrorable area. */ src_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], comp_height - dst_blk_y - (JDIMENSION)compptr->v_samp_factor, - (JDIMENSION)compptr->v_samp_factor, FALSE); + (JDIMENSION)compptr->v_samp_factor, false; } else { /* Bottom-edge blocks will be copied verbatim. */ src_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], dst_blk_y, - (JDIMENSION)compptr->v_samp_factor, FALSE); + (JDIMENSION)compptr->v_samp_factor, false; } for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { if (dst_blk_y < comp_height) { @@ -218,13 +218,13 @@ do_transpose(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, dst_blk_y += compptr->v_samp_factor) { dst_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, dst_coef_arrays[ci], dst_blk_y, - (JDIMENSION)compptr->v_samp_factor, TRUE); + (JDIMENSION)compptr->v_samp_factor, true; for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x += compptr->h_samp_factor) { src_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], dst_blk_x, - (JDIMENSION)compptr->h_samp_factor, FALSE); + (JDIMENSION)compptr->h_samp_factor, false; for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) { src_ptr = src_buffer[offset_x][dst_blk_y + offset_y]; dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x]; @@ -268,13 +268,13 @@ do_rot_90(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, dst_blk_y += compptr->v_samp_factor) { dst_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, dst_coef_arrays[ci], dst_blk_y, - (JDIMENSION)compptr->v_samp_factor, TRUE); + (JDIMENSION)compptr->v_samp_factor, true; for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x += compptr->h_samp_factor) { src_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], dst_blk_x, - (JDIMENSION)compptr->h_samp_factor, FALSE); + (JDIMENSION)compptr->h_samp_factor, false; for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) { src_ptr = src_buffer[offset_x][dst_blk_y + offset_y]; if (dst_blk_x < comp_width) { @@ -333,13 +333,13 @@ do_rot_270(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, dst_blk_y += compptr->v_samp_factor) { dst_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, dst_coef_arrays[ci], dst_blk_y, - (JDIMENSION)compptr->v_samp_factor, TRUE); + (JDIMENSION)compptr->v_samp_factor, true; for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x += compptr->h_samp_factor) { src_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], dst_blk_x, - (JDIMENSION)compptr->h_samp_factor, FALSE); + (JDIMENSION)compptr->h_samp_factor, false; for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) { dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x]; if (dst_blk_y < comp_height) { @@ -397,19 +397,19 @@ do_rot_180(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, dst_blk_y += compptr->v_samp_factor) { dst_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, dst_coef_arrays[ci], dst_blk_y, - (JDIMENSION)compptr->v_samp_factor, TRUE); + (JDIMENSION)compptr->v_samp_factor, true; if (dst_blk_y < comp_height) { /* Row is within the vertically mirrorable area. */ src_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], comp_height - dst_blk_y - (JDIMENSION)compptr->v_samp_factor, - (JDIMENSION)compptr->v_samp_factor, FALSE); + (JDIMENSION)compptr->v_samp_factor, false; } else { /* Bottom-edge rows are only mirrored horizontally. */ src_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], dst_blk_y, - (JDIMENSION)compptr->v_samp_factor, FALSE); + (JDIMENSION)compptr->v_samp_factor, false; } for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { if (dst_blk_y < comp_height) { @@ -503,13 +503,13 @@ do_transverse(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, dst_blk_y += compptr->v_samp_factor) { dst_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, dst_coef_arrays[ci], dst_blk_y, - (JDIMENSION)compptr->v_samp_factor, TRUE); + (JDIMENSION)compptr->v_samp_factor, true; for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x += compptr->h_samp_factor) { src_buffer = (*srcinfo->mem->access_virt_barray) ((j_common_ptr)srcinfo, src_coef_arrays[ci], dst_blk_x, - (JDIMENSION)compptr->h_samp_factor, FALSE); + (JDIMENSION)compptr->h_samp_factor, false; for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) { if (dst_blk_y < comp_height) { src_ptr = src_buffer[offset_x] @@ -954,4 +954,3 @@ jcopy_markers_execute(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, } } #pragma GCC diagnostic pop - diff --git a/targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp b/targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp index b7bfef7bb1..8225837dfb 100644 --- a/targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp +++ b/targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp @@ -51,7 +51,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[1].streamDriver, g_AvailableFSInterfaces[1].fsDriver, 0, - FALSE); + false; // W25Q128, drive F:, volume 1 FileSystemVolumeList::AddVolume( @@ -61,7 +61,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[1].streamDriver, g_AvailableFSInterfaces[1].fsDriver, 1, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp b/targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp index fcc2f6df56..021284c4e6 100644 --- a/targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp +++ b/targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[1].streamDriver, g_AvailableFSInterfaces[1].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp b/targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp index ef7d80d564..7ddd02598c 100644 --- a/targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp +++ b/targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp @@ -37,7 +37,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp b/targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp index ef7d80d564..7ddd02598c 100644 --- a/targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp +++ b/targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp @@ -37,7 +37,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp b/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp index ae37b648e1..b0a5e81f39 100644 --- a/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp +++ b/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp @@ -211,7 +211,7 @@ HRESULT FATFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } @@ -243,7 +243,7 @@ HRESULT FATFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volumeLab // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } diff --git a/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp b/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp index ea72cfe92d..92e1b3173e 100644 --- a/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp +++ b/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp @@ -138,7 +138,7 @@ HRESULT LITTLEFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } @@ -159,7 +159,7 @@ HRESULT LITTLEFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volume // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } diff --git a/targets/ChibiOS/_nanoCLR/nanoCRT.cpp b/targets/ChibiOS/_nanoCLR/nanoCRT.cpp index 4297bd9a2a..21ee545e58 100644 --- a/targets/ChibiOS/_nanoCLR/nanoCRT.cpp +++ b/targets/ChibiOS/_nanoCLR/nanoCRT.cpp @@ -139,14 +139,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } @@ -162,13 +162,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; strDst[0] = 0; return 1; } @@ -196,7 +196,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } diff --git a/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c b/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c index f78b9d0998..19d1f85dfc 100644 --- a/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c +++ b/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c @@ -201,8 +201,8 @@ uint8_t oneWire_lld_TouchReset(void) // set UART baud rate to 9600bps (required to send the RESET condition to the 1-Wire bus) uartSetSpeed(9600); - chBSemReset(&ONEWIRED1.TxCompleted, TRUE); - chBSemReset(&ONEWIRED1.RxCompleted, TRUE); + chBSemReset(&ONEWIRED1.TxCompleted, true; + chBSemReset(&ONEWIRED1.RxCompleted, true; uartStartReceive(ONEWIRED1.UartDriver, 1, &ONEWIRED1.RxBuffer[0]); uartStartSend(ONEWIRED1.UartDriver, 1, &ONEWIRED1.TxBuffer[0]); chThdSleepMilliseconds(10); @@ -229,8 +229,8 @@ bool oneWire_lld_TouchBit(bool sendbit) // (only required for Cortex-M7) cacheBufferFlush(&ONEWIRED1.TxBuffer[0], 1); - chBSemReset(&ONEWIRED1.RxCompleted, TRUE); - chBSemReset(&ONEWIRED1.TxCompleted, TRUE); + chBSemReset(&ONEWIRED1.RxCompleted, true; + chBSemReset(&ONEWIRED1.TxCompleted, true; uartStartReceive(ONEWIRED1.UartDriver, 1, &ONEWIRED1.RxBuffer[0]); uartStartSend(ONEWIRED1.UartDriver, 1, &ONEWIRED1.TxBuffer[0]); chThdSleepMilliseconds(0.1); @@ -274,8 +274,8 @@ uint8_t oneWire_lld_TouchByte(uint8_t sendbyte) // (only required for Cortex-M7) cacheBufferFlush(&ONEWIRED1.TxBuffer[0], 8); - chBSemReset(&ONEWIRED1.RxCompleted, TRUE); - chBSemReset(&ONEWIRED1.TxCompleted, TRUE); + chBSemReset(&ONEWIRED1.RxCompleted, true; + chBSemReset(&ONEWIRED1.TxCompleted, true; uartStartReceive(ONEWIRED1.UartDriver, 8, &ONEWIRED1.RxBuffer[0]); uartStartSend(ONEWIRED1.UartDriver, 8, &ONEWIRED1.TxBuffer[0]); chThdSleepMilliseconds(0.1); diff --git a/targets/ESP32/ESP32/target_FileSystem.cpp b/targets/ESP32/ESP32/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32/target_FileSystem.cpp +++ b/targets/ESP32/ESP32/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/ESP32_C3/target_FileSystem.cpp b/targets/ESP32/ESP32_C3/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32_C3/target_FileSystem.cpp +++ b/targets/ESP32/ESP32_C3/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/ESP32_C5/target_FileSystem.cpp b/targets/ESP32/ESP32_C5/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32_C5/target_FileSystem.cpp +++ b/targets/ESP32/ESP32_C5/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/ESP32_C6/target_FileSystem.cpp b/targets/ESP32/ESP32_C6/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32_C6/target_FileSystem.cpp +++ b/targets/ESP32/ESP32_C6/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/ESP32_C61/target_FileSystem.cpp b/targets/ESP32/ESP32_C61/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32_C61/target_FileSystem.cpp +++ b/targets/ESP32/ESP32_C61/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/ESP32_H2/target_FileSystem.cpp b/targets/ESP32/ESP32_H2/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32_H2/target_FileSystem.cpp +++ b/targets/ESP32/ESP32_H2/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/ESP32_P4/target_FileSystem.cpp b/targets/ESP32/ESP32_P4/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32_P4/target_FileSystem.cpp +++ b/targets/ESP32/ESP32_P4/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/ESP32_S2/target_FileSystem.cpp b/targets/ESP32/ESP32_S2/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32_S2/target_FileSystem.cpp +++ b/targets/ESP32/ESP32_S2/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/ESP32_S3/target_FileSystem.cpp b/targets/ESP32/ESP32_S3/target_FileSystem.cpp index 33430d84c1..4680f30ba1 100644 --- a/targets/ESP32/ESP32_S3/target_FileSystem.cpp +++ b/targets/ESP32/ESP32_S3/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp b/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp index 6f7752c629..0a907a1342 100644 --- a/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp +++ b/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp @@ -126,7 +126,7 @@ HRESULT FATFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } @@ -158,7 +158,7 @@ HRESULT FATFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volumeLab // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } diff --git a/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp b/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp index 31fdaa390d..6c24bdb5eb 100644 --- a/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp +++ b/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp @@ -126,7 +126,7 @@ HRESULT LITTLEFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } @@ -158,7 +158,7 @@ HRESULT LITTLEFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volume // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } diff --git a/targets/ESP32/_nanoCLR/nanoCRT.cpp b/targets/ESP32/_nanoCLR/nanoCRT.cpp index 0968b35c6c..72eb2c6e90 100644 --- a/targets/ESP32/_nanoCLR/nanoCRT.cpp +++ b/targets/ESP32/_nanoCLR/nanoCRT.cpp @@ -140,14 +140,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } @@ -163,13 +163,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; strDst[0] = 0; return 1; } @@ -197,7 +197,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } diff --git a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index 5a1ea58d0a..a09e468521 100644 --- a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -505,7 +505,7 @@ HRESULT FindOneDevice(CLR_RT_StackFrame &stack, bool findFirst) // get a pointer to the first element of the byte array serialNumberPointer = (uint8_t *)serialNumberField->GetFirstElement(); - oneWireSerialNum(serialNumberPointer, TRUE); + oneWireSerialNum(serialNumberPointer, true; } // pop timeout heap block from stack @@ -552,7 +552,7 @@ HRESULT Library_nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost::WriteBy uint8_t sendbyte; sendbyte = (uint8_t)stack.Arg1().NumericByRefConst().u1; - stack.SetResult_U1(oneWireTouchByte(sendbyte) == sendbyte ? TRUE : FALSE); + stack.SetResult_U1(oneWireTouchByte(sendbyte) == sendbyte ? TRUE : false; NANOCLR_NOCLEANUP_NOLABEL(); } diff --git a/targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/target_FileSystem.cpp b/targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/target_FileSystem.cpp index e22cf48e1c..e04755312e 100644 --- a/targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/target_FileSystem.cpp +++ b/targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/target_FileSystem.cpp @@ -49,7 +49,7 @@ void FS_AddVolumes() // g_AvailableFSInterfaces[1].streamDriver, // g_AvailableFSInterfaces[1].fsDriver, // 0, - // FALSE); + // false; // // W25Q128, drive F:, volume 1 // FileSystemVolumeList::AddVolume( @@ -59,7 +59,7 @@ void FS_AddVolumes() // g_AvailableFSInterfaces[1].streamDriver, // g_AvailableFSInterfaces[1].fsDriver, // 1, - // FALSE); + // false; } void FS_MountRemovableVolumes() diff --git a/targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp b/targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp index 4297bd9a2a..21ee545e58 100644 --- a/targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp +++ b/targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp @@ -139,14 +139,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } @@ -162,13 +162,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; strDst[0] = 0; return 1; } @@ -196,7 +196,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } diff --git a/targets/TI_SimpleLink/_common/sockets_simplelink.cpp b/targets/TI_SimpleLink/_common/sockets_simplelink.cpp index 77c3f1dddc..5e57511b00 100644 --- a/targets/TI_SimpleLink/_common/sockets_simplelink.cpp +++ b/targets/TI_SimpleLink/_common/sockets_simplelink.cpp @@ -848,7 +848,7 @@ void SOCKETS_CloseConnections() { NATIVE_PROFILE_PAL_COM(); // FIXME - // Sockets_SimpleLink_Driver::CloseConnections(FALSE); + // Sockets_SimpleLink_Driver::CloseConnections(false; } HRESULT SOCK_CONFIGURATION_LoadAdapterConfiguration(HAL_Configuration_NetworkInterface *config, uint32_t interfaceIndex) diff --git a/targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp b/targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp index 4297bd9a2a..21ee545e58 100644 --- a/targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp @@ -139,14 +139,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } @@ -162,13 +162,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; strDst[0] = 0; return 1; } @@ -196,7 +196,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp index 1913b53fc5..6ae0a23309 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp @@ -280,7 +280,7 @@ bool ISM43362_SOCKETS_Driver::Initialize() if (interfaceNumber == SOCK_SOCKET_ERROR) { - DEBUG_HANDLE_SOCKET_ERROR("Network init", FALSE); + DEBUG_HANDLE_SOCKET_ERROR("Network init", false; // FIXME debug_printf("SocketError: %d\n", errorCode); continue; } diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp index 8634ffc4a0..e331b0b18b 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp @@ -16,7 +16,7 @@ Sockets_ISM43362_Driver g_Sockets_ISM43362_Driver; SOCK_SOCKET SOCK_socket(int family, int type, int protocol) { NATIVE_PROFILE_PAL_COM(); - return Sockets_ISM43362_Driver::Socket(family, type, protocol, FALSE); + return Sockets_ISM43362_Driver::Socket(family, type, protocol, false; } int SOCK_bind(SOCK_SOCKET socket, const struct SOCK_sockaddr *address, int addressLen) { @@ -51,7 +51,7 @@ int SOCK_listen(SOCK_SOCKET socket, int backlog) SOCK_SOCKET SOCK_accept(SOCK_SOCKET socket, struct SOCK_sockaddr *address, int *addressLen) { NATIVE_PROFILE_PAL_COM(); - return Sockets_ISM43362_Driver::Accept(socket, address, addressLen, FALSE); + return Sockets_ISM43362_Driver::Accept(socket, address, addressLen, false; } int SOCK_shutdown(SOCK_SOCKET socket, int how) { @@ -149,7 +149,7 @@ bool Network_Uninitialize() void SOCKETS_CloseConnections() { NATIVE_PROFILE_PAL_COM(); - Sockets_ISM43362_Driver::CloseConnections(FALSE); + Sockets_ISM43362_Driver::CloseConnections(false; } HRESULT SOCK_CONFIGURATION_LoadAdapterConfiguration(HAL_Configuration_NetworkInterface *config, uint32_t interfaceIndex) @@ -481,7 +481,7 @@ void Sockets_ISM43362_Driver::RegisterSocket(SOCK_SOCKET sock, bool selectable, NATIVE_PROFILE_PAL_COM(); if (sock == SOCK_SOCKET_ERROR) { - ASSERT(FALSE); + ASSERT(false; return; } diff --git a/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index 324fa2a56a..125a0b613b 100644 --- a/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -518,7 +518,7 @@ HRESULT FindOneDevice(CLR_RT_StackFrame &stack, bool findFirst) // get a pointer to the first element of the byte array serialNumberPointer = (uint8_t *)serialNumberField->GetFirstElement(); - oneWireSerialNum(serialNumberPointer, TRUE); + oneWireSerialNum(serialNumberPointer, true; } } @@ -570,7 +570,7 @@ HRESULT Library_nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost::WriteBy uint8_t sendbyte; sendbyte = (uint8_t)stack.Arg1().NumericByRefConst().u1; - stack.SetResult_U1(oneWireTouchByte(sendbyte) == sendbyte ? TRUE : FALSE); + stack.SetResult_U1(oneWireTouchByte(sendbyte) == sendbyte ? TRUE : false; NANOCLR_NOCLEANUP_NOLABEL(); } diff --git a/targets/ThreadX/_common/NetX/netx_sockets.cpp b/targets/ThreadX/_common/NetX/netx_sockets.cpp index a17f89f96a..9fda1822ef 100644 --- a/targets/ThreadX/_common/NetX/netx_sockets.cpp +++ b/targets/ThreadX/_common/NetX/netx_sockets.cpp @@ -223,7 +223,7 @@ bool NETX_SOCKETS_Driver::Initialize() if (interfaceNumber == SOCK_SOCKET_ERROR) { - DEBUG_HANDLE_SOCKET_ERROR("Network init", FALSE); + DEBUG_HANDLE_SOCKET_ERROR("Network init", false; // FIXME debug_printf("SocketError: %d\n", errorCode); continue; } diff --git a/targets/ThreadX/_common/NetX/sockets_netx.cpp b/targets/ThreadX/_common/NetX/sockets_netx.cpp index 64e3713bde..3eacde36fe 100644 --- a/targets/ThreadX/_common/NetX/sockets_netx.cpp +++ b/targets/ThreadX/_common/NetX/sockets_netx.cpp @@ -16,7 +16,7 @@ Sockets_NETX_Driver g_Sockets_NETX_Driver; SOCK_SOCKET SOCK_socket(int family, int type, int protocol) { NATIVE_PROFILE_PAL_COM(); - return Sockets_NETX_Driver::Socket(family, type, protocol, FALSE); + return Sockets_NETX_Driver::Socket(family, type, protocol, false; } int SOCK_bind(SOCK_SOCKET socket, const struct SOCK_sockaddr *address, int addressLen) { @@ -51,7 +51,7 @@ int SOCK_listen(SOCK_SOCKET socket, int backlog) SOCK_SOCKET SOCK_accept(SOCK_SOCKET socket, struct SOCK_sockaddr *address, int *addressLen) { NATIVE_PROFILE_PAL_COM(); - return Sockets_NETX_Driver::Accept(socket, address, addressLen, FALSE); + return Sockets_NETX_Driver::Accept(socket, address, addressLen, false; } int SOCK_shutdown(SOCK_SOCKET socket, int how) { @@ -144,7 +144,7 @@ bool Network_Uninitialize() void SOCKETS_CloseConnections() { NATIVE_PROFILE_PAL_COM(); - Sockets_NETX_Driver::CloseConnections(FALSE); + Sockets_NETX_Driver::CloseConnections(false; } HRESULT SOCK_CONFIGURATION_LoadAdapterConfiguration(HAL_Configuration_NetworkInterface *config, uint32_t interfaceIndex) @@ -472,7 +472,7 @@ void Sockets_NETX_Driver::RegisterSocket(SOCK_SOCKET sock, bool selectable, bool NATIVE_PROFILE_PAL_COM(); if (sock == SOCK_SOCKET_ERROR) { - ASSERT(FALSE); + ASSERT(false; return; } diff --git a/targets/ThreadX/_common/nanoCLR/nanoCRT.cpp b/targets/ThreadX/_common/nanoCLR/nanoCRT.cpp index dad201afa3..aba95c1acd 100644 --- a/targets/ThreadX/_common/nanoCLR/nanoCRT.cpp +++ b/targets/ThreadX/_common/nanoCLR/nanoCRT.cpp @@ -140,14 +140,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } @@ -163,13 +163,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(FALSE); + _ASSERTE(false; strDst[0] = 0; return 1; } @@ -197,7 +197,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(FALSE); + _ASSERTE(false; return 1; } diff --git a/targets/netcore/littlefs/littlefs_FS_Driver.cpp b/targets/netcore/littlefs/littlefs_FS_Driver.cpp index 9aca04bdb4..b37fd1b949 100644 --- a/targets/netcore/littlefs/littlefs_FS_Driver.cpp +++ b/targets/netcore/littlefs/littlefs_FS_Driver.cpp @@ -92,7 +92,7 @@ HRESULT LITTLEFS_FS_Driver::GetSizeInfo(const VOLUME_ID *volume, int64_t *totalS // return S_OK; // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } @@ -107,7 +107,7 @@ HRESULT LITTLEFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } @@ -128,7 +128,7 @@ HRESULT LITTLEFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volume // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(FALSE); + ASSERT(false; return CLR_E_INVALID_DRIVER; } diff --git a/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp b/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp index bf48a60476..2f03034f2a 100644 --- a/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp +++ b/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp @@ -412,7 +412,7 @@ struct Settings if ((CLR_UINT8 *)header + header->TotalSize() > (CLR_UINT8 *)headerEnd) { // checksum passed, but not enough data in assembly - _ASSERTE(FALSE); + _ASSERTE(false; delete bufferSub; break; } diff --git a/targets/netcore/nanoFramework.nanoCLR/target_FileSystem.cpp b/targets/netcore/nanoFramework.nanoCLR/target_FileSystem.cpp index c7d9b2408a..f46bd40e6a 100644 --- a/targets/netcore/nanoFramework.nanoCLR/target_FileSystem.cpp +++ b/targets/netcore/nanoFramework.nanoCLR/target_FileSystem.cpp @@ -39,7 +39,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - FALSE); + false; } void FS_MountRemovableVolumes() diff --git a/targets/win32/nanoCLR/CLRStartup.cpp b/targets/win32/nanoCLR/CLRStartup.cpp index 3f19426758..c9421a88a3 100644 --- a/targets/win32/nanoCLR/CLRStartup.cpp +++ b/targets/win32/nanoCLR/CLRStartup.cpp @@ -491,7 +491,7 @@ struct Settings : CLR_RT_ParseOptions if ((CLR_UINT8 *)header + header->TotalSize() > (CLR_UINT8 *)headerEnd) { // checksum passed, but not enough data in assembly - _ASSERTE(FALSE); + _ASSERTE(false; delete bufferSub; break; } diff --git a/targets/win32/nanoCLR/Various.cpp b/targets/win32/nanoCLR/Various.cpp index a144b1e5d7..c6a7761b84 100644 --- a/targets/win32/nanoCLR/Various.cpp +++ b/targets/win32/nanoCLR/Various.cpp @@ -371,7 +371,7 @@ int hal_vfprintf(COM_HANDLE stream, const char *format, va_list arg) // break; // case FLASH_WRITE_TRANSPORT: - // _ASSERTE(FALSE); + // _ASSERTE(false; //} return chars; diff --git a/targets/win32/nanoCLR/targetPAL_Events.cpp b/targets/win32/nanoCLR/targetPAL_Events.cpp index 8ccb5cc734..ee2d2ab8e6 100644 --- a/targets/win32/nanoCLR/targetPAL_Events.cpp +++ b/targets/win32/nanoCLR/targetPAL_Events.cpp @@ -156,7 +156,7 @@ void Events_SetCallback(set_Event_Callback pfn, void *arg) (void)pfn; (void)arg; - _ASSERTE(FALSE); + _ASSERTE(false; } void FreeManagedEvent(uint8_t category, uint8_t subCategory, uint16_t data1, uint32_t data2) From 3ee82c5eb05d055ad5cea19c83e260dd0752ce01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 4 Jun 2026 23:22:44 +0100 Subject: [PATCH 09/18] Fix for the fix --- src/CLR/Core/CLR_RT_HeapBlock_Array.cpp | 2 +- .../Network/Enc28j60/enc28j60_lwip.cpp | 2 +- .../sys_net_native_System_Net_Sockets_NativeSocket.cpp | 2 +- src/PAL/COM/sockets/sockets_lwip.cpp | 4 ++-- targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp | 4 ++-- targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp | 4 ++-- targets/ChibiOS/_nanoCLR/nanoCRT.cpp | 10 +++++----- targets/ESP32/_FatFs/fatfs_FS_Driver.cpp | 4 ++-- targets/ESP32/_littlefs/littlefs_FS_Driver.cpp | 4 ++-- targets/ESP32/_nanoCLR/nanoCRT.cpp | 10 +++++----- targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp | 10 +++++----- targets/TI_SimpleLink/_common/sockets_simplelink.cpp | 2 +- targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp | 10 +++++----- .../_common/drivers/wifi/inventek/sockets_ISM43362.cpp | 4 ++-- targets/ThreadX/_common/NetX/sockets_netx.cpp | 4 ++-- targets/ThreadX/_common/nanoCLR/nanoCRT.cpp | 10 +++++----- targets/netcore/littlefs/littlefs_FS_Driver.cpp | 6 +++--- targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp | 2 +- targets/win32/nanoCLR/CLRStartup.cpp | 2 +- targets/win32/nanoCLR/Various.cpp | 2 +- targets/win32/nanoCLR/targetPAL_Events.cpp | 2 +- 21 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/CLR/Core/CLR_RT_HeapBlock_Array.cpp b/src/CLR/Core/CLR_RT_HeapBlock_Array.cpp index 15dd7d9537..8b218e7d12 100644 --- a/src/CLR/Core/CLR_RT_HeapBlock_Array.cpp +++ b/src/CLR/Core/CLR_RT_HeapBlock_Array.cpp @@ -329,7 +329,7 @@ HRESULT CLR_RT_HeapBlock_Array::Copy( dataDst + length * sizeElem > arrayDst->GetFirstElement() + arrayDst->m_numOfElements * sizeElem) { #ifdef DEBUG - _ASSERTE(false; + _ASSERTE(false); #endif NANOCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE); diff --git a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp index 5d0dfe2704..faf7526443 100644 --- a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp +++ b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip.cpp @@ -540,7 +540,7 @@ err_t enc28j60_lwip_xmit(struct netif *pNetIF, struct pbuf *pPBuf) if (length > ETHERSIZE) // (ETHERSIZE+4)) { debug_printf("xmit - length is too large, truncated \r\n"); - ASSERT(false; + ASSERT(false); length = ETHERSIZE; // ETHERSIZE+4; /* what a terriable hack! */ } diff --git a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp index 9d1c4d833f..2f2158bdb7 100644 --- a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp +++ b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp @@ -489,7 +489,7 @@ CLR_INT32 Library_sys_net_native_System_Net_Sockets_NativeSocket::Helper__Select writefds = &fds; break; default: - _ASSERTE(false; + _ASSERTE(false); // fall through case 2: exceptfds = &fds; diff --git a/src/PAL/COM/sockets/sockets_lwip.cpp b/src/PAL/COM/sockets/sockets_lwip.cpp index a2a7db6208..799c8ebc17 100644 --- a/src/PAL/COM/sockets/sockets_lwip.cpp +++ b/src/PAL/COM/sockets/sockets_lwip.cpp @@ -141,7 +141,7 @@ bool Network_Uninitialize() void SOCKETS_CloseConnections() { NATIVE_PROFILE_PAL_COM(); - Sockets_LWIP_Driver::CloseConnections(false; + Sockets_LWIP_Driver::CloseConnections(false); } HRESULT SOCK_CONFIGURATION_LoadAdapterConfiguration(HAL_Configuration_NetworkInterface *config, uint32_t interfaceIndex) @@ -485,7 +485,7 @@ void Sockets_LWIP_Driver::RegisterSocket(SOCK_SOCKET sock, bool selectable, bool NATIVE_PROFILE_PAL_COM(); if (sock == SOCK_SOCKET_ERROR) { - ASSERT(false; + ASSERT(false); return; } diff --git a/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp b/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp index b0a5e81f39..ab985c1571 100644 --- a/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp +++ b/targets/ChibiOS/_FatFs/fatfs_FS_Driver.cpp @@ -211,7 +211,7 @@ HRESULT FATFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } @@ -243,7 +243,7 @@ HRESULT FATFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volumeLab // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } diff --git a/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp b/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp index 92e1b3173e..210a6b0527 100644 --- a/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp +++ b/targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp @@ -138,7 +138,7 @@ HRESULT LITTLEFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } @@ -159,7 +159,7 @@ HRESULT LITTLEFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volume // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } diff --git a/targets/ChibiOS/_nanoCLR/nanoCRT.cpp b/targets/ChibiOS/_nanoCLR/nanoCRT.cpp index 21ee545e58..3557290927 100644 --- a/targets/ChibiOS/_nanoCLR/nanoCRT.cpp +++ b/targets/ChibiOS/_nanoCLR/nanoCRT.cpp @@ -139,14 +139,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(false; + _ASSERTE(false); return 1; } @@ -162,13 +162,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(false; + _ASSERTE(false); strDst[0] = 0; return 1; } @@ -196,7 +196,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(false; + _ASSERTE(false); return 1; } diff --git a/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp b/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp index 0a907a1342..2f5d2bec81 100644 --- a/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp +++ b/targets/ESP32/_FatFs/fatfs_FS_Driver.cpp @@ -126,7 +126,7 @@ HRESULT FATFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } @@ -158,7 +158,7 @@ HRESULT FATFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volumeLab // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } diff --git a/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp b/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp index 6c24bdb5eb..e6c99a1253 100644 --- a/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp +++ b/targets/ESP32/_littlefs/littlefs_FS_Driver.cpp @@ -126,7 +126,7 @@ HRESULT LITTLEFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } @@ -158,7 +158,7 @@ HRESULT LITTLEFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volume // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } diff --git a/targets/ESP32/_nanoCLR/nanoCRT.cpp b/targets/ESP32/_nanoCLR/nanoCRT.cpp index 72eb2c6e90..b1db73f820 100644 --- a/targets/ESP32/_nanoCLR/nanoCRT.cpp +++ b/targets/ESP32/_nanoCLR/nanoCRT.cpp @@ -140,14 +140,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(false; + _ASSERTE(false); return 1; } @@ -163,13 +163,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(false; + _ASSERTE(false); strDst[0] = 0; return 1; } @@ -197,7 +197,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(false; + _ASSERTE(false); return 1; } diff --git a/targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp b/targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp index 21ee545e58..3557290927 100644 --- a/targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp +++ b/targets/FreeRTOS/_common/nanoCLR/nanoCRT.cpp @@ -139,14 +139,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(false; + _ASSERTE(false); return 1; } @@ -162,13 +162,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(false; + _ASSERTE(false); strDst[0] = 0; return 1; } @@ -196,7 +196,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(false; + _ASSERTE(false); return 1; } diff --git a/targets/TI_SimpleLink/_common/sockets_simplelink.cpp b/targets/TI_SimpleLink/_common/sockets_simplelink.cpp index 5e57511b00..4e801df4cf 100644 --- a/targets/TI_SimpleLink/_common/sockets_simplelink.cpp +++ b/targets/TI_SimpleLink/_common/sockets_simplelink.cpp @@ -848,7 +848,7 @@ void SOCKETS_CloseConnections() { NATIVE_PROFILE_PAL_COM(); // FIXME - // Sockets_SimpleLink_Driver::CloseConnections(false; + // Sockets_SimpleLink_Driver::CloseConnections(false); } HRESULT SOCK_CONFIGURATION_LoadAdapterConfiguration(HAL_Configuration_NetworkInterface *config, uint32_t interfaceIndex) diff --git a/targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp b/targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp index 21ee545e58..3557290927 100644 --- a/targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/nanoCRT.cpp @@ -139,14 +139,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(false; + _ASSERTE(false); return 1; } @@ -162,13 +162,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(false; + _ASSERTE(false); strDst[0] = 0; return 1; } @@ -196,7 +196,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(false; + _ASSERTE(false); return 1; } diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp index e331b0b18b..790168a8d6 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp @@ -149,7 +149,7 @@ bool Network_Uninitialize() void SOCKETS_CloseConnections() { NATIVE_PROFILE_PAL_COM(); - Sockets_ISM43362_Driver::CloseConnections(false; + Sockets_ISM43362_Driver::CloseConnections(false); } HRESULT SOCK_CONFIGURATION_LoadAdapterConfiguration(HAL_Configuration_NetworkInterface *config, uint32_t interfaceIndex) @@ -481,7 +481,7 @@ void Sockets_ISM43362_Driver::RegisterSocket(SOCK_SOCKET sock, bool selectable, NATIVE_PROFILE_PAL_COM(); if (sock == SOCK_SOCKET_ERROR) { - ASSERT(false; + ASSERT(false); return; } diff --git a/targets/ThreadX/_common/NetX/sockets_netx.cpp b/targets/ThreadX/_common/NetX/sockets_netx.cpp index 3eacde36fe..16ba57df36 100644 --- a/targets/ThreadX/_common/NetX/sockets_netx.cpp +++ b/targets/ThreadX/_common/NetX/sockets_netx.cpp @@ -144,7 +144,7 @@ bool Network_Uninitialize() void SOCKETS_CloseConnections() { NATIVE_PROFILE_PAL_COM(); - Sockets_NETX_Driver::CloseConnections(false; + Sockets_NETX_Driver::CloseConnections(false); } HRESULT SOCK_CONFIGURATION_LoadAdapterConfiguration(HAL_Configuration_NetworkInterface *config, uint32_t interfaceIndex) @@ -472,7 +472,7 @@ void Sockets_NETX_Driver::RegisterSocket(SOCK_SOCKET sock, bool selectable, bool NATIVE_PROFILE_PAL_COM(); if (sock == SOCK_SOCKET_ERROR) { - ASSERT(false; + ASSERT(false); return; } diff --git a/targets/ThreadX/_common/nanoCLR/nanoCRT.cpp b/targets/ThreadX/_common/nanoCLR/nanoCRT.cpp index aba95c1acd..8bd569488d 100644 --- a/targets/ThreadX/_common/nanoCLR/nanoCRT.cpp +++ b/targets/ThreadX/_common/nanoCLR/nanoCRT.cpp @@ -140,14 +140,14 @@ int hal_strcpy_s(char *strDst, size_t sizeInBytes, const char *strSrc) size_t len; if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } len = hal_strlen_s(strSrc); if (sizeInBytes < len + 1) { - _ASSERTE(false; + _ASSERTE(false); return 1; } @@ -163,13 +163,13 @@ int hal_strncpy_s(char *strDst, size_t sizeInBytes, const char *strSrc, size_t c #undef strncpy if (strDst == NULL || strSrc == NULL || sizeInBytes == 0) { - _ASSERTE(false; + _ASSERTE(false); return 1; } if (sizeInBytes < count + 1) { - _ASSERTE(false; + _ASSERTE(false); strDst[0] = 0; return 1; } @@ -197,7 +197,7 @@ int hal_strncmp_s(const char *str1, const char *str2, size_t num) #undef strncmp if (str1 == NULL || str2 == NULL) { - _ASSERTE(false; + _ASSERTE(false); return 1; } diff --git a/targets/netcore/littlefs/littlefs_FS_Driver.cpp b/targets/netcore/littlefs/littlefs_FS_Driver.cpp index b37fd1b949..97d4796fcd 100644 --- a/targets/netcore/littlefs/littlefs_FS_Driver.cpp +++ b/targets/netcore/littlefs/littlefs_FS_Driver.cpp @@ -92,7 +92,7 @@ HRESULT LITTLEFS_FS_Driver::GetSizeInfo(const VOLUME_ID *volume, int64_t *totalS // return S_OK; // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } @@ -107,7 +107,7 @@ HRESULT LITTLEFS_FS_Driver::FlushAll(const VOLUME_ID *volume) // return S_OK; // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } @@ -128,7 +128,7 @@ HRESULT LITTLEFS_FS_Driver::GetVolumeLabel(const VOLUME_ID *volume, char *volume // return logicDisk->GetDiskVolLab(volumeLabel); // } - ASSERT(false; + ASSERT(false); return CLR_E_INVALID_DRIVER; } diff --git a/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp b/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp index 2f03034f2a..0f59b8e133 100644 --- a/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp +++ b/targets/netcore/nanoFramework.nanoCLR/CLRStartup.cpp @@ -412,7 +412,7 @@ struct Settings if ((CLR_UINT8 *)header + header->TotalSize() > (CLR_UINT8 *)headerEnd) { // checksum passed, but not enough data in assembly - _ASSERTE(false; + _ASSERTE(false); delete bufferSub; break; } diff --git a/targets/win32/nanoCLR/CLRStartup.cpp b/targets/win32/nanoCLR/CLRStartup.cpp index c9421a88a3..ce5fbc6b5b 100644 --- a/targets/win32/nanoCLR/CLRStartup.cpp +++ b/targets/win32/nanoCLR/CLRStartup.cpp @@ -491,7 +491,7 @@ struct Settings : CLR_RT_ParseOptions if ((CLR_UINT8 *)header + header->TotalSize() > (CLR_UINT8 *)headerEnd) { // checksum passed, but not enough data in assembly - _ASSERTE(false; + _ASSERTE(false); delete bufferSub; break; } diff --git a/targets/win32/nanoCLR/Various.cpp b/targets/win32/nanoCLR/Various.cpp index c6a7761b84..eda430a3a2 100644 --- a/targets/win32/nanoCLR/Various.cpp +++ b/targets/win32/nanoCLR/Various.cpp @@ -371,7 +371,7 @@ int hal_vfprintf(COM_HANDLE stream, const char *format, va_list arg) // break; // case FLASH_WRITE_TRANSPORT: - // _ASSERTE(false; + // _ASSERTE(false); //} return chars; diff --git a/targets/win32/nanoCLR/targetPAL_Events.cpp b/targets/win32/nanoCLR/targetPAL_Events.cpp index ee2d2ab8e6..3dc0c0bf72 100644 --- a/targets/win32/nanoCLR/targetPAL_Events.cpp +++ b/targets/win32/nanoCLR/targetPAL_Events.cpp @@ -156,7 +156,7 @@ void Events_SetCallback(set_Event_Callback pfn, void *arg) (void)pfn; (void)arg; - _ASSERTE(false; + _ASSERTE(false); } void FreeManagedEvent(uint8_t category, uint8_t subCategory, uint16_t data1, uint32_t data2) From 62d82c8a4ddefce5c095a6179e689f52adc76650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 4 Jun 2026 23:39:48 +0100 Subject: [PATCH 10/18] More fixes --- .../Network/Enc28j60/enc28j60_lwip_driver.cpp | 2 +- src/PAL/COM/sockets/Sockets_debugger.cpp | 10 ++-- src/PAL/COM/sockets/sockets_lwip.cpp | 16 +++---- src/PAL/Events/nanoPAL_Events_driver.cpp | 4 +- src/PAL/FileSystem/nanoPAL_FileSystem.cpp | 2 +- src/PAL/Lwip/lwIP_Sockets.cpp | 2 +- ...f_sys_io_filesystem_System_IO_NativeIO.cpp | 2 +- .../Graphics/Core/Support/Jpeg/Jpeg.cpp | 2 +- .../Graphics/Core/Support/Jpeg/jcapistd.c | 2 +- .../TouchPanel/Core/Gestures.cpp | 4 +- .../targetHAL_ConfigurationManager.cpp | 4 +- ...noFramework_Device_OneWire_OneWireHost.cpp | 4 +- .../include/stm32_onewire/hal_stm32_onewire.h | 14 +++--- .../hal/src/stm32_onewire/hal_stm32_onewire.c | 48 +++++++++---------- ...noFramework_Device_OneWire_OneWireHost.cpp | 8 ++-- .../targetHAL_ConfigurationManager.cpp | 4 +- .../_common/sockets_simplelink.cpp | 2 +- .../_nanoCLR/System.Device.Gpio/cpu_gpio.cpp | 2 +- .../_nanoCLR/targetPAL_Events.cpp | 2 +- .../TI_SimpleLink/_nanoCLR/targetPAL_Time.cpp | 2 +- .../targetHAL_ConfigurationManager.cpp | 6 +-- .../wifi/inventek/sockets_ISM43362.cpp | 16 +++---- .../targetHAL_ConfigurationManager.cpp | 4 +- .../targetHAL_ConfigurationManager.cpp | 4 +- ...noFramework_Device_OneWire_OneWireHost.cpp | 8 ++-- targets/ThreadX/_common/NetX/sockets_netx.cpp | 16 +++---- 26 files changed, 95 insertions(+), 95 deletions(-) diff --git a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp index a1a1ebda11..b1289146a7 100644 --- a/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp +++ b/src/DeviceInterfaces/Network/Enc28j60/enc28j60_lwip_driver.cpp @@ -22,7 +22,7 @@ static struct netif g_ENC28J60_NetIF; HAL_CONTINUATION InterruptTaskContinuation; HAL_COMPLETION LwipUpTimeCompletion; -static bool LwipNetworkStatus = FALSE; +static bool LwipNetworkStatus = false; static uint32_t LwipLastIpAddress = 0; extern ENC28J60_LWIP_DEVICE_CONFIG g_ENC28J60_LWIP_Config; diff --git a/src/PAL/COM/sockets/Sockets_debugger.cpp b/src/PAL/COM/sockets/Sockets_debugger.cpp index b38353db96..1ad7227c02 100644 --- a/src/PAL/COM/sockets/Sockets_debugger.cpp +++ b/src/PAL/COM/sockets/Sockets_debugger.cpp @@ -82,7 +82,7 @@ void Sockets_LWIP_Driver::Debugger_Initialize() g_Sockets_LWIP_Driver.m_stateDebugSocket = DbgSock_Uninitialized; - g_Sockets_LWIP_Driver.m_usingSSL = FALSE; + g_Sockets_LWIP_Driver.m_usingSSL = false; s_initializedDbg = true; } @@ -93,7 +93,7 @@ void Sockets_LWIP_Driver::Debugger_Uninitialize() g_Sockets_LWIP_Driver.m_multicastSocket = SOCK_SOCKET_ERROR; g_Sockets_LWIP_Driver.m_SocketDebugStream = SOCK_SOCKET_ERROR; g_Sockets_LWIP_Driver.m_SocketDebugListener = SOCK_SOCKET_ERROR; - s_initializedDbg = FALSE; + s_initializedDbg = false; } void Sockets_LWIP_Driver::Debugger_Abort() @@ -396,7 +396,7 @@ void Sockets_LWIP_Driver::CloseDebuggerSocket() SOCK_close(g_Sockets_LWIP_Driver.m_SocketDebugStream); } - g_Sockets_LWIP_Driver.m_usingSSL = FALSE; + g_Sockets_LWIP_Driver.m_usingSSL = false; g_Sockets_LWIP_Driver.m_SocketDebugStream = SOCK_SOCKET_ERROR; @@ -607,7 +607,7 @@ void Sockets_LWIP_Driver::MulticastDiscoveryRespond(void *arg) if (len > 0) { int32_t idx = 0; - bool fFound = FALSE; + bool fFound = false; const char *c_Signature = SOCK_DISCOVERY_MULTICAST_TOKEN; int32_t sigLen = hal_strlen_s(c_Signature); @@ -685,4 +685,4 @@ void Sockets_LWIP_Driver::MulticastDiscoveryRespond(void *arg) MulticastDiscoverySchedule(); } -bool Sockets_LWIP_Driver::s_initializedDbg = FALSE; +bool Sockets_LWIP_Driver::s_initializedDbg = false; diff --git a/src/PAL/COM/sockets/sockets_lwip.cpp b/src/PAL/COM/sockets/sockets_lwip.cpp index 799c8ebc17..a15b29af09 100644 --- a/src/PAL/COM/sockets/sockets_lwip.cpp +++ b/src/PAL/COM/sockets/sockets_lwip.cpp @@ -157,7 +157,7 @@ HRESULT SOCK_CONFIGURATION_UpdateAdapterConfiguration( { NATIVE_PROFILE_PAL_COM(); HRESULT hr = S_OK; - bool success = FALSE; + bool success = false; const uint32_t c_reInitFlag = NetworkInterface_UpdateOperation_Dhcp | NetworkInterface_UpdateOperation_DhcpRenew | NetworkInterface_UpdateOperation_Mac; @@ -414,7 +414,7 @@ bool Sockets_LWIP_Driver::Initialize() if (!s_initialized) { - g_Sockets_LWIP_Driver.m_fShuttingDown = FALSE; + g_Sockets_LWIP_Driver.m_fShuttingDown = false; g_Sockets_LWIP_Driver.m_cntSockets = 0; @@ -461,9 +461,9 @@ bool Sockets_LWIP_Driver::Uninitialize() ret = HAL_SOCK_Uninitialize(); - s_initialized = FALSE; - s_wirelessInitialized = FALSE; - s_discoveryInitialized = FALSE; + s_initialized = false; + s_wirelessInitialized = false; + s_discoveryInitialized = false; } return ret; @@ -546,6 +546,6 @@ void Sockets_LWIP_Driver::UnregisterSocket(SOCK_SOCKET sock) // return; // } -bool Sockets_LWIP_Driver::s_initialized = FALSE; -bool Sockets_LWIP_Driver::s_wirelessInitialized = FALSE; -bool Sockets_LWIP_Driver::s_discoveryInitialized = FALSE; +bool Sockets_LWIP_Driver::s_initialized = false; +bool Sockets_LWIP_Driver::s_wirelessInitialized = false; +bool Sockets_LWIP_Driver::s_discoveryInitialized = false; diff --git a/src/PAL/Events/nanoPAL_Events_driver.cpp b/src/PAL/Events/nanoPAL_Events_driver.cpp index 7f7db4be81..2d7b217c70 100644 --- a/src/PAL/Events/nanoPAL_Events_driver.cpp +++ b/src/PAL/Events/nanoPAL_Events_driver.cpp @@ -8,7 +8,7 @@ PalEventDriver g_palEventDriver; -bool PalEventDriver::s_initialized = FALSE; +bool PalEventDriver::s_initialized = false; HRESULT PalEventDriver::Initialize() { @@ -25,7 +25,7 @@ HRESULT PalEventDriver::Uninitialize() { if (PalEventDriver::s_initialized) { - PalEventDriver::s_initialized = FALSE; + PalEventDriver::s_initialized = false; /// Remove all nodes. g_palEventDriver.listenerList.Initialize(); diff --git a/src/PAL/FileSystem/nanoPAL_FileSystem.cpp b/src/PAL/FileSystem/nanoPAL_FileSystem.cpp index 3e3205f7d2..52c821d248 100644 --- a/src/PAL/FileSystem/nanoPAL_FileSystem.cpp +++ b/src/PAL/FileSystem/nanoPAL_FileSystem.cpp @@ -171,7 +171,7 @@ bool FileSystemVolumeList::InitializeVolumes() else { // even if success == FALSE, InitalizeVolume() will still get called - success = FALSE; + success = false; } volume = volume->Next(); diff --git a/src/PAL/Lwip/lwIP_Sockets.cpp b/src/PAL/Lwip/lwIP_Sockets.cpp index f2ac1f998f..3cc31dcc6f 100644 --- a/src/PAL/Lwip/lwIP_Sockets.cpp +++ b/src/PAL/Lwip/lwIP_Sockets.cpp @@ -336,7 +336,7 @@ bool LWIP_SOCKETS_Driver::Initialize() if (interfaceNumber == SOCK_SOCKET_ERROR) { g_LWIP_SOCKETS_Driver.m_interfaces[i].m_interfaceNumber = -1; - DEBUG_HANDLE_SOCKET_ERROR("Network init", false; + DEBUG_HANDLE_SOCKET_ERROR("Network init", false); continue; } diff --git a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeIO.cpp b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeIO.cpp index e8abde448d..101ae61e85 100644 --- a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeIO.cpp +++ b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_NativeIO.cpp @@ -134,7 +134,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_NativeIO::Format___STATIC__VOID__ FileSystemVolume *driver; FILESYSTEM_DRIVER_INTERFACE *originalFS = NULL; STREAM_DRIVER_INTERFACE *originalStream = NULL; - bool needInitialize = FALSE; + bool needInitialize = false; NANOCLR_CHECK_HRESULT(FindVolume(stack.Arg0(), driver, path)); hbFileSystemName = stack.Arg1().DereferenceString(); diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/Jpeg.cpp b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/Jpeg.cpp index 9372519d48..6cdaa729dd 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/Jpeg.cpp +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/Jpeg.cpp @@ -75,7 +75,7 @@ HRESULT CLR_GFX_Bitmap::CreateInstanceJpeg(CLR_RT_HeapBlock &ref, const CLR_UINT // Set output to 16bit 5-6-5 RGB format // We can add support for other bit-depth in the future cinfo.out_color_space = JCS_RGB; - cinfo.do_fancy_upsampling = FALSE; + cinfo.do_fancy_upsampling = false; jpeg_start_decompress(&cinfo); diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c index 3349018486..dd36f64e36 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcapistd.c @@ -35,7 +35,7 @@ * is wanted, but for safety's sake it should not be the default behavior: * programmers should have to make a deliberate choice to emit abbreviated * images. Therefore the documentation and examples should encourage people - * to pass write_all_tables=TRUE; then it will take active thought to do the + * to pass write_all_tables=true; then it will take active thought to do the * wrong thing. */ diff --git a/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp b/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp index 802c239ef3..cea2724f3a 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Core/Gestures.cpp @@ -15,7 +15,7 @@ TOUCH_PANEL_Point GestureLastPoint; // It seems that events are defined in nanoHAL_V2.h and are required to be matched with managed code events. // This is a fudge to get it to compile -bool GestureDriver::s_initialized = FALSE; +bool GestureDriver::s_initialized = false; // 50ms - allow for some touch points to accumulate before we run the gesture engine HRESULT GestureDriver::Initialize() { @@ -34,7 +34,7 @@ HRESULT GestureDriver::Uninitialize() { if (GestureDriver::s_initialized) { - GestureDriver::s_initialized = FALSE; + GestureDriver::s_initialized = false; if (m_gestureCompletion.IsLinked()) m_gestureCompletion.Abort(); ResetRecognition(); } diff --git a/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp b/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp index 09a373aeb5..22e4efae5e 100644 --- a/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp @@ -277,8 +277,8 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( bool done) { ByteAddress storageAddress = 0; - bool requiresEnumeration = FALSE; - bool success = FALSE; + bool requiresEnumeration = false; + bool success = false; if (configuration == DeviceConfigurationOption_Network) { diff --git a/targets/ChibiOS/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ChibiOS/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index c19bc1e6ae..52d9222a4e 100644 --- a/targets/ChibiOS/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ChibiOS/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -100,7 +100,7 @@ HRESULT Library_nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost::FindFir NANOCLR_HEADER(); uint8_t *serialNumberPointer; - msg_t oneWireOperationResult = FALSE; + msg_t oneWireOperationResult = false; CLR_RT_HeapBlock hbTimeout; CLR_INT64 *timeout; @@ -192,7 +192,7 @@ HRESULT Library_nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost::FindNex NANOCLR_HEADER(); uint8_t *serialNumberPointer; - msg_t oneWireOperationResult = FALSE; + msg_t oneWireOperationResult = false; CLR_RT_HeapBlock hbTimeout; CLR_INT64 *timeout; diff --git a/targets/ChibiOS/_nf-overlay/os/hal/include/stm32_onewire/hal_stm32_onewire.h b/targets/ChibiOS/_nf-overlay/os/hal/include/stm32_onewire/hal_stm32_onewire.h index 7aa3fa7205..6acab06afd 100644 --- a/targets/ChibiOS/_nf-overlay/os/hal/include/stm32_onewire/hal_stm32_onewire.h +++ b/targets/ChibiOS/_nf-overlay/os/hal/include/stm32_onewire/hal_stm32_onewire.h @@ -92,13 +92,13 @@ extern "C" { uint8_t oneWireWriteByte(uint8_t sendbyte); uint8_t oneWireReadByte(void); void oneWireSerialNum(uint8_t* serialnum_buf, uint8_t do_read); - uint8_t oneWireAccess(void); - uint8_t oneWireBlock(uint8_t doReset, uint8_t* tran_buf, uint8_t tran_len); - uint8_t oneWireWriteMemory(uint8_t* buf, uint32_t ln, uint32_t adr); - uint8_t oneWireCopyScratchpad(uint32_t ln, uint32_t adr); - uint8_t oneWireWriteScratchpad(uint8_t* buf, uint32_t ln, uint32_t adr); - uint8_t oneWireReadPage(uint32_t start_pg, uint8_t* finalbuf); - uint8_t oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff); + bool oneWireAccess(void); + bool oneWireBlock(uint8_t doReset, uint8_t* tran_buf, uint8_t tran_len); + bool oneWireWriteMemory(uint8_t* buf, uint32_t ln, uint32_t adr); + bool oneWireCopyScratchpad(uint32_t ln, uint32_t adr); + bool oneWireWriteScratchpad(uint8_t* buf, uint32_t ln, uint32_t adr); + bool oneWireReadPage(uint32_t start_pg, uint8_t* finalbuf); + bool oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff); bool oneWireFindFirst (bool doReset, bool alarmOnly); bool oneWireFindNext (bool doReset, bool alarmOnly); diff --git a/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c b/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c index 52134ecf04..1dc03e0ce5 100644 --- a/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c +++ b/targets/ChibiOS/_nf-overlay/os/hal/src/stm32_onewire/hal_stm32_onewire.c @@ -270,7 +270,7 @@ AUTHOR: jassimoes *******************************************************************************/ uint8_t oneWireWriteByte(uint8_t sendbyte) { - return (oneWireTouchByte(sendbyte) == sendbyte) ? TRUE : FALSE; + return (oneWireTouchByte(sendbyte) == sendbyte) ? true : false; } /******************************************************************************* @@ -357,9 +357,9 @@ void oneWireSerialNum(uint8_t *serialnum_buf, uint8_t do_read) // function is complete the 1-Wire device is ready to accept device-specific // commands. // - // Returns: TRUE (1) : reset indicates present and device is ready + // Returns: true: reset indicates present and device is ready // for commands. - // FALSE (0): reset does not indicate presence or echos 'writes' + // false: reset does not indicate presence or echos 'writes' // are not correct. // @@ -370,7 +370,7 @@ AUTHOR: jassimoes COMMENTS: *******************************************************************************/ -uint8_t oneWireAccess(void) +bool oneWireAccess(void) { uint8_t sendpacket[9]; uint8_t i; @@ -434,11 +434,11 @@ uint8_t oneWireAccess(void) // 'tran_len' - length in bytes to transfer // Supported devices: all // - // Returns: TRUE (1) : The optional reset returned a valid - // presence (doReset == TRUE) or there + // Returns: true: The optional reset returned a valid + // presence (doReset == true) or there // was no reset required. - // FALSE (0): The reset did not return a valid prsence - // (doReset == TRUE). + // false: The reset did not return a valid prsence + // (doReset == true). // // The maximum tran_len is 160 @@ -449,7 +449,7 @@ AUTHOR: jassimoes COMMENTS: *******************************************************************************/ -uint8_t oneWireBlock(uint8_t doReset, uint8_t *tran_buf, uint8_t tran_len) +bool oneWireBlock(bool doReset, uint8_t *tran_buf, uint8_t tran_len) { uint8_t i; // @@ -494,7 +494,7 @@ AUTHOR: jassimoes COMMENTS: *******************************************************************************/ -uint8_t oneWireWriteMemory(uint8_t *buf, uint32_t ln, uint32_t adr) +bool oneWireWriteMemory(uint8_t *buf, uint32_t ln, uint32_t adr) { //-------------------------------------------------// // write to scratch and then copy @@ -520,7 +520,7 @@ AUTHOR: jassimoes Only valid for DS1921G,H,Z *******************************************************************************/ -uint8_t oneWireCopyScratchpad(uint32_t ln, uint32_t adr) +bool oneWireCopyScratchpad(uint32_t ln, uint32_t adr) { // local variables uint8_t i; @@ -564,7 +564,7 @@ AUTHOR: jassimoes Only valid for DS1921G,H,Z *******************************************************************************/ -uint8_t oneWireWriteScratchpad(uint8_t *buf, uint32_t ln, uint32_t adr) +bool oneWireWriteScratchpad(uint8_t *buf, uint32_t ln, uint32_t adr) { uint8_t i; uint8_t pbuf[40]; @@ -643,7 +643,7 @@ Only valid for DS1921G,H,Z Simplification of addressing using SKIP ROM *******************************************************************************/ -uint8_t oneWireReadPage(uint32_t start_pg, uint8_t *finalbuf) +bool oneWireReadPage(uint32_t start_pg, uint8_t *finalbuf) { uint32_t lastcrc16; uint32_t len, i; @@ -721,8 +721,8 @@ DESCRIPTION block. buff byte array containing data that was read - @return - returns '0' if the read page wasn't completed. - '1' if the operation is complete. + @return - returns false if the read page wasn't completed. + true if the operation is complete. USAGE EXAMPLES: @@ -732,7 +732,7 @@ AUTHOR: jassimoes COMMENTS: *******************************************************************************/ -uint8_t oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff) +bool oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff) { uint8_t i, send_len = 0, lsCRC16; uint8_t raw_buf[15]; @@ -851,9 +851,9 @@ uint8_t oneWireReadPageCRCEE77(uint32_t page, uint8_t *buff) // 'alarmOnly' - TRUE (1) the find alarm command 0xEC is // sent instead of the normal search command 0xF0 // -// Returns: TRUE (1) : when a 1-Wire device was found and it's +// Returns: true : when a 1-Wire device was found and it's // Serial Number placed in the global SerialNum -// FALSE (0): There are no devices on the 1-Wire Net. +// false: There are no devices on the 1-Wire Net. bool oneWireFindFirst(bool doReset, bool alarmOnly) { // reset the search state @@ -869,22 +869,22 @@ bool oneWireFindFirst(bool doReset, bool alarmOnly) ** NAME: oneWireFindNext ******************************************************* ********************************************************************************/ // The 'oneWireFindNext' function does a general search. -// This function continues from the previos search state. The search state +// This function continues from the previous search state. The search state // can be reset by using the 'oneWireFindFirst' function. // This function contains one parameter 'alarmOnly'. -// When 'alarmOnly' is TRUE (1) the find alarm command +// When 'alarmOnly' is true the find alarm command // 0xEC is sent instead of the normal search command 0xF0. // Using the find alarm command 0xEC will limit the search to only // 1-Wire devices that are in an 'alarm' state. // -// 'doReset' - TRUE (1) perform reset before search, FALSE (0) do not +// 'doReset' - true : perform reset before search, false : do not // perform reset before search. -// 'alarmOnly' - TRUE (1) the find alarm command 0xEC is +// 'alarmOnly' - true : the find alarm command 0xEC is // sent instead of the normal search command 0xF0 // -// Returns: TRUE (1) : when a 1-Wire device was found and it's +// Returns: true : when a 1-Wire device was found and it's // Serial Number placed in the global SerialNum -// FALSE (0): when no new device was found. Either the +// false: when no new device was found. Either the // last search was the last device or there // are no devices on the 1-Wire Net. bool oneWireFindNext(bool doReset, bool alarmOnly) diff --git a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index a09e468521..79cc3b9307 100644 --- a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -261,7 +261,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) uint8_t attempt = 0; uint8_t discrepMarker = 0; bool outBit = 0; - bool result = FALSE; + bool result = false; uint8_t lastcrc8 = 0; // if the last call was the last one @@ -269,7 +269,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) { // reset the search LastDiscrepancy = 0; - LastDevice = FALSE; + LastDevice = false; LastFamilyDiscrepancy = 0; return false; @@ -389,7 +389,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) LastDevice = (LastDiscrepancy == 0); // search isn't completed there are more devices present in the bus - result = TRUE; + result = true; } return result; @@ -419,7 +419,7 @@ bool oneWireFindFirst(bool doReset, bool alarmOnly) { // reset the search state LastDiscrepancy = 0; - LastDevice = FALSE; + LastDevice = false; LastFamilyDiscrepancy = 0; // clear serial number buffer for new search diff --git a/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp b/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp index df60e2dfba..0f115afdb0 100644 --- a/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/FreeRTOS/NXP/_common/targetHAL_ConfigurationManager.cpp @@ -181,8 +181,8 @@ bool ConfigurationManager_StoreConfigurationBlock( bool done) { ByteAddress storageAddress = 0; - bool requiresEnumeration = FALSE; - bool success = FALSE; + bool requiresEnumeration = false; + bool success = false; if (configuration == DeviceConfigurationOption_Network) { diff --git a/targets/TI_SimpleLink/_common/sockets_simplelink.cpp b/targets/TI_SimpleLink/_common/sockets_simplelink.cpp index 4e801df4cf..c9348a031e 100644 --- a/targets/TI_SimpleLink/_common/sockets_simplelink.cpp +++ b/targets/TI_SimpleLink/_common/sockets_simplelink.cpp @@ -864,7 +864,7 @@ HRESULT SOCK_CONFIGURATION_UpdateAdapterConfiguration( { NATIVE_PROFILE_PAL_COM(); HRESULT hr = S_OK; - bool success = FALSE; + bool success = false; const uint32_t c_reInitFlag = NetworkInterface_UpdateOperation_Dhcp | NetworkInterface_UpdateOperation_DhcpRenew | NetworkInterface_UpdateOperation_Mac; diff --git a/targets/TI_SimpleLink/_nanoCLR/System.Device.Gpio/cpu_gpio.cpp b/targets/TI_SimpleLink/_nanoCLR/System.Device.Gpio/cpu_gpio.cpp index f8664501e5..9c93f7a34e 100644 --- a/targets/TI_SimpleLink/_nanoCLR/System.Device.Gpio/cpu_gpio.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/System.Device.Gpio/cpu_gpio.cpp @@ -392,7 +392,7 @@ bool CPU_GPIO_EnableInputPin( Clock_Params_init(¶ms); params.arg = (UArg)pState->pinConfigIndex; - params.startFlag = FALSE; + params.startFlag = false; // period it's 0 because we are using a one-shot timer params.period = 0; diff --git a/targets/TI_SimpleLink/_nanoCLR/targetPAL_Events.cpp b/targets/TI_SimpleLink/_nanoCLR/targetPAL_Events.cpp index d0affd12df..4aa6434690 100644 --- a/targets/TI_SimpleLink/_nanoCLR/targetPAL_Events.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/targetPAL_Events.cpp @@ -25,7 +25,7 @@ bool Events_Initialize_Platform() Clock_Params_init(¶ms); params.arg = NULL; - params.startFlag = FALSE; + params.startFlag = false; params.period = 0; boolEventsTimer = Clock_create(local_Events_SetBoolTimer_Callback, 0, ¶ms, Error_IGNORE); diff --git a/targets/TI_SimpleLink/_nanoCLR/targetPAL_Time.cpp b/targets/TI_SimpleLink/_nanoCLR/targetPAL_Time.cpp index 2e6ff7c2ba..08e60dfcdd 100644 --- a/targets/TI_SimpleLink/_nanoCLR/targetPAL_Time.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/targetPAL_Time.cpp @@ -24,7 +24,7 @@ HRESULT Time_Initialize() Clock_Params_init(¶ms); params.arg = NULL; - params.startFlag = FALSE; + params.startFlag = false; params.period = 0; nextEventTimer = Clock_create(NextEventTimer_Callback, 0, ¶ms, Error_IGNORE); diff --git a/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp index 90f60dfdeb..de9ba279a3 100644 --- a/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/Maxim/_common/targetHAL_ConfigurationManager.cpp @@ -207,8 +207,8 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( bool done) { ByteAddress storageAddress = 0; - bool requiresEnumeration = FALSE; - bool success = FALSE; + bool requiresEnumeration = false; + bool success = false; if (configuration == DeviceConfigurationOption_Network) { @@ -362,7 +362,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( uint32_t blockOffset; uint8_t *blockAddressInCopy; uint32_t blockSize; - bool success = FALSE; + bool success = false; // config sector size int sizeOfConfigSector = (uint32_t)&__nanoConfig_end__ - (uint32_t)&__nanoConfig_start__; diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp index 790168a8d6..cb327e98a6 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp @@ -165,7 +165,7 @@ HRESULT SOCK_CONFIGURATION_UpdateAdapterConfiguration( { NATIVE_PROFILE_PAL_COM(); HRESULT hr = S_OK; - bool success = FALSE; + bool success = false; const uint32_t c_reInitFlag = NetworkInterface_UpdateOperation_Dhcp | NetworkInterface_UpdateOperation_DhcpRenew | NetworkInterface_UpdateOperation_Mac; @@ -410,7 +410,7 @@ bool Sockets_ISM43362_Driver::Initialize() if (!s_initialized) { - g_Sockets_ISM43362_Driver.m_fShuttingDown = FALSE; + g_Sockets_ISM43362_Driver.m_fShuttingDown = false; g_Sockets_ISM43362_Driver.m_cntSockets = 0; @@ -457,9 +457,9 @@ bool Sockets_ISM43362_Driver::Uninitialize() ret = HAL_SOCK_Uninitialize(); - s_initialized = FALSE; - s_wirelessInitialized = FALSE; - s_discoveryInitialized = FALSE; + s_initialized = false; + s_wirelessInitialized = false; + s_discoveryInitialized = false; } return ret; @@ -547,6 +547,6 @@ bool Sockets_ISM43362_Driver::UpgradeToSsl(SOCK_SOCKET sock) // return; // } -bool Sockets_ISM43362_Driver::s_initialized = FALSE; -bool Sockets_ISM43362_Driver::s_wirelessInitialized = FALSE; -bool Sockets_ISM43362_Driver::s_discoveryInitialized = FALSE; +bool Sockets_ISM43362_Driver::s_initialized = false; +bool Sockets_ISM43362_Driver::s_wirelessInitialized = false; +bool Sockets_ISM43362_Driver::s_discoveryInitialized = false; diff --git a/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp index 207f7c9ba2..65cb2e7414 100644 --- a/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/ST/_common/targetHAL_ConfigurationManager.cpp @@ -285,8 +285,8 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( bool done) { ByteAddress storageAddress = 0; - bool requiresEnumeration = FALSE; - bool success = FALSE; + bool requiresEnumeration = false; + bool success = false; if (configuration == DeviceConfigurationOption_Network) { diff --git a/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp b/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp index 588033c72c..9364126c2e 100644 --- a/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ThreadX/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp @@ -295,8 +295,8 @@ __nfweak bool ConfigurationManager_StoreConfigurationBlock( bool done) { ByteAddress storageAddress = 0; - bool requiresEnumeration = FALSE; - bool success = FALSE; + bool requiresEnumeration = false; + bool success = false; if (configuration == DeviceConfigurationOption_Network) { diff --git a/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index 125a0b613b..4e7f2fe9d0 100644 --- a/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -235,7 +235,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) uint8_t attempt = 0; uint8_t discrepMarker = 0; bool outBit = 0; - bool result = FALSE; + bool result = false; uint8_t lastcrc8 = 0; // if the last call was the last one @@ -243,7 +243,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) { // reset the search LastDiscrepancy = 0; - LastDevice = FALSE; + LastDevice = false; LastFamilyDiscrepancy = 0; return false; @@ -363,7 +363,7 @@ bool oneWireFindNext(bool doReset, bool alarmOnly) LastDevice = (LastDiscrepancy == 0); // search isn't completed there are more devices present in the bus - result = TRUE; + result = true; } return result; @@ -393,7 +393,7 @@ bool oneWireFindFirst(bool doReset, bool alarmOnly) { // reset the search state LastDiscrepancy = 0; - LastDevice = FALSE; + LastDevice = false; LastFamilyDiscrepancy = 0; // clear serial number buffer for new search diff --git a/targets/ThreadX/_common/NetX/sockets_netx.cpp b/targets/ThreadX/_common/NetX/sockets_netx.cpp index 16ba57df36..279f961d56 100644 --- a/targets/ThreadX/_common/NetX/sockets_netx.cpp +++ b/targets/ThreadX/_common/NetX/sockets_netx.cpp @@ -160,7 +160,7 @@ HRESULT SOCK_CONFIGURATION_UpdateAdapterConfiguration( { NATIVE_PROFILE_PAL_COM(); HRESULT hr = S_OK; - bool success = FALSE; + bool success = false; const uint32_t c_reInitFlag = NetworkInterface_UpdateOperation_Dhcp | NetworkInterface_UpdateOperation_DhcpRenew | NetworkInterface_UpdateOperation_Mac; @@ -401,7 +401,7 @@ bool Sockets_NETX_Driver::Initialize() if (!s_initialized) { - g_Sockets_NETX_Driver.m_fShuttingDown = FALSE; + g_Sockets_NETX_Driver.m_fShuttingDown = false; g_Sockets_NETX_Driver.m_cntSockets = 0; @@ -448,9 +448,9 @@ bool Sockets_NETX_Driver::Uninitialize() ret = HAL_SOCK_Uninitialize(); - s_initialized = FALSE; - s_wirelessInitialized = FALSE; - s_discoveryInitialized = FALSE; + s_initialized = false; + s_wirelessInitialized = false; + s_discoveryInitialized = false; } return ret; @@ -533,6 +533,6 @@ void Sockets_NETX_Driver::UnregisterSocket(SOCK_SOCKET sock) // return; // } -bool Sockets_NETX_Driver::s_initialized = FALSE; -bool Sockets_NETX_Driver::s_wirelessInitialized = FALSE; -bool Sockets_NETX_Driver::s_discoveryInitialized = FALSE; +bool Sockets_NETX_Driver::s_initialized = false; +bool Sockets_NETX_Driver::s_wirelessInitialized = false; +bool Sockets_NETX_Driver::s_discoveryInitialized = false; From af02944d97b73fb0b2bb26a6e502b320dea23c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 4 Jun 2026 23:47:34 +0100 Subject: [PATCH 11/18] Add back missing close braket --- targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp | 4 ++-- targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp b/targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp index 8225837dfb..4c86f1762f 100644 --- a/targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp +++ b/targets/ChibiOS/ORGPAL_PALTHREE/target_FileSystem.cpp @@ -51,7 +51,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[1].streamDriver, g_AvailableFSInterfaces[1].fsDriver, 0, - false; + false); // W25Q128, drive F:, volume 1 FileSystemVolumeList::AddVolume( @@ -61,7 +61,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[1].streamDriver, g_AvailableFSInterfaces[1].fsDriver, 1, - false; + false); } void FS_MountRemovableVolumes() diff --git a/targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp b/targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp index 021284c4e6..fc65246c40 100644 --- a/targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp +++ b/targets/ChibiOS/ORGPAL_PALX/target_FileSystem.cpp @@ -52,7 +52,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[1].streamDriver, g_AvailableFSInterfaces[1].fsDriver, 0, - false; + false); } void FS_MountRemovableVolumes() From c753f81dc34a99cd6034ca4afdfbe00e43d2752a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 4 Jun 2026 23:48:06 +0100 Subject: [PATCH 12/18] Fix wrong include --- .../Graphics/Core/Support/Jpeg/jccoefct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c index b6b698df81..396dcd56b3 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c @@ -381,7 +381,7 @@ compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf) coef->whole_image[compptr->component_index], coef->iMCU_row_num * compptr->v_samp_factor, (JDIMENSION)compptr->v_samp_factor, - false; + false); } /* Loop to process one whole iMCU row */ From 8b307fa67b3d14919ce02792548ef8bfe75d3fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 5 Jun 2026 00:25:12 +0100 Subject: [PATCH 13/18] More fixes --- src/PAL/COM/sockets/sockets_lwip.cpp | 4 ++-- .../Graphics/Core/Support/Jpeg/jccoefct.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PAL/COM/sockets/sockets_lwip.cpp b/src/PAL/COM/sockets/sockets_lwip.cpp index a15b29af09..35a42b22bf 100644 --- a/src/PAL/COM/sockets/sockets_lwip.cpp +++ b/src/PAL/COM/sockets/sockets_lwip.cpp @@ -13,7 +13,7 @@ Sockets_LWIP_Driver g_Sockets_LWIP_Driver; SOCK_SOCKET SOCK_socket(int family, int type, int protocol) { NATIVE_PROFILE_PAL_COM(); - return Sockets_LWIP_Driver::Socket(family, type, protocol, false; + return Sockets_LWIP_Driver::Socket(family, type, protocol, false); } int SOCK_bind(SOCK_SOCKET socket, const struct SOCK_sockaddr *address, int addressLen) { @@ -48,7 +48,7 @@ int SOCK_listen(SOCK_SOCKET socket, int backlog) SOCK_SOCKET SOCK_accept(SOCK_SOCKET socket, struct SOCK_sockaddr *address, int *addressLen) { NATIVE_PROFILE_PAL_COM(); - return Sockets_LWIP_Driver::Accept(socket, address, addressLen, false; + return Sockets_LWIP_Driver::Accept(socket, address, addressLen, false); } int SOCK_shutdown(SOCK_SOCKET socket, int how) { diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c index 396dcd56b3..b2fb6888d5 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jccoefct.c @@ -269,7 +269,7 @@ compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf) coef->whole_image[ci], coef->iMCU_row_num * compptr->v_samp_factor, (JDIMENSION)compptr->v_samp_factor, - true; + true); /* Count non-dummy DCT block rows in this iMCU row. */ if (coef->iMCU_row_num < last_iMCU_row) block_rows = compptr->v_samp_factor; @@ -452,7 +452,7 @@ jinit_c_coef_controller(j_compress_ptr cinfo, bool need_full_buffer) coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)( (j_common_ptr)cinfo, JPOOL_IMAGE, - FALSE, + false, (JDIMENSION)jround_up((long)compptr->width_in_blocks, (long)compptr->h_samp_factor), (JDIMENSION)jround_up((long)compptr->height_in_blocks, (long)compptr->v_samp_factor), (JDIMENSION)compptr->v_samp_factor); From 05edcef994a517f5f68eb434662f08b36e5622b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 5 Jun 2026 00:45:47 +0100 Subject: [PATCH 14/18] MOre fixes --- src/CLR/Include/nanoCLR_Headers.h | 7 +++++++ src/PAL/COM/sockets/Sockets_debugger.cpp | 4 ++-- .../Graphics/Core/Support/Jpeg/jchuff.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/CLR/Include/nanoCLR_Headers.h b/src/CLR/Include/nanoCLR_Headers.h index e76819b86d..04c3fcbff2 100644 --- a/src/CLR/Include/nanoCLR_Headers.h +++ b/src/CLR/Include/nanoCLR_Headers.h @@ -16,4 +16,11 @@ #include #include +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + #endif // NANOCLR_HEADERS_H diff --git a/src/PAL/COM/sockets/Sockets_debugger.cpp b/src/PAL/COM/sockets/Sockets_debugger.cpp index 1ad7227c02..c286cfaca6 100644 --- a/src/PAL/COM/sockets/Sockets_debugger.cpp +++ b/src/PAL/COM/sockets/Sockets_debugger.cpp @@ -512,7 +512,7 @@ bool Sockets_LWIP_Driver::InitializeMulticastDiscovery() sockAddr.sin_addr.S_un.S_addr = SOCK_htonl(SOCK_INADDR_ANY); // UDP socket is easier in our scenario because it isn't session based - g_Sockets_LWIP_Driver.m_multicastSocket = Socket(SOCK_AF_INET, SOCK_SOCK_DGRAM, SOCK_IPPROTO_UDP, false; + g_Sockets_LWIP_Driver.m_multicastSocket = Socket(SOCK_AF_INET, SOCK_SOCK_DGRAM, SOCK_IPPROTO_UDP, false); SOCKET_CHECK_RESULT(g_Sockets_LWIP_Driver.m_multicastSocket); // set sock option for multicast @@ -640,7 +640,7 @@ void Sockets_LWIP_Driver::MulticastDiscoveryRespond(void *arg) // info.macAddressLen = current.macAddressLen; // memcpy( &info.macAddressBuffer[0], ¤t.macAddressBuffer[0], current.macAddressLen ); - sock = Socket(SOCK_AF_INET, SOCK_SOCK_DGRAM, SOCK_IPPROTO_UDP, false; + sock = Socket(SOCK_AF_INET, SOCK_SOCK_DGRAM, SOCK_IPPROTO_UDP, false); SOCKET_CHECK_RESULT(sock); memset(&sockAddr, 0, sizeof(sockAddr)); diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c index bb9f29ef89..f9aba4c233 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jchuff.c @@ -157,8 +157,8 @@ start_pass_huff(j_compress_ptr cinfo, bool gather_statistics) { /* Compute derived values for Huffman tables */ /* We may do this more than once for a table, but it's not expensive */ - jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, &entropy->dc_derived_tbls[dctbl]); - jpeg_make_c_derived_tbl(cinfo, FALSE, actbl, &entropy->ac_derived_tbls[actbl]); + jpeg_make_c_derived_tbl(cinfo, true, dctbl, &entropy->dc_derived_tbls[dctbl]); + jpeg_make_c_derived_tbl(cinfo, false, actbl, &entropy->ac_derived_tbls[actbl]); } /* Initialize DC predictions to 0 */ entropy->saved.last_dc_val[ci] = 0; From 489e22c95d7382ae405b6d3f37036a6a8d36c266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 5 Jun 2026 00:48:00 +0100 Subject: [PATCH 15/18] Reverting these as they are required for configurations --- src/CLR/Include/nanoCLR_Headers.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/CLR/Include/nanoCLR_Headers.h b/src/CLR/Include/nanoCLR_Headers.h index 04c3fcbff2..4dd5627ecb 100644 --- a/src/CLR/Include/nanoCLR_Headers.h +++ b/src/CLR/Include/nanoCLR_Headers.h @@ -16,11 +16,16 @@ #include #include -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE +// Constants for configuration options + +// Generic 'FALSE' preprocessor boolean constant +#if !defined(FALSE) #define FALSE 0 #endif +// Generic 'TRUE' preprocessor boolean constant +#if !defined(TRUE) +#define TRUE 1 +#endif + #endif // NANOCLR_HEADERS_H From 5f759ddeda52b9e00543dddf7bd0ba059c16d113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 5 Jun 2026 00:54:17 +0100 Subject: [PATCH 16/18] More fixes --- .../Graphics/Core/Support/Jpeg/jcmarker.c | 12 ++++++------ .../Graphics/Core/Support/Jpeg/jcparam.c | 2 +- .../Graphics/Core/Support/Jpeg/jctrans.c | 2 +- ...wire_nanoFramework_Device_OneWire_OneWireHost.cpp | 2 +- .../drivers/wifi/inventek/ISM43362_sockets.cpp | 2 +- .../drivers/wifi/inventek/sockets_ISM43362.cpp | 4 ++-- ...wire_nanoFramework_Device_OneWire_OneWireHost.cpp | 2 +- targets/ThreadX/_common/NetX/sockets_netx.cpp | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c index bcbbd4f709..afcdc0aaa8 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcmarker.c @@ -584,16 +584,16 @@ write_scan_header(j_compress_ptr cinfo) /* Progressive mode: only DC or only AC tables are used in one scan */ if (cinfo->Ss == 0) { if (cinfo->Ah == 0) /* DC needs no table for refinement scan */ - emit_dht(cinfo, compptr->dc_tbl_no, false; + emit_dht(cinfo, compptr->dc_tbl_no, false); } else { - emit_dht(cinfo, compptr->ac_tbl_no, true; + emit_dht(cinfo, compptr->ac_tbl_no, true); } } else { /* Sequential mode: need both DC and AC tables */ - emit_dht(cinfo, compptr->dc_tbl_no, false; - emit_dht(cinfo, compptr->ac_tbl_no, true; + emit_dht(cinfo, compptr->dc_tbl_no, false); + emit_dht(cinfo, compptr->ac_tbl_no, true); } } } @@ -643,9 +643,9 @@ write_tables_only(j_compress_ptr cinfo) if (!cinfo->arith_code) { for (i = 0; i < NUM_HUFF_TBLS; i++) { if (cinfo->dc_huff_tbl_ptrs[i] != NULL) - emit_dht(cinfo, i, false; + emit_dht(cinfo, i, false); if (cinfo->ac_huff_tbl_ptrs[i] != NULL) - emit_dht(cinfo, i, true; + emit_dht(cinfo, i, true); } } diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c index 09bec0927e..f179e8a80a 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcparam.c @@ -297,7 +297,7 @@ jpeg_set_defaults(j_compress_ptr cinfo) cinfo->data_precision = BITS_IN_JSAMPLE; /* Set up two quantization tables using default quality of 75 */ - jpeg_set_quality(cinfo, 75, true; + jpeg_set_quality(cinfo, 75, true); /* Set up two Huffman tables */ std_huff_tables(cinfo); diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c index d327f10d31..8de78aa5ca 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jctrans.c @@ -46,7 +46,7 @@ jpeg_write_coefficients(j_compress_ptr cinfo, jvirt_barray_ptr* coef_arrays) if (cinfo->global_state != CSTATE_START) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); /* Mark all tables to be written */ - jpeg_suppress_tables(cinfo, false; + jpeg_suppress_tables(cinfo, false); /* (Re)initialize error mgr and destination modules */ (*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo); (*cinfo->dest->init_destination) (cinfo); diff --git a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index 79cc3b9307..cacd4c092b 100644 --- a/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ESP32/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -505,7 +505,7 @@ HRESULT FindOneDevice(CLR_RT_StackFrame &stack, bool findFirst) // get a pointer to the first element of the byte array serialNumberPointer = (uint8_t *)serialNumberField->GetFirstElement(); - oneWireSerialNum(serialNumberPointer, true; + oneWireSerialNum(serialNumberPointer, true); } // pop timeout heap block from stack diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp index 6ae0a23309..3aef93d03b 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/ISM43362_sockets.cpp @@ -280,7 +280,7 @@ bool ISM43362_SOCKETS_Driver::Initialize() if (interfaceNumber == SOCK_SOCKET_ERROR) { - DEBUG_HANDLE_SOCKET_ERROR("Network init", false; + DEBUG_HANDLE_SOCKET_ERROR("Network init", false); // FIXME debug_printf("SocketError: %d\n", errorCode); continue; } diff --git a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp index cb327e98a6..9ae23b20e3 100644 --- a/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp +++ b/targets/ThreadX/ST/_common/drivers/wifi/inventek/sockets_ISM43362.cpp @@ -16,7 +16,7 @@ Sockets_ISM43362_Driver g_Sockets_ISM43362_Driver; SOCK_SOCKET SOCK_socket(int family, int type, int protocol) { NATIVE_PROFILE_PAL_COM(); - return Sockets_ISM43362_Driver::Socket(family, type, protocol, false; + return Sockets_ISM43362_Driver::Socket(family, type, protocol, false); } int SOCK_bind(SOCK_SOCKET socket, const struct SOCK_sockaddr *address, int addressLen) { @@ -51,7 +51,7 @@ int SOCK_listen(SOCK_SOCKET socket, int backlog) SOCK_SOCKET SOCK_accept(SOCK_SOCKET socket, struct SOCK_sockaddr *address, int *addressLen) { NATIVE_PROFILE_PAL_COM(); - return Sockets_ISM43362_Driver::Accept(socket, address, addressLen, false; + return Sockets_ISM43362_Driver::Accept(socket, address, addressLen, false); } int SOCK_shutdown(SOCK_SOCKET socket, int how) { diff --git a/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp b/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp index 4e7f2fe9d0..c3e08627b8 100644 --- a/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp +++ b/targets/ThreadX/SiliconLabs/_nanoCLR/nanoFramework.Device.OneWire/nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp @@ -518,7 +518,7 @@ HRESULT FindOneDevice(CLR_RT_StackFrame &stack, bool findFirst) // get a pointer to the first element of the byte array serialNumberPointer = (uint8_t *)serialNumberField->GetFirstElement(); - oneWireSerialNum(serialNumberPointer, true; + oneWireSerialNum(serialNumberPointer, true); } } diff --git a/targets/ThreadX/_common/NetX/sockets_netx.cpp b/targets/ThreadX/_common/NetX/sockets_netx.cpp index 279f961d56..419c8ff189 100644 --- a/targets/ThreadX/_common/NetX/sockets_netx.cpp +++ b/targets/ThreadX/_common/NetX/sockets_netx.cpp @@ -51,7 +51,7 @@ int SOCK_listen(SOCK_SOCKET socket, int backlog) SOCK_SOCKET SOCK_accept(SOCK_SOCKET socket, struct SOCK_sockaddr *address, int *addressLen) { NATIVE_PROFILE_PAL_COM(); - return Sockets_NETX_Driver::Accept(socket, address, addressLen, false; + return Sockets_NETX_Driver::Accept(socket, address, addressLen, false); } int SOCK_shutdown(SOCK_SOCKET socket, int how) { From a5493763e3c10775ce131830b7ebfd05077e56be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 5 Jun 2026 01:01:04 +0100 Subject: [PATCH 17/18] More fixes --- .../Graphics/Core/Support/Jpeg/jdmaster.c | 2 +- .../Graphics/Core/Support/Jpeg/jdtrans.c | 2 +- .../Graphics/Core/Support/Jpeg/jmemmgr.c | 8 ++++---- .../Graphics/Core/Support/Jpeg/jquant1.c | 2 +- .../TouchPanel/Core/TouchPanel.cpp | 4 ++-- .../os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c | 12 ++++++------ targets/ThreadX/_common/NetX/netx_sockets.cpp | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c index e58fa33129..478c4e6864 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdmaster.c @@ -459,7 +459,7 @@ prepare_for_output_pass(j_decompress_ptr cinfo) #ifdef QUANT_2PASS_SUPPORTED /* Final pass of 2-pass quantization */ master->pub.is_dummy_pass = false; - (*cinfo->cquantize->start_pass) (cinfo, false; + (*cinfo->cquantize->start_pass) (cinfo, false); (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); #else diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c index 38918a8629..437aad0745 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jdtrans.c @@ -121,7 +121,7 @@ transdecode_master_selection(j_decompress_ptr cinfo) } /* Always get a full-image coefficient buffer. */ - jinit_d_coef_controller(cinfo, true; + jinit_d_coef_controller(cinfo, true); /* We can now tell the memory manager to allocate virtual arrays. */ (*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo); diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c index 14ad97d77e..2127787610 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jmemmgr.c @@ -794,7 +794,7 @@ access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, ERREXIT(cinfo, JERR_VIRTUAL_BUG); /* Flush old buffer contents if necessary */ if (ptr->dirty) { - do_sarray_io(cinfo, ptr, true; + do_sarray_io(cinfo, ptr, true); ptr->dirty = false; } /* Decide what part of virtual array to access. @@ -820,7 +820,7 @@ access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr, * During the initial write pass, we will do no actual read * because the selected part is all undefined. */ - do_sarray_io(cinfo, ptr, false; + do_sarray_io(cinfo, ptr, false); } /* Ensure the accessed part of the array is defined; prezero if needed. * To improve locality of access, we only prezero the part of the array @@ -882,7 +882,7 @@ access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr, ERREXIT(cinfo, JERR_VIRTUAL_BUG); /* Flush old buffer contents if necessary */ if (ptr->dirty) { - do_barray_io(cinfo, ptr, true; + do_barray_io(cinfo, ptr, true); ptr->dirty = false; } /* Decide what part of virtual array to access. @@ -908,7 +908,7 @@ access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr, * During the initial write pass, we will do no actual read * because the selected part is all undefined. */ - do_barray_io(cinfo, ptr, false; + do_barray_io(cinfo, ptr, false); } /* Ensure the accessed part of the array is defined; prezero if needed. * To improve locality of access, we only prezero the part of the array diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c index 4c820e2101..4e6dc8d7b4 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jquant1.c @@ -717,7 +717,7 @@ quantize_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf, */ errorptr[0] = (FSERROR)bpreverr; /* unload prev err into array */ } - cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : true; + cquantize->on_odd_row = (cquantize->on_odd_row ? false : true); } } diff --git a/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp b/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp index ff03c34f6b..aa088215da 100644 --- a/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp +++ b/src/nanoFramework.Graphics/TouchPanel/Core/TouchPanel.cpp @@ -133,7 +133,7 @@ HRESULT TouchPanelDriver::GetDeviceCaps(unsigned int iIndex, void *lpOutput) { if (lpOutput == NULL) { - return false; + return CLR_E_FAIL; } switch (iIndex) @@ -162,7 +162,7 @@ HRESULT TouchPanelDriver::GetDeviceCaps(unsigned int iIndex, void *lpOutput) return (g_TouchPanelDriver.CalibrationPointGet((TOUCH_PANEL_CALIBRATION_POINT *)lpOutput)); default: - return false; + return CLR_E_FAIL; } return S_OK; diff --git a/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c b/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c index 19d1f85dfc..d5a84fc41b 100644 --- a/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c +++ b/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c @@ -201,8 +201,8 @@ uint8_t oneWire_lld_TouchReset(void) // set UART baud rate to 9600bps (required to send the RESET condition to the 1-Wire bus) uartSetSpeed(9600); - chBSemReset(&ONEWIRED1.TxCompleted, true; - chBSemReset(&ONEWIRED1.RxCompleted, true; + chBSemReset(&ONEWIRED1.TxCompleted, true); + chBSemReset(&ONEWIRED1.RxCompleted, true); uartStartReceive(ONEWIRED1.UartDriver, 1, &ONEWIRED1.RxBuffer[0]); uartStartSend(ONEWIRED1.UartDriver, 1, &ONEWIRED1.TxBuffer[0]); chThdSleepMilliseconds(10); @@ -229,8 +229,8 @@ bool oneWire_lld_TouchBit(bool sendbit) // (only required for Cortex-M7) cacheBufferFlush(&ONEWIRED1.TxBuffer[0], 1); - chBSemReset(&ONEWIRED1.RxCompleted, true; - chBSemReset(&ONEWIRED1.TxCompleted, true; + chBSemReset(&ONEWIRED1.RxCompleted, true); + chBSemReset(&ONEWIRED1.TxCompleted, true); uartStartReceive(ONEWIRED1.UartDriver, 1, &ONEWIRED1.RxBuffer[0]); uartStartSend(ONEWIRED1.UartDriver, 1, &ONEWIRED1.TxBuffer[0]); chThdSleepMilliseconds(0.1); @@ -274,8 +274,8 @@ uint8_t oneWire_lld_TouchByte(uint8_t sendbyte) // (only required for Cortex-M7) cacheBufferFlush(&ONEWIRED1.TxBuffer[0], 8); - chBSemReset(&ONEWIRED1.RxCompleted, true; - chBSemReset(&ONEWIRED1.TxCompleted, true; + chBSemReset(&ONEWIRED1.RxCompleted, true); + chBSemReset(&ONEWIRED1.TxCompleted, true); uartStartReceive(ONEWIRED1.UartDriver, 8, &ONEWIRED1.RxBuffer[0]); uartStartSend(ONEWIRED1.UartDriver, 8, &ONEWIRED1.TxBuffer[0]); chThdSleepMilliseconds(0.1); diff --git a/targets/ThreadX/_common/NetX/netx_sockets.cpp b/targets/ThreadX/_common/NetX/netx_sockets.cpp index 9fda1822ef..67aebac113 100644 --- a/targets/ThreadX/_common/NetX/netx_sockets.cpp +++ b/targets/ThreadX/_common/NetX/netx_sockets.cpp @@ -223,7 +223,7 @@ bool NETX_SOCKETS_Driver::Initialize() if (interfaceNumber == SOCK_SOCKET_ERROR) { - DEBUG_HANDLE_SOCKET_ERROR("Network init", false; + DEBUG_HANDLE_SOCKET_ERROR("Network init", false); // FIXME debug_printf("SocketError: %d\n", errorCode); continue; } From 01bba8938059b188e978004f4d82584344bd8951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 5 Jun 2026 16:08:01 +0100 Subject: [PATCH 18/18] More fixes --- src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c | 2 +- targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp | 2 +- targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c index 4776ad2409..ac1aa0b180 100644 --- a/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c +++ b/src/nanoFramework.Graphics/Graphics/Core/Support/Jpeg/jcinit.c @@ -36,7 +36,7 @@ GLOBAL(void) jinit_compress_master(j_compress_ptr cinfo) { /* Initialize master control (includes parameter checking/processing) */ - jinit_c_master_control(cinfo, FALSE /* full compression */); + jinit_c_master_control(cinfo, false /* full compression */); /* Preprocessing */ if (!cinfo->raw_data_in) { diff --git a/targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp b/targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp index 7ddd02598c..a1848935a6 100644 --- a/targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp +++ b/targets/ChibiOS/RP_PICO_RP2040/target_FileSystem.cpp @@ -37,7 +37,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - false; + false); } void FS_MountRemovableVolumes() diff --git a/targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp b/targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp index 7ddd02598c..a1848935a6 100644 --- a/targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp +++ b/targets/ChibiOS/RP_PICO_W_RP2040/target_FileSystem.cpp @@ -37,7 +37,7 @@ void FS_AddVolumes() g_AvailableFSInterfaces[0].streamDriver, g_AvailableFSInterfaces[0].fsDriver, 0, - false; + false); } void FS_MountRemovableVolumes()