Adjust to match modern c++ style

This commit is contained in:
Filip Markovic 2022-12-18 22:27:13 +01:00
parent 8e544370d9
commit be66d710b3

View file

@ -136,10 +136,12 @@ void CHyprpaper::recheckMonitor(SMonitor* pMonitor) {
zwlr_layer_surface_v1_ack_configure(pMonitor->pCurrentLayerSurface->pLayerSurface, pMonitor->configureSerial); zwlr_layer_surface_v1_ack_configure(pMonitor->pCurrentLayerSurface->pLayerSurface, pMonitor->configureSerial);
int XCURSOR_SIZE = 24; int XCURSOR_SIZE = 24;
if (getenv("XCURSOR_SIZE") != NULL) { if (const auto CURSORSIZENV = getenv("XCURSOR_SIZE"); CURSORSIZENV) {
char *endptr; try {
XCURSOR_SIZE = strtol(getenv("XCURSOR_SIZE"), &endptr, 10); if (XCURSOR_SIZE = std::stoi(CURSORSIZENV); XCURSOR_SIZE <= 0) {
if (*endptr || XCURSOR_SIZE <= 0) { throw std::exception();
}
} catch (...) {
Debug::log(WARN, "XCURSOR_SIZE environment variable is set incorrectly"); Debug::log(WARN, "XCURSOR_SIZE environment variable is set incorrectly");
XCURSOR_SIZE = 24; XCURSOR_SIZE = 24;
} }