Skip to content

Commit

Permalink
Silenced a few clang compiler warnings. There are still a few remaini…
Browse files Browse the repository at this point in the history
…ng from boost.
  • Loading branch information
BugraBarin committed Nov 7, 2014
1 parent 641f721 commit 0f3fcc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions DebugServer/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ VALUE WrapFuncall(VALUE data) {
if (!(TYPE(data) == T_ARRAY)) {
return Qnil;
}
int argc = RARRAY_LEN(data);
int argc = (int)RARRAY_LEN(data);
if (argc < 2) {
return Qnil;
}
Expand Down Expand Up @@ -158,7 +158,7 @@ Variable EvaluateRubyExpression(const std::string& expr, VALUE binding) {
VALUE DebugInspectorFunc(const rb_debug_inspector_t* di, void* data) {
auto frames = reinterpret_cast<std::vector<StackFrame>*>(data);
VALUE bt = rb_debug_inspector_backtrace_locations(di);
int bt_count = RARRAY_LEN(bt);
int bt_count = (int)RARRAY_LEN(bt);
for (int i=0; i < bt_count; ++i) {
VALUE bt_val = RARRAY_PTR(bt)[i];
VALUE path_val = rb_funcall(bt_val, rb_intern("path"), 0);
Expand Down Expand Up @@ -392,6 +392,7 @@ static void ProcessLine(Server::Impl* server, const std::string& file_path,

void Server::Impl::LineEvent(VALUE tp_val, void* data) {
EVENT_COMMON_CODE;
(void)event_sym; // Suppress unused warning

ProcessLine(server, file_path, line);
}
Expand Down Expand Up @@ -462,7 +463,7 @@ static int EachKeyValFunc(VALUE key, VALUE val, VALUE data) {
// Add the source lines vector
auto& lines_vec = impl->script_lines_[file_path];
// Add the source code
int n = RARRAY_LEN(val);
int n = (int)RARRAY_LEN(val);
lines_vec.reserve(n);
for (int i = 0; i < n; ++i) {
VALUE arr_val = RARRAY_PTR(val)[i];
Expand Down Expand Up @@ -756,7 +757,7 @@ IDebugServer::VariablesVector Server::GetVariables(const char* type,
VALUE binding = impl_->GetBinding(use_toplevel_binding);
if (binding != 0) {
VALUE arr_val = EvaluateRubyExpressionAsValue(type, binding);
int count = RARRAY_LEN(arr_val);
int count = (int)RARRAY_LEN(arr_val);
for (int i = 0; i < count; ++i) {
VALUE var_val = RARRAY_PTR(arr_val)[i];
Variable var;
Expand Down
2 changes: 1 addition & 1 deletion DebugServer/UI/RDIP/RDIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void RDIP::Connection::evaluateCommand(const std::string& cmd) {
} else if(regex_match(cmd, what, reg_var_instance)) {
size_t objectID = 0;
std::string str_what = what[1];
sscanf(str_what.c_str(), "%x", &objectID);
sscanf(str_what.c_str(), "%zx", &objectID);
server_response_ = std::bind(&RDIP::Connection::getInstanceVariables, this, objectID);
process_server_response_ = std::bind(&RDIP::Connection::sendVariables, this, "instance");
server_wait_cond_.notify_all();
Expand Down

0 comments on commit 0f3fcc0

Please sign in to comment.