Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
typedef of fixed length array cannot deal with [...]
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sarvi Shanmugham  
View profile  
 More options Sep 28 2012, 6:35 pm
From: Sarvi Shanmugham <sarvil...@gmail.com>
Date: Fri, 28 Sep 2012 15:35:11 -0700 (PDT)
Local: Fri, Sep 28 2012 6:35 pm
Subject: typedef of fixed length array cannot deal with [...]

I have the following in my library
#define FIXED_LEN_STR 255
typedef char fixed_len_str_t[FIXED_LEN_STR];

In my cdef("""
#define FIXED_LEN_STR ...   // This works
typedef char fixed_len_str_t[...];   // this does not work
""")  

Is my only choice to explicitly do the following? Is there a better way of
doing this?
typedef char fixed_len_str_t[255];

Also, the Error message when it hits the problem is as follows, which
doesn't tell me where the error is.
For now I understand this generally means and where to look. But for people
with no experience with CFFI,
 it would be help full to provide some context or line numbers or something
to help locate the point the cdef where this error happens.

File
"/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/api.py",
line 84, in cdef
    self._parser.parse(csource, override=override)
  File
"/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/cparser.py",
line 100, in parse
    self._internal_parse(csource)
  File
"/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/cparser.py",
line 137, in _internal_parse
    realtype = self._get_type(decl.type, name=decl.name)
  File
"/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/cparser.py",
line 222, in _get_type
    typenode.dim, partial_length_ok=partial_length_ok)
  File
"/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/cparser.py",
line 446, in _parse_constant
    raise api.FFIError("unsupported non-constant or "
cffi.api.FFIError: unsupported non-constant or not immediately constant
expression

Thanks,
Sarvi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sarvi Shanmugham  
View profile  
 More options Oct 4 2012, 4:15 am
From: Sarvi Shanmugham <sarvil...@gmail.com>
Date: Thu, 4 Oct 2012 01:15:52 -0700 (PDT)
Local: Thurs, Oct 4 2012 4:15 am
Subject: typedef of fixed length array cannot deal with [...]

I have always got quick responses so far, but haven't seen any for my recent questions.

Are these dumb questions, possibly? Or maybe too many questions :-))

I have always tried multiple routes at debugging and googling for answers before asking these questions.
And from what I can tell, all the questions I have asked so far, bar 1 which ended being a bug in my library, ended in either a bug fix or document update.

I hope this is just a case of people being too busy. :-))

Sarvi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Armin Rigo  
View profile  
 More options Oct 4 2012, 7:37 am
From: Armin Rigo <ar...@tunes.org>
Date: Thu, 4 Oct 2012 13:36:33 +0200
Local: Thurs, Oct 4 2012 7:36 am
Subject: Re: [python-cffi] typedef of fixed length array cannot deal with [...]
Hi,

On Thu, Oct 4, 2012 at 10:15 AM, Sarvi Shanmugham <sarvil...@gmail.com> wrote:
> I hope this is just a case of people being too busy. :-))

Yes, exactly :-)  Your questions are very useful, I have to thank you
for them.  They end up in good suggestions for improvements of CFFI.
I'll come back to your recent questions, but right now I'm at PyCon ZA
(South Africa) :-)

A bientôt,

Armin.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sarvi Shanmugham  
View profile  
 More options Oct 4 2012, 3:38 pm
From: Sarvi Shanmugham <sarvil...@gmail.com>
Date: Thu, 4 Oct 2012 12:38:32 -0700 (PDT)
Local: Thurs, Oct 4 2012 3:38 pm
Subject: Re: [python-cffi] typedef of fixed length array cannot deal with [...]

I noticed that
char my_array_variable[...];  // Does not work

But the following works
char my_array_variable[];  // This works

The original header files has
#define XYZ_LEN 255
char my_array_variable[XYZ_LEN];

Thx,
Sarvi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Armin Rigo  
View profile  
 More options Oct 28 2012, 4:44 am
From: Armin Rigo <ar...@tunes.org>
Date: Sun, 28 Oct 2012 09:44:07 +0100
Local: Sun, Oct 28 2012 4:44 am
Subject: Re: [python-cffi] typedef of fixed length array cannot deal with [...]
Hi,

On Thu, Oct 4, 2012 at 9:38 PM, Sarvi Shanmugham <sarvil...@gmail.com> wrote:
> I noticed that
> char my_array_variable[...];  // Does not work

> But the following works
> char my_array_variable[];  // This works

I fixed this use case to make the two declarations identical (3bb5d49c0c00).

A bientôt,

Armin.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sarvi Shanmugham  
View profile  
 More options Oct 28 2012, 1:33 pm
From: Sarvi Shanmugham <sarvil...@gmail.com>
Date: Sun, 28 Oct 2012 10:33:13 -0700 (PDT)
Local: Sun, Oct 28 2012 1:33 pm
Subject: Re: [python-cffi] typedef of fixed length array cannot deal with [...]

awesome. thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »