хотел – Übersetzung – Keybot-Wörterbuch

Spacer TTN Translation Network TTN TTN Login Français English Spacer Help
Ausgangssprachen Zielsprachen
Keybot 123 Ergebnisse  www.viva64.com
  V547. Expression is alw...  
Программист хотел реализовать следующий алгоритм.
The programmer wanted to implement the following algorithm.
  V3063. A part of condit...  
Программист хотел проверить, что переменная d попадает в заданный диапазон (это видно по комментарию перед проверкой). Но из-за опечатки он написал оператор '||', вместо оператора '&&'. Корректный код:
The programmer wanted to make sure that the d variable belongs to the specified range (it is stated in the comment before the check) but made a typo and wrote the '||' operator instead of '&&'. The fixed code:
  V3007. Odd semicolon ';...  
В данном коде программист хотел выполнить присваивание для всех элементов массива, но по ошибке поставил ';' после закрывающей скобки цикла. Таким образом, операция присваивания выполнится только один раз.
In this code, the programmer wanted the assignment operation to process all of the array's items but added a semicolon by mistake after the closing parenthesis of the loop. It results in the assignment operation being executed only once. Moreover, it also causes an array index out of bounds error.
  V3005. The 'x' variable...  
Из кода видно, что программист хотел изменить значения свойств объекта в соответствии с принятыми в методе параметрами, но ошибся и присвоил свойству 'QuestionId' вместо значения аргумента 'questionId' значение самого же свойства.
As seen from the code, the programmer intended to change the values of an object's properties according to the parameters accepted in the method, but mistakenly assigned to the 'QuestionId' property its own value instead of the 'questionId' argument's value.
  V714. Variable is not p...  
Это приведёт к копированию переменной 't' на каждой итерации и изменению локальной копии, что вряд ли то, что хотел программист. Скорее всего, хотелось изменить значения в контейнере 'myvector'. Корректно данный участок кода будет выглядеть следующим образом:
It will cause copying the 't' variable at each iteration and changing the local copy, which is hardly what the programmer wanted. Most likely, he intended to change the values in the 'myvector' container. A correct version of this code fragment should look as follows:
  V738. Temporary anonymo...  
После чего к временному объекту применяется оператор присваивания. Этот код не имеет смысла. Автор кода хотел явно сделать что-то другое. Например, он хотел в начале выполнить присваивание, а уже затем воспользоваться инкрементом.
In this code, a temporary copy of an iterator is created. Then the iterator is incremented. After that, the assignment operator is applied to the temporary object. This code doesn't make sense; the author obviously wanted it to do something else. For example, they may have intended to execute the assignment operation first and only then the increment operation.
  Чем дальше, тем экзотич...  
Вот здесь и крылась беда. Анализатор захотел пропустить тело функции, а вместо этого там встретились слова #pragma. Теоретически, эта ситуация должна была быть корректно обработана. Однако из-за опечатки, возникал нулевой указатель.
And here our troubles come from. The analyzer decided to skip the body of a function, but encountered #pragma instead. In theory, this situation should have been handled correctly. But the misprint caused the appearance of a null pointer.
  V744. Temporary object ...  
В данном примере будет создан временный анонимный объект типа 'CSingleLock', которой будет сразу же разрушен, еще до вызова функции foo(). В примере программист хотел обеспечить синхронизацию при исполнении функции foo(), но на самом деле функция будет вызвана без синхронизации, что может привести к серьезным ошибкам.
In this code, a temporary anonymous object of type 'CSingleLock' will be created and destroyed right off, even before the foo() function is called. In this example, the programmer wanted to make sure that the execution of the foo() function would be synched, but actually it will be called without synching, and it may cause serious errors.
  По просьбе читателей, п...  
Автор кода хотел выявить ситуацию, когда указатель нулевой или строка пустая. Но забыл разыменовать указатель ludp->lud_filter, поэтому указатель просто дважды проверится на равенство NULL.
The programmer wanted to check for a null pointer or an empty string but forgot to dereference the ludp->lud_filter pointer, so it is simply tested for NULL twice.
  Обзор статического анал...  
