-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cppcheck 2.15 #5282
Cppcheck 2.15 #5282
Changes from 10 commits
f49e76d
55e9e9a
b81f76c
f0cff49
3407f7e
bc2b590
fb16797
fe41009
799d4d1
834fa9c
21d7036
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,6 @@ coverage.xml | |
.pytest_cache/ | ||
junit.xml | ||
|
||
.cppcheck*/ | ||
|
||
CMakeUserPresets.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
***********************************************************************************************************************/ | ||
|
||
#include "InitRubyBindings.hpp" | ||
#include "RubyEval.hpp" | ||
#include "../interpreter/RubyEval.hpp" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lots of normalizing the way the includes are used. |
||
|
||
// #define HAVE_ISFINITE 1 | ||
#include <ruby.h> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
#ifndef RUBYEVAL_included | ||
#define RUBYEVAL_included | ||
|
||
#include "ruby.h" | ||
#include "./RubyException.hpp" | ||
#include <ruby.h> | ||
#include "RubyException.hpp" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curios , why are using relative path above but keeps the hpp name here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand the question, could you rephrase please? |
||
|
||
namespace openstudio { | ||
|
||
|
@@ -49,21 +49,21 @@ inline VALUE evalString(const std::string& t_str) { | |
// Generally speaking, the backtrace is there, but not for the case where it's a stack too deep error | ||
const ID ID_backtrace = rb_intern_const("backtrace"); | ||
if (exception_class != rb_eSysStackError && rb_respond_to(errinfo, ID_backtrace)) { | ||
std::vector<std::string> backtrace_lines; | ||
// std::vector<std::string> backtrace_lines; | ||
std::string btlines; | ||
/*volatile*/ VALUE backtrace; | ||
if (!NIL_P(backtrace = rb_funcall(errinfo, ID_backtrace, 0))) { | ||
VALUE backtracejoin = rb_ary_join(backtrace, rb_str_new2("\n")); | ||
btlines = StringValuePtr(backtracejoin); | ||
|
||
// Get the backing C array of the ruby array | ||
VALUE* elements = RARRAY_PTR(backtrace); | ||
for (long c = 0; c < RARRAY_LEN(backtrace); ++c) { | ||
VALUE entry = elements[c]; | ||
[[maybe_unused]] char* backtrace_line = RSTRING_PTR(entry); | ||
char* backtrace_line2 = StringValuePtr(entry); | ||
backtrace_lines.emplace_back(backtrace_line2); | ||
} | ||
// VALUE* elements = RARRAY_PTR(backtrace); | ||
// for (long c = 0; c < RARRAY_LEN(backtrace); ++c) { | ||
// VALUE entry = elements[c]; | ||
// [[maybe_unused]] char* backtrace_line = RSTRING_PTR(entry); | ||
// char* backtrace_line2 = StringValuePtr(entry); | ||
// backtrace_lines.emplace_back(backtrace_line2); | ||
// } | ||
} | ||
|
||
if (!btlines.empty()) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This effectively adds the root directories "python" and "ruby" to cppcheck