Revamp Semaphores example: Replace const by constexpr when applicable

Replace const by constexpr when the value of the variable can be
calculated at compile-time.

Fixes: QTBUG-108859
Pick-to: 6.6 6.5
Change-Id: I4abf5162d521fc5dca0286a6254f86c57a473367
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
Rym Bouabid 2023-09-11 14:14:13 +02:00
parent 2a2275756b
commit c4a1c171a3

View File

@ -7,9 +7,9 @@
#include <stdlib.h>
//! [0]
const int DataSize = 100000;
constexpr int DataSize = 100000;
const int BufferSize = 8192;
constexpr int BufferSize = 8192;
char buffer[BufferSize];
QSemaphore freeBytes(BufferSize);