{"id":179615,"date":"2013-05-14T12:34:05","date_gmt":"2013-05-14T08:34:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=179615"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=179615","title":{"rendered":"<span class=\"post_title\">\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u044b \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 C++Builder<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Embarcadero C++Builder XE3. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 inline-\u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442, \u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0438.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041c\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e <a href=\"http:\/\/www.viva64.com\/ru\/b\/0193\/\">\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b<\/a>, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0432\u0441\u0435 \u0434\u0440\u0443\u0433\u043e\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Visual C++ 2012. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0430: &quot;<a href=\"http:\/\/www.viva64.com\/ru\/b\/0163\/\">\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u044b \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 Visual C++ 2012<\/a>&quot;.<\/p>\n<p>  \u0412 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 Visual C++ \u0432\u0445\u043e\u0434\u044f\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441 C++Builder \u0445\u0443\u0436\u0435. \u0415\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 inline-\u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u0435-\u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438<\/h2>\n<p>  <\/p>\n<pre>#pragma warning(disable : 4115) #include &lt;objbase.h&gt; #pragma warning(default : 4115)<\/pre>\n<p>  \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0435 PVS-Studio:<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0290\/\">V665<\/a> Possibly, the usage of &#8216;#pragma warning(default: X)&#8217; is incorrect in this context. The &#8216;#pragma warning(push\/pop)&#8217; should be used instead. Check lines: 16, 18. iaguid.h 18<\/p>\n<p>  \u041d\u0435\u0445\u043e\u0440\u043e\u0448\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0414\u043b\u044f \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c &quot;#pragma warning(push[ ,n ])&quot; \u0438 &quot;#pragma warning(pop)&quot;.<\/p>\n<h2>\u041d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441<\/h2>\n<p>  <\/p>\n<pre>#define SET_VTYPE_AND_VARREF(type, val) \\   this-&gt;vt = VT_ ## type | VT_BYREF; \\   V_ ## type ## REF (this) = val;  TVariantT&amp; operator=(System::Currency* src) {   Clear();   if(src)     SET_VTYPE_AND_VARREF(CY,       reinterpret_cast&lt;tagCY*&gt;(&amp;(src-&gt;Val)));   return* this; }<\/pre>\n<p>  \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0435 PVS-Studio:<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0258\/\">V640<\/a> The code&#8217;s operational logic does not correspond with its formatting. The second statement will always be executed. It is possible that curly brackets are missing. utilcls.h 1781<\/p>\n<p>  \u041c\u0430\u043a\u0440\u043e\u0441 SET_VTYPE_AND_VARREF \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043b\u043e\u0445\u043e. \u0415\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0435 \u043e\u0431\u0440\u0430\u043c\u043b\u0435\u043d\u043e \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u043c\u0438 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438 { }. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u00abif (src)\u00bb \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<h2>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<pre>#define _BITS_BYTE    8 template&lt;class _Uint,     _Uint _Ax,     _Uint _Cx,     _Uint _Mx&gt;     class linear_congruential {   static _CONST_DATA int _Nw =     (_BITS_BYTE * sizeof (_Uint) + 31) \/ 32;    void seed(seed_seq&amp; _Seq)   {     _Uint _Arr[3 + _Nw];     ....     int _Lsh = _BITS_BYTE * sizeof (_Uint);     ....      for (int _Idx = _Nw; 0 &lt; --_Idx; )       _Arr[3 + _Idx - 1] |=         _Arr[3 + _Idx] &lt;&lt; _Lsh;     ....   } }<\/pre>\n<p>  \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0435 PVS-Studio:<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0225\/\">V610<\/a> Instantiate linear_congruential &lt; unsigned long, 40014, 0, 2147483563 &gt;: Undefined behavior. Check the shift operator &#8216;&lt;&lt;. The right operand &#8216;_Lsh&#8217; is greater than or equal to the length in bits of the promoted left operand. random 738<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;_Lsh&#8217; \u043f\u0440\u0438\u043c\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 32. \u041d\u0435\u043b\u044c\u0437\u044f \u0441\u0434\u0432\u0438\u0433\u0430\u0442\u044c 32-\u0431\u0438\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 31 \u0431\u0438\u0442. \u0412\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430: The behavior is undefined if the right operand is negative, or greater than or equal to the length in bits of the promoted left operand.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435, \u043e\u043f\u0430\u0441\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u043d \u043c\u0430\u043a\u0440\u043e\u0441 DXVABitMask:  <\/p>\n<pre>#define DXVABitMask(__n) (~((~0) &lt;&lt; __n))<\/pre>\n<p>  \u041f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430: Otherwise, if E1 has a signed type and non-negative value, and E1*2^E2 is representable in the result type, then that is the resulting value; otherwise, the behavior is undefined.<\/p>\n<p>  \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430, PVS-Studio \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;. The left operand &#8216;(~0)&#8217; is negative. dxva.h 1080 <\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0441\u0434\u0432\u0438\u0433\u0430\u0445 \u0438 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0437\u0430\u043c\u0435\u0442\u043a\u0435: <a href=\"http:\/\/www.viva64.com\/ru\/b\/0142\/\">\u041d\u0435 \u0437\u043d\u0430\u044f \u0431\u0440\u043e\u0434\u0430, \u043d\u0435 \u043b\u0435\u0437\u044c \u0432 \u0432\u043e\u0434\u0443. \u0427\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u0442\u044c\u044f<\/a>. <\/p>\n<h2>\u041d\u0435\u0443\u0447\u0442\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 new.<\/h2>\n<p>  \u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442, \u0433\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;new&#8217;, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0440\u0430\u0432\u0435\u043d NULL. \u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0438 \u0434\u0430\u0436\u0435 \u0432\u0440\u0435\u0434\u043d\u043e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;new&#8217; \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 std::bad_alloc.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;new&#8217;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0412 C++Builder \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e:  <\/p>\n<pre>#define NEW_NOTHROW(_bytes) new (nothrow) BYTE[_bytes]<\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0438\u0434\u0438\u043c\u043e \u043d\u0435 \u0432\u0435\u0437\u0434\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:  <\/p>\n<pre>inline void _bstr_t::Assign(BSTR s) throw(_com_error) {   if (m_Data != NULL) {     m_Data-&gt;Assign(s);    }    else {     m_Data = new Data_t(s, TRUE);     if (m_Data == NULL) {       _com_issue_error(E_OUTOFMEMORY);     }   } }<\/pre>\n<p>  \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0435 PVS-Studio:<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0293\/\">V668<\/a> There is no sense in testing the &#8216;m_Data&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. comutil.h 454<\/p>\n<p>  \u0421\u0442\u0440\u043e\u0447\u043a\u0430 &quot;_com_issue_error(E_OUTOFMEMORY);&quot; \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 std::bad_alloc().  <\/p>\n<pre>static inline BYTE *__CorHlprNewThrows(size_t bytes) {   BYTE *pbMemory = new BYTE[bytes];   if (pbMemory == NULL)     __CorHlprThrowOOM();   return pbMemory; }<\/pre>\n<p>  \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0435 PVS-Studio:<\/p>\n<p>  V668 There is no sense in testing the &#8216;pbMemory&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. corhlpr.h 56  <\/p>\n<pre>template&lt;class TYPE, class ARG_TYPE&gt; void CDXArray&lt;TYPE, ARG_TYPE&gt;::SetSize(int nNewSize, int nGrowBy) {   ....   TYPE* pNewData = (TYPE*) new BYTE[nNewMax * sizeof(TYPE)];    \/\/ oh well, it's better than crashing   if (pNewData == NULL)     return;   .... }<\/pre>\n<p>  \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0435 PVS-Studio:<\/p>\n<p>  V668 There is no sense in testing the &#8216;pNewData&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. dxtmpl.h 338<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430 \u043f\u043e\u0445\u043e\u0436\u0438, \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0443\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438:  <\/p>\n<ul>\n<li>V668 There is no sense in testing the &#8216;p&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. d3dx10math.inl 1008<\/li>\n<li>V668 There is no sense in testing the &#8216;p&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. dxtmpl.h 123<\/li>\n<li>V668 There is no sense in testing the &#8216;pNewData&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. dxtmpl.h 395<\/li>\n<li>V668 There is no sense in testing the &#8216;m_pHashTable&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. dxtmpl.h 1126<\/li>\n<li>V668 There is no sense in testing the &#8216;newBrush&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusbrush.h 44<\/li>\n<li>V668 There is no sense in testing the &#8216;retimage&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusbrush.h 374<\/li>\n<li>V668 There is no sense in testing the &#8216;argbs&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusbrush.h 615<\/li>\n<li>V668 There is no sense in testing the &#8216;argbs&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusbrush.h 645<\/li>\n<li>V668 There is no sense in testing the &#8216;argbs&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdipluspath.h 1196<\/li>\n<li>V668 There is no sense in testing the &#8216;argbs&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdipluspath.h 1231<\/li>\n<li>V668 There is no sense in testing the &#8216;argbs&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdipluspath.h 1372<\/li>\n<li>V668 There is no sense in testing the &#8216;argbs&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdipluspath.h 1405<\/li>\n<li>V668 There is no sense in testing the &#8216;newLineCap&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdipluslinecaps.h 153<\/li>\n<li>V668 There is no sense in testing the &#8216;nativeRegions&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusgraphics.h 1415<\/li>\n<li>V668 There is no sense in testing the &#8216;newRegion&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusregion.h 89<\/li>\n<li>V668 There is no sense in testing the &#8216;nativeFamilyList&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusfontcollection.h 57<\/li>\n<li>V668 There is no sense in testing the &#8216;newImage&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusbitmap.h 334<\/li>\n<li>V668 There is no sense in testing the &#8216;bitmap&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusbitmap.h 819<\/li>\n<li>V668 There is no sense in testing the &#8216;bitmap&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. gdiplusbitmap.h 862<\/li>\n<li>V668 There is no sense in testing the &#8216;m_pData&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. spcollec.h 266<\/li>\n<li>V668 There is no sense in testing the &#8216;pNewData&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. spcollec.h 325<\/li>\n<\/ul>\n<p>  \u0418 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 inline-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445! \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e, \u0447\u0442\u043e \u0442\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 *.cpp \u0444\u0430\u0439\u043b\u0430\u0445. \ud83d\ude42<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/h2>\n<p>  \u0412 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0432\u044b\u0448\u0435\u043b Embarcadero C++Builder XE4. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u044d\u0442\u043e \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u0443 \u043e\u0442 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 PVS-Studio. \u041f\u043b\u044e\u0441 \u044f \u0435\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u043b \u0441 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e PVS-Studio, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 C++Builder XE4. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 C++Builder \u043e\u0431\u0440\u0430\u0442\u044f\u0442 \u043d\u0430 \u043d\u0430\u0441 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u0445\u043e\u0442\u044f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438, \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a:  <\/p>\n<ol>\n<li><a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio\/\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 PVS-Studio<\/a>. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e.<\/li>\n<li>\u0410\u043d\u0434\u0440\u0435\u0439 \u041a\u0430\u0440\u043f\u043e\u0432. <a href=\"http:\/\/www.viva64.com\/ru\/a\/0081\/\">C++Builder, \u0441\u0431\u043e\u0440\u043a\u0430 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0435\u043d\u0435\u0441\u0441\u0430\u043d\u0441 Viva64<\/a>.<\/li>\n<li>\u041d\u0430\u0448 \u0442\u0432\u0438\u0442\u0442\u0435\u0440 <a href=\"https:\/\/twitter.com\/Code_Analysis\">@Code_Analysis<\/a>. \u041f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u043f\u043e \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u0421\u0438\/\u0421\u0438++.<\/li>\n<li>\u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 PVS-Studio. <a href=\"http:\/\/www.viva64.com\/ru\/examples\/\">\u041e\u0448\u0438\u0431\u043a\u0438, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 PVS-Studio \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/a>.<\/li>\n<\/ol>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/179615\/\"> http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/179615\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Embarcadero C++Builder XE3. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 inline-\u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442, \u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0438.  <\/p>\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-179615","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/179615","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=179615"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/179615\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=179615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=179615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=179615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}