Skip to content
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

Build-related fixes in src/Matrix.cc #212

Merged
merged 2 commits into from Jan 19, 2015
Merged

Build-related fixes in src/Matrix.cc #212

merged 2 commits into from Jan 19, 2015

Conversation

ghost
Copy link

@ghost ghost commented Jan 16, 2015

Hello!

These are two problems I noticed while trying to build OpenCV on my machine. The setRect() issue was a warning only, but the code seemed to be a clear error unless there's something I'm missing. The other change is a simple typecast which fixes a compile error I'd been hitting.

Thanks for taking a look!

Micah Elizabeth Scott added 2 commits January 16, 2015 12:11
Noticed a compiler warning for this during build, and the code looks
like the sort of thing that may often work accidentally, but is not
at all guaranteed to work.

This is the simplest fix I could imagine; keep the logic about whether
to return NULL or not in setRect(), but pass it a reference to some
memory in the caller's stack frame to use for the result.

This fixes the warning, but I haven't had a chance to verify functionality.
This fixes two instances of a compile error I'd been getting with
OpenCV 2.4.9 (via Homebrew) on Mac OS:

../node_modules/nan/nan_new.h:184:10: error: call to 'New' is ambiguous
  return NanIntern::Factory<T>::New(arg0);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/Matrix.cc:453:51: note: in instantiation of function template specialization 'NanNew<v8::Integer, unsigned long>' requested here
        v8::Handle<v8::Value> constructorArgs[3] = {buf, NanNew<v8::Integer>(vec.size()), NanNew<v8::Integer>(0)};
                                                         ^
../node_modules/nan/nan_new.h:86:26: note: candidate function
  static inline return_t New(int32_t value);
                         ^
../node_modules/nan/nan_new.h:87:26: note: candidate function
  static inline return_t New(uint32_t value);
@peterbraden
Copy link
Owner

Thanks!

peterbraden added a commit that referenced this pull request Jan 19, 2015
Build-related fixes in src/Matrix.cc
@peterbraden peterbraden merged commit 52de1e7 into peterbraden:master Jan 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant