Default value of int type pointer gives an Error

Asked by Raj Reddy

Hi,

Whenever there is a int* type variable and a default value NULL for that. The parser gives an error.

I have created a small project which showcases this. https://github.com/raj12lnm/TryPyBindGen

Cheers!
Raj

Question information

Language:
English Edit question
Status:
Answered
For:
PyBindGen Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Gustavo Carneiro (gjc) said :
#1

I pushed a patch to pybindgen to support this. But you need to add an
annotation in the header file to indicate the "direction" of the parameter.
 Also pybindgen doesn't support parameters declared with just the type but
no name.

diff --git a/my-module.h b/my-module.h
index 9786854..0e25203 100644
--- a/my-module.h
+++ b/my-module.h
@@ -6,6 +6,8 @@ class Rectangle {
   public:
     void set_values (int,int);
     int area() {return width*height;}
- void set_pointer (int* = 0);
+
+ // -#- @paramname(direction=in) -#-
+ void set_pointer (int* paramname = 0);

 };

On 30 July 2014 20:51, Raj Reddy <email address hidden>
wrote:

> New question #252418 on PyBindGen:
> https://answers.launchpad.net/pybindgen/+question/252418
>
> Hi,
>
> Whenever there is a int* type variable and a default value NULL for that.
> The parser gives an error.
>
> I have created a small project which showcases this.
> https://github.com/raj12lnm/TryPyBindGen
>
> Cheers!
> Raj
>
> --
> You received this question notification because you are an answer
> contact for PyBindGen.
>

--
Gustavo J. A. M. Carneiro
Gambit Research
"The universe is always one step beyond logic." -- Frank Herbert

Can you help with this problem?

Provide an answer of your own, or ask Raj Reddy for more information if necessary.

To post a message you must log in.