{"id":362500,"date":"2024-05-21T01:36:22","date_gmt":"2024-05-21T01:36:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=362500"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=362500","title":{"rendered":"<span>30 \u043b\u0435\u0442 DOOM: \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u2014 \u043d\u043e\u0432\u044b\u0435 \u0431\u0430\u0433\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u0433\u0440\u0435 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 DOOM \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u043e 30 \u043b\u0435\u0442! \u041c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u043e\u0439\u0442\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438 \u0432 \u0447\u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u0434 \u044d\u0442\u043e\u0439 \u043b\u0435\u0433\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u0439 \u0438\u0433\u0440\u044b \u0441\u043f\u0443\u0441\u0442\u044f \u0433\u043e\u0434\u044b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6e2\/c79\/563\/6e2c79563c5fcda17b8d827d2ff443da.png\" alt=\"gzdoom_ru\/image1.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e2\/c79\/563\/6e2c79563c5fcda17b8d827d2ff443da.png\"\/><\/figure>\n<h3>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>DOOM \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043a\u0430\u043a \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0435\u043b\u0438\u0447\u0430\u0439\u0448\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u0433\u0440, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0438\u0433\u0440\u043e\u0432\u0443\u044e \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u044e. \u0418\u0433\u0440\u0430 \u0441\u0442\u0430\u043b\u0430 \u0440\u0435\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432\u0432\u0435\u043b\u0430 \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b \u0432 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0435 \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0434\u043b\u044f \u0448\u0443\u0442\u0435\u0440\u043e\u0432 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043b\u0438\u0446\u0430. \u0415\u0451 \u0431\u044b\u0441\u0442\u0440\u0430\u044f, \u043d\u0430\u043f\u0440\u044f\u0436\u0451\u043d\u043d\u0430\u044f \u0438\u0433\u0440\u043e\u0432\u0430\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430, \u043c\u0440\u0430\u0447\u043d\u0430\u044f \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u0430 \u0438 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0439 \u0430\u0440\u0441\u0435\u043d\u0430\u043b \u043e\u0440\u0443\u0436\u0438\u044f \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043f\u0430\u043b\u0438 \u0432 \u0441\u0435\u0440\u0434\u0446\u0430 \u0438\u0433\u0440\u043e\u043a\u043e\u0432. \u0427\u0442\u043e \u0443\u0436 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0435\u043c \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0438! \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f: &#171;\u0425\u0435\u0432\u0438-\u043c\u0435\u0442\u0430\u043b\u043b \u0438\u0433\u0440\u0430\u0435\u0442 \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u044b \u0441\u0440\u0430\u0436\u0430\u0435\u0448\u044c\u0441\u044f \u0441 \u0434\u0435\u043c\u043e\u043d\u0430\u043c\u0438, \u043e\u043d \u0438\u0433\u0440\u0430\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0435\u043c\u043e\u043d\u044b \u0441\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0441 \u0442\u043e\u0431\u043e\u0439!&#187;.<\/p>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u0430 \u0438 \u0441\u043a\u0443\u0447\u043d\u043e \u044d\u0442\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0431\u0443\u0434\u0435\u043c \u0414\u0443\u043c\u0433\u0430\u0435\u043c \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0446\u0438\u0442\u0430\u0442\u0435 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 DOOM Eternal:<\/p>\n<blockquote>\n<p>\u041f\u0440\u043e\u0442\u0438\u0432 \u0432\u0441\u0435\u0445 \u0438\u0441\u0447\u0430\u0434\u0438\u0439 \u0438\u0437 \u0433\u043b\u0443\u0431\u0438\u043d \u043f\u0440\u0435\u0438\u0441\u043f\u043e\u0434\u043d\u0435\u0439, \u043f\u0440\u043e\u0442\u0438\u0432 \u0432\u0441\u0435\u0445 \u043d\u0435\u0447\u0435\u0441\u0442\u0438\u0432\u0446\u0435\u0432 \u0440\u043e\u0434\u0430 \u043b\u044e\u0434\u0441\u043a\u043e\u0433\u043e, \u043f\u0440\u043e\u0442\u0438\u0432 \u043b\u0435\u0433\u0438\u043e\u043d\u043e\u0432 \u043c\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0435\u0431\u044f \u043e\u0434\u043d\u043e\u0433\u043e. \u0420\u0432\u0438 \u0438 \u043a\u0440\u043e\u043c\u0441\u0430\u0439, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0438\u0441\u0441\u044f\u043a\u043d\u0443\u0442.<\/p>\n<\/blockquote>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0432\u0430\u0442\u044c \u0438 \u043a\u0440\u043e\u043c\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u0442\u043e \u0437\u043b\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0430\u0434. \u0410 \u043a\u0430\u043a\u043e\u0435 \u043d\u0430\u0438\u0445\u0443\u0434\u0448\u0435\u0435 \u0437\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430? \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0431\u0430\u0433\u0438 \u0432 \u043a\u043e\u0434\u0435! \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0438 <s>\u0443\u0431\u0438\u0432\u0430\u0442\u044c<\/s> \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043b\u0430\u0446\u0434\u0430\u0440\u043c\u0430 \u0434\u043b\u044f \u0432\u044b\u0441\u0430\u0434\u043a\u0438 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442 <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/tree\/g4.11.3\">GZDoom v4.11.3<\/a> \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u0433\u0440\u044b DOOM. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430 \u2014 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 <a href=\"https:\/\/pvs-studio.ru\/ru\/\">PVS-Studio<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0436, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0430: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c \u0433\u043b\u0430\u0432 \u0438\u0437 \u0438\u0433\u0440\u044b. \u041f\u043e\u0447\u0435\u043c\u0443? \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0438\u043f\u0443 \u0431\u0430\u0433\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u041f\u043e \u043a\u043e\u043b\u0435\u043d\u043e \u0432 \u0442\u0440\u0443\u043f\u0430\u0445&#187; \u0431\u0443\u0434\u0443\u0442 \u0431\u0430\u0433\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 &#171;\u043c\u0451\u0440\u0442\u0432\u044b\u043c\u0438&#187; (\u0432\u0438\u0441\u044f\u0447\u0438\u043c\u0438) \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438, \u043c\u0435\u0440\u0442\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u041f\u043e\u0431\u0435\u0440\u0435\u0436\u044c\u0435 \u0430\u0434\u0430&#187;&#8230;  \u043b\u0430\u0434\u043d\u043e, \u0441\u0442\u043e\u043f. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043f\u0440\u043e\u0441\u0442\u043e \u044f \u0442\u0430\u043a \u0437\u0430\u0445\u043e\u0442\u0435\u043b. \u0417\u0432\u0443\u0447\u0438\u0442 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u043c\u044b <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0662\/\">\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438<\/a> \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u043e\u0440\u0442\u0430 DOOM Engine \u043d\u0430 Linux. \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0435\u0451 \u043a \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044e \u0432\u0441\u0435\u043c \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u0441\u0435\u0440\u0438\u0438 \ud83d\ude42<\/p>\n<\/blockquote>\n<h3>\u041f\u043e \u043a\u043e\u043b\u0435\u043d\u043e \u0432 \u0442\u0440\u0443\u043f\u0430\u0445<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/20e\/9b0\/05d\/20e9b005d271eb6666ca1690f79f64b4.png\" alt=\"gzdoom_ru\/image2.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/20e\/9b0\/05d\/20e9b005d271eb6666ca1690f79f64b4.png\"\/><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0432\u044b\u0441\u0430\u0434\u043a\u0430 \u0432 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041c\u044b \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u043c \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432\u0448\u0438\u0445 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u0446\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0443. \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043e\u0442 \u0432\u0441\u0435\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u043e\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0437\u043e\u043c\u0431\u0438-\u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0447\u0435\u043c-\u0442\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0431\u044c\u0451\u0442\u0441\u044f \u0433\u043e\u043b\u043e\u0432\u043e\u0439 \u043e\u0431 \u0441\u0442\u0435\u043d\u0443. \u0414\u0430\u043c \u0432\u0430\u043c \u0432\u0440\u0435\u043c\u044f \u0441\u0430\u043c\u0438\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u043a \u0447\u0435\u043c\u0443, \u044f \u043b\u0438\u0448\u044c \u043f\u043e\u043a\u0430 \u043d\u0430\u0432\u0451\u043b \u043f\u0440\u0438\u0446\u0435\u043b \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e.<\/p>\n<pre><code class=\"cpp\">void SWPalDrawers::DrawUnscaledFuzzColumn(const SpriteDrawerArgs&amp; args) {   ....   int fuzzstep = 1;   int fuzz = _fuzzpos % FUZZTABLE;    #ifndef ORIGINAL_FUZZ    while (count > 0)   {     int available = (FUZZTABLE - fuzz);     int next_wrap = available \/ fuzzstep;     if (available % fuzzstep != 0)             \/\/ &lt;=        next_wrap++;     .... \/\/ \u0417\u0434\u0435\u0441\u044c fuzzstep \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041a\u043b\u044f\u043d\u0443\u0441\u044c BFG.   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1063\/\">V1063<\/a> The modulo by 1 operation is meaningless. The result will always be zero. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/rendering\/swrenderer\/drawers\/r_draw_rgba.cpp#L328\">r_draw_rgba.cpp 328<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;available % fuzzstep != 0&#8217; is always false. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/rendering\/swrenderer\/drawers\/r_draw_rgba.cpp#L328\">r_draw_rgba.cpp 328<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>fuzzstep<\/em> \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0441\u0440\u0430\u0437\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <em>1<\/em> \u0432\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430. \u0414\u0430\u043b\u0435\u0435 \u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0412 \u0446\u0438\u043a\u043b\u0435 <em>while<\/em> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <em>if (available % fuzzstep != 0)<\/em> \u0440\u0430\u0437 \u0437\u0430 \u0440\u0430\u0437\u043e\u043c, \u0432 \u043d\u0430\u0434\u0435\u0436\u0434\u0435 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f&#8230; (\u0447\u0451\u0440\u0442, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u043d\u0435 \u0442\u0430 \u0438\u0433\u0440\u0430), \u043d\u043e <em>fuzzstep<\/em> \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0438 \u043c\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u0435\u043b\u0438\u043c <em>available<\/em> \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0430 <em>1<\/em>, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <em>0<\/em>, \u0438 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0441 <em>0<\/em>&#8230;<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u0440\u0435\u0435 \u043f\u043e\u043a\u043e\u043d\u0447\u0438\u043c \u0441 \u043d\u0438\u043c \u0438 \u043f\u0440\u043e\u0439\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2<\/strong><\/p>\n<p>\u041d\u0430 \u043d\u0430\u0448\u0435\u043c \u043f\u0443\u0442\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u0430, \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043a\u0435\u043c-\u0442\u043e \u0434\u043e \u043d\u0430\u0441.<\/p>\n<p>\u041f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0440\u043f\u0435\u0445\u043e\u0432: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u043e\u0432 \u043d\u0430\u0448\u043b\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043c\u0438\u043d\u0443. \u0418 \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043c\u043e\u043d\u044b \u0440\u0435\u0448\u0430\u0442 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438, \u0442\u043e&#8230; \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442. \u041c\u0438\u043d\u0443 \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b\u0438&#8230;<\/p>\n<pre><code class=\"cpp\">StringPool::Block *StringPool::AddBlock(size_t size) {   ....   auto mem = (Block *)malloc(size);   if (mem == nullptr)   {        }   mem->Limit = (uint8_t *)mem + size;   mem->Avail = &amp;mem[1];   mem->NextBlock = TopBlock;   TopBlock = mem;   return mem; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> There might be dereferencing of a potential null pointer &#8216;mem&#8217;. Check lines: 100, 95. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/6ce809efe2902e43ceaa7031b875225d3a0367de\/src\/common\/filesystem\/source\/fs_stringpool.cpp#L100\">fs_stringpool.cpp 100<\/a><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435. \u0417\u0434\u0435\u0441\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>mem<\/em> \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>malloc<\/em>. \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, <em>malloc<\/em> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>NULL<\/em>, \u0438 \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0437\u043d\u0430\u043b\u0438 \u0438 \u0434\u0430\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 <em>if (mem == nullptr)<\/em>, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>malloc<\/em>, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0938\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0432\u0435\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/utility\/program\/exit\"><em>std::exit<\/em><\/a>, \u0438\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435.<\/p>\n<p>\u041d\u0435 \u0441\u0442\u0430\u0432 \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043d\u0443, \u043c\u044b \u0438\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3<\/strong><\/p>\n<p>\u041d\u0430 \u043f\u0443\u0442\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442 \u043d\u0430\u0441 \u0438 \u043d\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u0442\u044c. \u041e\u043d \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442.<\/p>\n<pre><code class=\"cpp\">void PClassActor::InitializeDefaults() {   ....   if (MetaSize > 0)    memcpy(Meta, ParentClass->Meta, ParentClass->MetaSize);   else    memset(Meta, 0, MetaSize);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\">V575<\/a> The &#8216;memset&#8217; function processes &#8216;0&#8217; elements. Inspect the third argument. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/gamedata\/info.cpp#L518\">info.cpp 518<\/a><\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043f\u0430\u043c\u044f\u0442\u044c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <em>Meta<\/em>, \u0445\u043e\u0442\u044f\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0443\u043b\u044f\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/string\/byte\/memset\"><em>memset<\/em><\/a>. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0432\u0435\u0442\u043a\u0443 <em>else<\/em> \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 <em>MetaSize<\/em> \u0440\u0430\u0432\u0435\u043d 0. \u0414\u043b\u044f <em>memset<\/em> \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442: &#171;\u0437\u0430\u043f\u043e\u043b\u043d\u0438 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u0442\u0430\u043a\u0438\u043c-\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 0 \u0431\u0430\u0439\u0442&#187; == &#171;\u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0439&#187;.<\/p>\n<p>\u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4<\/strong><\/p>\n<p>\u041c\u044b \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0438\u043c\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e, \u0442\u0443\u0442 \u0436\u0435 \u043d\u0430\u043f\u0430\u0434\u0430\u0435\u0442.<\/p>\n<pre><code class=\"cpp\">void FDecalLib::ParseDecal (FScanner &amp;sc) {   FDecalTemplate newdecal;   ....   memset ((void *)&amp;newdecal, 0, sizeof(newdecal));   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v598\/\">V598<\/a> The &#8216;memset&#8217; function is used to nullify the fields of &#8216;FDecalTemplate&#8217; class. Virtual table pointer will be damaged by this. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/gamedata\/decallib.cpp#L367\">decallib.cpp 367<\/a><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>memset<\/em> \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>newdecal<\/em> \u0442\u0438\u043f\u0430 <em>FDecalTemplate<\/em>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0445\u043e\u0442\u044f\u0442 \u0437\u0430\u043d\u0443\u043b\u0438\u0442\u044c \u043e\u0431\u044c\u0435\u043a\u0442. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0438\u043f <em>FDecalTemplate<\/em> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<pre><code class=\"cpp\">class FDecalTemplate : public FDecalBase { .... }  class FDecalBase {   ....   virtual const FDecalTemplate *GetDecal () const;   virtual void ReplaceDecalRef (FDecalBase *from, FDecalBase *to) = 0;   .... }; <\/code><\/pre>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>sizeof<\/em> \u0436\u0435 \u0432\u0435\u0440\u043d\u0451\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f. \u041e\u0431\u043d\u0443\u043b\u044f\u044f \u043f\u043e\u043b\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0430\u043d\u0443\u043b\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 <s>\u043f\u0440\u043e\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043d\u043e\u0433\u0443<\/s> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043c\u0430\u0433 \u043e\u0442 \u0443\u0434\u0430\u0440\u0430 \u0434\u0435\u043c\u043e\u043d\u0430.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0439\u0434\u044f \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435, \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u043e\u0434\u0438\u043d\u043e\u043a\u043e \u0441\u0438\u0434\u044f\u0449\u0435\u0433\u043e \u043c\u043e\u0440\u043f\u0435\u0445\u0430:<\/p>\n<pre><code class=\"cpp\">class PaletteContainer { public:   PalEntry BaseColors[256]; \/\/ non-gamma corrected palette   .... };  static void DrawPaletteTester(int paletteno) {   ....   for (int i = 0; i &lt; 16; ++i)   {     for (int j = 0; j &lt; 16; ++j)     {       PalEntry pe;       if (t > 1)       {         auto palette = GPalette.GetTranslation(TRANSLATION_Standard,                                                t - 2)->Palette;         pe = palette[k];       }       else GPalette.BaseColors[k];                     \/\/ &lt;=       ....     }     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v607\/\">V607<\/a> Ownerless expression &#8216;GPalette.BaseColors[k]&#8217;. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/d_main.cpp#L762\">d_main.cpp 762<\/a><\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u0430\u043a\u0430\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u0438\u0441\u0441\u0438\u044f \u0431\u044b\u043b\u0430 \u0443 \u043d\u0435\u0433\u043e, \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f. \u041e\u043d \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e \u043f\u0440\u043e\u0431\u044b\u043b \u0437\u0434\u0435\u0441\u044c \u0432 \u043e\u0434\u0438\u043d\u043e\u0447\u0435\u0441\u0442\u0432\u0435 \u0438 \u0443\u0436\u0435 \u0437\u0430\u0431\u044b\u043b.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N6<\/strong><\/p>\n<p>\u041e\u0441\u0442\u0430\u0432\u0438\u0432 \u043c\u043e\u0440\u043f\u0435\u0445\u0430 \u0438 \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0432 \u0437\u0430 \u0443\u0433\u043e\u043b, \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043e\u0441\u0441\u0430 \u2014 \u0431\u0430\u0440\u043e\u043d\u0430 \u0430\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043c\u0430\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<pre><code class=\"cpp\">uint8_t work[8 +           \/\/ signature              12+2*4+5 +    \/\/ IHDR              12+4 +        \/\/ gAMA              12+256*3];    \/\/ PLTE uint32_t *const sig = (uint32_t *)&amp;work[0]; <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v641\/\">V641<\/a> The size of the &#8216;&amp;work[0]&#8217; buffer is not a multiple of the element size of the type &#8216;uint32_t&#8217;. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/textures\/m_png.cpp#L143\">m_png.cpp 143<\/a><\/p>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432 <em>work<\/em> \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 829 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 <em>uint8_t<\/em>. \u0417\u0430\u0442\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>sig<\/em> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 <em>work<\/em> \u043a \u0442\u0438\u043f\u0443 <em>uint32_t<\/em>.<\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u0430\u0432\u0438\u043b strict aliasing. \u041c\u0430\u0441\u0441\u0438\u0432 <em>work<\/em> \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d \u043f\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0435 1, \u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>sig<\/em> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0435 4 \u0431\u0430\u0439\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0440\u0430\u0442\u0435\u043d 4, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 (ARM).<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 <em>alignas<\/em>:<\/p>\n<pre><code class=\"cpp\">uint8_t alignas(uint32_t) work[....]; <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0430\u0434\u0440\u0435\u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d \u043f\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0435 4 \u0431\u0430\u0439\u0442\u043e\u0432.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043f\u043b\u043e\u0445\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c. \u0427\u0438\u0441\u043b\u043e 829 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 4, \u0438 \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0435\u0449\u0451 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0433\u043b\u0430\u0432\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439.<\/p>\n<h3>\u041f\u043e\u0431\u0435\u0440\u0435\u0436\u044c\u0435 \u0430\u0434\u0430<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/162\/37b\/a8f\/16237ba8fd024a0b3dce583a70320489.png\" alt=\"gzdoom_ru\/image3.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/162\/37b\/a8f\/16237ba8fd024a0b3dce583a70320489.png\"\/><\/figure>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u043c\u043e\u043d\u044b, \u2014 \u0434\u0430\u0436\u0435 \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0445\u0438\u043b\u044b\u043c\u0438, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0441\u0438\u043b\u044c\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043d\u0430 1730 \u0441\u0442\u0440\u043e\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 <em>vectors.h<\/em>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N7<\/strong><\/p>\n<pre><code class=\"cpp\">constexpr DAngle nullAngle = DAngle::fromDeg(0.); <\/code><\/pre>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435. \u0427\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0439\u0442\u0438 \u043d\u0435 \u0442\u0430\u043a? \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u044f\u0434\u043e\u043c \u043c\u044b \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u043c \u043b\u0435\u0436\u0430\u0449\u0435\u0433\u043e \u0440\u0430\u043d\u0435\u043d\u043e\u0433\u043e \u043c\u043e\u0440\u043f\u0435\u0445\u0430.<\/p>\n<p>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u044f \u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u044e\u043d\u0438\u0442\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0432 \u044d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0441\u0432\u043e\u044f \u043a\u043e\u043f\u0438\u044f \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b?<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u0430\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 100 \u0431\u0430\u0439\u0442. \u0418 \u0438\u0445 \u0442\u0430\u043a\u0438\u0445 100. \u0418 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 100 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0438? \u0417\u0430\u0431\u0443\u0434\u044c\u0442\u0435, \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0441\u0442\u0440\u0430\u0448\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>\u0413\u043e\u0440\u0430\u0437\u0434\u043e \u0445\u0443\u0436\u0435 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e (\u0432\u0440\u0443, \u043c\u043d\u043e\u0433\u043e) \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1043\/\">V1043<\/a> A global object variable &#8216;nullAngle&#8217; is declared in the header. Multiple copies of it will be created in all translation units that include this header file. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/utility\/vectors.h#L1730\">vectors.h 1730<\/a><\/p>\n<p>\u0422\u0430\u043a\u0438\u0445 \u0436\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u0435\u0449\u0451 11 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0434\u0435\u043c\u043e\u043d\u043e\u043c, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u0432\u044b\u043b\u0435\u0447\u0438\u043c \u0440\u0430\u043d\u0435\u043d\u043e\u0433\u043e \u043c\u043e\u0440\u043f\u0435\u0445\u0430. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++17, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>inline<\/em>:<\/p>\n<pre><code class=\"cpp\">inline constexpr DAngle nullAngle = DAngle::fromDeg(0.); <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442, \u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">\/\/ vectors.h extern const DAngle nullAngle;  \/\/ some.cpp const DAngle nullAngle = DAngle::fromDeg(0.); <\/code><\/pre>\n<p>\u0412\u0441\u0451, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0440\u043f\u0435\u0445 \u0441\u043d\u043e\u0432\u0430 \u0432 \u0441\u0442\u0440\u043e\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N8<\/strong><\/p>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043f\u0443\u0442\u0438.<\/p>\n<pre><code class=\"cpp\">PalettedPixels FVoxelTexture::CreatePalettedPixels(int conversion, int frame) {   uint8_t *pp = SourceVox->Palette.Data();    if (pp != nullptr)   {     ....   }   else    {     for (int i = 0; i &lt; 256; i++, pp+=3)     {       bitmap[i] = (uint8_t)i;       pe[i] = GPalette.BaseColors[i];       pe[i].a = 255;     }   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v769\/\">V769<\/a> The &#8216;pp&#8217; pointer in the &#8216;pp += 3&#8217; expression equals nullptr. The resulting value is senseless and it should not be used. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/models\/models_voxel.cpp#L145\">models_voxel.cpp 145<\/a><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u0432\u0435\u0442\u043a\u0443 <em>else<\/em> \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>pp == nullptr<\/em>. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u0441\u043b\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0446\u0438\u043a\u043b\u0443 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043f\u043e\u0439\u043c\u0438 \u043d\u0430 \u0447\u0442\u043e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412\u0440\u044f\u0434 \u043b\u0438 \u0435\u0433\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u043d\u043e\u0433\u0443, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0431\u0443\u0434\u0435\u0442 \u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b. \u0418\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043c\u043e\u0440\u043f\u0435\u0445 \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043c\u043e\u043d\u0443 \u0443\u043a\u0443\u0441\u0438\u0442\u044c \u0441\u0435\u0431\u044f, \u0442\u043e \u0434\u0435\u043c\u043e\u043d, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N9<\/strong><\/p>\n<p>\u0417\u0430\u0439\u0434\u044f \u0432 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u0434\u0435\u043c\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u044d\u0442\u0438\u043c \u0438 \u0438\u0437\u0443\u0447\u0438\u043c \u0435\u0433\u043e <s>\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/s> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<pre><code class=\"cpp\">void DLL InitLUTs() {   ....   for (i=0; i&lt;32; i++)   for (j=0; j&lt;64; j++)   for (k=0; k&lt;32; k++)   {     r = i &lt;&lt; 3;        g = j &lt;&lt; 2;     b = k &lt;&lt; 3;      Y = (r + g + b) >> 2;     u = 128 + ((r - b) >> 2);     v = 128 + ((-r + 2*g -b)>>3);   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v610\/\">V610<\/a> Unspecified behavior. Check the shift operator &#8216;>>&#8217;. The left operand is negative (&#8216;(- r + 2 * g &#8212; b)&#8217; = [-496..504]). <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/textures\/hires\/hqnx_asm\/hq4x_asm.cpp#L5391\">hq4x_asm.cpp 5391<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v610\/\">V610<\/a> Unspecified behavior. Check the shift operator &#8216;>>&#8217;. The left operand is negative (&#8216;(r &#8212; b)&#8217; = [-248..248]). <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/textures\/hires\/hqnx_asm\/hq4x_asm.cpp#L5390\">hq4x_asm.cpp 5390<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0430\u0437\u043c\u0438\u043d\u043a\u0430 \u0434\u043b\u044f \u043c\u043e\u0437\u0433\u0430. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0443\u0442\u043e\u0447\u043d\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u043d\u0438\u0436\u0435 C23 \u0438\u043b\u0438 C++20. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u0433\u0434\u0435 \u043e\u043d\u043e \u0441\u043f\u0440\u044f\u0442\u0430\u043d\u043e.<\/p>\n<p>\u0412 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c <em>u<\/em> \u0438 <em>v<\/em>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0434\u0432\u0438\u0433, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435. \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <em>r<\/em>, <em>g<\/em>, <em>b<\/em> \u0438 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<pre><code class=\"cpp\">void DLL InitLUTs() {   ....   for (i=0; i&lt;32; i++)   for (j=0; j&lt;64; j++)   for (k=0; k&lt;32; k++)   {     r = i &lt;&lt; 3;                   \/\/ [0 .. 248]     g = j &lt;&lt; 2;                   \/\/ [0 .. 252]     b = k &lt;&lt; 3;                   \/\/ [0 .. 248]     Y = (r + g + b) >> 2;     u = 128 + ((r - b) >> 2);     \/\/ ([0..248] - [0..248]) >> 3     v = 128 + ((-r + 2*g -b)>>3); \/\/ (-[0..248]+[0..504]-[0..248])>>3   } } <\/code><\/pre>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u0446\u0438\u043a\u043b\u0430\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043f\u0440\u0430\u0432\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u0432\u0435\u0434\u0451\u0442 \u043a \u043d\u0435\u0443\u0442\u043e\u0447\u043d\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445, \u0433\u0434\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f DOOM, \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u043e \u043d\u0430\u0434\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e DOOM, \u0433\u0434\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 <a href=\"https:\/\/www.ign.com\/articles\/weirdest-devices-that-run-doom-1993\">\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442<\/a> \ud83d\ude42<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N10<\/strong><\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u0434\u0435\u043c\u043e\u043d\u0430. \u041d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043e\u043d \u0442\u0443\u0442 \u0436\u0435 \u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0431\u043b\u0438\u043a.<\/p>\n<pre><code class=\"cpp\">int FPCXTexture::CopyPixels(FBitmap *bmp, int conversion, int frame) {   ....   uint8_t c = lump.ReadUInt8();   c = 0x0c;  \/\/ Apparently there's many non-compliant PCXs out there...   if (c != 0x0c)    {     for(int i=0;i&lt;256;i++) pe[i]=PalEntry(255,i,i,i);\/\/ default to a gray map   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v519\/\">V519<\/a> The &#8216;c&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 475, 476. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/textures\/formats\/pcxtexture.cpp#L476\">pcxtexture.cpp 476<\/a><\/p>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>c<\/em> \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0432 \u043d\u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0442\u0443\u0442 \u0436\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442 \u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>0x0c<\/em>.<\/p>\n<p>\u0422\u0430\u043a\u0438\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432 \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>V519 The &#8216;dg.mIndexIndex&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 820, 829. v_2ddrawer.cpp 829<\/p>\n<\/li>\n<li>\n<p>V519 The &#8216;dg.mTexture&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 885, 887. v_2ddrawer.cpp 887<\/p>\n<\/li>\n<li>\n<p>V519 The &#8216;LastChar&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 226, 228. singlelumpfont.cpp 228<\/p>\n<\/li>\n<li>\n<p>V519 The &#8216;flavour.fogEquationRadial&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 164, 167. gles_renderstate.cpp 167<\/p>\n<\/li>\n<li>\n<p>V519 The &#8216;flavour.twoDFog&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 162, 169. gles_renderstate.cpp 169<\/p>\n<\/li>\n<li>\n<p>V519 The &#8216;flavour.fogEnabled&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 163, 170. gles_renderstate.cpp 170<\/p>\n<\/li>\n<li>\n<p>V519 The &#8216;flavour.colouredFog&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 165, 171. gles_renderstate.cpp 171<\/p>\n<\/li>\n<li>\n<p>&#8230; \u0438 \u0442.\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f: \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>if (c !=0x0c)<\/em>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, <em>then<\/em>-\u0432\u0435\u0442\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u0430. \u041d\u0430 \u044d\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;c != 0x0c&#8217; is always false. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/textures\/formats\/pcxtexture.cpp#L477\">pcxtexture.cpp 477<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e \u0436, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0440\u0430\u043d\u044c\u0448\u0435 \u0437\u0434\u0435\u0441\u044c \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439, \u043d\u043e \u0437\u0430\u0442\u0435\u043c \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u0432\u0435\u0442\u043a\u0430 \u043a\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0442\u0430\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u043e\u0439. \u0410 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435\u0442, \u043a\u0442\u043e \u0436\u0435 \u0437\u043d\u0430\u0435\u0442 \u044d\u0442\u0438\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432 \ud83d\ude42<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N11<\/strong><\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0434\u0432\u0430 \u043a\u0430\u043a\u043e\u0434\u0435\u043c\u043e\u043d\u0430-\u0431\u043b\u0438\u0437\u043d\u0435\u0446\u0430.<\/p>\n<pre><code class=\"cpp\">int32_t ANIM_LoadAnim(anim_t *anim, const uint8_t *buffer, size_t length) {   ....   length -= sizeof(lpfileheader)+128+768;   if (length &lt; 0)     return -1;   ....   length -= lpheader.nLps * sizeof(lp_descriptor);   if (length &lt; 0)     return -2;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;length &lt; 0&#8217; is always false. Unsigned type value is never &lt; 0. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/textures\/animlib.cpp#L225\">animlib.cpp 225<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;length &lt; 0&#8217; is always false. Unsigned type value is never &lt; 0. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/textures\/animlib.cpp#L247\">animlib.cpp 247<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043b\u0438 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435, \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0432 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u0442\u0430\u0445?<\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>length<\/em> \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f <em>size_t<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u043c. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <em>length &lt; 0<\/em> \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b.<\/p>\n<p>P.S. \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438. \u0414\u043b\u044f \u0438\u0433\u0440\u044b \u044d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e. \u0410 \u0432\u043e\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0445 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0430\u044f <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6441\/\">\u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c<\/a>. \u0420\u0430\u0437 \u043d\u0435\u043a\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0441\u044b\u0433\u0440\u0430\u0442\u044c \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0431\u0443\u0444\u0435\u0440.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N12<\/strong><\/p>\n<p>\u0410 \u0432\u043e\u0442 \u043c\u044b \u0438 \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u0431\u043e\u0441\u0441\u0430 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u044b \u2014 \u041a\u0438\u0431\u0435\u0440\u0434\u0435\u043c\u043e\u043d\u0430. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043c\u0430\u043b\u043e \u043a\u0442\u043e \u0438\u0437 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u0438\u043c.<\/p>\n<p>\u041f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u043e\u0442\u0447\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u0431\u0440\u0451\u043b \u0432 \u0444\u0430\u0439\u043b <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/g_statusbar\/hudmessages.cpp#L858\">hudmessages.cpp<\/a>. \u0418 \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u0436 \u0441 25 \u0410\u0420\u0413\u0423\u041c\u0415\u041d\u0422\u0410\u041c\u0418!<\/p>\n<pre><code class=\"cpp\">void DHUDMessageTypeOnFadeOut::DoDraw(int linenum, int x, int y,                                       bool clean, int hudheight) {   DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text,            DTA_VirtualWidth, HUDWidth,            DTA_VirtualHeight, hudheight,            DTA_ClipLeft, ClipLeft,            DTA_ClipRight, ClipRight,            DTA_ClipTop, ClipTop,            DTA_ClipBottom, ClipBot,            DTA_Alpha, Alpha,            DTA_TextLen, LineVisible,            DTA_RenderStyle, Style,            TAG_DONE); } <\/code><\/pre>\n<p>\u041c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0436\u0435 \u0437\u0430 \u043c\u043e\u0440\u043f\u0435\u0445 \u044d\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b. \u041c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430, \u043e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/2d\/v_draw.h#L279\">\u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f<\/a> \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <em>DrawText<\/em> \u043d\u0435 \u0442\u0430\u043a\u0438\u0435 \u0443\u0436 \u0434\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">void DrawText(F2DDrawer* drawer,               FFont* font,               int normalcolor,               double x, double y,               const char* string,               int tag_first,               ...);  void DrawText(F2DDrawer* drawer,               FFont* font,               int normalcolor,               double x, double y,               const char32_t* string,               int tag_first,               ...); <\/code><\/pre>\n<p>\u0412\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c 7 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \ud83d\ude42 \u041d\u043e \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/0069\/\">variadic \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/a> \u043f\u0435\u0440\u0435\u0440\u043e\u0441 \u0430\u0436 \u0432 25 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432&#8230; \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u043d\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u044f\u0434 \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442:<\/p>\n<ol>\n<li>\n<p>\u0423\u0445\u0443\u0434\u0448\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430: \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442. \u041d\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0410 \u0435\u0441\u043b\u0438 \u0431\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u043b\u0430 \u0434\u0440\u0443\u0433\u043e\u0435, \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u043b\u0438\u0448\u044c \u0437\u0430\u043f\u043b\u0430\u043a\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438: \u0448\u0430\u043d\u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u0432 \u0442\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0441 \u0442\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0432\u044b\u0448\u0435, \u0430 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0451, \u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0432\u0441\u0435 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u044d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0448\u0430\u043d\u0441 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0434: \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041e\u043d\u0430 \u0443\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0443\u0447\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0438 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0451 \u0442\u0435\u043b\u043e. \u041d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451 \u043d\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0451 \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043a\u043e\u0434 \u0442\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0440\u0443\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043b: \u0438 \u0440\u0438\u0441\u0443\u0435\u0442, \u0438 \u0436\u043e\u043d\u0433\u043b\u0438\u0440\u0443\u0435\u0442&#8230; \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u044f \u0432\u0438\u0436\u0443: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u0430\u043a\u0443\u044e-\u043b\u0438\u0431\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0451, \u043b\u0438\u0431\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435.<\/p>\n<h3>\u0418\u043d\u0444\u0435\u0440\u043d\u043e<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/249\/766\/e5a\/249766e5a2f70373765636940f0e8553.png\" alt=\"gzdoom_ru\/image4.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/249\/766\/e5a\/249766e5a2f70373765636940f0e8553.png\"\/><\/figure>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N13<\/strong><\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0433\u043b\u0430\u0432\u0435, \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0432\u0438\u0434\u0438\u043c \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u043c\u043e\u043d\u0430:<\/p>\n<pre><code class=\"cpp\">ExpEmit FxVMFunctionCall::Emit(VMFunctionBuilder *build) {   int count = 0;   if (count == 1)   {     ExpEmit reg;     if (CheckEmitCast(build, false, reg))     {       ArgList.DeleteAndClear();       ArgList.ShrinkToFit();       return reg;     }   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;count == 1&#8217; is always false. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/scripting\/backend\/codegen.cpp#L9405\">codegen.cpp 9405<\/a><\/p>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0434\u0435\u043c\u043e\u043d \u0432\u0440\u044f\u0434 \u043b\u0438 \u0442\u044f\u043d\u0435\u0442 \u043d\u0430 \u0431\u043e\u0441\u0441\u0430, \u0441\u043a\u043e\u0440\u0435\u0435 \u0438\u043c\u043f. \u0410 \u0432\u043e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439&#8230;<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N14<\/strong><\/p>\n<p>&#8230; \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u0437\u0440\u0430\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0447\u0435\u043d\u044c \u0443\u043c\u0435\u043b\u043e \u0441\u043f\u0440\u044f\u0442\u0430\u043b\u0441\u044f. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0430\u043c\u0438 \u0432\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cpp\">static void CreateIndexedFlatVertices(FFlatVertexBuffer* fvb,                                       TArray&lt;sector_t>&amp; sectors) {   ....   for (auto&amp; sec : sectors)   {     for (auto ff : sec.e->XFloor.ffloors)     {       if (ff->top.model == &amp;sec)       {         ff->top.vindex = sec.iboindex[ff->top.isceiling];            }        if (ff->bottom.model == &amp;sec)       {         ff->bottom.vindex = sec.iboindex[ff->top.isceiling];         }     }   } } <\/code><\/pre>\n<p>\u0422\u044f\u0436\u0435\u043b\u043e, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438? \u0410 \u0432\u043e\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0432\u0442\u043e\u043d\u0430\u0432\u043e\u0434\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0440\u0443\u0436\u0438\u044f \u0435\u0433\u043e \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v778\/\">V778<\/a> Two similar code fragments were found. Perhaps, this is a typo and &#8216;bottom&#8217; variable should be used instead of &#8216;top&#8217;. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/rendering\/hwrenderer\/hw_vertexbuilder.cpp#L407\">hw_vertexbuilder.cpp 407<\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438, \u0433\u0434\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 <em>ff->top<\/em> \u0438 <em>ff->bottom<\/em> \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>vindex<\/em>. \u041e\u043d\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438, \u044f \u0431\u044b \u0434\u0430\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u0441\u0438\u043b\u044c\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043d\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 copy-paste. \u0412 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441 <em>ff->bottom.vindex<\/em>, \u0433\u0434\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f <em>sec.iboindex<\/em> \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043f\u043e\u043b\u0435 <em>ff->bottom.isceiling<\/em>, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c <em>top<\/em> \u043d\u0430 <em>bottom<\/em>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N15<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442\u0441\u044f 3 \u0431\u0430\u0440\u043e\u043d\u0430 \u0430\u0434\u0430, \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u043f\u0435\u0440\u0432\u044b\u043c:<\/p>\n<pre><code class=\"cpp\">void TParseContextBase::rValueErrorCheck(const TSourceLoc&amp; loc,                                          const char* op,                                          TIntermTyped* node) {   TIntermBinary* binaryNode = node->getAsBinaryNode();   const TIntermSymbol* symNode = node->getAsSymbolNode();    if (!node) return;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\">V595<\/a> The &#8216;node&#8217; pointer was utilized before it was verified against nullptr. Check lines: 231, 234. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/libraries\/ZVulkan\/src\/glslang\/glslang\/MachineIndependent\/ParseContextBase.cpp#L231\">ParseContextBase.cpp 231<\/a><\/p>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f (\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c!), \u043d\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043b\u0438 \u0435\u0433\u043e \u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0411\u0430\u0445! \u0418 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u0434\u0432\u0430 \u043a\u043d\u044f\u0437\u044f \u0430\u0434\u0430:<\/p>\n<ul>\n<li>\n<p>V595 The &#8216;linker&#8217; pointer was utilized before it was verified against nullptr. Check lines: 1550, 1552. ShaderLang.cpp 1550<\/p>\n<\/li>\n<li>\n<p>V595 The &#8216;mo&#8217; pointer was utilized before it was verified against nullptr. Check lines: 6358, 6359. p_mobj.cpp 6358<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N16<\/strong><\/p>\n<p>\u0411\u043e\u0441\u0441 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u044b \u2014 \u043f\u0430\u0443\u043a-\u043f\u0440\u0435\u0434\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c, \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"cpp\">PClassPointer::PClassPointer(PClass *restrict)   : PPointer(restrict->VMType), ClassRestriction(restrict) {   if (restrict) mDescriptiveName.Format(\"ClassPointer&lt;%s>\",                                         restrict->TypeName.GetChars());   else mDescriptiveName = \"ClassPointer\";   loadOp = OP_LP;   storeOp = OP_SP;   Flags |= TYPE_ClassPointer;   mVersion = restrict->VMType->mVersion; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v664\/\">V664<\/a> The &#8216;restrict&#8217; pointer is being dereferenced on the initialization list before it is verified against null inside the body of the constructor function. Check lines: 1605, 1607. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/scripting\/core\/types.cpp#L1605\">types.cpp 1605<\/a><\/p>\n<p>\u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u043d\u043e \u0432\u043e\u0442 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430, \u0441\u0430\u043c\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u043d\u044c\u0448\u0435 \u2014 \u0435\u0449\u0451 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<h3>\u0422\u0432\u043e\u044f \u043f\u043b\u043e\u0442\u044c \u0441\u044a\u0435\u0434\u0435\u043d\u0430<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/859\/927\/8d0\/8599278d0747cb5a7ff710857ca4a26a.png\" alt=\"gzdoom_ru\/image5.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/859\/927\/8d0\/8599278d0747cb5a7ff710857ca4a26a.png\"\/><\/figure>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u043b\u0430\u0432\u0430. \u0414\u0443\u043c\u0433\u0430\u0439 \u0438\u0437\u043d\u0435\u043c\u043e\u0436\u0451\u043d \u0438 \u0432\u0435\u0441\u044c \u0432 \u043a\u0440\u043e\u0432\u0438, \u043d\u043e \u0434\u043e \u043f\u043e\u0431\u0435\u0434\u044b \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N17<\/strong><\/p>\n<pre><code class=\"cpp\">bool FScanner::GetFloat (bool evaluate) {   ....   if(sym &amp;&amp; sym->tokenType == TK_IntConst &amp;&amp; sym->tokenType != TK_FloatConst)   {     BigNumber = sym->Number;     Number = (int)sym->Number;     Float = sym->Float;     \/\/ String will retain the actual symbol name.     return true;   }   .... } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e: \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438, \u0447\u0442\u043e \u0442\u0438\u043f \u0442\u043e\u043a\u0435\u043d\u0430 \u2014 \u044d\u0442\u043e <em>TK_IntConst<\/em>. \u0410 \u0437\u0430\u0442\u0435\u043c&#8230; \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438, \u0447\u0442\u043e \u0442\u0438\u043f \u0442\u043e\u043a\u0435\u043d\u0430 \u043d\u0435 <em>TK_FloatConst<\/em>. \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u2014 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432 \u043c\u0435\u0440\u0443, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u0434\u0443\u043b\u0441\u044f \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0441\u044f \u043c\u0435\u043d\u0435\u0435 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v590\/\">V590<\/a> Consider inspecting this expression. The expression is excessive or contains a misprint. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/engine\/sc_man.cpp#L829\">sc_man.cpp 829<\/a><\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v560\/\">V560<\/a> A part of conditional expression is always true: sym->tokenType != TK_FloatConst. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/engine\/sc_man.cpp#L829\">sc_man.cpp 829<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e \u043e\u0442\u0447\u0451\u0442\u0443 \u044f \u043d\u0430\u0448\u0451\u043b \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043c\u0435\u0441\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>V590 Consider inspecting this expression. The expression is excessive or contains a misprint. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/engine\/sc_man.cpp#L787\">sc_man.cpp 787<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u043e\u0432 \u044d\u0442\u043e\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c. \u041d\u043e \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u043f\u0435\u0440\u0435\u0434\u0438.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N18<\/strong><\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0438\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0435.<\/p>\n<pre><code class=\"cpp\">static ASMJIT_INLINE bool X86RAPass_mustConvertSArg(X86RAPass* self,                                                     uint32_t dstTypeId,                                                     uint32_t srcTypeId) noexcept {   bool dstFloatSize = dstTypeId == TypeId::kF32   ? 4 :                       dstTypeId == TypeId::kF64   ? 8 : 0;    bool srcFloatSize = srcTypeId == TypeId::kF32   ? 4 :                       srcTypeId == TypeId::kF32x1 ? 4 :                       srcTypeId == TypeId::kF64   ? 8 :                       srcTypeId == TypeId::kF64x1 ? 8 : 0;    if (dstFloatSize &amp;&amp; srcFloatSize)     return dstFloatSize != srcFloatSize;   else     return false; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;dstFloatSize != srcFloatSize&#8217; is always false. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/libraries\/asmjit\/asmjit\/x86\/x86regalloc.cpp#L1115\">x86regalloc.cpp 1115<\/a><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u0447\u0442\u043e \u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 <em>dstTypeId<\/em> \u0438 <em>srcTypeId<\/em>. \u0420\u0430\u0437\u043c\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c 0, 4, \u043b\u0438\u0431\u043e 8 \u0431\u0430\u0439\u0442. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 4 \u0438\u043b\u0438 8 \u0431\u0430\u0439\u0442, \u0442\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u0430 <em>bool<\/em> \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>true<\/em>. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 0 \u0431\u0430\u0439\u0442, \u0442\u043e <em>false<\/em>. \u0414\u0430\u043b\u044c\u0448\u0435, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u043e\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043d\u0435 0 \u0431\u0430\u0439\u0442, \u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u0437\u043d\u0430\u0442\u044c, \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u043b\u0438 \u043d\u0435\u0442. \u041d\u043e \u0442\u0443\u0442, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0442\u0438\u043f\u043e\u0432 (<em>dstTypeId<\/em> \u0438 <em>srcTypeId<\/em>), \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0430\u043c\u0438 \u0444\u043b\u0430\u0433\u0438, \u043f\u0440\u0438\u0447\u0451\u043c \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u043e\u0431\u0430 <em>true<\/em>.<\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0436\u0438\u0434\u0430\u043b\u0438\u0441\u044c. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u043f\u0440\u0438\u0447\u0451\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b <a href=\"https:\/\/godbolt.org\/z\/Eoeje14TE\">\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043a\u043e\u0434<\/a> \u0442\u0430\u043a, \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e 2-\u043e\u0439 <em>return<\/em>.<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043d\u044f\u0442\u043d\u044b\u0439 \u0444\u0430\u043a\u0442<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043a\u043e\u0434 \u0438\u0437 third-party \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0418 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u044e. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043d\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u043a\u0442. \u0412 2017 \u0433\u043e\u0434\u0443 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 asmjit \u0431\u044b\u043b \u043e\u0442\u043a\u0440\u044b\u0442 <a href=\"https:\/\/github.com\/asmjit\/asmjit\/issues\/178\">\u0442\u0438\u043a\u0435\u0442<\/a> \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 GCC 7.2 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. \u0418 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0435\u0433\u043e <a href=\"https:\/\/github.com\/asmjit\/asmjit\/commit\/771d66b301e60ebc3ffa69b11765622c547df6ab\">\u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438<\/a>:<\/p>\n<pre><code class=\"cpp\">static ASMJIT_INLINE bool X86RAPass_mustConvertSArg(X86RAPass* self,                                                     uint32_t dstTypeId,                                                     uint32_t srcTypeId) noexcept {   uint32_t dstFloatSize = dstTypeId == TypeId::kF32   ? 4 :         \/\/ &lt;=                           dstTypeId == TypeId::kF64   ? 8 : 0;    uint32_t srcFloatSize = srcTypeId == TypeId::kF32   ? 4 :         \/\/ &lt;=                           srcTypeId == TypeId::kF32x1 ? 4 :                           srcTypeId == TypeId::kF64   ? 8 :                           srcTypeId == TypeId::kF64x1 ? 8 : 0;     if (dstFloatSize &amp;&amp; srcFloatSize)     return dstFloatSize != srcFloatSize;   else     return false; } <\/code><\/pre>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0440\u0430\u0432\u044b\u0435 \u043c\u043e\u0440\u043f\u0435\u0445\u0438 \u043e\u0431\u0440\u0430\u0442\u044f\u0442 \u043d\u0430 \u044d\u0442\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0442.\u043a. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/commits\/g4.11.3\/libraries\/asmjit\">\u043f\u043e\u043f\u044b\u0442\u043a\u0438<\/a> \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b\u0438, \u043d\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<\/div>\n<\/details>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N19<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043d\u0430\u0442\u043e\u0439 \u0441 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0431\u043e\u0441\u0441\u043e\u043c \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">FString SuggestNewName(const ReverbContainer *env) {   char text[32];   size_t len;    strncpy(text, env->Name, 31);   text[31] = 0;    len = strlen(text);   ....   if (text[len - 1] != ' ' &amp;&amp; len &lt; 31)      \/\/ &lt;=   {     text[len++] = ' ';   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v781\/\">V781<\/a> The value of the &#8216;len&#8217; index is checked after it was used. Perhaps there is a mistake in program logic. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/audio\/sound\/s_reverbedit.cpp#L193\">s_reverbedit.cpp 193<\/a><\/p>\n<p>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043d\u043e \u044f \u0431\u044b \u043d\u0430\u0437\u0432\u0430\u043b \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u043a\u0440\u044b\u0442\u043d\u043e\u0441\u0442\u0438. \u0422\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043d\u0435\u0439 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u0440\u043e\u0431\u0435\u043b\u0430, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0443\u043f.<\/p>\n<p>\u041b\u043e\u0433\u0438\u0447\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u0412\u0435\u0434\u044c \u0442\u043e\u0433\u0434\u0430, \u0435\u0441\u043b\u0438 \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439, \u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>&amp;&amp;<\/em>, \u0437\u0430 \u0441\u0447\u0451\u0442 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%92%D1%8B%D1%87%D0%B8%D1%81%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F_%D0%BF%D0%BE_%D0%BA%D0%BE%D1%80%D0%BE%D1%82%D0%BA%D0%BE%D0%B9_%D1%81%D1%85%D0%B5%D0%BC%D0%B5\">\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043f\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435<\/a>, \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442.<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>len<\/em> \u0440\u0430\u0432\u043d\u043e 32, \u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u044f \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043d\u043e\u0432\u0430 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d xD.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N20<\/strong><\/p>\n<p>\u0418\u0442\u0430\u043a, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0439\u0442\u0435! \u0421\u0430\u043c\u044b\u0439 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u043e\u0441\u0441 \u0432\u0441\u0435\u0445 \u0444\u0438\u043d\u0430\u043b\u043e\u0432.<\/p>\n<p>\u041b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0448\u0443 \u043a \u0441\u0442\u043e\u043b\u0443. \u041d\u0435\u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u2014 \u0442\u043e\u0436\u0435.<\/p>\n<pre><code class=\"cpp\">void OpenALSoundRenderer::BackgroundProc() {   std::unique_lock&lt;std::mutex> lock(StreamLock);   while (!QuitThread.load())   {     if (Streams.Size() == 0)     {       \/\/ If there's nothing to play, wait indefinitely.       StreamWake.wait(lock);     }     else     {       \/\/ Else, process all active streams and sleep for 100ms       for (size_t i = 0; i &lt; Streams.Size(); i++)         Streams[i]->Process();       StreamWake.wait_for(lock, std::chrono::milliseconds(100));     }   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1089\/\">V1089<\/a> Waiting on condition variable without predicate. A thread can wait indefinitely or experience a spurious wakeup. Consider passing a predicate as the second argument. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/audio\/sound\/oalsound.cpp#L927\">oalsound.cpp 927<\/a><\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <em>Streams<\/em> (consumer). \u0415\u0441\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0434\u0430\u043d\u043d\u044b\u0435 (producer), \u0442\u043e consumer \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435, \u043f\u043e\u043a\u0430 producer \u043d\u0435 \u043f\u0440\u043e\u0431\u0443\u0434\u0438\u0442 \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e. \u0412 \u0441\u043e\u043d \u043f\u043e\u0442\u043e\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/thread\/condition_variable\/wait\"><em>std::condition_variable::wait<\/em><\/a> \u0438 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/thread\/condition_variable\/wait_for\"><em>std::condition_variable::wait_for<\/em><\/a>, \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e\/\u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u043a\u0430\u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Spurious_wakeup\">\u0441\u043f\u043e\u043d\u0442\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u0435<\/a>. \u041e\u043d\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e producer \u0435\u0449\u0451 \u043d\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u043b consumer&#8217;\u043e\u0432 \u043f\u0440\u043e\u0431\u0443\u0434\u0438\u0442\u044c\u0441\u044f, \u043e\u0434\u043d\u0430\u043a\u043e consumer&#8217;\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0441\u0443\u0434\u044f \u043f\u043e \u043a\u043e\u0434\u0443, \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445:<\/p>\n<ul>\n<li>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <em>Streams<\/em> \u043d\u0435 \u043f\u0443\u0441\u0442. \u041f\u043e\u0442\u043e\u043a \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u044f\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>StreamWake<\/em>.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>BackgroundProc<\/em> \u043d\u0430\u0434\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u041e\u043f\u043e\u0432\u0435\u0441\u0442\u044f\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>QuitThread<\/em>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0437-\u0437\u0430 \u0441\u043f\u043e\u043d\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0441\u043d\u0430, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c <em>Streams<\/em> \u0431\u0443\u0434\u0435\u0442 \u043f\u0443\u0441\u0442. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u0434 \u043f\u043e\u043b\u043d\u044b\u043c \u0431\u0430\u0440\u044c\u0435\u0440\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438 (\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/atomic\/atomic\/load\"><em>std::atomic&lt;T>::load<\/em><\/a> \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u043f\u0440\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e).<\/p>\n<p>\u0411\u0440\u0430\u0432\u044b\u0435 \u043c\u043e\u0440\u043f\u0435\u0445\u0438 \u043d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0439. \u041d\u043e \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0443\u0442\u043e\u0447\u043a\u0443 \u043b\u0443\u0447\u0448\u0435:<\/p>\n<pre><code class=\"cpp\">void OpenALSoundRenderer::BackgroundProc() {   std::unique_lock&lt;std::mutex> lock { StreamLock };    bool repeat = !QuitThread.load(std::memory_order_relaxed);    const auto pred = [this, &amp;repeat]   {     repeat = !QuitThread.load(std::memory_order_relaxed);     return !repeat || Streams.Size() != 0;   };    while (repeat)   {     \/\/ If there's nothing to play, wait indefinitely.     auto cond_met = StreamWake.wait_for(lock, 100ms, pred);     if (!cond_met || !repeat)     {       continue;     }      \/\/ Else, process all active streams and sleep for 100ms     for (size_t i = 0; i &lt; Streams.Size(); i++)     {       Streams[i]->Process();     }   } } <\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<p>1.\u0426\u0438\u043a\u043b \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>repeat<\/em>. \u041e\u043d\u0430 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>QuitThread<\/em> (\u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c consumer). <\/p>\n<p>2.\u041e\u0441\u043b\u0430\u0431\u0438\u043b\u0438 \u0431\u0430\u0440\u044c\u0435\u0440 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>QuitThread<\/em>. \u0421\u0443\u0434\u044f \u043f\u043e \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435, \u0435\u0451 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u043e\u043c <em>StreamLock<\/em>. \u041c\u044c\u044e\u0442\u0435\u043a\u0441 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u043c \u0431\u0430\u0440\u044c\u0435\u0440\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438 (<em>std::memory_order_seq_cst<\/em>), \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <em>std::memory_order_relaxed<\/em>. \u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\/\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0435 \u043f\u0435\u0440\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043b \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <em>std::memory_order_acquire<\/em>, \u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u2014 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <em>std::memory_order_release.<\/em> <\/p>\n<p>3.\u0414\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u043f\u043e\u043d\u0442\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u044f. \u041f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>QuitThread<\/em>. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443, \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0442\u0435\u043d\u0438\u0435 <em>QuitThread<\/em> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <em>std::memory_order_relaxed<\/em>. <\/p>\n<p>4.\u041e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432 <em>std::condition_variable::wait_for<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0432\u0438\u0442\u044c consumer \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u043e\u0431\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0432\u0435\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u044f, \u043a\u0430\u0436\u0434\u044b\u0435 100 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0430\u0442\u044c consumer. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <em>std::condition_variable::notify_*<\/em> \u043f\u0440\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 <em>QuitThread<\/em> \u0432 <em>true<\/em>.  <\/p>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0424\u0443\u0445&#8230; \u041d\u0443 \u0438 \u043a\u0432\u0435\u0441\u0442 \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0436\u0438\u0442\u044c. \u041a\u0430\u043a\u0438\u0445 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043c\u043e\u043d\u043e\u0432 \u043c\u044b \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0438 \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043f\u0443\u0442\u0438. \u0412\u0441\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 +\u043e\u043f\u044b\u0442 \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<p>\u0417\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0446\u0438\u0442\u0430\u0442\u043e\u0439 \u0438\u0437 \u043a\u043e\u0434\u0435\u043a\u0441\u0430 \u041d\u0435\u043a\u0440\u043e\u043f\u043e\u043b\u0438\u0441\u0430:<\/p>\n<blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0437\u0430\u0449\u0438\u0442\u043d\u0438\u043a\u0430, \u0438\u0431\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u044b \u0437\u043d\u0430\u0435\u0448\u044c, \u0437\u0430\u0447\u0435\u043c \u043c\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c.<\/p>\n<\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0437\u0430\u0449\u0438\u0442\u043d\u0438\u043a\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0442 \u0431\u0430\u0433\u043e\u0432, \u0438\u0431\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043b\u0435\u0433\u0435\u043d\u0434\u0430\u0440\u043d\u044b\u0445 \u0438\u0433\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0433\u0440\u0430\u043b \u043a\u0430\u0436\u0434\u044b\u0439, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>\u0412\u0441\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e! \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0432\u0440\u0435\u043c\u044f. \u0421 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u044e \u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u043f\u0440\u0438\u043c\u0443 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u043b\u044e\u0431\u043e\u043c \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0438!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/779596\/\"> https:\/\/habr.com\/ru\/articles\/779596\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u0433\u0440\u0435 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 DOOM \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u043e 30 \u043b\u0435\u0442! \u041c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u043e\u0439\u0442\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438 \u0432 \u0447\u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u0434 \u044d\u0442\u043e\u0439 \u043b\u0435\u0433\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u0439 \u0438\u0433\u0440\u044b \u0441\u043f\u0443\u0441\u0442\u044f \u0433\u043e\u0434\u044b.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>DOOM \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043a\u0430\u043a \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0435\u043b\u0438\u0447\u0430\u0439\u0448\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u0433\u0440, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0438\u0433\u0440\u043e\u0432\u0443\u044e \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u044e. \u0418\u0433\u0440\u0430 \u0441\u0442\u0430\u043b\u0430 \u0440\u0435\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432\u0432\u0435\u043b\u0430 \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b \u0432 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0435 \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0434\u043b\u044f \u0448\u0443\u0442\u0435\u0440\u043e\u0432 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043b\u0438\u0446\u0430. \u0415\u0451 \u0431\u044b\u0441\u0442\u0440\u0430\u044f, \u043d\u0430\u043f\u0440\u044f\u0436\u0451\u043d\u043d\u0430\u044f \u0438\u0433\u0440\u043e\u0432\u0430\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430, \u043c\u0440\u0430\u0447\u043d\u0430\u044f \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u0430 \u0438 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0439 \u0430\u0440\u0441\u0435\u043d\u0430\u043b \u043e\u0440\u0443\u0436\u0438\u044f \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043f\u0430\u043b\u0438 \u0432 \u0441\u0435\u0440\u0434\u0446\u0430 \u0438\u0433\u0440\u043e\u043a\u043e\u0432. \u0427\u0442\u043e \u0443\u0436 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0435\u043c \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0438! \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f: &#171;\u0425\u0435\u0432\u0438-\u043c\u0435\u0442\u0430\u043b\u043b \u0438\u0433\u0440\u0430\u0435\u0442 \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u044b \u0441\u0440\u0430\u0436\u0430\u0435\u0448\u044c\u0441\u044f \u0441 \u0434\u0435\u043c\u043e\u043d\u0430\u043c\u0438, \u043e\u043d \u0438\u0433\u0440\u0430\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0435\u043c\u043e\u043d\u044b \u0441\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0441 \u0442\u043e\u0431\u043e\u0439!&#187;.<\/p>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u0430 \u0438 \u0441\u043a\u0443\u0447\u043d\u043e \u044d\u0442\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0431\u0443\u0434\u0435\u043c \u0414\u0443\u043c\u0433\u0430\u0435\u043c \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0446\u0438\u0442\u0430\u0442\u0435 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 DOOM Eternal:<\/p>\n<blockquote>\n<p>\u041f\u0440\u043e\u0442\u0438\u0432 \u0432\u0441\u0435\u0445 \u0438\u0441\u0447\u0430\u0434\u0438\u0439 \u0438\u0437 \u0433\u043b\u0443\u0431\u0438\u043d \u043f\u0440\u0435\u0438\u0441\u043f\u043e\u0434\u043d\u0435\u0439, \u043f\u0440\u043e\u0442\u0438\u0432 \u0432\u0441\u0435\u0445 \u043d\u0435\u0447\u0435\u0441\u0442\u0438\u0432\u0446\u0435\u0432 \u0440\u043e\u0434\u0430 \u043b\u044e\u0434\u0441\u043a\u043e\u0433\u043e, \u043f\u0440\u043e\u0442\u0438\u0432 \u043b\u0435\u0433\u0438\u043e\u043d\u043e\u0432 \u043c\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0435\u0431\u044f \u043e\u0434\u043d\u043e\u0433\u043e. \u0420\u0432\u0438 \u0438 \u043a\u0440\u043e\u043c\u0441\u0430\u0439, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0438\u0441\u0441\u044f\u043a\u043d\u0443\u0442.<\/p>\n<\/blockquote>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0432\u0430\u0442\u044c \u0438 \u043a\u0440\u043e\u043c\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u0442\u043e \u0437\u043b\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0430\u0434. \u0410 \u043a\u0430\u043a\u043e\u0435 \u043d\u0430\u0438\u0445\u0443\u0434\u0448\u0435\u0435 \u0437\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430? \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0431\u0430\u0433\u0438 \u0432 \u043a\u043e\u0434\u0435! \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0438 <s>\u0443\u0431\u0438\u0432\u0430\u0442\u044c<\/s> \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043b\u0430\u0446\u0434\u0430\u0440\u043c\u0430 \u0434\u043b\u044f \u0432\u044b\u0441\u0430\u0434\u043a\u0438 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442 <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/tree\/g4.11.3\">GZDoom v4.11.3<\/a> \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u0433\u0440\u044b DOOM. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430 \u2014 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 <a href=\"https:\/\/pvs-studio.ru\/ru\/\">PVS-Studio<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0436, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0430: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c \u0433\u043b\u0430\u0432 \u0438\u0437 \u0438\u0433\u0440\u044b. \u041f\u043e\u0447\u0435\u043c\u0443? \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0438\u043f\u0443 \u0431\u0430\u0433\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u041f\u043e \u043a\u043e\u043b\u0435\u043d\u043e \u0432 \u0442\u0440\u0443\u043f\u0430\u0445&#187; \u0431\u0443\u0434\u0443\u0442 \u0431\u0430\u0433\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 &#171;\u043c\u0451\u0440\u0442\u0432\u044b\u043c\u0438&#187; (\u0432\u0438\u0441\u044f\u0447\u0438\u043c\u0438) \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438, \u043c\u0435\u0440\u0442\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u041f\u043e\u0431\u0435\u0440\u0435\u0436\u044c\u0435 \u0430\u0434\u0430&#187;&#8230;  \u043b\u0430\u0434\u043d\u043e, \u0441\u0442\u043e\u043f. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043f\u0440\u043e\u0441\u0442\u043e \u044f \u0442\u0430\u043a \u0437\u0430\u0445\u043e\u0442\u0435\u043b. \u0417\u0432\u0443\u0447\u0438\u0442 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u043c\u044b <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0662\/\">\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438<\/a> \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u043e\u0440\u0442\u0430 DOOM Engine \u043d\u0430 Linux. \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0435\u0451 \u043a \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044e \u0432\u0441\u0435\u043c \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u0441\u0435\u0440\u0438\u0438 \ud83d\ude42<\/p>\n<\/blockquote>\n<h3>\u041f\u043e \u043a\u043e\u043b\u0435\u043d\u043e \u0432 \u0442\u0440\u0443\u043f\u0430\u0445<\/h3>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0432\u044b\u0441\u0430\u0434\u043a\u0430 \u0432 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041c\u044b \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u043c \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432\u0448\u0438\u0445 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u0446\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0443. \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043e\u0442 \u0432\u0441\u0435\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u043e\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0437\u043e\u043c\u0431\u0438-\u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0447\u0435\u043c-\u0442\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0431\u044c\u0451\u0442\u0441\u044f \u0433\u043e\u043b\u043e\u0432\u043e\u0439 \u043e\u0431 \u0441\u0442\u0435\u043d\u0443. \u0414\u0430\u043c \u0432\u0430\u043c \u0432\u0440\u0435\u043c\u044f \u0441\u0430\u043c\u0438\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u043a \u0447\u0435\u043c\u0443, \u044f \u043b\u0438\u0448\u044c \u043f\u043e\u043a\u0430 \u043d\u0430\u0432\u0451\u043b \u043f\u0440\u0438\u0446\u0435\u043b \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e.<\/p>\n<pre><code class=\"cpp\">void SWPalDrawers::DrawUnscaledFuzzColumn(const SpriteDrawerArgs&amp; args) {   ....   int fuzzstep = 1;   int fuzz = _fuzzpos % FUZZTABLE;    #ifndef ORIGINAL_FUZZ    while (count > 0)   {     int available = (FUZZTABLE - fuzz);     int next_wrap = available \/ fuzzstep;     if (available % fuzzstep != 0)             \/\/ &lt;=        next_wrap++;     .... \/\/ \u0417\u0434\u0435\u0441\u044c fuzzstep \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041a\u043b\u044f\u043d\u0443\u0441\u044c BFG.   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1063\/\">V1063<\/a> The modulo by 1 operation is meaningless. The result will always be zero. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/rendering\/swrenderer\/drawers\/r_draw_rgba.cpp#L328\">r_draw_rgba.cpp 328<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;available % fuzzstep != 0&#8217; is always false. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/rendering\/swrenderer\/drawers\/r_draw_rgba.cpp#L328\">r_draw_rgba.cpp 328<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>fuzzstep<\/em> \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0441\u0440\u0430\u0437\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <em>1<\/em> \u0432\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430. \u0414\u0430\u043b\u0435\u0435 \u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0412 \u0446\u0438\u043a\u043b\u0435 <em>while<\/em> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <em>if (available % fuzzstep != 0)<\/em> \u0440\u0430\u0437 \u0437\u0430 \u0440\u0430\u0437\u043e\u043c, \u0432 \u043d\u0430\u0434\u0435\u0436\u0434\u0435 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f&#8230; (\u0447\u0451\u0440\u0442, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u043d\u0435 \u0442\u0430 \u0438\u0433\u0440\u0430), \u043d\u043e <em>fuzzstep<\/em> \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0438 \u043c\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u0435\u043b\u0438\u043c <em>available<\/em> \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0430 <em>1<\/em>, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <em>0<\/em>, \u0438 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0441 <em>0<\/em>&#8230;<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u0440\u0435\u0435 \u043f\u043e\u043a\u043e\u043d\u0447\u0438\u043c \u0441 \u043d\u0438\u043c \u0438 \u043f\u0440\u043e\u0439\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2<\/strong><\/p>\n<p>\u041d\u0430 \u043d\u0430\u0448\u0435\u043c \u043f\u0443\u0442\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u0430, \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043a\u0435\u043c-\u0442\u043e \u0434\u043e \u043d\u0430\u0441.<\/p>\n<p>\u041f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0440\u043f\u0435\u0445\u043e\u0432: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u043e\u0432 \u043d\u0430\u0448\u043b\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043c\u0438\u043d\u0443. \u0418 \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043c\u043e\u043d\u044b \u0440\u0435\u0448\u0430\u0442 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438, \u0442\u043e&#8230; \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442. \u041c\u0438\u043d\u0443 \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b\u0438&#8230;<\/p>\n<pre><code class=\"cpp\">StringPool::Block *StringPool::AddBlock(size_t size) {   ....   auto mem = (Block *)malloc(size);   if (mem == nullptr)   {        }   mem->Limit = (uint8_t *)mem + size;   mem->Avail = &amp;mem[1];   mem->NextBlock = TopBlock;   TopBlock = mem;   return mem; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v522\/\">V522<\/a> There might be dereferencing of a potential null pointer &#8216;mem&#8217;. Check lines: 100, 95. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/6ce809efe2902e43ceaa7031b875225d3a0367de\/src\/common\/filesystem\/source\/fs_stringpool.cpp#L100\">fs_stringpool.cpp 100<\/a><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435. \u0417\u0434\u0435\u0441\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>mem<\/em> \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>malloc<\/em>. \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, <em>malloc<\/em> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>NULL<\/em>, \u0438 \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0437\u043d\u0430\u043b\u0438 \u0438 \u0434\u0430\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 <em>if (mem == nullptr)<\/em>, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>malloc<\/em>, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0938\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0432\u0435\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/utility\/program\/exit\"><em>std::exit<\/em><\/a>, \u0438\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435.<\/p>\n<p>\u041d\u0435 \u0441\u0442\u0430\u0432 \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043d\u0443, \u043c\u044b \u0438\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3<\/strong><\/p>\n<p>\u041d\u0430 \u043f\u0443\u0442\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442 \u043d\u0430\u0441 \u0438 \u043d\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u0442\u044c. \u041e\u043d \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442.<\/p>\n<pre><code class=\"cpp\">void PClassActor::InitializeDefaults() {   ....   if (MetaSize > 0)    memcpy(Meta, ParentClass->Meta, ParentClass->MetaSize);   else    memset(Meta, 0, MetaSize);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\">V575<\/a> The &#8216;memset&#8217; function processes &#8216;0&#8217; elements. Inspect the third argument. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/gamedata\/info.cpp#L518\">info.cpp 518<\/a><\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043f\u0430\u043c\u044f\u0442\u044c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <em>Meta<\/em>, \u0445\u043e\u0442\u044f\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0443\u043b\u044f\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/string\/byte\/memset\"><em>memset<\/em><\/a>. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0432\u0435\u0442\u043a\u0443 <em>else<\/em> \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 <em>MetaSize<\/em> \u0440\u0430\u0432\u0435\u043d 0. \u0414\u043b\u044f <em>memset<\/em> \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442: &#171;\u0437\u0430\u043f\u043e\u043b\u043d\u0438 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u0442\u0430\u043a\u0438\u043c-\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 0 \u0431\u0430\u0439\u0442&#187; == &#171;\u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0439&#187;.<\/p>\n<p>\u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4<\/strong><\/p>\n<p>\u041c\u044b \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0438\u043c\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e, \u0442\u0443\u0442 \u0436\u0435 \u043d\u0430\u043f\u0430\u0434\u0430\u0435\u0442.<\/p>\n<pre><code class=\"cpp\">void FDecalLib::ParseDecal (FScanner &amp;sc) {   FDecalTemplate newdecal;   ....   memset ((void *)&amp;newdecal, 0, sizeof(newdecal));   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v598\/\">V598<\/a> The &#8216;memset&#8217; function is used to nullify the fields of &#8216;FDecalTemplate&#8217; class. Virtual table pointer will be damaged by this. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/gamedata\/decallib.cpp#L367\">decallib.cpp 367<\/a><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>memset<\/em> \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>newdecal<\/em> \u0442\u0438\u043f\u0430 <em>FDecalTemplate<\/em>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0445\u043e\u0442\u044f\u0442 \u0437\u0430\u043d\u0443\u043b\u0438\u0442\u044c \u043e\u0431\u044c\u0435\u043a\u0442. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0438\u043f <em>FDecalTemplate<\/em> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<pre><code class=\"cpp\">class FDecalTemplate : public FDecalBase { .... }  class FDecalBase {   ....   virtual const FDecalTemplate *GetDecal () const;   virtual void ReplaceDecalRef (FDecalBase *from, FDecalBase *to) = 0;   .... }; <\/code><\/pre>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>sizeof<\/em> \u0436\u0435 \u0432\u0435\u0440\u043d\u0451\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f. \u041e\u0431\u043d\u0443\u043b\u044f\u044f \u043f\u043e\u043b\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0430\u043d\u0443\u043b\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 <s>\u043f\u0440\u043e\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043d\u043e\u0433\u0443<\/s> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043c\u0430\u0433 \u043e\u0442 \u0443\u0434\u0430\u0440\u0430 \u0434\u0435\u043c\u043e\u043d\u0430.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0439\u0434\u044f \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435, \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u043e\u0434\u0438\u043d\u043e\u043a\u043e \u0441\u0438\u0434\u044f\u0449\u0435\u0433\u043e \u043c\u043e\u0440\u043f\u0435\u0445\u0430:<\/p>\n<pre><code class=\"cpp\">class PaletteContainer { public:   PalEntry BaseColors[256]; \/\/ non-gamma corrected palette   .... };  static void DrawPaletteTester(int paletteno) {   ....   for (int i = 0; i &lt; 16; ++i)   {     for (int j = 0; j &lt; 16; ++j)     {       PalEntry pe;       if (t > 1)       {         auto palette = GPalette.GetTranslation(TRANSLATION_Standard,                                                t - 2)->Palette;         pe = palette[k];       }       else GPalette.BaseColors[k];                     \/\/ &lt;=       ....     }     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v607\/\">V607<\/a> Ownerless expression &#8216;GPalette.BaseColors[k]&#8217;. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/d_main.cpp#L762\">d_main.cpp 762<\/a><\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u0430\u043a\u0430\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u0438\u0441\u0441\u0438\u044f \u0431\u044b\u043b\u0430 \u0443 \u043d\u0435\u0433\u043e, \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f. \u041e\u043d \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e \u043f\u0440\u043e\u0431\u044b\u043b \u0437\u0434\u0435\u0441\u044c \u0432 \u043e\u0434\u0438\u043d\u043e\u0447\u0435\u0441\u0442\u0432\u0435 \u0438 \u0443\u0436\u0435 \u0437\u0430\u0431\u044b\u043b.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N6<\/strong><\/p>\n<p>\u041e\u0441\u0442\u0430\u0432\u0438\u0432 \u043c\u043e\u0440\u043f\u0435\u0445\u0430 \u0438 \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0432 \u0437\u0430 \u0443\u0433\u043e\u043b, \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043e\u0441\u0441\u0430 \u2014 \u0431\u0430\u0440\u043e\u043d\u0430 \u0430\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043c\u0430\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<pre><code class=\"cpp\">uint8_t work[8 +           \/\/ signature              12+2*4+5 +    \/\/ IHDR              12+4 +        \/\/ gAMA              12+256*3];    \/\/ PLTE uint32_t *const sig = (uint32_t *)&amp;work[0]; <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v641\/\">V641<\/a> The size of the &#8216;&amp;work[0]&#8217; buffer is not a multiple of the element size of the type &#8216;uint32_t&#8217;. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/textures\/m_png.cpp#L143\">m_png.cpp 143<\/a><\/p>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432 <em>work<\/em> \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 829 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 <em>uint8_t<\/em>. \u0417\u0430\u0442\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>sig<\/em> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 <em>work<\/em> \u043a \u0442\u0438\u043f\u0443 <em>uint32_t<\/em>.<\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u0430\u0432\u0438\u043b strict aliasing. \u041c\u0430\u0441\u0441\u0438\u0432 <em>work<\/em> \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d \u043f\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0435 1, \u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>sig<\/em> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0435 4 \u0431\u0430\u0439\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0440\u0430\u0442\u0435\u043d 4, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 (ARM).<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 <em>alignas<\/em>:<\/p>\n<pre><code class=\"cpp\">uint8_t alignas(uint32_t) work[....]; <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0430\u0434\u0440\u0435\u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d \u043f\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0435 4 \u0431\u0430\u0439\u0442\u043e\u0432.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043f\u043b\u043e\u0445\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c. \u0427\u0438\u0441\u043b\u043e 829 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 4, \u0438 \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0435\u0449\u0451 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0433\u043b\u0430\u0432\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439.<\/p>\n<h3>\u041f\u043e\u0431\u0435\u0440\u0435\u0436\u044c\u0435 \u0430\u0434\u0430<\/h3>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u043c\u043e\u043d\u044b, \u2014 \u0434\u0430\u0436\u0435 \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0445\u0438\u043b\u044b\u043c\u0438, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0441\u0438\u043b\u044c\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043d\u0430 1730 \u0441\u0442\u0440\u043e\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 <em>vectors.h<\/em>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N7<\/strong><\/p>\n<pre><code class=\"cpp\">constexpr DAngle nullAngle = DAngle::fromDeg(0.); <\/code><\/pre>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435. \u0427\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0439\u0442\u0438 \u043d\u0435 \u0442\u0430\u043a? \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u044f\u0434\u043e\u043c \u043c\u044b \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u043c \u043b\u0435\u0436\u0430\u0449\u0435\u0433\u043e \u0440\u0430\u043d\u0435\u043d\u043e\u0433\u043e \u043c\u043e\u0440\u043f\u0435\u0445\u0430.<\/p>\n<p>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u044f \u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u044e\u043d\u0438\u0442\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0432 \u044d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0441\u0432\u043e\u044f \u043a\u043e\u043f\u0438\u044f \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b?<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u0430\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 100 \u0431\u0430\u0439\u0442. \u0418 \u0438\u0445 \u0442\u0430\u043a\u0438\u0445 100. \u0418 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 100 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0438? \u0417\u0430\u0431\u0443\u0434\u044c\u0442\u0435, \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0441\u0442\u0440\u0430\u0448\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>\u0413\u043e\u0440\u0430\u0437\u0434\u043e \u0445\u0443\u0436\u0435 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e (\u0432\u0440\u0443, \u043c\u043d\u043e\u0433\u043e) \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1043\/\">V1043<\/a> A global object variable &#8216;nullAngle&#8217; is declared in the header. Multiple copies of it will be created in all translation units that include this header file. <a href=\"https:\/\/github.com\/ZDoom\/gzdoom\/blob\/g4.11.3\/src\/common\/utility\/vectors.h#L1730\">vectors.h 1730<\/a><\/p>\n<p>\u0422\u0430\u043a\u0438\u0445 \u0436\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u0435\u0449\u0451 11 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0434\u0435\u043c\u043e\u043d\u043e\u043c, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-362500","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/362500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=362500"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/362500\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}