Предположение CppCat о том, что я может быть хотел изменить значение по указателю — неверно, я хотел изменить сам указатель. Но тем ни менее польза от этого сообщения есть — оно указывает на лишнюю операцию взятия значения по указателю — "*".
CppCat's assumption that I probably wanted to change the value by the pointer is incorrect; I actually wanted to change the pointer itself. However, this message is still helpful - it points to an unnecessary operation of taking a value by pointer,"*". It is not used here, so I could simply write "ch--"
  О том, как мы опробовал...  
Также я передал временный лицензионный ключ и разработчикам из других проектных групп компании "Эйдос-Медицина". Хотел, чтобы ребята попробовали и сделали выводы о том, нужен ли им такой инструмент в работе.
I also shared the temporary PVS-Studio registration key with the developers from other project teams of the Eidos-Medicine ltd. company. I wanted them to try it and decide if they needed a tool like that in their work. Here are a few responses of theirs:
  Как уменьшить вероятнос...  
Этот код работает не так, как может показаться на первый взгляд. Программист, скорее всего, хотел сложить значение X с числом 1 или с числом 2, в зависимости от условия (A == B). Но на самом деле условием является выражение "X + (A == B)".
It works differently than it might seem at first sight. Most likely, the programmer intended to add the X value to number 1 or 2 depending on the (A == B) condition. But actually it is the "X + (A == B)" expression which is the condition. In fact, it is this code written in the project:
  Джон Кармак про PVS-Stu...  
Эти ошибки демонстрируют, что может быть найдено. Я хотел написать несколько примеров кода к этой своей статье, но лучше посмотрите там. Когда будете смотреть, не ухмыляйтесь, заявляя: "Уж я-то никогда таких ошибок не сделаю!"
There are a number of good articles on the PVS-Studio site, most with code examples drawn from open source projects demonstrating exactly what types of things are found. I considered adding some representative code analysis warnings to this article, but there are already better documented examples present there. Go look at them, and don't smirk and think "I would never write that!"
  V738. Temporary anonymo...  
После чего к временному объекту применяется оператор присваивания. Этот код не имеет смысла. Автор кода хотел явно сделать что-то другое. Например, он хотел в начале выполнить присваивание, а уже затем воспользоваться инкрементом.
In this code, a temporary copy of an iterator is created. Then the iterator is incremented. After that, the assignment operator is applied to the temporary object. This code doesn't make sense; the author obviously wanted it to do something else. For example, they may have intended to execute the assignment operation first and only then the increment operation.
  Пересечение PVS-Studio ...  
В начале я хотел нарисовать диаграмму Венна, в виде красивых кружочков. Но оказывается, это целая задача. Excel рисуют кружочки без учёта их площади. А программы, которые рисуют правильные пропорциональные диаграммы - платные.
At first I planned to draw a Venn diagram, as neat circles. But it appeared to be a tough task. You see, Excel draws circles without taking into account their areas, while programs that can draw correct proportional diagrams are paid. So I had to get along with squares which required only a calculator, pen, paper and the Paint editor.
  Проверяем исходный код ...  
Рискну предположить, что разработчик хотел пробежать по элементам коллекции _extensions, найти первый объект existingExtension с соответствующим extensionId и выйти из цикла. Но из-за экономии на скобках цикл безусловно завершается после первой итерации, что существенно влияет на логику работы программы.
My guess is that the developer wanted to iterate through the elements of the _extensions collection to find the first existingExtension object with the corresponding extensionId and exit the loop. However, because they saved on parentheses, the loop is exited unconditionally immediately after the first iteration, which greatly affects the program's execution logic.
  V731. The variable of c...  
Этим кодом невнимательный программист хотел сравнить переменную 'ch' с символом новой строки, но по ошибке поставил не те кавычки. В результате значение переменной 'ch' сравнивается с адресом, по которому располагается строка "
The inattentive author of this code wanted to compare the 'ch' variable with a new string's character but used quotes of a wrong type. This resulted in the value of the 'ch' variable being compared to the "\n" string's address. Code like that can compile and execute well in C but usually makes no sense. The correct version of the code sample above should use single quotes instead of double ones:
  Немного о взаимодействи...  
