mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
renamee cCvError::raise_cverror to cCvError::raise, and added raise_cverror to cvutils.h (shortcut macro of cCvError::raise)
This commit is contained in:
parent
ec43f609c4
commit
d983d80fa6
4 changed files with 8 additions and 4 deletions
|
@ -152,7 +152,7 @@ by_code(int error_code)
|
|||
}
|
||||
|
||||
void
|
||||
raise_cverror(cv::Exception e)
|
||||
raise(cv::Exception e)
|
||||
{
|
||||
rb_raise(by_code(e.code), e.what());
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ __NAMESPACE_BEGIN_CVERROR
|
|||
|
||||
void define_ruby_class();
|
||||
VALUE by_code(int error_code);
|
||||
void raise_cverror(cv::Exception e);
|
||||
void raise(cv::Exception e);
|
||||
|
||||
__NAMESPACE_END_CVERROR
|
||||
__NAMESPACE_END_OPENCV
|
||||
|
|
|
@ -10,13 +10,15 @@
|
|||
#include "cvutils.h"
|
||||
|
||||
void
|
||||
raise_typeerror(VALUE object, VALUE expected_class) {
|
||||
raise_typeerror(VALUE object, VALUE expected_class)
|
||||
{
|
||||
rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
|
||||
rb_obj_classname(object), rb_class2name(expected_class));
|
||||
}
|
||||
|
||||
void
|
||||
raise_compatible_typeerror(VALUE object, VALUE expected_class) {
|
||||
raise_compatible_typeerror(VALUE object, VALUE expected_class)
|
||||
{
|
||||
rb_raise(rb_eTypeError, "wrong argument type %s (expected %s or compatible object)",
|
||||
rb_obj_classname(object), rb_class2name(expected_class));
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
|
||||
#define raise_cverror(e) cCvError::raise(e)
|
||||
|
||||
void raise_typeerror(VALUE object, VALUE expected_class);
|
||||
void raise_compatible_typeerror(VALUE object, VALUE expected_class);
|
||||
void* rb_cvAlloc(size_t size);
|
||||
|
|
Loading…
Add table
Reference in a new issue