Причина, по которой эта заметка появилась в том, что многие считают, что анализатор PVS-Studio основан на Clang. Это не так. Хотел кратко изложить информацию, о том, почему в составе дистрибутива PVS-Studio находится компилятор Clang и для чего он используется.
The reason for writing this post is that many programmers think that the PVS-Studio analyzer is based on Clang. It's not so. I'd just like to explain in brief why the PVS-Studio distribution kit contains the Clang compiler and what it is used for.
  Команда PVS-Studio расш...  
Кто-то просто не сообразил это сделать. Кто-то хотел, но ему было некогда, а потом он забыл про это. В результате, в огромном количестве программ продолжают жить некорректные обработчики ситуаций, когда невозможно выделить память.
However, even those who know that the 'new' operator has changed its behavior have not reviewed and fixed their old code. Some simply didn't think about that; others did but were short of time at the moment and forgot all about it later. It resulted in a huge number of programs still inhabited by incorrect handlers of memory allocation errors.
  Анализируем ошибки в от...  
Создается класс ApplicationException, но никак не используется. Вероятнее всего, программист хотел выбросить исключение, но забыл добавить оператор throw перед созданным исключением.
Class ApplicationException is created but not used in any way. The programmer must have wanted an exception to be thrown but forgot to add the throw keyword when forming the exception.
  V581. The conditional e...  
Содержит этот код ошибку или нет, зависит от того, что хотел сделать программист. Если во втором условии нужно вычислить длину другой строки, то это ошибка. Исправленный код:
Whether this code contains an error or not, depends upon what exactly the programmer intended to do. If the second condition must calculate the length of the other string, then it is an error. This is the correct code:
  V3107. Identical expres...  
Возможно программист хотел просто прибавить к переменной 'x' значение 5. Тогда корректный код может выглядеть так:
Perhaps the programmer simply wanted to add the value 5 to the 'x' variable. In that case, the fixed code would look like this:
  V3107. Identical expres...  
Либо же программист хотел прибавить 5, но случайно добавил лишнюю переменную 'x' в выражение. Тогда корректный код может выглядеть так:
Or perhaps they wanted to add the value 5 but wrote an extra 'x' variable by mistake. Then the code should look like this:
  Проверка проекта Intel ...  
А что собственно этой статьёй хотел сказать автор? Интелу СРОЧНО нужно внимательно присмотреться к PVS-Studio. :-)
Well, and what did the author actually want to say by writing this article? Intel URGENTLY needs to pay the greatest attention to PVS-Studio. :-)
  Экспериментальная верси...  
Более интересный случай. Что именно хотел сделать программист, мне непонятно. Возможно, он хотел сформировать сообщение вот такого вида:
This is a more interesting case. It's not very clear what the programmer wanted to say. Probably he wanted the message to be like this:
  Повторная проверка прое...  
Это явно не то, что хотел программист. Видимо здесь мы опять имеем дело с опечаткой. Корректный код:
This is obviously not what the programmer intended. Perhaps we deal with a misprint here again. This is the correct code:
  V560. A part of conditi...  
Программист хотел проверить состояние определенного бита в переменной dwFlags. Но из-за опечатки он написал оператор '&&', вместо оператора '&'. Корректный код:
The programmer wanted to check some particular bit in the dwFlags variable. But he made a misprint by writing the '&&' operator instead of '&' operator. This is the correct code:
  Экспериментальная верси...  
Более интересный случай. Что именно хотел сделать программист, мне непонятно. Возможно, он хотел сформировать сообщение вот такого вида:
This is a more interesting case. It's not very clear what the programmer wanted to say. Probably he wanted the message to be like this:
  Проверка операционной с...  
В следующей статье представлены оставшиеся предупреждения анализатора, о которых я хотел бы рассказать. Они будут различных типов и разделены на несколько групп.
In the next article, we discussed the remaining warnings I have picked for you. They are grouped into several categories according to their types.
  Сравнение статического ...  
Кто, глядя на код, точно скажет, к какому if относится else? А это ли хотел сделать программист? А вы уверены?
Who can look at the code and say exactly to what if else refers? Was it the thing the programmer wanted to do? Are you sure?
Arrow 1 2 3 4 5